Commit Graph
8 Commits
Author SHA1 Message Date
holivier 1f673804a4 Improved: put simple-method optional for compound file (OFBIZ-11645) 2020-05-29 11:54:50 +02:00
Deepak Dixit 982fe0c58a Added missing licence header
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813620 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 12:46:43 +00:00
Jacques Le Roux 6e54fba04e A last slightly modified patch from James Yong for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
I have uploaded a patch for the simple methods schema.
In general, the top level attributes are converted to simpleType, and attributeGroups to complexType.

Changed the following attribute name
1. ‘field’ to ‘fieldType’
2. ‘level’ to ‘levelType'

Denormalize the following attributeGroups
1. attlist.compare
2. attlist.compare-field

Left attributeGroup ‘typeDefaultString’ unchanged, cos it doesn’t matter. Not in use, it seem.

jleroux: we also fixed an issue with 
<xs:element name="field" type="fieldType"/> 
to 
<xs:element ref="field"/>
In the patch 

And I found a small issue (not minilang related) in ExampleCompoundWidgets.xml
-            <sm:log message="CompoundWidgetsFunc runs" sm:level="info"/>
+            <sm:log message="CompoundWidgetsFunc runs" level="info"/>


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750647 13f79535-47bb-0310-9956-ffa450edef68
2016-06-29 14:06:29 +00:00
Jacques Le Roux 642f42886e A temporary workaround for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
Reverts the simple method to use the original schema without namespace. "Duplicates" simple-methods.xsd in simple-methods-ns.xsd as we did, to get the simple-method namespace for compound-widgets.

For myself: when we will do the 3rd more elegant option (no schema duplication), have been changed also:
minilang-catalog.xml
compound-widgets.xsd


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749938 13f79535-47bb-0310-9956-ffa450edef68
2016-06-23 16:40:22 +00:00
Jacques Le Roux 89212904bd Completes and finish "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
This is the 2nd step: puts back the original names, so it will be transparent for remaining references in xml catalogs, Java code, etc.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749489 13f79535-47bb-0310-9956-ffa450edef68
2016-06-21 11:37:47 +00:00
Jacques Le Roux 3aadf4e8da A slightly modified patch from James Yong for "Autocompletion for Compound Widget" https://issues.apache.org/jira/browse/OFBIZ-7061
1. The following xsd are duplicated to use namespaces
  site-conf.xsd     ->  site-conf-ns.xsd
  widget-form.xsd   ->  widget-form-ns.xsd
  widget-screen.xsd ->  widget-screen-ns.xsd
  widget-menu.xsd   ->  widget-menu-ns.xsd
  simple-methods.xsd->  simple-methods-ns.xsd
For example, in site-conf-ns.xsd, we have the following document level attribute
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://ofbiz.apache.org/Site-Conf" targetNamespace="http://ofbiz.apache.org/Site-Conf">
instead of 
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

2. The above schema are used into compound-widgets.xsd so that compound widgets use only one consolidated schema. 

3. Update ExampleCompoundWidgets.xml to use the new compound-widgets.xsd. For example
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:sc="http://ofbiz.apache.org/Site-Conf"
        xmlns:sm="http://ofbiz.apache.org/Simple-Method"
        xmlns:wf="http://ofbiz.apache.org/Widget-Form"
        xmlns:wt="http://ofbiz.apache.org/Widget-Tree"
        xmlns:wm="http://ofbiz.apache.org/Widget-Menu"
        xmlns:ws="http://ofbiz.apache.org/Widget-Screen"
        xsi:noNamespaceSchemaLocation="../../../../framework/widget/dtd/compound-widgets.xsd">
    
    <sc:site-conf>
        <sc:request-map uri="CompoundWidgets1">
            <sc:security https="true" auth="true"/>
            <sc:event type="simple" invoke="CompoundWidgetsFunc" path="component://example/widget/example/ExampleCompoundWidgets.xml"/>
            <sc:response name="success" type="view" value="CompoundWidgets1"/>
        </sc:request-map>
        <sc:request-map uri="CompoundWidgets2"><sc:security https="true" auth="true"/><sc:response name="success" type="view" value="CompoundWidgets2"/></sc:request-map>

        <sc:view-map name="CompoundWidgets1" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets1"/>
        <sc:view-map name="CompoundWidgets2" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets2"/>
    </sc:site-conf>
