Makes it load-demo & start
removes securityext/da&test
fixes jcr/build.xml (jetty is now in specialpurpose)
Adds lost example which was in jackrabbit20100709 (not sure it's a good idea to keep it there)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/jackrabbit20120501@1553099 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/NOTICE b/NOTICE
index b78fc7f..7f1bfe3 100644
--- a/NOTICE
+++ b/NOTICE
@@ -95,6 +95,19 @@
(C) Copyright 2004, 2005 International Business Machines Corporation. All rights reserved.
=========================================================================
+== Apache Jackrabbit Notice ==
+=========================================================================
+
+Apache Jackrabbit
+Copyright 2010 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Based on source code originally developed by
+Day Software (http://www.day.com/).
+
+=========================================================================
== Apache Log4J Notice ==
=========================================================================
diff --git a/applications/securityext/src/org/ofbiz/securityext/da/ServiceDaHandler.java b/applications/securityext/src/org/ofbiz/securityext/da/ServiceDaHandler.java
deleted file mode 100644
index d3de322..0000000
--- a/applications/securityext/src/org/ofbiz/securityext/da/ServiceDaHandler.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * 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.
- *******************************************************************************/
-package org.ofbiz.securityext.da;
-
-import java.util.Map;
-
-import javolution.util.FastMap;
-
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.entity.Delegator;
-import org.ofbiz.security.authz.da.DynamicAccessHandler;
-import org.ofbiz.service.GenericDispatcher;
-import org.ofbiz.service.GenericServiceException;
-import org.ofbiz.service.LocalDispatcher;
-import org.ofbiz.service.ServiceUtil;
-
-public class ServiceDaHandler implements DynamicAccessHandler {
-
- private static final String module = ServiceDaHandler.class.getName();
- protected LocalDispatcher dispatcher;
- protected Delegator delegator;
-
- public String getPattern() {
- return "^service:(.*)$";
- }
-
- public boolean handleDynamicAccess(String accessString, String userId, String permission, Map<String, ? extends Object> context) {
- Map<String,Object> serviceContext = FastMap.newInstance();
- serviceContext.put("userId", userId);
- serviceContext.put("permission", permission);
- serviceContext.put("accessString", accessString);
- serviceContext.put("permissionContext", context);
-
- String serviceName = accessString.substring(8);
- Map<String, Object> result;
- try {
- result = dispatcher.runSync(serviceName, serviceContext, 60, true);
- } catch (GenericServiceException e) {
- Debug.logError(e, module);
- return false;
- }
-
- if (result != null && !ServiceUtil.isError(result)) {
- Boolean reply = (Boolean) result.get("permissionGranted");
- if (reply == null) {
- reply = Boolean.FALSE;
- }
- return reply;
- } else {
- return false;
- }
- }
-
- public void setDelegator(Delegator delegator) {
- this.delegator = delegator;
- this.dispatcher = GenericDispatcher.getLocalDispatcher("SecurityDA", delegator);
- }
-}
diff --git a/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java b/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java
deleted file mode 100644
index 2cc32ec..0000000
--- a/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * 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.
- *******************************************************************************/
-package org.ofbiz.securityext.test;
-
-import java.util.Map;
-
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.security.SecurityConfigurationException;
-import org.ofbiz.security.authz.AbstractAuthorization;
-import org.ofbiz.security.authz.Authorization;
-import org.ofbiz.security.authz.AuthorizationFactory;
-import org.ofbiz.service.testtools.OFBizTestCase;
-
-public class AuthorizationTests extends OFBizTestCase {
-
- private static final String module = AuthorizationTests.class.getName();
- protected Authorization security = null;
-
- public AuthorizationTests(String name) {
- super(name);
- }
-
- @Override
- public void setUp() throws SecurityConfigurationException {
- if (security == null) {
- security = AuthorizationFactory.getInstance(delegator);
- }
- AbstractAuthorization.clearThreadLocal();
- }
-
- public void testBasicAdminPermission() throws Exception {
- Debug.logInfo("Running testBasicAdminPermission()", module);
- assertTrue("User was not granted permission as expected", security.hasPermission("system", "access:foo:bar", null));
- }
-
- public void testBasePermissionFailure() throws Exception {
- Debug.logInfo("Running testBasePermissionFailure()", module);
- assertFalse("Permission did not fail as expected", security.hasPermission("system", "no:permission", null));
- }
-
- public void testDynamicAccessFromClasspath() throws Exception {
- Debug.logInfo("Running testDynamicAccessFromClasspath()", module);
- assertTrue("User was not granted dynamic access as expected", security.hasPermission("system", "test:groovy2:2000", null));
- }
-
- public void testDynamicAccessService() throws Exception {
- Debug.logInfo("Running testDynamicAccessService()", module);
- assertTrue("User was not granted dynamic access as expected", security.hasPermission("system", "test:service:2000", null));
- }
-
- public void testDynamicAccessFailure() throws Exception {
- Debug.logInfo("Running testDynamicAccessFailure()", module);
- assertFalse("Dynamic access did not fail as expected", security.hasPermission("system", "test:groovy1:2000", null));
- }
-
- public void testAutoGrantPermissions() throws Exception {
- Debug.logInfo("Running testDynamicAccessFailure()", module);
-
- // first verify the user does not have the initial permission
- assertFalse("User already has the auto-granted permission", security.hasPermission("system", "test:autogranted", null));
-
- // next run security check to setup the auto-grant
- assertTrue("User was not granted dynamic access as expected", security.hasPermission("system", "test:groovy1:1000", null));
-
- // as long as this runs in the same thread (and it should) access should now be granted
- assertTrue("User was not auto-granted expected permission", security.hasPermission("system", "test:autogranted", null));
- }
-
- public void testAutoGrantCleanup() throws Exception {
- Debug.logInfo("Running testAutoGrantCleanup()", module);
- assertFalse("User was auto-granted an unexpected permission", security.hasPermission("user", "test:autogranted", null));
- }
-
- public void testDynamicAccessRecursion() throws Exception {
- Debug.logInfo("Running testDynamicAccessRecursion()", module);
- assertFalse("User was granted an unexpected permission", security.hasPermission("user", "test:recursion", null));
- }
-
- public void testFindAllPermissionRegexp() throws Exception {
- Debug.logInfo("Running testFindAllPermissionRegexp()", module);
- Map<String,Boolean> permResultMap = security.findMatchingPermission("system", ".*:example", null);
- assertEquals("Invalid result map size; should be 5", 5, permResultMap.size());
- assertTrue("User was not granted expected permission {access:example}", permResultMap.get("access:example"));
- assertTrue("User was not granted expected permission {create:example}", permResultMap.get("create:example"));
- assertTrue("User was not granted expected permission {read:example}", permResultMap.get("read:example"));
- assertTrue("User was not granted expected permission {update:example}", permResultMap.get("update:example"));
- assertTrue("User was not granted expected permission {delete:example}", permResultMap.get("delete:example"));
- }
-
- public void testFindLimitedPermissionRegexp() throws Exception {
- Debug.logInfo("Running testFindLimitedPermissionRegexp()", module);
- Map<String,Boolean> permResultMap = security.findMatchingPermission("user", "(access|read):example", null);
- assertEquals("Invalid result map size; should be 2", 2, permResultMap.size());
- assertFalse("User was granted an unexpected permission {access:example}", permResultMap.get("access:example"));
- assertFalse("User was granted an unexpected permission {read:example}", permResultMap.get("read:example"));
- }
-}
diff --git a/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy b/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy
deleted file mode 100644
index 0c2e894..0000000
--- a/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * 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.
- *******************************************************************************/
-
- package org.ofbiz.securityext.test;
-
-import org.ofbiz.base.util.Debug;
-
-String recordNumber = permission.substring(permission.lastIndexOf(":") + 1)
-if ("system".equals(userId) && "2000".equals(recordNumber)) {
- Debug.log("Matched approval requirements {system} - {2000}; returning true");
- return true;
-}
-
-Debug.logInfo("Did not match expected requirements; returning false", "groovy");
-return false;
diff --git a/framework/jcr/build.xml b/framework/jcr/build.xml
index 1d08c7e..6d889d5 100644
--- a/framework/jcr/build.xml
+++ b/framework/jcr/build.xml
@@ -39,7 +39,7 @@
<fileset dir="../../framework/entity/build/lib" includes="*.jar"/>
<fileset dir="../../framework/service/build/lib" includes="*.jar"/>
<fileset dir="../../framework/security/build/lib" includes="*.jar"/>
- <fileset dir="../../framework/jetty/lib" includes="*.jar"/>
+ <fileset dir="../../specialpurpose/jetty/lib" includes="*.jar"/>
</path>
<target name="jar" depends="classes">
diff --git a/specialpurpose/example/webapp/example/jackrabbit/ContentChooser.ftl b/specialpurpose/example/webapp/example/jackrabbit/ContentChooser.ftl
new file mode 100644
index 0000000..17e62a9
--- /dev/null
+++ b/specialpurpose/example/webapp/example/jackrabbit/ContentChooser.ftl
@@ -0,0 +1,52 @@
+<#--
+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.
+-->
+${uiLabelMap.ExampleJackrabbitQuickContentSelect}
+<form id="selectNode" action="EditRepositoryContent" type="post">
+ <select name="path" id="nodePath">
+ <option value="" selected></option>
+ <#list parameters.contentList as content>
+ <option value="${content}">${content}</option>
+ </#list>
+ </select>
+ <select name="language" id="nodeLanguage">
+ <option value="" selected></option>
+ </select>
+ <input type="submit" />
+</form>
+
+<script type="text/javascript">
+ var languageList = ${parameters.languageList}
+
+ jQuery("#nodePath").change(function() {
+ var newOptions = languageList[jQuery(this).val()];
+
+ var options = "";
+ for (option in newOptions) {
+ options = options + "<option value='" + newOptions[option] + "'>" + newOptions[option] + "</option>";
+
+ }
+ options = options + "<option value='' ></option>"
+
+ jQuery("#nodeLanguage").children().remove();
+ jQuery("#nodeLanguage").append(options);
+
+ });
+</script>
+
+<br />
\ No newline at end of file
diff --git a/specialpurpose/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl b/specialpurpose/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl
new file mode 100644
index 0000000..7848e3e
--- /dev/null
+++ b/specialpurpose/example/webapp/example/jackrabbit/JackrabbitDataTree.ftl
@@ -0,0 +1,94 @@
+<#--
+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.
+-->
+<script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script>
+
+<div id="jackrabbitDataTree">${parameters.dataTree!""}</div>
+
+<script type="text/javascript">
+ var rawdata = ${parameters.dataTree!};
+
+ jQuery(function () {
+ jQuery("#jackrabbitDataTree").jstree({
+ "plugins" : [ "themes", "json_data", "ui", "contextmenu"],
+ "json_data" : {
+ "data" : rawdata
+ },
+ 'contextmenu': {
+ 'items': {
+ 'ccp' : false,
+ 'create' : false,
+ 'rename' : false,
+ 'open' : {
+ 'label' : "${uiLabelMap.ExampelsJackrabbitOpenData}",
+ 'action' : function(obj) {
+ openDataFromRepository(obj.attr('nodepath'), obj.attr('nodetype'));
+ }
+ },
+ 'remove' : {
+ 'label' : "${uiLabelMap.ExampelsJackrabbitRemoveData}",
+ 'action' : function(obj) {
+ removeDataFromRepository(obj.attr('nodepath'), obj.attr('nodetype'));
+ }
+ }
+ }
+ }
+ });
+ });
+
+ function removeDataFromRepository(nodepath, nodetype) {
+ var parameters = {"path" : nodepath};
+ var url = "RemoveRepositoryNode";
+
+ runPostRequest(url, parameters)
+ }
+
+ function openDataFromRepository(nodepath, nodetype) {
+
+ var parameters = {"path" : nodepath};
+ var url = "EditRepositoryContent";
+
+ runPostRequest(url, parameters)
+ }
+
+ function runPostRequest(url, parameters) {
+ // create a hidden form
+ var form = jQuery('<form></form>');
+
+ form.attr("method", "POST");
+ form.attr("action", url);
+
+ 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();
+ }
+
+
+</script>
\ No newline at end of file
diff --git a/specialpurpose/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl b/specialpurpose/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl
new file mode 100644
index 0000000..68570d9
--- /dev/null
+++ b/specialpurpose/example/webapp/example/jackrabbit/JackrabbitFileTree.ftl
@@ -0,0 +1,110 @@
+<#--
+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.
+-->
+<script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script>
+
+<div id="jackrabbitFileTree">${parameters.fileTree!""}</div>
+
+<script type="text/javascript">
+ var rawdata = ${parameters.fileTree!};
+
+ jQuery(function () {
+ 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'));
+ }
+ },
+ 'download' : {
+ 'label' : "${uiLabelMap.ExampelsJackrabbitDownloadFile}",
+ 'action' : function(obj) {
+ downloadFileFromRepository(obj.attr('nodepath'), obj.attr('nodetype'));
+ }
+ }
+ }
+ }
+ });
+ });
+
+ function openFileFromRepository(nodepath, nodetype) {
+ var parameters = {"path" : nodepath};
+ var url = "OpenFileInformation";
+
+ runPostRequest(url, parameters)
+ }
+
+ function removeFileFromRepository(nodepath, nodetype) {
+ var parameters = {"path" : nodepath};
+ var url = "RemoveRepositoryFile";
+
+ runPostRequest(url, parameters)
+ }
+
+ function downloadFileFromRepository(nodepath, nodetype) {
+ if ("nt:folder" == nodetype) { // the open function for foldes is not supported yet.
+ return;
+ }
+
+ var parameters = {"path" : nodepath};
+ var url = "GetFileFromRepository";
+
+ runPostRequest(url, parameters)
+ }
+
+ function runPostRequest(url, parameters) {
+ // create a hidden form
+ var form = jQuery('<form></form>');
+
+ form.attr("method", "POST");
+ form.attr("action", url);
+
+ 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();
+ }
+
+
+</script>
\ No newline at end of file
diff --git a/specialpurpose/example/widget/example/CommonScreens.xml b/specialpurpose/example/widget/example/CommonScreens.xml
index 6dcba08..701e13b 100644
--- a/specialpurpose/example/widget/example/CommonScreens.xml
+++ b/specialpurpose/example/widget/example/CommonScreens.xml
@@ -256,6 +256,32 @@
</section>
</screen>
+ <screen name="CommonExampleJackrabbitDecorator">
+ <section>
+ <actions>
+ <set field="headerItem" value="ExampleJackrabbit" />
+ <set field="labelFieldName" value="exampleTypeId" />
+ <set field="dataFieldName" value="total" />
+ </actions>
+ <widgets>
+ <decorator-screen name="main-decorator"
+ location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="pre-body">
+ <include-menu name="ExampleJackrabbit" location="component://example/widget/example/ExampleMenus.xml"/>
+ </decorator-section>
+ <decorator-section name="body">
+ <container style="clear" />
+ <section>
+ <widgets>
+ <decorator-section-include name="body" />
+ </widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
<screen name="main">
<!-- This is the screen for the Main page in the Example component. A common pattern
in OFBiz is to have each component include a Main page as a starting point for
diff --git a/specialpurpose/example/widget/example/ExampleJackrabbitForms.xml b/specialpurpose/example/widget/example/ExampleJackrabbitForms.xml
new file mode 100644
index 0000000..c45da2c
--- /dev/null
+++ b/specialpurpose/example/widget/example/ExampleJackrabbitForms.xml
@@ -0,0 +1,167 @@
+<?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.
+-->
+
+<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" separate-columns="true" odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+ <field name="path">
+ <hyperlink target="EditRepositoryContent" description="${path}">
+ <parameter param-name="contentId" from-field="contentId" />
+ <parameter param-name="path" from-field="path" />
+ </hyperlink>
+ </field>
+ <field name="contentId">
+ <hyperlink target="EditRepositoryContent" description="${contentId}">
+ <parameter param-name="contentId" from-field="contentId" />
+ <parameter param-name="path" from-field="path" />
+ </hyperlink>
+ </field>
+ <field name="contentTypeId">
+ <display />
+ </field>
+ <field name="statusId">
+ <display />
+ </field>
+ <field name="statusId">
+ <display />
+ </field>
+ </form>
+
+ <form name="SelectContentObject" type="single" target="">
+ <field name="contentDropDown" position="1">
+ <drop-down ><list-options key-name="contentList" description="${contentList}" list-name="parameters.contentList" list-entry-name="contentList"/></drop-down>
+ </field>
+
+ <!--
+ <field name="languageDropDown" position="2" title="">
+ <drop-down><list-options key-name="languageList" list-name="parameters.languageList"/></drop-down>
+ </field>
+ -->
+ <field name="submit" position="2"><submit/></field>
+ </form>
+
+ <form name="AddRepositoryData" type="single" target="StoreNewRepositoryData">
+ <field name="path" title="${uiLabelMap.ExampleRepositoryNode}" tooltip="${uiLabelMap.ExampleAddNewNodePath}">
+ <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="title">
+ <text />
+ </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="path" title="${uiLabelMap.ExampleRepositoryFolder}" tooltip="${uiLabelMap.ExampleAddNewNodePath}">
+ <text></text>
+ </field>
+ <field name="fileData" title="${uiLabelMap.ExampleRepositoryFile}">
+ <file size="28"></file>
+ </field>
+ <field name="fileLocale" title="${uiLabelMap.CommonChooseLanguage}" >
+ <drop-down allow-empty="true" ><list-options key-name="localeId" list-name="parameters.localeList" description="${localeId}"/></drop-down>
+ </field>
+ <field name="description"><textarea cols="30"/></field>
+ <field name="submit">
+ <submit />
+ </field>
+ </form>
+
+ <form name="EditRepositoryDataChangeLanguage" type="single" target="EditRepositoryContent" default-entity-name="Content">
+ <field name="path" title="${uiLabelMap.ExampleRepositoryNode}" map-name="content">
+ <hidden />
+ </field>
+ <field name="language" title="${uiLabelMap.CommonChooseLanguage}" >
+ <drop-down allow-empty="false" current="first-in-list" current-description="${parameters.selectedLanguage}"><list-options key-name="languageList" description="${languageList}" list-name="parameters.languageList" list-entry-name="languageList"/></drop-down>
+ </field>
+ <field name="versions" >
+ <drop-down allow-empty="true" current="selected" no-current-selected-key="${parameters.version}"><list-options key-name="versionList" description="${versionList}" list-name="parameters.versionList" list-entry-name="versionList"/></drop-down>
+ </field>
+ <field name="submit" ><submit/></field>
+ </form>
+
+ <form name="EditRepositoryData" type="single" target="UpdateRepositoryData" >
+ <field name="title">
+ <display />
+ </field>
+ <field name="path" title="${uiLabelMap.ExampleRepositoryNode}" >
+ <display />
+ </field>
+ <field name="language" title="${uiLabelMap.CommonLanguageTitle}">
+ <display />
+ </field>
+ <field name="pubDate" >
+ <display />
+ </field>
+ <field name="createDate" >
+ <display />
+ </field>
+ <field name="version" >
+ <display />
+ </field>
+ <field name="content" title="${uiLabelMap.ExampleRepositoryMessage}" >
+ <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="path">
+ <display />
+ </field>
+ <field name="primaryNodeType">
+ <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="fileMimeType" use-when="parameters.get("fileMimeType")!=null">
+ <display />
+ </field>
+ <field name="fileLastModified" use-when="parameters.get("fileLastModified")!=null">
+ <display />
+ </field>
+ <field name="fileCreationDate">
+ <display />
+ </field>
+ </form>
+
+ <form name="QueryRepositoryDataForm" type="single" target="QueryRepositoryData">
+ <field name="queryData" ><text /></field>
+ <field name="submit"><submit/></field>
+ </form>
+
+ <form name="ExampleJackrabbitShowQueryResults" type="list" target="EditRepositoryContent" list-name="queryResult" separate-columns="true" odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+ <field name="path" title="${uiLabelMap.ExampleRepositoryNode}" ><hyperlink target="EditRepositoryContent" description="${path}"><parameter param-name="path"/></hyperlink></field>
+ <field name="score" ><display /></field>
+ </form>
+</forms>
\ No newline at end of file
diff --git a/specialpurpose/example/widget/example/ExampleJackrabbitScreens.xml b/specialpurpose/example/widget/example/ExampleJackrabbitScreens.xml
new file mode 100644
index 0000000..6c02a41
--- /dev/null
+++ b/specialpurpose/example/widget/example/ExampleJackrabbitScreens.xml
@@ -0,0 +1,213 @@
+<?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.
+-->
+
+<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
+
+ <screen name="ListRepositoryData">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleExampleJackrabbit" />
+ <set field="tabButtonItem" value="ExampleJackrabbitListNodes" />
+ <entity-condition list="repositoryContent" entity-name="Content">
+ <condition-expr field-name="contentTypeId" operator="equals" value="REPOSITORY"/>
+ </entity-condition>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <container>
+ <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="ListRepositoryData" />
+ </container>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </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>
+ <platform-specific>
+ <html><html-template location="component://example/webapp/example/jackrabbit/ContentChooser.ftl"/></html>
+ </platform-specific>
+ </container>
+ <container>
+ <label>${uiLabelMap.ExampleJackrabbitQueryForContent}</label>
+ <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="QueryRepositoryDataForm" />
+ </container>
+ <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}">
+ <decorator-section name="body">
+ <container>
+ <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="AddRepositoryData" />
+ </container>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
+ <screen name="ExampleJackrabbitUploadFileData">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleExampleJackrabbit" />
+ <set field="tabButtonItem" value="ExampleJackrabbitUploadFileData" />
+ <script location="component://example/webapp/example/WEB-INF/actions/includes/PrepareLocalesForDropDown.groovy"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <container>
+ <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="UploadRepositoryFileData" />
+ </container>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
+ <screen name="ExampleJackrabbitScanRepositoryStructure">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleExampleJackrabbit" />
+ <set field="tabButtonItem" value="ExampleJackrabbitScanRepositoryStrukture" />
+ <set field="listIt" from-field="parameters.listIt"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <container>
+ <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="ScanRepositoryStructure" />
+ </container>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
+ <screen name="ExampleJackrabbitEditRepositoryContent">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleExampleJackrabbit" />
+ <set field="tabButtonItem" value="ExampleJackrabbitMainPage" />
+ </actions>
+ <widgets>
+ <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" />
+ <parameter param-name="contentId" from-field="content.contentId"/>
+ </link>
+ </container>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
+ <screen name="ExampleJackrabbitShowUploadedFiles">
+ <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>
+ <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>
+ </widgets>
+ </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>
+
+ <screen name="ExampleJackrabbitShowQueryResult">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleExampleJackrabbit" />
+ <set field="tabButtonItem" value="ExampleJackrabbitShowContentData" />
+ <set field="queryResult" from-field="parameters.queryResult"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonExampleJackrabbitDecorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <container>
+ <include-form location="component://example/widget/example/ExampleJackrabbitForms.xml" name="ExampleJackrabbitShowQueryResults" />
+ </container>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
+</screens>
\ No newline at end of file
diff --git a/specialpurpose/example/widget/example/ExampleMenus.xml b/specialpurpose/example/widget/example/ExampleMenus.xml
index f4b979d..3fe40ba 100644
--- a/specialpurpose/example/widget/example/ExampleMenus.xml
+++ b/specialpurpose/example/widget/example/ExampleMenus.xml
@@ -88,4 +88,12 @@
<menu-item name="ExampleBarChart" title="Bar chart"><link target="ExampleBarChart"/></menu-item>
<menu-item name="ExamplePieChart" title="Pie chart"><link target="ExamplePieChart"/></menu-item>
</menu>
+
+ <menu name="ExampleJackrabbit" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+ <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="ExampleJackrabbitScanRepositoryStrukture" title="${uiLabelMap.ExampleScanRepositoryStrukture}"><link target="ExampleJackrabbitScanRepositoryStructure"/></menu-item>
+ </menu>
</menus>
diff --git a/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml b/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml
index e2b8d74..3e870f2 100644
--- a/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml
+++ b/specialpurpose/example/widget/example/FormWidgetExampleScreens.xml
@@ -82,7 +82,7 @@
</widgets>
</section>
</container>
- <container style="screenlet-body">
+ <container style="screenlet-body">
<container style="button-bar"><label style="h2">${uiLabelMap.ExampleLookupFieldsTitle}</label></container>
<container style="screenlet-body">
<label style="h3">${uiLabelMap.ExampleSourceCode}</label>