Author: jleroux
Date: Mon Mar 28 12:15:15 2016
New Revision: 1736878

URL: http://svn.apache.org/viewvc?rev=1736878&view=rev
Log:
A 1st patch from Pierre Smits for <<Have the ability to test solr queries 
through widgets (screens & forms)>> 
https://issues.apache.org/jira/browse/OFBIZ-6595

Adding widgest (screens, forms, etc) so that an end-user can execute a search  
against the data indexed would enhance the applicability of the application.
This patch is the first increment to address the issue. Please feel free to 
test drive and provide feedback
Currently it includes the following aspects:

    SolrMenus.xml - providing the application menu, items:
        main - opening the start screen of the app
        admin - opening the Solr admin page in a new target
        newquery - opening the query screen
    SolrScreens.xml - defining Solr specific screen widgets
    CommonScreens.xml - defining the common screens for Solr specific screen 
widgets
    SolrUiLabels.xml - defining Solr app specific labels
    SolrForms.xml - defining Solr specific form widgets
    controller.xml - (re)defining request-map and view-map re widgets

This file also includes a modification to web.xml of the Solr component, 
changing the mainDecoratorLocation
This patch currently doesn't include functionality to execute a query through 
widgets and show the result.

Added:
    ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml   (with props)
    ofbiz/trunk/specialpurpose/solr/widget/
    ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml   (with props)
    ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml   (with props)
    ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml   (with props)
    ofbiz/trunk/specialpurpose/solr/widget/forms/
    ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml   (with props)
Modified:
    ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/web.xml

Added: ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml?rev=1736878&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml (added)
+++ ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml Mon Mar 28 12:15:15 
2016
@@ -0,0 +1,30 @@
+<?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.
+-->
+<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd";>
+    
+    <property key="SolrApplication">
+        <value xml:lang="en">Apache Solr Integration</value>
+    </property>
+    
+    <property key="SolrCompanyName">
+        <value xml:lang="en">OFBIz - Solr Integration</value>
+    </property>
+    
+</resource>
\ No newline at end of file

Propchange: ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/solr/config/SolrUiLabels.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/controller.xml?rev=1736878&r1=1736877&r2=1736878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/controller.xml 
(original)
+++ ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/controller.xml Mon Mar 
28 12:15:15 2016
@@ -40,9 +40,15 @@
     </request-map>
     <request-map uri="main">
         <security https="true" auth="false"/>
-        <event type="java" path="org.ofbiz.solr.control.OFBizSolrLoginWorker" 
invoke="extensionCheckLogin"/>
-        <response name="success" type="none"/>
-        <response name="error" type="view" value="login"/>
+        <response name="success" type="view" value="main"/>
     </request-map>
-
+    <request-map uri="newquery">
+        <security https="true" auth="false"/>
+        <response name="success" type="view" value="newquery"/>
+    </request-map>
+    
+    <!-- view-maps -->
+    <view-map name="main" type="screen" 
page="component://solr/widget/SolrScreens.xml#Main"/>
+    <view-map name="newquery" type="screen" 
page="component://solr/widget/SolrScreens.xml#NewQuery"/>
+    
 </site-conf>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/web.xml?rev=1736878&r1=1736877&r2=1736878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/web.xml (original)
+++ ofbiz/trunk/specialpurpose/solr/webapp/solr/WEB-INF/web.xml Mon Mar 28 
12:15:15 2016
@@ -33,7 +33,7 @@
     </context-param>
     <context-param>
         <param-name>mainDecoratorLocation</param-name>
-        <param-value>component://content/widget/CommonScreens.xml</param-value>
+        <param-value>component://solr/widget/CommonScreens.xml</param-value>
         <!-- The location of the main-decorator screen to use for this webapp; 
referred to as a context variable in screen def XML files. -->
     </context-param>
     <context-param>

Added: ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml?rev=1736878&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml (added)
+++ ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml Mon Mar 28 
12:15:15 2016
@@ -0,0 +1,60 @@
+<?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="main-decorator">
+        <section>
+            <actions>
+                <set field="activeApp" value="solr" global="true"/>
+                <property-map resource="SolrUiLabels" map-name="uiLabelMap" 
global="true"/>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
global="true"/>
+                <set field="layoutSettings.companyName" 
from-field="uiLabelMap.SolrCompanyName" global="true"/>
+                <set field="layoutSettings.companySubtitle" 
from-field="uiLabelMap.SolrCompanySubtitle" global="true"/>
+
+                <set field="applicationMenuName" value="SolrAppBar" 
global="true"/>
+                <set field="applicationMenuLocation" 
value="component://solr/widget/SolrMenus.xml" global="true"/>
+                <set field="applicationTitle" 
value="${uiLabelMap.SolrApplication}" global="true"/>
+            </actions>
+            <widgets>
+                <include-screen name="ApplicationDecorator" 
location="component://commonext/widget/CommonScreens.xml"/>
+            </widgets>
+        </section>
+    </screen>
+    
+    <screen name="SolrCommonDecorator">
+        <section>
+            <widgets>
+                <decorator-screen name="main-decorator" 
location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <decorator-section-include name="body"/>
+                            </widgets>
+                            <fail-widgets>
+                                <label 
style="h3">${uiLabelMap.SolrViewPermissionError}</label>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+</screens>
\ No newline at end of file

Propchange: ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/solr/widget/CommonScreens.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml?rev=1736878&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml (added)
+++ ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml Mon Mar 28 12:15:15 
2016
@@ -0,0 +1,35 @@
+<?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.
+-->
+<menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-menu.xsd";>
+    
+    <menu name="SolrAppBar" title="${uiLabelMap.SolrApplication}"  
extends="CommonAppBarMenu" 
extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="admin" title="${uiLabelMap.SolrAdmin}">
+            <link target="/solr" url-mode="plain" target-window="_blank"/>
+        </menu-item>
+        <menu-item name="main" title="${uiLabelMap.CommonMain}">
+            <link target="main"/>
+        </menu-item>
+        <menu-item name="query" title="${uiLabelMap.CommonQuery}">
+            <link target="newquery"/>
+        </menu-item>
+    </menu>
+    
+</menus>
\ No newline at end of file

Propchange: ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/solr/widget/SolrMenus.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml?rev=1736878&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml (added)
+++ ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml Mon Mar 28 12:15:15 
2016
@@ -0,0 +1,46 @@
+<?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="Main">
+        <section>
+            <widgets>
+                <decorator-screen name="SolrCommonDecorator" 
location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    
+    <screen name="NewQuery">
+        <section>
+            <widgets>
+                <decorator-screen name="SolrCommonDecorator" 
location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <include-form 
location="component://solr/widget/forms/SolrForms.xml" name="NewQuery"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+</screens>
\ No newline at end of file

Propchange: ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/solr/widget/SolrScreens.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml?rev=1736878&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml (added)
+++ ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml Mon Mar 28 
12:15:15 2016
@@ -0,0 +1,30 @@
+<?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="NewQuery" type="single" target="query">
+        <field name="query" title="${uiLabelMap.QueryString}"><textarea 
cols="120" rows="5"/></field>
+        <field name="search" title="${uiLabelMap.CommonFind}" 
widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+</forms>
\ No newline at end of file

Propchange: ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/solr/widget/forms/SolrForms.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml


Reply via email to