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.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1736878 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user