Author: sascharodekamp
Date: Tue Nov 29 10:45:20 2011 New Revision: 1207817 URL: http://svn.apache.org/viewvc?rev=1207817&view=rev Log: Update the Jackrabbit API structure, Rename some classes (the Class name was to long) Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrDataHelper.java (with props) ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java (with props) ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrHelper.java (with props) ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java (contents, props changed) - copied, changed from r1207166, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/AbstractJcrHelper.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java (contents, props changed) - copied, changed from r1207166, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrArticleHelper.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitFileHelper.java (contents, props changed) - copied, changed from r1207166, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitArticle.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFile.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFile.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFolder.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFolder.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitHierarchyNode.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitHierarchyNode.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitLocalizedContent.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitNews.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitResource.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitResource.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitUnstructured.java (contents, props changed) - copied, changed from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java Removed: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/AbstractJcrHelper.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrArticleHelper.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrContentHelper.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFile.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFolder.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitHierarchyNode.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitResource.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java Modified: ofbiz/branches/jackrabbit20100709/framework/example/src/org/ofbiz/example/JackrabbitEvents.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/loader/jackrabbit/JCRFactoryImpl.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/services/JackrabbitServices.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java Modified: ofbiz/branches/jackrabbit20100709/framework/example/src/org/ofbiz/example/JackrabbitEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/src/org/ofbiz/example/JackrabbitEvents.java?rev=1207817&r1=1207816&r2=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/src/org/ofbiz/example/JackrabbitEvents.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/src/org/ofbiz/example/JackrabbitEvents.java Tue Nov 29 10:45:20 2011 @@ -38,14 +38,15 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericValue; import org.ofbiz.jcr.access.JcrRepositoryAccessor; import org.ofbiz.jcr.access.jackrabbit.JackrabbitRepositoryAccessor; -import org.ofbiz.jcr.api.JcrArticleHelper; -import org.ofbiz.jcr.api.JcrContentHelper; +import org.ofbiz.jcr.api.JcrDataHelper; import org.ofbiz.jcr.api.JcrFileHelper; +import org.ofbiz.jcr.api.jackrabbit.JackrabbitArticleHelper; +import org.ofbiz.jcr.api.jackrabbit.JackrabbitFileHelper; import org.ofbiz.jcr.orm.OfbizRepositoryMapping; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitArticle; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFile; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFolder; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitHierarchyNode; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitArticle; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitFile; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitFolder; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitHierarchyNode; import org.ofbiz.jcr.util.jackrabbit.JcrUtilJackrabbit; public class JackrabbitEvents { @@ -60,7 +61,7 @@ public class JackrabbitEvents { */ public static String addNewTextMessageToJcrRepository(HttpServletRequest request, HttpServletResponse response) { GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); - JcrArticleHelper articleHelper = new JcrArticleHelper(userLogin); + JcrDataHelper articleHelper = new JackrabbitArticleHelper(userLogin); String contentPath = request.getParameter("path"); String language = request.getParameter("msgLocale"); @@ -126,8 +127,8 @@ public class JackrabbitEvents { return "error"; } - JcrArticleHelper articleHelper = new JcrArticleHelper(userLogin); - OfbizRepositoryMappingJackrabbitArticle ormArticle = null; + JcrDataHelper articleHelper = new JackrabbitArticleHelper(userLogin); + JackrabbitArticle ormArticle = null; if (UtilValidate.isEmpty(version)) { ormArticle = articleHelper.readContentFromRepository(contentPath, language); } else { @@ -156,9 +157,9 @@ public class JackrabbitEvents { GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); String contentPath = request.getParameter("path"); - JcrArticleHelper articleHelper = new JcrArticleHelper(userLogin); + JcrDataHelper articleHelper = new JackrabbitArticleHelper(userLogin); - OfbizRepositoryMappingJackrabbitArticle ormArticle = articleHelper.readContentFromRepository(contentPath); + JackrabbitArticle ormArticle = articleHelper.readContentFromRepository(contentPath); ormArticle.setTitle(request.getParameter("title")); ormArticle.setContent(request.getParameter("content")); @@ -189,7 +190,7 @@ public class JackrabbitEvents { String contentPath = request.getParameter("path"); - JcrContentHelper helper = new JcrContentHelper(userLogin); + JcrDataHelper helper = new JackrabbitArticleHelper(userLogin); helper.removeContentObject(contentPath); return "success"; @@ -228,7 +229,7 @@ public class JackrabbitEvents { } } - JcrFileHelper fileHelper = new JcrFileHelper(userLogin); + JcrFileHelper fileHelper = new JackrabbitFileHelper(userLogin); try { @@ -357,11 +358,11 @@ public class JackrabbitEvents { return "error"; } - JcrFileHelper fileHelper = new JcrFileHelper(userLogin); - OfbizRepositoryMappingJackrabbitHierarchyNode orm = fileHelper.getRepositoryContent(contentPath); + JcrFileHelper fileHelper = new JackrabbitFileHelper(userLogin); + JackrabbitHierarchyNode orm = fileHelper.getRepositoryContent(contentPath); if (fileHelper.isFileContent()) { - OfbizRepositoryMappingJackrabbitFile file = (OfbizRepositoryMappingJackrabbitFile) orm; + JackrabbitFile file = (JackrabbitFile) orm; InputStream fileStream = file.getResource().getData(); String fileName = file.getPath(); @@ -386,18 +387,18 @@ public class JackrabbitEvents { GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); String contentPath = request.getParameter("path"); - JcrFileHelper fileHelper = new JcrFileHelper(userLogin); + JcrFileHelper fileHelper = new JackrabbitFileHelper(userLogin); OfbizRepositoryMapping orm = fileHelper.getRepositoryContent(contentPath); // Here we can differentiate between a file or folder content if (fileHelper.isFileContent()) { - OfbizRepositoryMappingJackrabbitFile file = (OfbizRepositoryMappingJackrabbitFile) orm; + JackrabbitFile file = (JackrabbitFile) orm; request.setAttribute("fileName", file.getPath()); request.setAttribute("fileLastModified", file.getResource().getLastModified().getTime()); request.setAttribute("fileMimeType", file.getResource().getMimeType()); request.setAttribute("fileCreationDate", file.getCreationDate().getTime()); } else if (fileHelper.isFolderContent()) { - OfbizRepositoryMappingJackrabbitFolder folder = (OfbizRepositoryMappingJackrabbitFolder) orm; + JackrabbitFolder folder = (JackrabbitFolder) orm; request.setAttribute("fileName", folder.getPath()); request.setAttribute("fileCreationDate", folder.getCreationDate().getTime()); } @@ -410,7 +411,7 @@ public class JackrabbitEvents { String searchQuery = request.getParameter("queryData"); - JcrContentHelper helper = new JcrContentHelper(userLogin); + JcrDataHelper helper = new JackrabbitArticleHelper(userLogin); try { request.setAttribute("queryResult", helper.queryData(searchQuery)); Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrDataHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrDataHelper.java?rev=1207817&view=auto ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrDataHelper.java (added) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrDataHelper.java Tue Nov 29 10:45:20 2011 @@ -0,0 +1,82 @@ +package org.ofbiz.jcr.api; + +import java.util.Calendar; +import java.util.List; + +import javax.jcr.ItemExistsException; +import javax.jcr.RepositoryException; + +import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitArticle; + +public interface JcrDataHelper extends JcrHelper{ + + /** + * Read the article content object from the repository. Throws an Exception + * when the read content type is not an article content type. + * + * @param contentPath + * @return content article object + * @throws + */ + public abstract JackrabbitArticle readContentFromRepository(String contentPath) throws ClassCastException; + + /** + * Read the article content object, in the passed language, from the + * repository. if the language is not available, the default language will + * be choose. Throws an Exception when the read content type is not an + * article content type. + * + * @param contentPath + * @return content article object + * @throws + */ + public abstract JackrabbitArticle readContentFromRepository(String contentPath, String language) throws ClassCastException; + + /** + * Read the article content object, in the passed language and version, from + * the repository. if the language is not available, the default language + * will be choose. Throws an Exception when the read content type is not an + * article content type. + * + * @param contentPath + * @param language + * @param version + * @return + * @throws + */ + public abstract JackrabbitArticle readContentFromRepository(String contentPath, String language, String version) throws ClassCastException; + + /** + * Stores a new article content object in the repository. + * + * @param contentPath + * @param language + * @param title + * @param content + * @param publicationDate + * @throws ObjectContentManagerException + * @throws ItemExistsException + */ + public abstract void storeContentInRepository(String contentPath, String language, String title, String content, Calendar publicationDate) throws ObjectContentManagerException, ItemExistsException; + + /** + * Update an existing content article object in the repository. + * + * @param updatedArticle + * @throws RepositoryException + * @throws ObjectContentManagerException + */ + public abstract void updateContentInRepository(JackrabbitArticle updatedArticle) throws RepositoryException, ObjectContentManagerException; + + /** + * Returns a list of versions which are available for the current article. + * If no article is loaded before, the list will be empty. + * + * @return + */ + public abstract List<String> getVersionListForCurrentArticle(); + + public abstract List<String> getAvailableLanguageList(); + +} \ No newline at end of file Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrDataHelper.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java?rev=1207817&view=auto ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java (added) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java Tue Nov 29 10:45:20 2011 @@ -0,0 +1,73 @@ +package org.ofbiz.jcr.api; + +import java.io.InputStream; + +import javax.jcr.RepositoryException; + +import org.apache.jackrabbit.ocm.exception.ObjectContentManagerException; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitHierarchyNode; + +public interface JcrFileHelper extends JcrHelper{ + + /** + * Returns a content file object from the repository. Throws an Exception + * when the read content type is not an article content type. + * + * @param contentPath + * @return + * @throws + */ + public abstract JackrabbitHierarchyNode getRepositoryContent(String contentPath) throws ClassCastException; + + /** + * Returns a content file object in the passed version from the repository. + * Throws an Exception when the read content type is not an article content + * type. + * + * @param contentPath + * @return + * @throws + */ + public abstract JackrabbitHierarchyNode getRepositoryContent(String contentPath, String version) throws ClassCastException; + + /** + * Stores a new file content object in the repository. + * + * @param fileData + * @param fileName + * @param folderPath + * @param mimeType + * @throws ObjectContentManagerException + * @throws RepositoryException + */ + public abstract void storeContentInRepository(byte[] fileData, String fileName, String folderPath) throws ObjectContentManagerException, RepositoryException; + + /** + * Stores a new file content object in the repository. + * + * @param fileData + * @param fileName + * @param folderPath + * @param mimeType + * @throws ObjectContentManagerException + * @throws RepositoryException + */ + public abstract void storeContentInRepository(InputStream fileData, String fileName, String folderPath) throws ObjectContentManagerException, RepositoryException; + + /** + * Returns TRUE if the current content is a file content (Type: + * OfbizRepositoryMappingJackrabbitFile) + * + * @return + */ + public abstract boolean isFileContent(); + + /** + * Returns TRUE if the current content is a folder content (Type: + * OfbizRepositoryMappingJackrabbitFolder) + * + * @return + */ + public abstract boolean isFolderContent(); + +} \ No newline at end of file Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrHelper.java?rev=1207817&view=auto ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrHelper.java (added) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrHelper.java Tue Nov 29 10:45:20 2011 @@ -0,0 +1,25 @@ +package org.ofbiz.jcr.api; + +import java.util.List; +import java.util.Map; + +import javax.jcr.RepositoryException; + +public interface JcrHelper { + + /** + * This will close the connection to the content repository and make sure + * that all changes a stored successfully. + */ + public abstract void closeContentSession(); + + /** + * Remove the passed node from the content repository. + * + * @param contentPath + */ + public abstract void removeContentObject(String contentPath); + + public abstract List<Map<String, String>> queryData(String query) throws RepositoryException; + +} \ No newline at end of file Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrHelper.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java (from r1207166, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/AbstractJcrHelper.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/AbstractJcrHelper.java&r1=1207166&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/AbstractJcrHelper.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java Tue Nov 29 10:45:20 2011 @@ -1,30 +1,69 @@ -package org.ofbiz.jcr.api; +package org.ofbiz.jcr.api.jackrabbit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.jcr.RepositoryException; +import javax.jcr.query.QueryResult; +import javax.jcr.query.Row; +import javax.jcr.query.RowIterator; + +import javolution.util.FastMap; + +import org.ofbiz.base.util.Debug; import org.ofbiz.jcr.access.JcrRepositoryAccessor; +import org.ofbiz.jcr.api.JcrHelper; -public abstract class AbstractJcrHelper { +public abstract class JackrabbitAbstractHelper implements JcrHelper { + + private static String module = JackrabbitAbstractHelper.class.getName(); protected JcrRepositoryAccessor access = null; - public AbstractJcrHelper (JcrRepositoryAccessor accessor) { + public JackrabbitAbstractHelper(JcrRepositoryAccessor accessor) { this.access = accessor; } - /** - * This will close the connection to the content repository and make sure - * that all changes a stored successfully. + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.JcrHelper#closeContentSession() */ + @Override public void closeContentSession() { access.closeAccess(); access = null; } - /** - * Remove the passed node from the content repository. - * - * @param contentPath + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.JcrHelper#removeContentObject(java.lang.String) */ + @Override public void removeContentObject(String contentPath) { access.removeContentObject(contentPath); } + + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.JcrHelper#queryData(java.lang.String) + */ + @Override + public List<Map<String, String>> queryData(String query) throws RepositoryException { + QueryResult qr = this.access.queryForRepositoryData(query); + + List<Map<String, String>> resultNodePaths = new ArrayList<Map<String, String>>(); + RowIterator rows = qr.getRows(); + while (rows.hasNext()) { + Row row = rows.nextRow(); + Map<String, String> content = FastMap.newInstance(); + content.put("path", row.getPath()); + content.put("score", String.valueOf(row.getScore())); + + resultNodePaths.add(content); + if (Debug.isOn(Debug.INFO)) { + Debug.logInfo("For query: " + query + " found node with path: " + row.getPath(), module); + } + + } + + return resultNodePaths; + } } Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitAbstractHelper.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java (from r1207166, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrArticleHelper.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrArticleHelper.java&r1=1207166&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrArticleHelper.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java Tue Nov 29 10:45:20 2011 @@ -1,4 +1,4 @@ -package org.ofbiz.jcr.api; +package org.ofbiz.jcr.api.jackrabbit; import java.util.ArrayList; import java.util.Calendar; @@ -19,8 +19,9 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericValue; import org.ofbiz.jcr.access.jackrabbit.ConstantsJackrabbit; import org.ofbiz.jcr.access.jackrabbit.JackrabbitRepositoryAccessor; +import org.ofbiz.jcr.api.JcrDataHelper; import org.ofbiz.jcr.orm.OfbizRepositoryMapping; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitArticle; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitArticle; /** * This Helper class encapsulate the jcr article content bean. it provide all @@ -34,11 +35,11 @@ import org.ofbiz.jcr.orm.jackrabbit.Ofbi * in the Framework. * */ -public class JcrArticleHelper extends AbstractJcrHelper { +public class JackrabbitArticleHelper extends JackrabbitAbstractHelper implements JcrDataHelper { - private final static String module = JcrArticleHelper.class.getName(); + private final static String module = JackrabbitArticleHelper.class.getName(); - private static OfbizRepositoryMappingJackrabbitArticle article = null; + private static JackrabbitArticle article = null; private static List<String> possibleLocales = null; @@ -55,105 +56,77 @@ public class JcrArticleHelper extends Ab /** * Setup my content Object */ - public JcrArticleHelper(GenericValue userLogin) { + public JackrabbitArticleHelper(GenericValue userLogin) { super(new JackrabbitRepositoryAccessor(userLogin)); } - /** - * Read the article content object from the repository. Throws an Exception - * when the read content type is not an article content type. - * - * @param contentPath - * @return content article object - * @throws + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.DataHelper#readContentFromRepository(java.lang.String) */ - public OfbizRepositoryMappingJackrabbitArticle readContentFromRepository(String contentPath) throws ClassCastException { + @Override + public JackrabbitArticle readContentFromRepository(String contentPath) throws ClassCastException { return readContentFromRepository(contentPath, ""); } - /** - * Read the article content object, in the passed language, from the - * repository. if the language is not available, the default language will - * be choose. Throws an Exception when the read content type is not an - * article content type. - * - * @param contentPath - * @return content article object - * @throws + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.DataHelper#readContentFromRepository(java.lang.String, java.lang.String) */ - public OfbizRepositoryMappingJackrabbitArticle readContentFromRepository(String contentPath, String language) throws ClassCastException { + @Override + public JackrabbitArticle readContentFromRepository(String contentPath, String language) throws ClassCastException { contentPath = determineContentLanguagePath(contentPath, language); OfbizRepositoryMapping orm = super.access.getContentObject(contentPath); - if (orm instanceof OfbizRepositoryMappingJackrabbitArticle) { - article = (OfbizRepositoryMappingJackrabbitArticle) orm; + if (orm instanceof JackrabbitArticle) { + article = (JackrabbitArticle) orm; article.setVersion(super.access.getBaseVersion(contentPath)); return article; } else { - throw new ClassCastException("The content object for the path: " + contentPath + " is not an article content object. This Helper can only handle content objects with the type: " + OfbizRepositoryMappingJackrabbitArticle.class.getName()); + throw new ClassCastException("The content object for the path: " + contentPath + " is not an article content object. This Helper can only handle content objects with the type: " + JackrabbitArticle.class.getName()); } } - /** - * Read the article content object, in the passed language and version, from - * the repository. if the language is not available, the default language - * will be choose. Throws an Exception when the read content type is not an - * article content type. - * - * @param contentPath - * @param language - * @param version - * @return - * @throws + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.DataHelper#readContentFromRepository(java.lang.String, java.lang.String, java.lang.String) */ - public OfbizRepositoryMappingJackrabbitArticle readContentFromRepository(String contentPath, String language, String version) throws ClassCastException { + @Override + public JackrabbitArticle readContentFromRepository(String contentPath, String language, String version) throws ClassCastException { contentPath = determineContentLanguagePath(contentPath, language); OfbizRepositoryMapping orm = super.access.getContentObject(contentPath, version); - if (orm instanceof OfbizRepositoryMappingJackrabbitArticle) { - article = (OfbizRepositoryMappingJackrabbitArticle) orm; + if (orm instanceof JackrabbitArticle) { + article = (JackrabbitArticle) orm; article.setPath(contentPath); // the content path must be // manipulated because, the jackrabbit // orm returns a full blown path with // version information. return article; } else { - throw new ClassCastException("The content object for the path: " + contentPath + " is not an article content object. This Helper can only handle content objects with the type: " + OfbizRepositoryMappingJackrabbitArticle.class.getName()); + throw new ClassCastException("The content object for the path: " + contentPath + " is not an article content object. This Helper can only handle content objects with the type: " + JackrabbitArticle.class.getName()); } } - /** - * Stores a new article content object in the repository. - * - * @param contentPath - * @param language - * @param title - * @param content - * @param publicationDate - * @throws ObjectContentManagerException - * @throws ItemExistsException + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.DataHelper#storeContentInRepository(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Calendar) */ + @Override public void storeContentInRepository(String contentPath, String language, String title, String content, Calendar publicationDate) throws ObjectContentManagerException, ItemExistsException { if (UtilValidate.isEmpty(language)) { language = determindeTheDefaultLanguage(); } // construct the content article object - article = new OfbizRepositoryMappingJackrabbitArticle(contentPath, language, title, content, publicationDate); + article = new JackrabbitArticle(contentPath, language, title, content, publicationDate); super.access.storeContentObject(article); } - /** - * Update an existing content article object in the repository. - * - * @param updatedArticle - * @throws RepositoryException - * @throws ObjectContentManagerException + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.DataHelper#updateContentInRepository(org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitArticle) */ - public void updateContentInRepository(OfbizRepositoryMappingJackrabbitArticle updatedArticle) throws RepositoryException, ObjectContentManagerException { + @Override + public void updateContentInRepository(JackrabbitArticle updatedArticle) throws RepositoryException, ObjectContentManagerException { // if the item not already exist create it. if (!super.access.getSession().itemExists(updatedArticle.getPath())) { Debug.logWarning("This content object with the path: " + updatedArticle.getPath() + " doesn't exist in the repository. It will now created.", module); @@ -164,12 +137,10 @@ public class JcrArticleHelper extends Ab super.access.updateContentObject(updatedArticle); } - /** - * Returns a list of versions which are available for the current article. - * If no article is loaded before, the list will be empty. - * - * @return + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.DataHelper#getVersionListForCurrentArticle() */ + @Override public List<String> getVersionListForCurrentArticle() { List<String> versions = new ArrayList<String>(); ; @@ -184,6 +155,10 @@ public class JcrArticleHelper extends Ab return versions; } + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.DataHelper#getAvailableLanguageList() + */ + @Override public List<String> getAvailableLanguageList() { List<String> languages = new ArrayList<String>(); Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitArticleHelper.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitFileHelper.java (from r1207166, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitFileHelper.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitFileHelper.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java&r1=1207166&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/JcrFileHelper.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitFileHelper.java Tue Nov 29 10:45:20 2011 @@ -1,4 +1,4 @@ -package org.ofbiz.jcr.api; +package org.ofbiz.jcr.api.jackrabbit; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -15,11 +15,12 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericValue; import org.ofbiz.jcr.access.jackrabbit.ConstantsJackrabbit; import org.ofbiz.jcr.access.jackrabbit.JackrabbitRepositoryAccessor; +import org.ofbiz.jcr.api.JcrFileHelper; import org.ofbiz.jcr.orm.OfbizRepositoryMapping; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFile; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFolder; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitHierarchyNode; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitResource; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitFile; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitFolder; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitHierarchyNode; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitResource; import org.ofbiz.jcr.util.jackrabbit.JcrUtilJackrabbit; /** @@ -34,38 +35,29 @@ import org.ofbiz.jcr.util.jackrabbit.Jcr * in the Framework. * */ -public class JcrFileHelper extends AbstractJcrHelper { +public class JackrabbitFileHelper extends JackrabbitAbstractHelper implements JcrFileHelper { - private final static String module = JcrFileHelper.class.getName(); + private final static String module = JackrabbitFileHelper.class.getName(); - private OfbizRepositoryMappingJackrabbitHierarchyNode hierarchy = null; + private JackrabbitHierarchyNode hierarchy = null; - public JcrFileHelper(GenericValue userLogin) { + public JackrabbitFileHelper(GenericValue userLogin) { super(new JackrabbitRepositoryAccessor(userLogin)); } - /** - * Returns a content file object from the repository. Throws an Exception - * when the read content type is not an article content type. - * - * @param contentPath - * @return - * @throws + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.FileHelper#getRepositoryContent(java.lang.String) */ - public OfbizRepositoryMappingJackrabbitHierarchyNode getRepositoryContent(String contentPath) throws ClassCastException { + @Override + public JackrabbitHierarchyNode getRepositoryContent(String contentPath) throws ClassCastException { return getRepositoryContent(contentPath, null); } - /** - * Returns a content file object in the passed version from the repository. - * Throws an Exception when the read content type is not an article content - * type. - * - * @param contentPath - * @return - * @throws + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.FileHelper#getRepositoryContent(java.lang.String, java.lang.String) */ - public OfbizRepositoryMappingJackrabbitHierarchyNode getRepositoryContent(String contentPath, String version) throws ClassCastException { + @Override + public JackrabbitHierarchyNode getRepositoryContent(String contentPath, String version) throws ClassCastException { OfbizRepositoryMapping orm = null; if (version != null) { orm = super.access.getContentObject(contentPath, version); @@ -73,43 +65,31 @@ public class JcrFileHelper extends Abstr orm = super.access.getContentObject(contentPath); } - if (orm instanceof OfbizRepositoryMappingJackrabbitFile) { - OfbizRepositoryMappingJackrabbitFile fileObj = (OfbizRepositoryMappingJackrabbitFile) orm; + if (orm instanceof JackrabbitFile) { + JackrabbitFile fileObj = (JackrabbitFile) orm; hierarchy = fileObj; return fileObj; - } else if (orm instanceof OfbizRepositoryMappingJackrabbitFolder) { - OfbizRepositoryMappingJackrabbitFile fileObj = (OfbizRepositoryMappingJackrabbitFile) orm; + } else if (orm instanceof JackrabbitFolder) { + JackrabbitFile fileObj = (JackrabbitFile) orm; hierarchy = fileObj; return fileObj; } - throw new ClassCastException("The content object for the path: " + contentPath + " is not a file content object. This Helper can only handle content objects with the type: " + OfbizRepositoryMappingJackrabbitFile.class.getName()); + throw new ClassCastException("The content object for the path: " + contentPath + " is not a file content object. This Helper can only handle content objects with the type: " + JackrabbitFile.class.getName()); } - /** - * Stores a new file content object in the repository. - * - * @param fileData - * @param fileName - * @param folderPath - * @param mimeType - * @throws ObjectContentManagerException - * @throws RepositoryException + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.FileHelper#storeContentInRepository(byte[], java.lang.String, java.lang.String) */ + @Override public void storeContentInRepository(byte[] fileData, String fileName, String folderPath) throws ObjectContentManagerException, RepositoryException { storeContentInRepository(new ByteArrayInputStream(fileData), fileName, folderPath); } - /** - * Stores a new file content object in the repository. - * - * @param fileData - * @param fileName - * @param folderPath - * @param mimeType - * @throws ObjectContentManagerException - * @throws RepositoryException + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.FileHelper#storeContentInRepository(java.io.InputStream, java.lang.String, java.lang.String) */ + @Override public void storeContentInRepository(InputStream fileData, String fileName, String folderPath) throws ObjectContentManagerException, RepositoryException { if (UtilValidate.isEmpty(folderPath)) { throw new ObjectContentManagerException("Please specify a folder path, the folder path should not be empty!"); @@ -118,13 +98,13 @@ public class JcrFileHelper extends Abstr } // create an ORM Resource Object - OfbizRepositoryMappingJackrabbitResource ormResource = new OfbizRepositoryMappingJackrabbitResource(); + JackrabbitResource ormResource = new JackrabbitResource(); ormResource.setData(fileData); ormResource.setMimeType(getMimeTypeFromInputStream(fileData)); ormResource.setLastModified(new GregorianCalendar()); // create an ORM File Object - OfbizRepositoryMappingJackrabbitFile ormFile = new OfbizRepositoryMappingJackrabbitFile(); + JackrabbitFile ormFile = new JackrabbitFile(); ormFile.setCreationDate(new GregorianCalendar()); ormFile.setResource(ormResource); ormFile.setPath(fileName); @@ -134,14 +114,14 @@ public class JcrFileHelper extends Abstr folderPath = JcrUtilJackrabbit.createAbsoluteNodePath(folderPath); if (super.access.getSession().itemExists(folderPath)) { OfbizRepositoryMapping orm = super.access.getContentObject(folderPath); - if (orm instanceof OfbizRepositoryMappingJackrabbitFolder) { - OfbizRepositoryMappingJackrabbitFolder ormFolder = (OfbizRepositoryMappingJackrabbitFolder) orm; + if (orm instanceof JackrabbitFolder) { + JackrabbitFolder ormFolder = (JackrabbitFolder) orm; ormFolder.addChild(ormFile); super.access.updateContentObject(ormFolder); } } else { // create the ORM folder Object - OfbizRepositoryMappingJackrabbitFolder ormFolder = new OfbizRepositoryMappingJackrabbitFolder(); + JackrabbitFolder ormFolder = new JackrabbitFolder(); ormFolder.addChild(ormFile); ormFolder.setPath(folderPath); @@ -150,24 +130,20 @@ public class JcrFileHelper extends Abstr } - /** - * Returns TRUE if the current content is a file content (Type: - * OfbizRepositoryMappingJackrabbitFile) - * - * @return + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.FileHelper#isFileContent() */ + @Override public boolean isFileContent() { - return (hierarchy instanceof OfbizRepositoryMappingJackrabbitFile); + return (hierarchy instanceof JackrabbitFile); } - /** - * Returns TRUE if the current content is a folder content (Type: - * OfbizRepositoryMappingJackrabbitFolder) - * - * @return + /* (non-Javadoc) + * @see org.ofbiz.jcr.api.jackrabbit.FileHelper#isFolderContent() */ + @Override public boolean isFolderContent() { - return (hierarchy instanceof OfbizRepositoryMappingJackrabbitFolder); + return (hierarchy instanceof JackrabbitFolder); } private static String getMimeTypeFromInputStream(InputStream is) { Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/api/jackrabbit/JackrabbitFileHelper.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/loader/jackrabbit/JCRFactoryImpl.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/loader/jackrabbit/JCRFactoryImpl.java?rev=1207817&r1=1207816&r2=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/loader/jackrabbit/JCRFactoryImpl.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/loader/jackrabbit/JCRFactoryImpl.java Tue Nov 29 10:45:20 2011 @@ -47,14 +47,14 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.jcr.loader.JCRFactory; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitArticle; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFile; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitFolder; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitHierarchyNode; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitLocalizedContent; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitNews; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitResource; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitUnstructured; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitArticle; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitFile; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitFolder; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitHierarchyNode; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitLocalizedContent; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitNews; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitResource; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitUnstructured; import org.w3c.dom.Element; public class JCRFactoryImpl implements JCRFactory { @@ -102,14 +102,14 @@ public class JCRFactoryImpl implements J List<Class> classes = new ArrayList<Class>(); // put this in an xml configuration file // should the ocm classes be loaded in during the container startup? - classes.add(OfbizRepositoryMappingJackrabbitUnstructured.class); - classes.add(OfbizRepositoryMappingJackrabbitHierarchyNode.class); - classes.add(OfbizRepositoryMappingJackrabbitNews.class); - classes.add(OfbizRepositoryMappingJackrabbitFile.class); - classes.add(OfbizRepositoryMappingJackrabbitFolder.class); - classes.add(OfbizRepositoryMappingJackrabbitResource.class); - classes.add(OfbizRepositoryMappingJackrabbitLocalizedContent.class); - classes.add(OfbizRepositoryMappingJackrabbitArticle.class); + classes.add(JackrabbitUnstructured.class); + classes.add(JackrabbitHierarchyNode.class); + classes.add(JackrabbitNews.class); + classes.add(JackrabbitFile.class); + classes.add(JackrabbitFolder.class); + classes.add(JackrabbitResource.class); + classes.add(JackrabbitLocalizedContent.class); + classes.add(JackrabbitArticle.class); mapper = new AnnotationMapperImpl(classes); } Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitArticle.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitArticle.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitArticle.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitArticle.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitArticle.java Tue Nov 29 10:45:20 2011 @@ -5,8 +5,8 @@ import java.util.Calendar; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; -@Node(extend = OfbizRepositoryMappingJackrabbitLocalizedContent.class) -public class OfbizRepositoryMappingJackrabbitArticle extends OfbizRepositoryMappingJackrabbitLocalizedContent { +@Node(extend = JackrabbitLocalizedContent.class) +public class JackrabbitArticle extends JackrabbitLocalizedContent { @Field(id = true) String title = null; @@ -23,7 +23,7 @@ public class OfbizRepositoryMappingJackr * @param content * @param pubDate */ - public OfbizRepositoryMappingJackrabbitArticle(String nodePath, String language, String title, String content, Calendar pubDate) { + public JackrabbitArticle(String nodePath, String language, String title, String content, Calendar pubDate) { super(nodePath, language); this.title = title; @@ -34,7 +34,7 @@ public class OfbizRepositoryMappingJackr /** * */ - public OfbizRepositoryMappingJackrabbitArticle() { + public JackrabbitArticle() { super(); // create empty instance } Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitArticle.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFile.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFile.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFile.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFile.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFile.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFile.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFile.java Tue Nov 29 10:45:20 2011 @@ -4,17 +4,17 @@ import org.apache.jackrabbit.ocm.mapper. import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; import org.ofbiz.jcr.access.jackrabbit.ConstantsJackrabbit; -@Node(jcrType = "nt:file", extend = OfbizRepositoryMappingJackrabbitHierarchyNode.class) -public class OfbizRepositoryMappingJackrabbitFile extends OfbizRepositoryMappingJackrabbitHierarchyNode { +@Node(jcrType = "nt:file", extend = JackrabbitHierarchyNode.class) +public class JackrabbitFile extends JackrabbitHierarchyNode { @Bean(jcrName = "jcr:content") - private OfbizRepositoryMappingJackrabbitResource resource; + private JackrabbitResource resource; - public OfbizRepositoryMappingJackrabbitResource getResource() { + public JackrabbitResource getResource() { return resource; } - public void setResource(OfbizRepositoryMappingJackrabbitResource resource) { + public void setResource(JackrabbitResource resource) { this.resource = resource; } Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFile.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFolder.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFolder.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFolder.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFolder.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFolder.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitFolder.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFolder.java Tue Nov 29 10:45:20 2011 @@ -7,22 +7,22 @@ import org.apache.jackrabbit.ocm.manager import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; -@Node(jcrType = "nt:folder", extend = OfbizRepositoryMappingJackrabbitHierarchyNode.class) -public class OfbizRepositoryMappingJackrabbitFolder extends OfbizRepositoryMappingJackrabbitHierarchyNode { - @Collection(autoUpdate = true, jcrSameNameSiblings = false, elementClassName = OfbizRepositoryMappingJackrabbitHierarchyNode.class, collectionConverter = NTCollectionConverterImpl.class) - private List<OfbizRepositoryMappingJackrabbitHierarchyNode> children; +@Node(jcrType = "nt:folder", extend = JackrabbitHierarchyNode.class) +public class JackrabbitFolder extends JackrabbitHierarchyNode { + @Collection(autoUpdate = true, jcrSameNameSiblings = false, elementClassName = JackrabbitHierarchyNode.class, collectionConverter = NTCollectionConverterImpl.class) + private List<JackrabbitHierarchyNode> children; - public List<OfbizRepositoryMappingJackrabbitHierarchyNode> getChildren() { + public List<JackrabbitHierarchyNode> getChildren() { return children; } - public void setChildren(List<OfbizRepositoryMappingJackrabbitHierarchyNode> children) { + public void setChildren(List<JackrabbitHierarchyNode> children) { this.children = children; } - public void addChild(OfbizRepositoryMappingJackrabbitHierarchyNode node) { + public void addChild(JackrabbitHierarchyNode node) { if (children == null) { - children = new ArrayList<OfbizRepositoryMappingJackrabbitHierarchyNode>(); + children = new ArrayList<JackrabbitHierarchyNode>(); } children.add(node); } Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitFolder.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitHierarchyNode.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitHierarchyNode.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitHierarchyNode.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitHierarchyNode.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitHierarchyNode.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitHierarchyNode.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitHierarchyNode.java Tue Nov 29 10:45:20 2011 @@ -8,7 +8,7 @@ import org.ofbiz.jcr.orm.OfbizRepository import org.ofbiz.jcr.util.jackrabbit.JcrUtilJackrabbit; @Node(jcrType = "nt:hierarchyNode", jcrMixinTypes="mix:versionable") -public class OfbizRepositoryMappingJackrabbitHierarchyNode implements OfbizRepositoryMapping { +public class JackrabbitHierarchyNode implements OfbizRepositoryMapping { @Field(path = true, id = true, jcrProtected = true) protected String path; private String version; Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitHierarchyNode.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitLocalizedContent.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitLocalizedContent.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitLocalizedContent.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitLocalizedContent.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitLocalizedContent.java Tue Nov 29 10:45:20 2011 @@ -6,13 +6,13 @@ import org.apache.jackrabbit.ocm.mapper. import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; import org.ofbiz.jcr.access.jackrabbit.ConstantsJackrabbit; -@Node(isAbstract = true, extend = OfbizRepositoryMappingJackrabbitUnstructured.class) -public abstract class OfbizRepositoryMappingJackrabbitLocalizedContent extends OfbizRepositoryMappingJackrabbitUnstructured { +@Node(isAbstract = true, extend = JackrabbitUnstructured.class) +public abstract class JackrabbitLocalizedContent extends JackrabbitUnstructured { @Field private String language; - public OfbizRepositoryMappingJackrabbitLocalizedContent() { + public JackrabbitLocalizedContent() { super(); this.language = ""; super.setLocalized(true); @@ -25,7 +25,7 @@ public abstract class OfbizRepositoryMap * @param nodePath * @param language */ - public OfbizRepositoryMappingJackrabbitLocalizedContent(String nodePath, String language) { + public JackrabbitLocalizedContent(String nodePath, String language) { super(nodePath); this.language = language; Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitLocalizedContent.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitNews.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitNews.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitNews.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitNews.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitNews.java Tue Nov 29 10:45:20 2011 @@ -5,8 +5,8 @@ import java.util.Calendar; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; -@Node(extend = OfbizRepositoryMappingJackrabbitLocalizedContent.class) -public class OfbizRepositoryMappingJackrabbitNews extends OfbizRepositoryMappingJackrabbitLocalizedContent { +@Node(extend = JackrabbitLocalizedContent.class) +public class JackrabbitNews extends JackrabbitLocalizedContent { @Field(id = true) String title = null; @@ -15,12 +15,12 @@ public class OfbizRepositoryMappingJackr @Field String content = null; - public OfbizRepositoryMappingJackrabbitNews() { + public JackrabbitNews() { super(); // create an empty object } - public OfbizRepositoryMappingJackrabbitNews(String nodePath, String language, String title, Calendar pubDate, String content) { + public JackrabbitNews(String nodePath, String language, String title, Calendar pubDate, String content) { super(nodePath, language); this.title = title; this.pubDate = pubDate; Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitNews.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitResource.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitResource.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitResource.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitResource.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitResource.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitResource.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitResource.java Tue Nov 29 10:45:20 2011 @@ -7,7 +7,7 @@ import org.apache.jackrabbit.ocm.mapper. import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; @Node(jcrType = "nt:resource") -public class OfbizRepositoryMappingJackrabbitResource { +public class JackrabbitResource { @Field(jcrName = "jcr:mimeType") private String mimeType; Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitResource.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitUnstructured.java (from r1207009, ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java) URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitUnstructured.java?p2=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitUnstructured.java&p1=ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java&r1=1207009&r2=1207817&rev=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/OfbizRepositoryMappingJackrabbitUnstructured.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitUnstructured.java Tue Nov 29 10:45:20 2011 @@ -9,9 +9,9 @@ import org.ofbiz.jcr.access.jackrabbit.C import org.ofbiz.jcr.orm.OfbizRepositoryMapping; @Node(isAbstract = true, jcrMixinTypes = "mix:versionable") -public abstract class OfbizRepositoryMappingJackrabbitUnstructured implements OfbizRepositoryMapping { +public abstract class JackrabbitUnstructured implements OfbizRepositoryMapping { - protected static String module = OfbizRepositoryMappingJackrabbitUnstructured.class.getName(); + protected static String module = JackrabbitUnstructured.class.getName(); @Field(path = true) private String path; @@ -22,11 +22,11 @@ public abstract class OfbizRepositoryMap @Field private boolean localized; - protected OfbizRepositoryMappingJackrabbitUnstructured() { + protected JackrabbitUnstructured() { // create an empty object } - protected OfbizRepositoryMappingJackrabbitUnstructured(String nodePath) { + protected JackrabbitUnstructured(String nodePath) { this.setPath(nodePath); this.creationDate = new GregorianCalendar(); this.localized = false; Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/jackrabbit/JackrabbitUnstructured.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/services/JackrabbitServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/services/JackrabbitServices.java?rev=1207817&r1=1207816&r2=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/services/JackrabbitServices.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/services/JackrabbitServices.java Tue Nov 29 10:45:20 2011 @@ -13,7 +13,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.entity.GenericValue; import org.ofbiz.jcr.access.jackrabbit.JackrabbitRepositoryAccessor; import org.ofbiz.jcr.loader.JCRFactoryUtil; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitNews; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitNews; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ServiceUtil; @@ -58,7 +58,7 @@ public class JackrabbitServices { start = new Date().getTime(); for (int i = 0; i <= maxNodes; i++) { try { - OfbizRepositoryMappingJackrabbitNews news = new OfbizRepositoryMappingJackrabbitNews("/__Speedtest_Node-" + i, "de", "", null, ""); + JackrabbitNews news = new JackrabbitNews("/__Speedtest_Node-" + i, "de", "", null, ""); access.storeContentObject(news); access.removeContentObject("/__Speedtest_Node-" + i); } catch (Exception e) { Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java?rev=1207817&r1=1207816&r2=1207817&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java Tue Nov 29 10:45:20 2011 @@ -31,10 +31,11 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.entity.GenericValue; import org.ofbiz.jcr.access.JcrRepositoryAccessor; import org.ofbiz.jcr.access.jackrabbit.JackrabbitRepositoryAccessor; -import org.ofbiz.jcr.api.JcrArticleHelper; -import org.ofbiz.jcr.api.JcrContentHelper; +import org.ofbiz.jcr.api.JcrDataHelper; import org.ofbiz.jcr.api.JcrFileHelper; -import org.ofbiz.jcr.orm.jackrabbit.OfbizRepositoryMappingJackrabbitArticle; +import org.ofbiz.jcr.api.jackrabbit.JackrabbitArticleHelper; +import org.ofbiz.jcr.api.jackrabbit.JackrabbitFileHelper; +import org.ofbiz.jcr.orm.jackrabbit.JackrabbitArticle; import org.ofbiz.jcr.util.jackrabbit.JcrUtilJackrabbit; import org.ofbiz.service.ServiceUtil; import org.ofbiz.service.testtools.OFBizTestCase; @@ -64,17 +65,17 @@ public class JackrabbitTests extends OFB public void testCrudArticleNode() throws Exception { // Create New Object - JcrArticleHelper helper = new JcrArticleHelper(userLogin); + JcrDataHelper helper = new JackrabbitArticleHelper(userLogin); helper.storeContentInRepository("news/article", "en", "News Of Today", "Hello World", new GregorianCalendar()); - OfbizRepositoryMappingJackrabbitArticle content = helper.readContentFromRepository("news/article"); + JackrabbitArticle content = helper.readContentFromRepository("news/article"); assertEquals("Hello World", content.getContent()); content.setContent("New World!"); helper.updateContentInRepository(content); - OfbizRepositoryMappingJackrabbitArticle updatedContent = helper.readContentFromRepository("news/article"); + JackrabbitArticle updatedContent = helper.readContentFromRepository("news/article"); assertEquals("New World!", updatedContent.getContent()); helper.removeContentObject("news"); @@ -83,10 +84,10 @@ public class JackrabbitTests extends OFB } public void testVersionning() throws Exception { - JcrArticleHelper helper = new JcrArticleHelper(userLogin); + JcrDataHelper helper = new JackrabbitArticleHelper(userLogin); helper.storeContentInRepository("news/versionArticle", "en", "News Of Today", "Hello World", new GregorianCalendar()); - OfbizRepositoryMappingJackrabbitArticle content = helper.readContentFromRepository("news/versionArticle"); + JackrabbitArticle content = helper.readContentFromRepository("news/versionArticle"); assertEquals("1.0", content.getVersion()); content.setTitle("New Title"); @@ -101,7 +102,7 @@ public class JackrabbitTests extends OFB } public void testLanguageDetermination() throws Exception { - JcrArticleHelper helper = new JcrArticleHelper(userLogin); + JcrDataHelper helper = new JackrabbitArticleHelper(userLogin); helper.storeContentInRepository("news/tomorrow", "en", "The news for tomorrow.", "Content.", new GregorianCalendar()); helper.storeContentInRepository("superhero", "de", "Batman", "The best superhero!", new GregorianCalendar()); @@ -129,7 +130,7 @@ public class JackrabbitTests extends OFB InputStream file = new FileInputStream(f); - JcrFileHelper helper = new JcrFileHelper(userLogin); + JcrFileHelper helper = new JackrabbitFileHelper(userLogin); helper.storeContentInRepository(file, f.getName(), "/fileHome"); assertNotNull(helper.getRepositoryContent("/fileHome/" + f.getName())); @@ -147,15 +148,11 @@ public class JackrabbitTests extends OFB } public void testQuery() throws Exception { - JcrArticleHelper article = new JcrArticleHelper(userLogin); + JcrDataHelper helper = new JackrabbitArticleHelper(userLogin); - article.storeContentInRepository("/query", "en", "query", "query test", new GregorianCalendar()); + helper.storeContentInRepository("/query", "en", "query", "query test", new GregorianCalendar()); - article.closeContentSession(); - - JcrContentHelper content = new JcrContentHelper(userLogin); - - List<Map<String, String>> queryResult = content.queryData("SELECT * FROM [nt:unstructured]"); + List<Map<String, String>> queryResult = helper.queryData("SELECT * FROM [nt:unstructured]"); assertEquals(3, queryResult.size()); // the list should contain 3 result sets @@ -163,9 +160,9 @@ public class JackrabbitTests extends OFB assertEquals("/query", queryResult.get(1).get("path")); assertEquals("/query/en", queryResult.get(2).get("path")); - content.removeContentObject("query"); + helper.removeContentObject("query"); - content.closeContentSession(); + helper.closeContentSession(); } |
Free forum by Nabble | Edit this page |