Author: sascharodekamp
Date: Sun May 29 13:38:54 2011 New Revision: 1128874 URL: http://svn.apache.org/viewvc?rev=1128874&view=rev Log: Update - Add a new Screen to show file information (title, language,description) and add some code to read the file properties Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/helper/JcrFileHelperJackrabbit.java ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/orm/OfbizRepositoryMappingJackrabbit.java ofbiz/branches/jackrabbit20100709/framework/example/config/ExampleUiLabels.xml ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/WEB-INF/controller.xml ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitForms.xml ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitScreens.xml ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelper.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelperAbstract.java ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/OfbizRepositoryMapping.java Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java (original) +++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/JackrabbitEvents.java Sun May 29 13:38:54 2011 @@ -291,8 +291,6 @@ public class JackrabbitEvents { * @return */ public static String uploadFileData(HttpServletRequest request, HttpServletResponse response) { - String language = request.getParameter("fileLocale"); - String description = request.getParameter("description"); ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory(10240, FileUtil.getFile("runtime/tmp"))); List<FileItem> list = null; Map<String, String> passedParams = FastMap.newInstance(); @@ -322,7 +320,7 @@ public class JackrabbitEvents { if (file != null && file.length >= 1) { try { - jackrabbit.uploadFileData(file, passedParams.get("completeFileName"), language, description); + jackrabbit.uploadFileData(file, passedParams.get("completeFileName"), passedParams.get("fileLocale"), passedParams.get("description")); } catch (GenericEntityException e) { Debug.logError(e, module); request.setAttribute("_ERROR_MESSAGE_", e.toString()); @@ -425,4 +423,17 @@ public class JackrabbitEvents { return "success"; } + + public static String getFileInformation(HttpServletRequest request, HttpServletResponse resposne) { + + JcrFileHelper jackrabbit = new JcrFileHelperJackrabbit(request); + + request.setAttribute("fileName", jackrabbit.getNodeName()); + request.setAttribute("fileLanguage", jackrabbit.getSelctedLanguage()); + request.setAttribute("fileDescription", jackrabbit.getFileDescription()); + request.setAttribute("fileMimeType", jackrabbit.getFileMimeType()); + jackrabbit.closeSession(); + + return "success"; + } } \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/helper/JcrFileHelperJackrabbit.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/helper/JcrFileHelperJackrabbit.java?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/helper/JcrFileHelperJackrabbit.java (original) +++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/helper/JcrFileHelperJackrabbit.java Sun May 29 13:38:54 2011 @@ -3,6 +3,7 @@ package org.ofbiz.content.jcr.helper; import java.io.ByteArrayInputStream; import java.io.InputStream; +import javax.jcr.Property; import javax.jcr.RepositoryException; import javax.jcr.Session; import javax.servlet.http.HttpServletRequest; @@ -21,6 +22,7 @@ import org.ofbiz.jcr.helper.JcrFileHelpe public class JcrFileHelperJackrabbit extends JcrFileHelperAbstract implements JcrFileHelper { + private static String module = JcrFileHelperJackrabbit.class.getName(); private static String fileRootNode = "/fileHome"; /** @@ -233,10 +235,58 @@ public class JcrFileHelperJackrabbit ext * @see org.ofbiz.jcr.helper.JcrFileHelper#getFileMimeType() */ @Override - public String getFileMimeType() throws RepositoryException { - return orm.getFileMimeType(); + public String getFileMimeType() { + String ret = null; + try { + ret = orm.getFileMimeType(); + } catch (RepositoryException e) { + Debug.logError(e, module); + } + + return ret; + } + + /* + * (non-Javadoc) + * + * @see org.ofbiz.jcr.helper.JcrFileHelper#getFileDescription() + */ + @Override + public String getFileDescription() { + String ret = null; + Property prop = orm.getNodeProperty("jcr:description"); + if (prop != null) { + try { + ret = prop.getString(); + } catch (RepositoryException e) { + Debug.logError(e, module); + } + } + + return ret; + } + + /* + * (non-Javadoc) + * + * @see org.ofbiz.jcr.helper.JcrFileHelper#getSelctedLanguage() + */ + @Override + public String getSelctedLanguage() { + String ret = null; + Property prop = orm.getNodeProperty("jcr:language"); + if (prop != null) { + try { + ret = prop.getString(); + } catch (RepositoryException e) { + Debug.logError(e, module); + } + } + + return ret; } + /** * Adds the file home node to the repository node, if not already exists. * Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/orm/OfbizRepositoryMappingJackrabbit.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/orm/OfbizRepositoryMappingJackrabbit.java?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/orm/OfbizRepositoryMappingJackrabbit.java (original) +++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/jcr/orm/OfbizRepositoryMappingJackrabbit.java Sun May 29 13:38:54 2011 @@ -320,6 +320,24 @@ public class OfbizRepositoryMappingJackr /* * (non-Javadoc) * + * @see + * org.ofbiz.jcr.orm.OfbizContentMapping#getNodeProperty(java.lang.String) + */ + @Override + public Property getNodeProperty(String propertyName) { + try { + if (this.node.hasProperty(propertyName)) { + return this.node.getProperty(propertyName); + } + } catch (RepositoryException e) { + Debug.logError(e, module); + } + return null; + } + + /* + * (non-Javadoc) + * * @see org.ofbiz.jcr.orm.OfbizContentMapping#getContentId() */ @Override @@ -352,6 +370,12 @@ public class OfbizRepositoryMappingJackr */ @Override public void removeRepositoryNode() throws RepositoryException, GenericEntityException { + if (node.hasNodes()) { + // make sure all child nodes are checked out before deleting them + checkOutChildNodes(node); + } + checkOutNode(node); + node.remove(); try { GenericValue content = delegator.findOne("Content", false, UtilMisc.toMap("contentId", this.content.getString("contentId"))); @@ -361,7 +385,7 @@ public class OfbizRepositoryMappingJackr if (UtilValidate.isNotEmpty(relatedContents)) { delegator.removeAll(relatedContents); } - session.save(); + saveSessionAndCheckinNode(); } catch (GenericEntityException e) { throw new GenericEntityException(e); } @@ -553,6 +577,10 @@ public class OfbizRepositoryMappingJackr } Node fileNode = this.node.getNode(fileName); + // read file language + if (fileNode.hasProperty(PROPERTY_FIELDS.LANGUAGE.getType())) { + selectedLanguage = fileNode.getProperty(PROPERTY_FIELDS.LANGUAGE.getType()).getString(); + } Node jcrContent = fileNode.getNode("jcr:content"); if (!jcrContent.hasProperty(PROPERTY_FIELDS.DATA.getType())) { @@ -722,6 +750,25 @@ public class OfbizRepositoryMappingJackr } /** + * Checks out recusivly all child nodes + * + * @param startNode + * @throws RepositoryException + */ + private void checkOutChildNodes(Node startNode) throws RepositoryException { + NodeIterator ni = startNode.getNodes(); + while (ni.hasNext()) { + Node nextNode = ni.nextNode(); + checkOutNode(nextNode); + if (nextNode.hasNodes()) { + checkOutChildNodes(nextNode); + } + } + + // checkOutNode(startNode); + } + + /** * Returns a JSON Array with the repository text data structure. The JSON * array is directly build for the jsTree jQuery plugin. * Modified: ofbiz/branches/jackrabbit20100709/framework/example/config/ExampleUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/config/ExampleUiLabels.xml?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/config/ExampleUiLabels.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/config/ExampleUiLabels.xml Sun May 29 13:38:54 2011 @@ -857,5 +857,9 @@ <value xml:lang="de">Verion des Content Knoten</value> <value xml:lang="en">Version of the base content node</value> </property> + <property key="ExampelsJackrabbitOpenFile"> + <value xml:lang="de">Datei Informationen öffnen</value> + <value xml:lang="en">Open file information</value> + </property> </resource> Modified: ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/WEB-INF/controller.xml?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/WEB-INF/controller.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/WEB-INF/controller.xml Sun May 29 13:38:54 2011 @@ -318,6 +318,12 @@ under the License. <response name="success" type="view" value="ExampleJackrabbitShowContentData"/> <response name="error" type="view" value="ExampleJackrabbitShowContentData"/> </request-map> + <request-map uri="OpenFileInformation"> + <security auth="true" https="true" /> + <event type="java" path="org.ofbiz.content.jcr.JackrabbitEvents" invoke="getFileInformation"/> + <response name="success" type="view" value="ExampleJackrabbitOpenFileInformation"/> + <response name="error" type="view" value="ExampleJackrabbitShowUploadedFiles"/> + </request-map> <!-- View Mappings --> <view-map name="main" type="screen" page="component://example/widget/example/CommonScreens.xml#main"/> @@ -371,6 +377,7 @@ under the License. <view-map name="ExampleJackrabbitUploadFileData" page="component://example/widget/example/ExampleJackrabbitScreens.xml#ExampleJackrabbitUploadFileData" type="screen" /> <view-map name="ExampleJackrabbitShowUploadedFiles" page="component://example/widget/example/ExampleJackrabbitScreens.xml#ExampleJackrabbitShowUploadedFiles" type="screen" /> <view-map name="ExampleJackrabbitShowContentData" page="component://example/widget/example/ExampleJackrabbitScreens.xml#ExampleJackrabbitShowContentData" type="screen" /> + <view-map name="ExampleJackrabbitOpenFileInformation" page="component://example/widget/example/ExampleJackrabbitScreens.xml#ExampleJackrabbitShowFileInformation" type="screen" /> <!-- Supported Content Types --> Modified: ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl Sun May 29 13:38:54 2011 @@ -18,18 +18,18 @@ under the License. --> <script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script> -<div id="jackrabbitDataTree">${parameters.dataTree!}</div> +<div id="jackrabbitDataTree">${parameters.dataTree!""}</div> <script type="text/javascript"> - var rawdata = ${parameters.dataTree!}; + var rawdata = ${parameters.dataTree!}; jQuery(function () { - jQuery("#jackrabbitDataTree").jstree({ - "plugins" : [ "themes", "json_data", "ui", "contextmenu"], - "json_data" : { - "data" : rawdata - }, - 'contextmenu': { + jQuery("#jackrabbitDataTree").jstree({ + "plugins" : [ "themes", "json_data", "ui", "contextmenu"], + "json_data" : { + "data" : rawdata + }, + 'contextmenu': { 'items': { 'ccp' : false, 'create' : false, @@ -48,46 +48,46 @@ under the License. } } } - }); + }); }); function removeDataFromRepository(nodepath, nodetype) { - var parameters = {"repositoryNode" : nodepath}; - var url = "RemoveRepositoryNode"; + var parameters = {"repositoryNode" : nodepath}; + var url = "RemoveRepositoryNode"; - runPostRequest(url, parameters) + runPostRequest(url, parameters) } function openDataFromRepository(nodepath, nodetype) { - var parameters = {"repositoryNode" : nodepath}; - var url = "EditRepositoryContent"; + var parameters = {"repositoryNode" : nodepath}; + var url = "EditRepositoryContent"; - runPostRequest(url, parameters) + runPostRequest(url, parameters) } function runPostRequest(url, parameters) { - // create a hidden form - var form = jQuery('<form></form>'); + // create a hidden form + var form = jQuery('<form></form>'); - form.attr("method", "POST"); - form.attr("action", url); + form.attr("method", "POST"); + form.attr("action", url); - jQuery.each(parameters, function(key, value) { - var field = jQuery('<input></input>'); + jQuery.each(parameters, function(key, value) { + var field = jQuery('<input></input>'); - field.attr("type", "hidden"); - field.attr("name", key); - field.attr("value", value); - - form.append(field); - }); - - // The form needs to be apart of the document in - // order for us to be able to submit it. - jQuery(document.body).append(form); - form.submit(); - form.remove(); + field.attr("type", "hidden"); + field.attr("name", key); + field.attr("value", value); + + form.append(field); + }); + + // The form needs to be apart of the document in + // order for us to be able to submit it. + jQuery(document.body).append(form); + form.submit(); + form.remove(); } Modified: ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl Sun May 29 13:38:54 2011 @@ -18,79 +18,92 @@ under the License. --> <script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script> -<div id="jackrabbitFileTree">${parameters.fileTree!}</div> +<div id="jackrabbitFileTree">${parameters.fileTree!""}</div> <script type="text/javascript"> - var rawdata = ${parameters.fileTree!}; + var rawdata = ${parameters.fileTree!}; jQuery(function () { - jQuery("#jackrabbitFileTree").jstree({ - "plugins" : [ "themes", "json_data", "ui", "contextmenu"], - "json_data" : { - "data" : rawdata - }, - 'contextmenu': { + jQuery("#jackrabbitFileTree").jstree({ + "plugins" : [ "themes", "json_data", "ui", "contextmenu"], + "json_data" : { + "data" : rawdata + }, + 'contextmenu': { 'items': { 'ccp' : false, 'create' : false, 'rename' : false, + 'open' : { + 'label' : "${uiLabelMap.ExampelsJackrabbitOpenFile}", + 'action' : function(obj) { + openFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype')); + } + }, 'remove' : { 'label' : "${uiLabelMap.ExampelsJackrabbitRemoveFile}", 'action' : function(obj) { removeFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype')); } }, - 'open' : { + 'download' : { 'label' : "${uiLabelMap.ExampelsJackrabbitDownloadFile}", 'action' : function(obj) { - openFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype')); + downloadFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype')); } } } } - }); + }); }); + function openFileFromRepository(nodepath, nodetype) { + var parameters = {"repositoryNode" : nodepath}; + var url = "OpenFileInformation"; + + runPostRequest(url, parameters) + } + function removeFileFromRepository(nodepath, nodetype) { - var parameters = {"repositoryNode" : nodepath}; - var url = "RemoveRepositoryFile"; + var parameters = {"repositoryNode" : nodepath}; + var url = "RemoveRepositoryFile"; - runPostRequest(url, parameters) + runPostRequest(url, parameters) } - function openFileFromRepository(nodepath, nodetype) { - if ("nt:folder" == nodetype) { // the open function for foldes is not supported yet. - return; - } + function downloadFileFromRepository(nodepath, nodetype) { + if ("nt:folder" == nodetype) { // the open function for foldes is not supported yet. + return; + } - var parameters = {"repositoryNode" : nodepath}; - var url = "GetFileFromRepository"; + var parameters = {"repositoryNode" : nodepath}; + var url = "GetFileFromRepository"; - runPostRequest(url, parameters) + runPostRequest(url, parameters) } function runPostRequest(url, parameters) { - // create a hidden form - var form = jQuery('<form></form>'); + // create a hidden form + var form = jQuery('<form></form>'); - form.attr("method", "POST"); - form.attr("action", url); + form.attr("method", "POST"); + form.attr("action", url); - jQuery.each(parameters, function(key, value) { - var field = jQuery('<input></input>'); + jQuery.each(parameters, function(key, value) { + var field = jQuery('<input></input>'); - field.attr("type", "hidden"); - field.attr("name", key); - field.attr("value", value); - - form.append(field); - }); - - // The form needs to be apart of the document in - // order for us to be able to submit it. - jQuery(document.body).append(form); - form.submit(); - form.remove(); + field.attr("type", "hidden"); + field.attr("name", key); + field.attr("value", value); + + form.append(field); + }); + + // The form needs to be apart of the document in + // order for us to be able to submit it. + jQuery(document.body).append(form); + form.submit(); + form.remove(); } Modified: ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitForms.xml?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitForms.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitForms.xml Sun May 29 13:38:54 2011 @@ -120,4 +120,19 @@ under the License. <display /> </field> </form> + + <form name="ExampleJackrabbitShowFileInformation" type="single" list-name="listIt" default-entity-name="Content" separate-columns="true" odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar"> + <field name="fileName"> + <display /> + </field> + <field name="fileLanguage"> + <display /> + </field> + <field name="fileMimeType"> + <display /> + </field> + <field name="fileDescription"> + <display /> + </field> + </form> </forms> \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitScreens.xml?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitScreens.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitScreens.xml Sun May 29 13:38:54 2011 @@ -170,4 +170,22 @@ under the License. </section> </screen> + <screen name="ExampleJackrabbitShowFileInformation"> + <section> + <actions> + <set field="titleProperty" value="PageTitleExampleJackrabbit" /> + <set field="tabButtonItem" value="ExampleJackrabbitShowUploadedFiles" /> + </actions> + <widgets> + <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <container> + <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="ExampleJackrabbitShowFileInformation" /> + </container> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + </screens> \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelper.java?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelper.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelper.java Sun May 29 13:38:54 2011 @@ -130,7 +130,7 @@ public interface JcrFileHelper { * @return * @throws RepositoryException */ - public String getFileMimeType() throws RepositoryException; + public String getFileMimeType(); /** * Get the current selected content language. @@ -164,4 +164,10 @@ public interface JcrFileHelper { */ public List<String> getAllLanguageVersions(); + /** + * Returns the description of the current file object. + * + * @return + */ + public String getFileDescription(); } \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelperAbstract.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelperAbstract.java?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelperAbstract.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrFileHelperAbstract.java Sun May 29 13:38:54 2011 @@ -23,9 +23,13 @@ public abstract class JcrFileHelperAbstr public abstract InputStream getFileContent() throws RepositoryException; - public abstract String getFileMimeType() throws RepositoryException; + public abstract String getFileMimeType(); public abstract JSONArray getJsonFileTree() throws RepositoryException; public abstract JcrFileHelper addNewNode(String newNode) throws RepositoryException, GenericEntityException; + + public abstract String getFileDescription(); + + public abstract String getSelctedLanguage(); } Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/OfbizRepositoryMapping.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/OfbizRepositoryMapping.java?rev=1128874&r1=1128873&r2=1128874&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/OfbizRepositoryMapping.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/orm/OfbizRepositoryMapping.java Sun May 29 13:38:54 2011 @@ -5,6 +5,7 @@ import java.util.List; import javax.jcr.Node; import javax.jcr.PathNotFoundException; +import javax.jcr.Property; import javax.jcr.RepositoryException; import javax.jcr.version.Version; @@ -63,6 +64,15 @@ public interface OfbizRepositoryMapping public Node getNode(); /** + * Return the property of the current node. Return null if the property not + * exists or an exception is raised. + * + * @param propertyName + * @return + */ + public Property getNodeProperty(String propertyName); + + /** * Returns the contentId from the related content object. If the content * object is null, an empty string will be retunred. * |
Free forum by Nabble | Edit this page |