...... the rest

4. Change java code to support reading xml with namespace (i.e. xml for compound widgets)

jleroux: I simply replaced tabs by spaces in Java files and removed this commented out line 
  <compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/compound-widgets.xsd">
in ExampleCompoundWidgets.xml

We decided to duplicate the simple-methods.xsd rather than updating all concerned files. Else we would have to update the attributes at document level for rest of the controllers, menus, forms, simple methods and screens. For example, in controller.xml, we would have to change 
  xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd”
to 
  xmlns="http://ofbiz.apache.org/sc” xsi:schemaLocation="http://ofbiz.apache.org/dtds/site-conf-ns.xsd”>
But especially we would have to use the same syntax with namespaces prefixes than in ExampleCompoundWidgets.xml (see example above). This can be discussed because with auto-completion it's not a big deal, but could be overwhelming for existing custom projects...

James mentionned that "the schema location at compound-widgets.xsd is relative to the project...". I don't see any problems with that. We can keep as is as long as we maintain the relation (ie if the main XSDs are moved). Moreover with the previous addition of compound-widgets.xsd in widget-catalog.xml it seems all things work correctly (eg w/o the new *-ns.xsd yet committed, the auto-completion works well in ExampleCompoundWidgets.xml




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746302 13f79535-47bb-0310-9956-ffa450edef68
2016-05-31 16:48:09 +00:00
Jacques Le Roux e90be02370 Fixes "ExampleCompoundWidgets throws errors" - https://issues.apache.org/jira/browse/OFBIZ-7023
Actually this is due to both compound-widgets.xsd and ExampleCompoundWidgets.xml errors. Both have not visible effects but in logs

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1741022 13f79535-47bb-0310-9956-ffa450edef68
2016-04-26 13:35:07 +00:00
Jacques Le Roux 7b82a482e2 A combined patch from Adrian's, James Yong's and my work for "Add Support For Compound Screen Widget XML Files" - https://issues.apache.org/jira/browse/OFBIZ-4090 and "Add Example for Compound Screen Widget" - https://issues.apache.org/jira/browse/OFBIZ-6990
Adrian: This adds the ability to include screen widgets, form widgets, menu widgets, and simple methods in a single XML file. This approach could be used in situations where the widgets share a logical grouping - so they can be kept in one place.

James: An example to test out Compound Screen Widget

jlerouxc: here are the changes and tests globally
# As James mentionned we no longer need *-v2.xsd files, I removed them from Adrian's patch
# I created a compound-widgets.xsd based on Adrian's and James Yong's previous work. From Paul Foxworthy's comment in OFBIZ-4090, I decided to name the root compound-widgets (hence the file name). I arranged its elements in another way, see below with ExampleCompoundWidgets.xml
# I slightly modified James Yong's ExampleCompoundScreenWidget.xml file and renamed it ExampleCompoundWidgets.xml. I added an "s" because there are several OFBiz widgets gathered in one place. For the modifications: I simply changed the names and arranged the elements in another way which I find better suited. I'm used to 1st create the query, then the menus, the screens and their forms. We rarely use widget-trees but it's there also. Finally the simple-method at end if any. The order is not enforced though, so everybody can use her/his own :)
# I added a French label
# I completed the widget-catalog.xml with this new entry and tested locally in Eclipse by reloading the XML catalog entries.

I hope I did not miss nor mixed things, the local instance I used is a bit overcrowded with pending changes...




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738958 13f79535-47bb-0310-9956-ffa450edef68
2016-04-13 15:38:16 +00:00