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=1099770&r1=1099769&r2=1099770&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitForms.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitForms.xml Thu May 5 12:32:13 2011 @@ -1,79 +1,109 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache - License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed - under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> - <form name="ListRepositoryData" type="list" list-name="repositoryContent" 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="contentId"> - <hyperlink target="EditRepositoryContent" description="${contentId}"> - <parameter param-name="contentId" from-field="contentId" /> - <parameter param-name="repositoryNode" from-field="repositoryNode" /> - </hyperlink> - </field> - <field name="contentTypeId"> - <display /> - </field> - <field name="repositoryNode"> - <display /> - </field> - <field name="statusId"> - <display /> - </field> - <field name="statusId"> - <display /> - </field> - </form> - - <form name="AddRepositoryData" type="single" target="StoreNewRepositoryData"> - <field name="repositoryNode" title="${uiLabelMap.ExampleRepositoryNode}" tooltip="${uiLabelMap.ExampleAddNewNodePath}"> - <text></text> - </field> - <field name="message" title="${uiLabelMap.ExampleRepositoryMessage}"> - <text></text> - </field> - <field name="submit"> - <submit /> - </field> - </form> - - <form name="UploadRepositoryFileData" type="upload" target="StoreNewRepositoryFileData"> - <field name="repositoryNode" title="${uiLabelMap.ExampleRepositoryFolder}" tooltip="${uiLabelMap.ExampleAddNewNodePath}"> - <text></text> - </field> - <field name="fileData" title="${uiLabelMap.ExampleRepositoryFile}"> - <file size="28"></file> - </field> - <field name="submit"> - <submit /> - </field> - </form> - - <form name="EditRepositoryData" type="single" target="UpdateRepositoryData" default-entity-name="Content"> - <field name="contentId" map-name="content"> - <display /> - </field> - <field name="repositoryNode" title="${uiLabelMap.ExampleRepositoryNode}" map-name="content"> - <display /> - </field> - <field name="message" title="${uiLabelMap.ExampleRepositoryMessage}" map-name="content"> - <text default-value="${parameters.message}"></text> - </field> - <field name="submit"> - <submit /> - </field> - </form> - - <form name="ScanRepositoryStructure" type="list" 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="repositoryNode"> - <display /> - </field> - <field name="nodeContent"> - <display /> - </field> - <field name="primaryNodeType"> - <display /> - </field> - </form> + <form name="ListRepositoryData" type="list" list-name="repositoryContent" 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="repositoryNode"> + <hyperlink target="EditRepositoryContent" description="${repositoryNode}"> + <parameter param-name="contentId" from-field="contentId" /> + <parameter param-name="repositoryNode" from-field="repositoryNode" /> + </hyperlink> + </field> + <field name="contentId"> + <hyperlink target="EditRepositoryContent" description="${contentId}"> + <parameter param-name="contentId" from-field="contentId" /> + <parameter param-name="repositoryNode" from-field="repositoryNode" /> + </hyperlink> + </field> + <field name="contentTypeId"> + <display /> + </field> + <field name="statusId"> + <display /> + </field> + <field name="statusId"> + <display /> + </field> + </form> + + <form name="AddRepositoryData" type="single" target="StoreNewRepositoryData"> + <field name="repositoryNode" title="${uiLabelMap.ExampleRepositoryNode}" tooltip="${uiLabelMap.ExampleAddNewNodePath}"> + <text></text> + </field> + <field name="msgLocale" title="${uiLabelMap.CommonChooseLanguage}" > + <drop-down allow-empty="true" ><list-options key-name="localeId" list-name="parameters.localeList" description="${localeId}"/></drop-down> + </field> + <field name="message" title="${uiLabelMap.ExampleRepositoryMessage}"> + <textarea visual-editor-enable="true" /> + </field> + <field name="submit"> + <submit /> + </field> + </form> + + <form name="UploadRepositoryFileData" type="upload" target="StoreNewRepositoryFileData"> + <field name="repositoryNode" title="${uiLabelMap.ExampleRepositoryFolder}" tooltip="${uiLabelMap.ExampleAddNewNodePath}"> + <text></text> + </field> + <field name="fileData" title="${uiLabelMap.ExampleRepositoryFile}"> + <file size="28"></file> + </field> + <field name="submit"> + <submit /> + </field> + </form> + + <form name="EditRepositoryDataChangeLanguage" type="single" target="EditRepositoryContent" default-entity-name="Content"> + <field name="repositoryNode" title="${uiLabelMap.ExampleRepositoryNode}" map-name="content"> + <hidden /> + </field> + <field name="language" title="${uiLabelMap.CommonChooseLanguage}" event="onChange" action="javascript:jQuery('#EditRepositoryDataChangeLanguage').submit();"> + <drop-down allow-empty="false" current="first-in-list" current-description="${parameters.selectedLanguage}"><list-options key-name="localeId" list-name="parameters.languageList" description="${localeId}"/></drop-down> + </field> + </form> + + <form name="EditRepositoryData" type="single" target="UpdateRepositoryData" default-entity-name="Content"> + <field name="repositoryNode" title="${uiLabelMap.ExampleRepositoryNode}" map-name="content"> + <display /> + </field> + <field name="selectedLanguage" title="${uiLabelMap.CommonLanguageTitle}"> + <display /> + </field> + <field name="message" title="${uiLabelMap.ExampleRepositoryMessage}" map-name="content"> + <textarea visual-editor-enable="true" default-value="${parameters.message}"/> + </field> + <field name="submit"> + <submit /> + </field> + </form> + + <form name="ScanRepositoryStructure" type="list" 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="repositoryNode"> + <display /> + </field> + <field name="nodeContent"> + <display /> + </field> + <field name="primaryNodeType"> + <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=1099770&r1=1099769&r2=1099770&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitScreens.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleJackrabbitScreens.xml Thu May 5 12:32:13 2011 @@ -25,7 +25,7 @@ under the License. <section> <actions> <set field="titleProperty" value="PageTitleExampleJackrabbit" /> - <set field="tabButtonItem" value="ExampleJackrabbitMainPage" /> + <set field="tabButtonItem" value="ExampleJackrabbitListNodes" /> <entity-condition list="repositoryContent" entity-name="Content"> <condition-expr field-name="contentTypeId" operator="equals" value="REPOSITORY"/> </entity-condition> @@ -42,11 +42,33 @@ under the License. </section> </screen> + <screen name="ExampleJackrabbitShowContentData"> + <section> + <actions> + <set field="titleProperty" value="PageTitleExampleJackrabbit" /> + <set field="tabButtonItem" value="ExampleJackrabbitShowContentData" /> + </actions> + <widgets> + <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <container> + <label>${uiLabelMap.ExampleJackrabbitTryRightClick}</label> + <platform-specific> + <html><html-template location="component://example/webapp/example/jackrabbit/JackrabbitDataTree.ftl"/></html> + </platform-specific> + </container> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="ExampleJackrabbitAddData"> <section> <actions> <set field="titleProperty" value="PageTitleExampleJackrabbit" /> <set field="tabButtonItem" value="ExampleJackrabbitAddData" /> + <script location="component://example/webapp/example/WEB-INF/actions/includes/PrepareLocalesForDropDown.groovy"/> </actions> <widgets> <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}"> @@ -88,9 +110,9 @@ under the License. <widgets> <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <container> - <link target="CleanJcrRepository" style="buttontext" text="${uiLabelMap.ExampleJackrabbitCleanRepository}"></link> <label>${uiLabelMap.ExampleJackrabbitCleanRepositoryTooltip}</label> - </container> + <container> + <link target="CleanJcrRepository" style="buttontext" text="${uiLabelMap.ExampleJackrabbitCleanRepository}"></link> <label>${uiLabelMap.ExampleJackrabbitCleanRepositoryTooltip}</label> + </container> <container> <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="ScanRepositoryStructure" /> </container> @@ -113,6 +135,7 @@ under the License. <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <container> + <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="EditRepositoryDataChangeLanguage" /> <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="EditRepositoryData" /> <link target="RemoveRepositoryNode" text="remove" style="buttontext"> <parameter param-name="repositoryNode" from-field="content.repositoryNode" /> @@ -135,10 +158,10 @@ under the License. <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <container> - <label>${uiLabelMap.ExampleJackrabbitTryRightClick}</label> - <platform-specific> - <html><html-template location="component://example/webapp/example/jackrabbit/JackrabbitFileTree.ftl"/></html> - </platform-specific> + <label>${uiLabelMap.ExampleJackrabbitTryRightClick}</label> + <platform-specific> + <html><html-template location="component://example/webapp/example/jackrabbit/JackrabbitFileTree.ftl"/></html> + </platform-specific> </container> </decorator-section> </decorator-screen> Modified: ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleMenus.xml?rev=1099770&r1=1099769&r2=1099770&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleMenus.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/example/widget/example/ExampleMenus.xml Thu May 5 12:32:13 2011 @@ -48,7 +48,7 @@ under the License. <menu-item name="ExampleCharts" title="Chart examples"> <link target="ExampleBarChart"/> </menu-item> - <menu-item name="ExampleJackrabbit" title="Jackrabbit Sandbox"><link target="ExampleJackrabbit"/></menu-item> + <menu-item name="ExampleJackrabbit" title="Jackrabbit Sandbox"><link target="ExampleJackrabbitShowContentData"/></menu-item> </menu> <menu name="EditExample" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> @@ -104,10 +104,11 @@ under the License. </menu> <menu name="ExampleJackrabbit" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> - <menu-item name="ExampleJackrabbitMainPage" title="${uiLabelMap.ExampleMainPage}"><link target="ExampleJackrabbit"/></menu-item> + <menu-item name="ExampleJackrabbitShowContentData" title="${uiLabelMap.ExampleJackrabbitShowContentData}"><link target="ExampleJackrabbitShowContentData"/></menu-item> <menu-item name="ExampleJackrabbitAddData" title="${uiLabelMap.ExampleAddNewContentEntry}"><link target="ExampleJackrabbitAddData"/></menu-item> <menu-item name="ExampleJackrabbitUploadFileData" title="${uiLabelMap.ExampleJackrabbitUploadFileData}"><link target="ExampleJackrabbitUploadFileData"/></menu-item> <menu-item name="ExampleJackrabbitShowUploadedFiles" title="${uiLabelMap.ExampleJackrabbitShowUploadedFiles}"><link target="ExampleJackrabbitShowUploadedFiles"/></menu-item> + <menu-item name="ExampleJackrabbitListNodes" title="${uiLabelMap.ExampleJackrabbitListNodes}"><link target="ExampleJackrabbit"/></menu-item> <menu-item name="ExampleJackrabbitScanRepositoryStrukture" title="${uiLabelMap.ExampleScanRepositoryStrukture}"><link target="ExampleJackrabbitScanRepositoryStructure"/></menu-item> </menu> </menus> 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=1099770&r1=1099769&r2=1099770&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 Thu May 5 12:32:13 2011 @@ -105,4 +105,12 @@ public interface JcrFileHelper { */ public String getFileMimeType() throws RepositoryException; + /** + * Get the current selected content language. + * + * @return + */ + public String getSelctedLanguage(); + + } \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrHelperAbstract.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrHelperAbstract.java?rev=1099770&r1=1099769&r2=1099770&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrHelperAbstract.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrHelperAbstract.java Thu May 5 12:32:13 2011 @@ -12,53 +12,62 @@ import org.ofbiz.jcr.orm.OfbizRepository */ public abstract class JcrHelperAbstract { - public static final String module = JcrHelperAbstract.class.getName(); + public static final String module = JcrHelperAbstract.class.getName(); - protected OfbizRepositoryMapping orm = null; - protected GenericValue userLogin = null; + protected OfbizRepositoryMapping orm = null; + protected GenericValue userLogin = null; - /** - * close the current jcr session. - */ - public void closeSession() { - orm.closeSession(); - } - - /** - * Remove the current repository node. Removes also all child nodes. - * - * @throws GenericEntityException - * @throws RepositoryException - */ - public void removeRepositoryNode() throws GenericEntityException, RepositoryException { - orm.removeRepositoryNode(); - } - - /** - * Returns the database content object. - * - * @return - */ - public GenericValue getContentObject() { - return orm.getContentObject(); - } - - /** - * Returns the name of the node. - * - * @return - */ - public String getNodeName() { - return orm.getNodeName(); - } - - protected Boolean checkNodeWritePermission(GenericValue userLogin) { - // TODO have to be specified - return Boolean.TRUE; - } - - protected Boolean checkNodeReadPermission(GenericValue userLogin) { - // TODO have to be specified - return Boolean.TRUE; - } + /** + * close the current jcr session. + */ + public void closeSession() { + orm.closeSession(); + } + + /** + * Remove the current repository node. Removes also all child nodes. + * + * @throws GenericEntityException + * @throws RepositoryException + */ + public void removeRepositoryNode() throws GenericEntityException, RepositoryException { + orm.removeRepositoryNode(); + } + + /** + * Returns the database content object. + * + * @return + */ + public GenericValue getContentObject() { + return orm.getContentObject(); + } + + /** + * Returns the name of the node. + * + * @return + */ + public String getNodeName() { + return orm.getNodeName(); + } + + protected Boolean checkNodeWritePermission(GenericValue userLogin) { + // TODO have to be specified + return Boolean.TRUE; + } + + protected Boolean checkNodeReadPermission(GenericValue userLogin) { + // TODO have to be specified + return Boolean.TRUE; + } + + /** + * Get the current selected content language. + * + * @return + */ + public String getSelctedLanguage() { + return orm.getSelctedLanguage(); + } } Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelper.java?rev=1099770&r1=1099769&r2=1099770&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelper.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelper.java Thu May 5 12:32:13 2011 @@ -1,78 +1,137 @@ package org.ofbiz.jcr.helper; +import java.util.List; + import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; +import net.sf.json.JSONArray; + import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; public interface JcrTextHelper { - /** - * Store new text content in the text content tree. Returns the contentId of - * the database content object - * - * @param message - * @return - * @throws RepositoryException - */ - public String storeNewTextData(String message) throws RepositoryException; - - /** - * Get the String content to the current node. - * - * @return - * @throws PathNotFoundException - * @throws RepositoryException - */ - public String getTextData() throws PathNotFoundException, RepositoryException; - - /** - * Update the text content of a current text node. - * - * @param message - * @return - * @throws PathNotFoundException - * @throws RepositoryException - */ - public String updateTextData(String message) throws PathNotFoundException, RepositoryException; - - /** - * Add a child node to the current node. The new JcrTextHelper object will - * be returned. - * - * @param newNode - * @return - * @throws RepositoryException - * @throws GenericEntityException - */ - public JcrTextHelper addNewNode(String newNode) throws RepositoryException, GenericEntityException; - - /** - * close the current jcr session. - */ - public void closeSession(); - - /** - * Remove the current repository node. Removes also all child nodes. - * - * @throws GenericEntityException - * @throws RepositoryException - */ - public void removeRepositoryNode() throws GenericEntityException, RepositoryException; - - /** - * Returns the database content object. - * - * @return - */ - public GenericValue getContentObject(); - - /** - * Returns the name of the node. - * - * @return - */ - public String getNodeName(); + /** + * Store new text content in the text content tree. Returns the contentId of + * the database content object + * + * @param message + * @return + * @throws RepositoryException + * @throws GenericEntityException + */ + public String storeNewTextData(String message) throws RepositoryException, GenericEntityException; + + /** + * Store new text content in the text content tree. Returns the contentId of + * the database content object + * + * @param message + * @return + * @throws RepositoryException + * @throws GenericEntityException + */ + public String storeNewTextData(String message, String language) throws RepositoryException, GenericEntityException; + + /** + * Get the String content to the current node, returns the system default language. + * + * @return + * @throws PathNotFoundException + * @throws RepositoryException + */ + public String getTextData() throws PathNotFoundException, RepositoryException; + + /** + * Get the String content to the current node. + * + * @param language + * @return + * @throws PathNotFoundException + * @throws RepositoryException + */ + public String getTextData(String language) throws PathNotFoundException, RepositoryException; + + /** + * Update the text content of a current text node. + * + * @param message + * @return + * @throws RepositoryException + * @throws GenericEntityException + */ + public String updateTextData(String message) throws RepositoryException, GenericEntityException; + + /** + * Update the text content of a current text node. + * + * @param message + * @param language + * @return + * @throws RepositoryException + * @throws GenericEntityException + */ + public String updateTextData(String message, String language) throws RepositoryException, GenericEntityException; + + /** + * Add a child node to the current node. The new JcrTextHelper object will + * be returned. + * + * @param newNode + * @return + * @throws RepositoryException + * @throws GenericEntityException + */ + public JcrTextHelper addNewNode(String newNode) throws RepositoryException, GenericEntityException; + + /** + * close the current jcr session. + */ + public void closeSession(); + + /** + * Remove the current repository node. Removes also all child nodes. + * + * @throws GenericEntityException + * @throws RepositoryException + */ + public void removeRepositoryNode() throws GenericEntityException, RepositoryException; + + /** + * Returns the database content object. + * + * @return + */ + public GenericValue getContentObject(); + + /** + * Returns the name of the node. + * + * @return + */ + public String getNodeName(); + + /** + * Returns a list of available languages for the node content. + * + * @return + */ + public List<String> getAvailableLanguages() throws PathNotFoundException, RepositoryException; + + /** + * Get the current selected content language. + * + * @return + */ + public String getSelctedLanguage(); + + /** + * Returns the Repository Data (including all Text contents) Tree as JSON Object + * + * @return + * @throws RepositoryException + */ + public JSONArray getJsonDataTree() throws RepositoryException; } \ No newline at end of file Modified: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelperAbstract.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelperAbstract.java?rev=1099770&r1=1099769&r2=1099770&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelperAbstract.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/helper/JcrTextHelperAbstract.java Thu May 5 12:32:13 2011 @@ -1,5 +1,7 @@ package org.ofbiz.jcr.helper; +import java.util.List; + import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; @@ -7,12 +9,18 @@ import org.ofbiz.entity.GenericEntityExc public abstract class JcrTextHelperAbstract extends JcrHelperAbstract { - public abstract String storeNewTextData(String message) throws RepositoryException; + public abstract String storeNewTextData(String message) throws RepositoryException, GenericEntityException; + + public abstract String storeNewTextData(String message, String language) throws RepositoryException, GenericEntityException; public abstract String getTextData() throws PathNotFoundException, RepositoryException; - public abstract String updateTextData(String message) throws PathNotFoundException, RepositoryException; + public abstract String getTextData(String language) throws PathNotFoundException, RepositoryException; + + public abstract String updateTextData(String message) throws PathNotFoundException, RepositoryException, GenericEntityException; public abstract JcrTextHelper addNewNode(String newNode) throws RepositoryException, GenericEntityException; + public abstract List<String> getAvailableLanguages() throws PathNotFoundException, RepositoryException; + } 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=1099770&r1=1099769&r2=1099770&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 Thu May 5 12:32:13 2011 @@ -1,6 +1,7 @@ package org.ofbiz.jcr.orm; import java.io.InputStream; +import java.util.List; import javax.jcr.Node; import javax.jcr.PathNotFoundException; @@ -14,123 +15,171 @@ import org.ofbiz.entity.GenericValue; public interface OfbizRepositoryMapping { - /** - * Object delegator reference - */ - public Delegator getDelegator(); - - /** - * Close the current repository session should be used when the operation - * with this object are finished. - */ - public void closeSession(); - - /** - * Updates only the node text property data - * - * @param message - * @return - * @throws RepositoryException - */ - public void updateOrStoreTextData(String message) throws RepositoryException; - - /** - * Returns the related Content Object - * - * @return - */ - public GenericValue getContentObject(); - - /** - * Returns the related Repository Node - * - * @return - */ - public Node getNode(); - - /** - * Returns the contentId from the related content object. If the content - * object is null, an empty string will be retunred. - * - * @return - */ - public String getContentId(); - - /** - * Returns the absolute path of the node. - * - * @return - */ - public String getNodePath(); - - /** - * Returns the name of the node. - * - * @return - */ - public String getNodeName(); - - /** - * Remove a repository Node and the related database entry. - * - * @throws RepositoryException - * @throws GenericEntityException - */ - public void removeRepositoryNode() throws RepositoryException, GenericEntityException; - - /** - * Returns only the String Content of a node, if none exists an empty String - * will be returned - * - * @return - * @throws PathNotFoundException - * @throws RepositoryException - */ - public String getStringContent() throws PathNotFoundException, RepositoryException; - - /** - * Upload and store a file in the repository - * - * @param description - * @param file - * @return - * @throws PathNotFoundException - * @throws RepositoryException - * @throws GenericEntityException - */ - public void uploadFileData(InputStream file, String fileName) throws PathNotFoundException, RepositoryException, GenericEntityException; - - /** - * Return the file stream from the current node object. - * - * @param fileName - * @return - * @throws RepositoryException - */ - public InputStream getFileContent(String fileName) throws RepositoryException; - - /** - * Returns the content type of the file. An empty String will be returned if the node - * is not a file node or no mimeType exists. - * - * @return - * @throws RepositoryException - */ - public String getFileMimeType() throws RepositoryException; - - /** - * Returns the repository file tree as Json Object. - * - * @return - * @throws RepositoryException - */ - public JSONArray getJsonFileTree() throws RepositoryException; - - /** - * Get the file stream from the current node. - * - * @return - * @throws RepositoryException - */ - public InputStream getFileContent() throws RepositoryException; + /** + * Object delegator reference + */ + public Delegator getDelegator(); + + /** + * Close the current repository session should be used when the operation + * with this object are finished. + */ + public void closeSession(); + + /** + * Updates only the node text property data + * + * @param message + * @return + * @throws RepositoryException + * @throws GenericEntityException + */ + public void updateOrStoreTextData(String message) throws RepositoryException, GenericEntityException; + + /** + * Updates only the node text property data + * + * @param message + * @param language + * @return + * @throws RepositoryException + * @throws GenericEntityException + */ + public void updateOrStoreTextData(String message, String language) throws RepositoryException, GenericEntityException; + + /** + * Returns the related Content Object + * + * @return + */ + public GenericValue getContentObject(); + + /** + * Returns the related Repository Node + * + * @return + */ + public Node getNode(); + + /** + * Returns the contentId from the related content object. If the content + * object is null, an empty string will be retunred. + * + * @return + */ + public String getContentId(); + + /** + * Returns the absolute path of the node. + * + * @return + */ + public String getNodePath(); + + /** + * Returns the name of the node. + * + * @return + */ + public String getNodeName(); + + /** + * Remove a repository Node and the related database entry. + * + * @throws RepositoryException + * @throws GenericEntityException + */ + public void removeRepositoryNode() throws RepositoryException, GenericEntityException; + + /** + * Returns only the String Content of a node, if none exists an empty String + * will be returned. + * + * @return + * @throws PathNotFoundException + * @throws RepositoryException + */ + public String getStringContent() throws PathNotFoundException, RepositoryException; + + /** + * Returns only the String Content of a node, if none exists an empty String + * will be returned. + * + * @param language + * @return + * @throws PathNotFoundException + * @throws RepositoryException + */ + String getStringContent(String language) throws PathNotFoundException, RepositoryException; + + /** + * Upload and store a file in the repository + * + * @param description + * @param file + * @return + * @throws PathNotFoundException + * @throws RepositoryException + * @throws GenericEntityException + */ + public void uploadFileData(InputStream file, String fileName) throws PathNotFoundException, RepositoryException, GenericEntityException; + + /** + * Return the file stream from the current node object. + * + * @param fileName + * @return + * @throws RepositoryException + */ + public InputStream getFileContent(String fileName) throws RepositoryException; + + /** + * Returns the content type of the file. An empty String will be returned if the node + * is not a file node or no mimeType exists. + * + * @return + * @throws RepositoryException + */ + public String getFileMimeType() throws RepositoryException; + + /** + * Returns the repository file tree as Json Object. + * + * @return + * @throws RepositoryException + */ + public JSONArray getJsonFileTree() throws RepositoryException; + + /** + * Returns the repository data (including all text content data) tree as Json Object. + * + * @return + * @throws RepositoryException + */ + public JSONArray getJsonDataTree() throws RepositoryException; + + /** + * Get the file stream from the current node. + * + * @return + * @throws RepositoryException + */ + public InputStream getFileContent() throws RepositoryException; + + /** + * Returns a List of available languages of the current node content + * + * @return + * @throws PathNotFoundException + * @throws RepositoryException + */ + public List<String> getAvailableLanguages() throws PathNotFoundException, RepositoryException; + + /** + * Get the current selected content language. + * + * @return + */ + public String getSelctedLanguage(); + } \ No newline at end of file |
Free forum by Nabble | Edit this page |