|
Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml Sat Aug 4 18:11:00 2012 @@ -21,136 +21,6 @@ under the License. <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> - - <!--#Bam# portletWidget --> - <form name="ShowPortalPortlet" type="single" default-map-name="portalPortlet" default-entity-name="PortalPortlet"> - <actions> - <entity-one entity-name="PortletType" value-field="portletType"> - <field-map field-name="portletTypeId" from-field="portalPortlet.portletTypeId"/> - </entity-one> - </actions> -<!-- <auto-fields-entity entity-name="PortalPortlet" default-field-type="display"/>--> - <field name="portalPortletId"><display/></field> - <field name="portletLongId" tooltip="${context.portletLongId}"><display/></field> - <field name="portletName"><display/></field> - <field name="portletTypeId" tooltip="${portletType.screenLocation}#${portletType.screenName}"> - <drop-down allow-empty="true"> - <entity-options description="[${portletTypeId}] ${description}" entity-name="PortletType"> - <entity-order-by field-name="portletTypeId"/> - </entity-options> - </drop-down> - </field> - <field name="component"><display/></field> - <field name="subComponent"><display/></field> - <field name="webapp"><display/></field> - <field name="useScreen"><display description="${uiLabelMap.Common${useScreen}}"/></field> - <field name="screenName" tooltip="${context.screenName}"><display/></field> - <field name="screenLocation" tooltip="${context.screenLocation}"><display/></field> - <field name="useScript"><display description="${uiLabelMap.Common${useScript}}"/></field> - <field name="scriptName" tooltip="${context.scriptName}"><display/></field> - <field name="uiLabelLocation" tooltip="${context.uiLabelLocation}"><display/></field> - <field name="formName" tooltip="${context.formName}"><display/></field> - <field name="formLocation" tooltip="${context.formLocation}"><display/></field> - <field name="pkIdName" tooltip="${context.pkIdName}"><display/></field> -<!-- <field name="areaDivId" tooltip="${context.areaDivId}"><display/></field> with id build with portalPageId portalPortletId portletSeqId, it seem, it's no more necessary because always unique --> - <field name="editAreaDivId" tooltip="${context.editAreaDivId}"><display/></field> - <field name="subAreaDivId" tooltip="${context.subAreaDivId}"><display/></field> - <field name="titleLabel" tooltip="${context.titleLabel}"><display/></field> - <field name="useMenu"><display description="${uiLabelMap.Common${useMenu}}"/></field> - <field name="menuName" tooltip="${context.menuName}"><display/></field> - <field name="menuLocation" tooltip="${context.menuLocation}"><display/></field> - <field name="helpName" tooltip="${context.helpName}"><display/></field> - <field name="editFormName" tooltip="${context.editFormName}"><display/></field> - <field name="editFormLocation" tooltip="${context.editFormLocation}"><display/></field> - <field name="description" tooltip="${context.description}"><display/></field> - <field name="screenshot" tooltip="${context.screenshot}"><display/></field> - <field name="description" tooltip="${context.description}"><display/></field> - <field name="securityServiceName" tooltip="${context.securityServiceName}"><display/></field> - <field name="securityPermission" tooltip="${context.securityPermission}"><display/></field> - <field name="securityMainAction" tooltip="${context.securityMainAction}"><display/></field> -<!-- <field name="back" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">--> -<!-- <hyperlink target="ShowPortalPortlet" description="${uiLabelMap.CommonBack}"/>--> -<!-- </field>--> - <sort-order> - <field-group title="${uiLabelMap.PortalPortletFieldFunctions}" collapsible="true"> - <sort-field name="portalPortletId"/> - <sort-field name="portletLongId"/> - <sort-field name="portletTypeId"/> - <sort-field name="portletName"/> - <sort-field name="description"/> - <sort-field name="component"/> - <sort-field name="subComponent"/> - <sort-field name="webapp"/> - <sort-field name="uiLabelLocation"/> - <sort-field name="screenshot"/> - </field-group> - <field-group title="${uiLabelMap.PortalPortletFieldActionsBefore}" collapsible="true"> - <sort-field name="useScript"/> - <sort-field name="scriptName"/> - <sort-field name="pkIdName"/> - </field-group> - <field-group title="${uiLabelMap.PortalPortletFieldContent}" collapsible="true"> - <sort-field name="titleLabel"/> - <sort-field name="useScreen"/> - <sort-field name="screenName"/> - <sort-field name="screenLocation"/> - <sort-field name="formName"/> - <sort-field name="formLocation"/> - <sort-field name="useMenu"/> - <sort-field name="menuName"/> - <sort-field name="menuLocation"/> - </field-group> - <field-group title="${uiLabelMap.PortalPortletFieldAjaxEditArea}" collapsible="true"> - <sort-field name="editAreaDivId"/> - <sort-field name="subAreaDivId"/> - </field-group> - <field-group title="${uiLabelMap.PortalPortletFieldAttributeMgmt}" collapsible="true"> - <sort-field name="editFormName"/> - <sort-field name="editFormLocation"/> - </field-group> - <field-group title="${uiLabelMap.PortalPortletFieldHelp}" collapsible="true"> - <sort-field name="helpName"/> - </field-group> - <field-group title="${uiLabelMap.PortalPortletFieldSecurity}" collapsible="true"> - <sort-field name="securityServiceName"/> - <sort-field name="securityPermission"/> - <sort-field name="securityMainAction"/> - </field-group> - </sort-order> - </form> - <form name="SelectPortalPortlet" type="single" target="ShowPortalPortlet"> - <field name="portalPageId"><text/></field> - <field name="portalPortletId" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field> - <field name="portletSeqId"><text/></field> - <field name="submit" title="${uiLabelMap.CommonValidate}"><submit/></field> - </form> - <form name="listPortletAttribute" type="list" list-name="portletAttributeList"> - <actions> - <entity-and entity-name="PortletAttribute" list="portletAttributeList"> - <field-map field-name="portalPageId" from-field="parameters.portalPageId"/> - <field-map field-name="portalPortletId" from-field="parameters.portalPortletId"/> - <field-map field-name="portletSeqId" from-field="parameters.portletSeqId"/> - <order-by field-name="attrName"/> - </entity-and> - </actions> - <field name="attrName"><display/></field> - <field name="attrValue"><display/></field> - <field name="attrType"><display/></field> - </form> - <form name="listPortletAttributeNA" type="list" list-name="portletAttributeList"> - <actions> - <entity-and entity-name="PortletAttribute" list="portletAttributeList"> - <field-map field-name="portalPageId" value="_NA_"/> - <field-map field-name="portalPortletId" from-field="parameters.portalPortletId"/> - <field-map field-name="portletSeqId" value="00000"/> - <order-by field-name="attrName"/> - </entity-and> - </actions> - <field name="attrName"><display/></field> - <field name="attrValue"><display/></field> - <field name="attrType"><display/></field> - </form> - <!--#Eam# portletWidget --> <form name="FindPortalPages" type="single" target="FindPortalPage" default-entity-name="PortalPage"> <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field> <field name="portalPageId" position="1" title="${uiLabelMap.CommonId}"><text-find/></field> Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml Sat Aug 4 18:11:00 2012 @@ -22,56 +22,6 @@ under the License. xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd"> - - - <!--#Bam# portletWidget currently only To be able to have help for each portalPortlet field --> - <screen name="ShowPortalPortlet"> - <section> - <actions> - <set field="headerItem" value="portalAdmin"/> - <set field="titleProperty" value="WebtoolsShowPortalPortlet"/> - <entity-one value-field="portalPortlet" entity-name="PortalPortlet"/> - <script location="component://webtools/webapp/webtools/WEB-INF/actions/portlet/RetrievePortletAttributes.groovy" /> - </actions> - <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <section> - <widgets> - <include-form name="SelectPortalPortlet" location="component://webtools/widget/PortalAdmForms.xml"/> - <include-form name="ShowPortalPortlet" location="component://webtools/widget/PortalAdmForms.xml"/> - <include-form name="listPortletAttribute" location="component://webtools/widget/PortalAdmForms.xml"/> - <label text="Generic Portlet attribute for _NA_ and 00000"/> - <include-form name="listPortletAttributeNA" location="component://webtools/widget/PortalAdmForms.xml"/> - </widgets> - </section> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> - <screen name="ShowPortalPortletHelp"> - <section> - <actions> - <set field="headerItem" value="portalAdmin"/> - <set field="titleProperty" value="WebtoolsShowPortalPortlet"/> - <entity-one value-field="portalPortlet" entity-name="PortalPortlet"/> - <script location="component://webtools/webapp/webtools/WEB-INF/actions/portlet/RetrievePortletAttributes.groovy" /> - </actions> - <widgets> - <decorator-screen name="uiLabelDecorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <section> - <widgets> - <include-form name="ShowPortalPortlet" location="component://webtools/widget/PortalAdmForms.xml"/> - </widgets> - </section> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> - <!--#Eam# portletWidget --> <!-- list all PortalPage in a tabular format --> <screen name="FindPortalPage"> <section> Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceForms.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceForms.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceForms.xml Sat Aug 4 18:11:00 2012 @@ -110,14 +110,24 @@ under the License. <field name="key"><display/></field> <field name="value"><display/></field> </form> + <form name="PoolState" type="single" default-map-name="poolState"> + <field name="pollerName"><display/></field> + <field name="pollerThreadName"><display/></field> + <field name="invokerThreadNameFormat"><display/></field> + <field name="keepAliveTimeInSeconds"><display/></field> + <field name="numberOfCoreInvokerThreads"><display/></field> + <field name="currentNumberOfInvokerThreads"><display/></field> + <field name="numberOfActiveInvokerThreads"><display/></field> + <field name="maxNumberOfInvokerThreads"><display/></field> + <field name="greatestNumberOfInvokerThreads"><display/></field> + <field name="numberOfCompletedTasks"><display/></field> + </form> <form name="ListJavaThread" type="list" list-name="threads" paginate-target="threadList" separate-columns="true" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> - <field name="threadId" title="${uiLabelMap.WebtoolsThread}"><display description="${threadId} ${threadName}"/></field> - <field name="status" title="${uiLabelMap.CommonStatus}"><display/></field> - <field name="jobName" title="${uiLabelMap.WebtoolsJob}"><display default-value="${uiLabelMap.CommonNone}"/></field> + <field name="id" title="${uiLabelMap.WebtoolsThread}"><display description="${threadId} ${threadName}"/></field> + <field name="name" title="${uiLabelMap.WebtoolsJob}"><display default-value="${uiLabelMap.CommonNone}"/></field> <field name="serviceName" title="${uiLabelMap.WebtoolsService}"><display default-value="${uiLabelMap.CommonNone}"/></field> - <field name="usage" title="${uiLabelMap.WebtoolsUsage}"><display/></field> - <field name="ttl" title="${uiLabelMap.WebtoolsTTL} (ms)"><display/></field> + <field name="time"><display/></field> <field name="runTime" title="${uiLabelMap.CommonTime} (ms)"><display/></field> </form> <form name="ListServices" type="list" list-name="services" paginate-target="ServiceLog" separate-columns="true" Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceScreens.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceScreens.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/ServiceScreens.xml Sat Aug 4 18:11:00 2012 @@ -103,6 +103,7 @@ under the License. <decorator-screen name="CommonServiceDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <screenlet title="${uiLabelMap.WebtoolsServiceEngineThreads}"> + <include-form name="PoolState" location="component://webtools/widget/ServiceForms.xml"/> <include-form name="ListJavaThread" location="component://webtools/widget/ServiceForms.xml"/> </screenlet> <screenlet title="${uiLabelMap.WebtoolsGeneralJavaThreads}"> Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsForms.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsForms.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsForms.xml Sat Aug 4 18:11:00 2012 @@ -31,7 +31,7 @@ under the License. <field name="avgTime" title="${uiLabelMap.WebtoolsStatsAvg}"><display/></field> <field name="maxTime" title="${uiLabelMap.WebtoolsStatsMax}"><display/></field> <field name="hitsPerMin" title="${uiLabelMap.WebtoolsStatsHitsPerMin}"><display/></field> - <field name="viewBins" widget-style="buttontext" title=" "> + <field name="viewBins" title=" " widget-area-style="button-col"> <hyperlink description="${uiLabelMap.WebtoolsStatsViewBins}" target="StatBinsHistory"> <parameter param-name="statsId" from-field="requestId"/> <parameter param-name="type" from-field="requestType"/> @@ -45,4 +45,20 @@ under the License. <form name="ListRequestBins" extends="ListStats" list-name="requestList"> <field name="viewBins"><hidden/></field> </form> + + <form name="ListMetrics" type="list" list-name="metricsList" paginate-target="ViewMetrics" + header-row-style="header-row-2" default-table-style="basic-table light-grid"> + <actions> + <service service-name="getAllMetrics" /> + </actions> + <field name="name" title="${uiLabelMap.CommonName}"><display/></field> + <field name="serviceRate" title="${uiLabelMap.WebtoolsMetricsRate}"><display/></field> + <field name="threshold" title="${uiLabelMap.WebtoolsMetricsThreshold}"><display/></field> + <field name="totalEvents" title="${uiLabelMap.WebtoolsMetricsTotalEvents}"><display/></field> + <field name="resetMetric" title=" " widget-area-style="button-col"> + <hyperlink description="${uiLabelMap.CommonReset}" target="ResetMetric"> + <parameter param-name="name"/> + </hyperlink> + </field> + </form> </forms> Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsScreens.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsScreens.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/StatsScreens.xml Sat Aug 4 18:11:00 2012 @@ -21,12 +21,10 @@ 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="StatsSinceStart"> + <screen name="StatsDecorator"> <section> <actions> - <set field="titleProperty" value="WebtoolsStatsMainPageTitle"/> <set field="headerItem" value="stats"/> - <script location="component://webtools/webapp/webtools/WEB-INF/actions/stats/StatsSinceStart.groovy"/> </actions> <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> @@ -36,22 +34,11 @@ under the License. <if-has-permission permission="SERVER_STATS" action="_VIEW"/> </condition> <widgets> - <screenlet title="${uiLabelMap.WebtoolsStatsMainPageTitle}"> - <include-menu name="StatsSinceStart" location="component://webtools/widget/Menus.xml"/> - <label>${uiLabelMap.WebtoolsStatsCurrentTime} ${nowTimestamp}</label> - <screenlet title="${uiLabelMap.WebtoolsStatsRequestStats}"> - <include-form name="ListRequestStats" location="component://webtools/widget/StatsForms.xml"/> - </screenlet> - <screenlet title="${uiLabelMap.WebtoolsStatsEventStats}"> - <include-form name="ListEventStats" location="component://webtools/widget/StatsForms.xml"/> - </screenlet> - <screenlet title="${uiLabelMap.WebtoolsStatsViewStats}"> - <include-form name="ListViewStats" location="component://webtools/widget/StatsForms.xml"/> - </screenlet> - </screenlet> + <include-menu name="StatsTabBar" location="component://webtools/widget/Menus.xml"/> + <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="h3">${uiLabelMap.WebtoolsStatsPermissionMsg}</label> + <label style="h3">${uiLabelMap.WebtoolsPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -60,28 +47,81 @@ under the License. </section> </screen> + <screen name="StatsSinceStart"> + <section> + <actions> + <set field="titleProperty" value="WebtoolsStatsMainPageTitle"/> + <set field="tabButtonItem" value="stats"/> + <script location="component://webtools/webapp/webtools/WEB-INF/actions/stats/StatsSinceStart.groovy"/> + </actions> + <widgets> + <decorator-screen name="StatsDecorator" location="${parameters.statsDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <container style="page-title"> + <label text="${uiLabelMap[titleProperty]}"/> + </container> + <include-menu name="StatsSinceStart" location="component://webtools/widget/Menus.xml"/> + <label>${uiLabelMap.WebtoolsStatsCurrentTime} ${nowTimestamp}</label> + <screenlet title="${uiLabelMap.WebtoolsStatsRequestStats}" padded="false"> + <include-form name="ListRequestStats" location="component://webtools/widget/StatsForms.xml"/> + </screenlet> + <screenlet title="${uiLabelMap.WebtoolsStatsEventStats}" padded="false"> + <include-form name="ListEventStats" location="component://webtools/widget/StatsForms.xml"/> + </screenlet> + <screenlet title="${uiLabelMap.WebtoolsStatsViewStats}" padded="false"> + <include-form name="ListViewStats" location="component://webtools/widget/StatsForms.xml"/> + </screenlet> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="StatBinsHistory"> <section> <actions> <set field="titleProperty" value="WebtoolsStatsBinsPageTitle"/> - <set field="headerItem" value="stats"/> + <set field="tabButtonItem" value="stats"/> <script location="component://webtools/webapp/webtools/WEB-INF/actions/stats/StatBinsHistory.groovy"/> </actions> <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-screen name="StatsDecorator" location="${parameters.statsDecoratorLocation}"> <decorator-section name="body"> <section> - <condition> - <if-has-permission permission="SERVER_STATS" action="_VIEW"/> - </condition> <widgets> - <screenlet title="${uiLabelMap.WebtoolsStatsBinsPageTitle}"> - <include-menu name="StatsBinHistory" location="component://webtools/widget/Menus.xml"/> - <label>${uiLabelMap.WebtoolsStatsCurrentTime} ${nowTimestamp}</label> - <screenlet title="${uiLabelMap.WebtoolsStatsRequestStats}"> - <include-form name="ListRequestBins" location="component://webtools/widget/StatsForms.xml"/> - </screenlet> - </screenlet> + <container style="page-title"> + <label text="${uiLabelMap[titleProperty]}"/> + </container> + <include-menu name="StatsBinHistory" location="component://webtools/widget/Menus.xml"/> + <label>${uiLabelMap.WebtoolsStatsCurrentTime} ${nowTimestamp}</label> + <include-form name="ListRequestBins" location="component://webtools/widget/StatsForms.xml"/> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="ViewMetrics"> + <section> + <actions> + <set field="titleProperty" value="WebtoolsViewMetrics" /> + <set field="tabButtonItem" value="metrics"/> + </actions> + <widgets> + <decorator-screen name="StatsDecorator" location="${parameters.statsDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <container style="page-title"> + <label text="${uiLabelMap[titleProperty]}"/> + </container> + <include-form name="ListMetrics" location="component://webtools/widget/StatsForms.xml" /> </widgets> </section> </decorator-section> Modified: ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd Sat Aug 4 18:11:00 2012 @@ -230,19 +230,6 @@ under the License. </xs:annotation> </xs:attribute> --> - <xs:attribute name="validate-link-on-enter" default="false"> - <xs:annotation><xs:documentation>in some case, a single form doest not include a submit button, instead it includes an hypperlink. setting this attribute to true wil result in click on the link when enter button is pressed on any form other input</xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="validate-link-id" default="submit"> - <xs:annotation><xs:documentation>in some case, a single form doest not include a submit button, instead it includes an hypperlink. setting this attribute to true wil result in click on the link when enter button is pressed on any form other input</xs:documentation></xs:annotation> - </xs:attribute> - </xs:attributeGroup> <xs:element name="alt-target"> <xs:complexType> @@ -396,24 +383,6 @@ under the License. </xs:attribute> <xs:attribute name="area-id" type="xs:string" use="required"/> <xs:attribute name="area-target" type="xs:string" use="required"/> - <!-- - <xs:attribute name="use-when" type="xs:string"> - <xs:annotation><xs:documentation> - Used to specify a condition that must be true to use this field; the condition should be written using the - Java syntax and can operate on values in the form context; conditional fields are evaluated in reverse - order so the last field defined that evaluates to true is the one that is rendered. - </xs:documentation></xs:annotation> - </xs:attribute> - --> - <xs:attribute name="redirect-all-parameter" default="false"> - <xs:annotation><xs:documentation>Usable only for type="submit", use all parameters returned by the submit as parameter for area-target.</xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> </xs:attributeGroup> <xs:element name="on-event-update-area"> <xs:annotation> @@ -422,10 +391,6 @@ under the License. <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="redirect-parameter"> - <xs:annotation><xs:documentation> - Usable only for type="submit", give parameter name returned by the submit to put as parameter for area-target.</xs:documentation></xs:annotation> - </xs:element> </xs:sequence> <xs:attributeGroup ref="attlist.on-form-event-update-area"/> </xs:complexType> @@ -437,9 +402,6 @@ under the License. <xs:complexType> <xs:sequence> <xs:element minOccurs="0" ref="AllFields"/> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="show-portlet"> - <xs:annotation><xs:documentation>it's possible to generate multiple show-portlet with one click.</xs:documentation></xs:annotation> - </xs:element> <xs:element minOccurs="0" maxOccurs="unbounded" ref="on-field-event-update-area"/> </xs:sequence> <xs:attributeGroup ref="attlist.field"/> @@ -967,113 +929,7 @@ under the License. <xs:attribute type="xs:string" name="param-name" use="required"/> <xs:attribute type="xs:string" name="from-field"/> <xs:attribute type="xs:string" name="value"/> - <xs:attribute name="send-if-empty" default="false"> - <xs:annotation><xs:documentation>if true param-name will be included in parameters list even if value is empty or from-field is null </xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:attributeGroup> - <xs:element name="show-portlet"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameters-form"> - <xs:annotation><xs:documentation>used to give a form name which will used to send all field content as parameters, form-name attribute is optional, if not present current form name is used</xs:documentation></xs:annotation> - </xs:element> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/> - </xs:sequence> - <xs:attributeGroup ref="attlist.showPortlet"/> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="attlist.showPortlet"> - <xs:attribute name="also-hidden" default="true"> - <xs:annotation><xs:documentation>If set to true, an hidden form field is also rendered, with the name of the field and its content.</xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute type="xs:string" name="portlet-id" use="required"> - <xs:annotation><xs:documentation>The portalPortletId which want to show, will pass as parameter to target; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="portal-page-id"> - <xs:annotation><xs:documentation>if a field named portalPageId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="portlet-seq-id"> - <xs:annotation><xs:documentation>if a field named portletSeqId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="target"> - <xs:annotation><xs:documentation>The target uri, default value is refreshPortlet; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="description"> - <xs:annotation><xs:documentation>Specifies the string to display, can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="area-id"> - <xs:annotation><xs:documentation>Area where to show the portlet, default value is "PP_${targetPageId}${targetPortletId}${targetSeqId}", will be pass as parameter to target if has content otherwise generate a warning message;can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="alternate"> - <xs:annotation><xs:documentation>Alternate text if the image is not found at image-location</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="image-title"> - <xs:annotation><xs:documentation>Use as a title for the HTML img tag</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="image-location"/> - <xs:attribute name="request-confirmation" default="false"> - <xs:annotation><xs:documentation>If true then the user is presented with a dialog box, if confirmation-message is empty, use default</xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="confirmation-message" type="xs:string"><xs:annotation><xs:documentation>The message displayed in confirmation box</xs:documentation></xs:annotation></xs:attribute> - <xs:attribute name="parameters-map" type="xs:string"> - <xs:annotation><xs:documentation>A Map in the context that will be used as additional name/value pairs.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:integer" name="size"> - <xs:annotation><xs:documentation>Specifies the size of the field (as a number of characters), when the text to display exceed the given size it is truncated and add the complete text as a hint</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="collapse-screenlet"> - <xs:annotation><xs:documentation>Specifies the name of screenlet to collapse, can use the ${} syntax to insert context values, if value is empty nothing will be done</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute name="mark-selected" default="false"> - <xs:annotation><xs:documentation>If true, when user click a selected css is apply to the line to show the selected line; only one line can be selected, a click on a second line unselected the first before select the new one.</xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute type="xs:string" name="parameters-form"> - <xs:annotation><xs:documentation>Specifies the name of a form, all field of it will be put as parameters, can use the ${} syntax to insert context values, if value is empty nothing will be done</xs:documentation></xs:annotation> - </xs:attribute> </xs:attributeGroup> - <xs:element name="redirect-parameter"> - <xs:complexType> - <xs:attribute type="xs:string" name="param-name" use="required"/> - <xs:attribute name="send-if-empty" default="false"> - <xs:annotation><xs:documentation>if true param-name will be included in parameters list even if value is empty or from-field is null </xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:complexType> - </xs:element> - <xs:element name="parameters-form"> - <xs:complexType> - <xs:attribute type="xs:string" name="form-name"/> - </xs:complexType> - </xs:element> <xs:element name="ignored" substitutionGroup="AllFields"> <xs:complexType/> </xs:element> Modified: ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd Sat Aug 4 18:11:00 2012 @@ -96,7 +96,6 @@ under the License. <xs:element minOccurs="0" ref="condition"/> <xs:element minOccurs="0" ref="actions"/> <xs:element minOccurs="0" ref="link"/> - <xs:element minOccurs="0" ref="show-portlet"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="menu-item"/> </xs:sequence> <xs:attributeGroup ref="attlist.menu-item"/> @@ -136,7 +135,6 @@ under the License. </xs:element> <xs:attributeGroup name="attlist.image"> <xs:attribute type="xs:string" name="src"/> - <xs:attribute type="xs:string" name="title"/> <xs:attribute type="xs:string" name="id"/> <xs:attribute type="xs:string" name="style"/> <xs:attribute type="xs:string" name="width"/> @@ -607,69 +605,4 @@ under the License. <xs:attributeGroup name="attlist.if-empty"> <xs:attribute name="field" use="required"/> </xs:attributeGroup> - <xs:element name="show-portlet"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/> - </xs:sequence> - <xs:attributeGroup ref="attlist.showPortlet"/> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="attlist.showPortlet"> - <xs:attribute name="also-hidden" default="true"> - <xs:annotation><xs:documentation>If set to true, an hidden form field is also rendered, with the name of the field and its content.</xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute type="xs:string" name="portlet-id" use="required"> - <xs:annotation><xs:documentation>The portalPortletId which want to show, will pass as parameter to target; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="portal-page-id"> - <xs:annotation><xs:documentation>if a field named portalPageId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="portlet-seq-id"> - <xs:annotation><xs:documentation>if a field named portletSeqId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="target"> - <xs:annotation><xs:documentation>The target uri, default value is refreshPortlet; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="description"> - <xs:annotation><xs:documentation>Specifies the string to display, can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="area-id"> - <xs:annotation><xs:documentation>Area where to show the portlet, default value is "PP_${targetPageId}${targetPortletId}${targetSeqId}", will be pass as parameter to target if has content otherwise generate a warning message;can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="alternate"> - <xs:annotation><xs:documentation>Alternate text if the image is not found at image-location</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="image-title"> - <xs:annotation><xs:documentation>Use as a title for the HTML img tag</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="image-location"/> - <xs:attribute name="request-confirmation" default="false"> - <xs:annotation><xs:documentation>If true then the user is presented with a dialog box, if confirmation-message is empty, use default</xs:documentation></xs:annotation> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="confirmation-message" type="xs:string"><xs:annotation><xs:documentation>The message displayed in confirmation box</xs:documentation></xs:annotation></xs:attribute> - <xs:attribute name="parameters-map" type="xs:string"> - <xs:annotation><xs:documentation>A Map in the context that will be used as additional name/value pairs.</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:integer" name="size"> - <xs:annotation><xs:documentation>Specifies the size of the field (as a number of characters), when the text to display exceed the given size it is truncated and add the complete text as a hint</xs:documentation></xs:annotation> - </xs:attribute> - </xs:attributeGroup> - <xs:element name="parameters-form"> - <xs:complexType> - <xs:attribute type="xs:string" name="form-name"/> - </xs:complexType> - </xs:element> </xs:schema> Modified: ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd Sat Aug 4 18:11:00 2012 @@ -1124,14 +1124,6 @@ under the License. </xs:restriction> </xs:simpleType> </xs:attribute> - <!-- #Bam# : portletWidget --> - <xs:attribute type="xs:string" name="portalPortletId"> - <xs:annotation><xs:documentation>Retrieve only the attributes for this portalPortlet</xs:documentation></xs:annotation> - </xs:attribute> - <xs:attribute type="xs:string" name="portletSeqId"> - <xs:annotation><xs:documentation>Specify the portletSeqId of the portalPortlet to look for when retrieving the attributes</xs:documentation></xs:annotation> - </xs:attribute> - <!-- #Eam# : portletWidget --> </xs:attributeGroup> <xs:element name="sub-content" substitutionGroup="AllWidgets"> Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java Sat Aug 4 18:11:00 2012 @@ -32,35 +32,6 @@ import org.w3c.dom.Element; @SuppressWarnings("serial") public class ModelWidget implements Serializable { - public interface ShowPortletLink { - public String getImage(Map<String, Object> context); - public String getImageTitle(Map<String, Object> context); - public String getAlternate(Map<String, Object> context); - public String getDescription(Map<String, Object> context); - } - public static class ShowPortletLinkData { - public String imgSrc; - public String imgTitle; - public String alt; - public String description; - } - public interface ShowPortletItem { - public String getPortalPageId(Map<String, Object> context); - public String getPortletId(Map<String, Object> context); - public String getPortletSeqId(Map<String, Object> context); - public String getAreaId(Map<String, Object> context); - public String getTarget(Map<String, Object> context); - public Map<String, String> getParameterMap(Map<String, Object> context); - } - public static class ShowPortletItemData { - public String portalPageId; - public String portletId; - public String portletSeqId; - public String areaId; - public String target; - public Map<String, String> parameterMap; - public StringBuilder params; - } /** * The parameter name used to control widget boundary comments. Currently * set to "widgetVerbose". Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java Sat Aug 4 18:11:00 2012 @@ -76,9 +76,8 @@ public abstract class ModelWidgetAction public abstract void runAction(Map<String, Object> context) throws GeneralException; public static List<ModelWidgetAction> readSubActions(ModelWidget modelWidget, Element parentElement) { - List<ModelWidgetAction> actions = FastList.newInstance(); - List<? extends Element> actionElementList = UtilXml.childElementList(parentElement); + List<ModelWidgetAction> actions = new ArrayList<ModelWidgetAction>(actionElementList.size()); for (Element actionElement: actionElementList) { if ("set".equals(actionElement.getNodeName())) { actions.add(new SetField(modelWidget, actionElement)); @@ -104,7 +103,6 @@ public abstract class ModelWidgetAction throw new IllegalArgumentException("Action element not supported with name: " + actionElement.getNodeName()); } } - return actions; } @@ -389,37 +387,31 @@ public abstract class ModelWidgetAction } public static class Script extends ModelWidgetAction { - protected FlexibleStringExpander scriptLocationExdr; + protected String location; + protected String method; public Script(ModelWidget modelWidget, Element scriptElement) { super (modelWidget, scriptElement); - this.scriptLocationExdr = FlexibleStringExpander.getInstance(scriptElement.getAttribute("location")); + String scriptLocation = scriptElement.getAttribute("location"); + this.location = WidgetWorker.getScriptLocation(scriptLocation); + this.method = WidgetWorker.getScriptMethodName(scriptLocation); } @Override public void runAction(Map<String, Object> context) throws GeneralException { - Locale locale = (Locale) context.get("locale"); - String scriptLocation = this.scriptLocationExdr.expandString(context, locale); - String location = WidgetWorker.getScriptLocation(scriptLocation); - String method = WidgetWorker.getScriptMethodName(scriptLocation); if (location.endsWith(".xml")) { + Map<String, Object> localContext = FastMap.newInstance(); + localContext.putAll(context); DispatchContext ctx = WidgetWorker.getDispatcher(context).getDispatchContext(); - MethodContext methodContext = new MethodContext(ctx, context); + MethodContext methodContext = new MethodContext(ctx, localContext, null); try { SimpleMethod.runSimpleMethod(location, method, methodContext); - Map<String, Object> resultContext = methodContext.getEnv("widget"); - if (UtilValidate.isNotEmpty(resultContext)){ - context.putAll(resultContext); - } - Map<String, Object> parametersUp = methodContext.getParameters(); - if (UtilValidate.isNotEmpty(parametersUp)){ - context.put("parameters",parametersUp); - } + context.putAll(methodContext.getResults()); } catch (MiniLangException e) { throw new GeneralException("Error running simple method at location [" + location + "]", e); } } else { - ScriptUtil.executeScript(location, method, context); + ScriptUtil.executeScript(this.location, this.method, context); } } } Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java Sat Aug 4 18:11:00 2012 @@ -31,7 +31,7 @@ import org.ofbiz.entity.GenericEntityExc import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityUtil; -import org.ofbiz.security.authz.Authorization; +import org.ofbiz.security.Security; /** * PortalPageWorker Class @@ -151,9 +151,9 @@ public class PortalPageWorker { GenericValue userLogin = (GenericValue) context.get("userLogin"); if (UtilValidate.isNotEmpty(userLogin)) { String userLoginId = (String) userLogin.get("userLoginId"); - Authorization authz = (Authorization) context.get("authz"); + Security security = (Security) context.get("security"); - Boolean hasPortalAdminPermission = authz.hasPermission(userLoginId, "PORTALPAGE_ADMIN", context); + Boolean hasPortalAdminPermission = security.hasPermission("PORTALPAGE_ADMIN", userLogin); try { Delegator delegator = WidgetWorker.getDelegator(context); GenericValue portalPage = delegator.findOne("PortalPage", UtilMisc.toMap("portalPageId", portalPageId),false); Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Sat Aug 4 18:11:00 2012 @@ -37,7 +37,6 @@ import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; -import org.ofbiz.base.util.UtilURL; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; @@ -46,8 +45,6 @@ import org.ofbiz.service.LocalDispatcher import org.ofbiz.webapp.control.ConfigXMLReader; import org.ofbiz.webapp.control.RequestHandler; import org.ofbiz.webapp.taglib.ContentUrlTag; -import org.ofbiz.widget.ModelWidget.ShowPortletItemData; -import org.ofbiz.widget.ModelWidget.ShowPortletLinkData; import org.ofbiz.widget.form.ModelForm; import org.ofbiz.widget.form.ModelFormField; import org.w3c.dom.Element; @@ -144,12 +141,6 @@ public class WidgetWorker { } } - //#Bam# portletWidget - public static void buildShowPortletUrl(Appendable externalWriter, String target, Map<String, String> parameterMap, - String prefix, boolean fullPath, boolean secure, boolean encode, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) throws IOException { - } - //#Eam# portletWidget - public static void appendContentUrl(Appendable writer, String location, HttpServletRequest request) throws IOException { StringBuilder buffer = new StringBuilder(); ContentUrlTag.appendContentPrefix(request, buffer); @@ -328,14 +319,12 @@ public class WidgetWorker { public static class Parameter { protected String name; protected FlexibleStringExpander value; - protected FlexibleStringExpander sendIfEmpty; //#Eam# portletWidget protected FlexibleMapAccessor<Object> fromField; public Parameter(Element element) { this.name = element.getAttribute("param-name"); this.value = UtilValidate.isNotEmpty(element.getAttribute("value")) ? FlexibleStringExpander.getInstance(element.getAttribute("value")) : null; this.fromField = UtilValidate.isNotEmpty(element.getAttribute("from-field")) ? FlexibleMapAccessor.getInstance(element.getAttribute("from-field")) : null; - this.sendIfEmpty = UtilValidate.isNotEmpty(element.getAttribute("send-if-empty")) ? FlexibleStringExpander.getInstance(element.getAttribute("send-if-empty")) : null; //#Eam# portletWidget } public Parameter(String paramName, String paramValue, boolean isField) { @@ -400,13 +389,6 @@ public class WidgetWorker { return null; } } - //#Bam# portletWidget - public boolean sendIfEmpty(Map<String, Object> context) { - if (this.sendIfEmpty != null) - return "true".equals(this.sendIfEmpty.expandString(context)); - else return false; - } - //#Eam# portletWidget } public static String determineAutoLinkType(String linkType, String target, String targetType, HttpServletRequest request) { @@ -494,115 +476,4 @@ public class WidgetWorker { Delegator delegator = (Delegator) context.get("delegator"); return delegator; } - //#Bam# portletWidget - /** - * Prepare data for Form and Menu show-portlet - */ - public static ShowPortletLinkData prepareShowPortletLinkData(ModelWidget.ShowPortletLink showPortletLink, Map<String, Object> context) { - ShowPortletLinkData splData = new ShowPortletLinkData(); - splData.imgSrc = showPortletLink.getImage(context); - if (UtilValidate.isEmpty(splData.imgSrc)) { - splData.imgSrc = ""; - } - splData.imgTitle = showPortletLink.getImageTitle(context); - if (UtilValidate.isEmpty(splData.imgTitle)) { - splData.imgTitle = ""; - } - splData.alt = showPortletLink.getAlternate(context); - if (UtilValidate.isEmpty(splData.alt)) { - splData.alt = ""; - } - splData.description = showPortletLink.getDescription(context); - if(UtilValidate.isEmpty(splData.description)) { - splData.description = ""; - } - return splData; - } - public static ShowPortletItemData prepareShowPortletItemsData(ModelWidget.ShowPortletItem showPortletItem, Map<String, Object> context) { - ShowPortletItemData spiData = new ShowPortletItemData(); - spiData.portalPageId = showPortletItem.getPortalPageId(context); - spiData.portletId = showPortletItem.getPortletId(context); - spiData.portletSeqId = showPortletItem.getPortletSeqId(context); - if (UtilValidate.isEmpty(spiData.portalPageId) && context.containsKey("portalPageId")) { - spiData.portalPageId = (String) context.get("portalPageId"); - } - // portletID is mandatory in show-portlet so, if value is null it's a choice - //if (UtilValidate.isEmpty(portletId) && context.containsKey("portalPortletId")) - // portletId = (String) context.get("portalPortletId"); - if (UtilValidate.isEmpty(spiData.portletSeqId) && context.containsKey("portletSeqId")) { - spiData.portletSeqId = (String) context.get("portletSeqId"); - } - spiData.areaId = showPortletItem.getAreaId(context); - if (UtilValidate.isEmpty(spiData.areaId)) { - if (UtilValidate.isNotEmpty(spiData.portalPageId) && UtilValidate.isNotEmpty(spiData.portletId) && UtilValidate.isNotEmpty(spiData.portletSeqId)) { - spiData.areaId = "PP_" + spiData.portalPageId + spiData.portletId + spiData.portletSeqId; - } - else { - //Debug.logWarning("The form [" + modelFormField.getModelForm().getFormLocation() + "#" + modelFormField.getModelForm().getName() +"] has a show-portlet field that should define a target-area or must have target-page-id, target-portlet-id and target-seq_id attributes", module); - } - } - spiData.target = "showPortlet"; - if (UtilValidate.isNotEmpty(showPortletItem.getTarget(context))) { - spiData.target = showPortletItem.getTarget(context); - } - - StringBuilder params = new StringBuilder(); - Map<String, String> parameters = showPortletItem.getParameterMap(context); - for (String key : parameters.keySet()) { - WidgetWorker.addToParams(params, key, parameters.get(key)); - } - - if (UtilValidate.isNotEmpty(spiData.portalPageId)) { - WidgetWorker.addToParams(params, "portalPageId", spiData.portalPageId); - } else { - WidgetWorker.addToParamsIfInContext(params, context, "portalPageId", parameters); - } - - if (UtilValidate.isNotEmpty(spiData.portletId)) { - WidgetWorker.addToParams(params, "portalPortletId", spiData.portletId); - } - - if (UtilValidate.isNotEmpty(spiData.portletSeqId)) { - WidgetWorker.addToParams(params, "portletSeqId", spiData.portletSeqId); - } else { - WidgetWorker.addToParamsIfInContext(params, context, "portletSeqId", parameters); - } - - WidgetWorker.addToParamsIfInContext(params, context, "areaId", parameters); - WidgetWorker.addToParamsIfInContext(params, context, "idDescription", parameters); - spiData.params = params; - return spiData; - } - - /** - * if context.get(key) not empty or context.get(parameters.key) not empty and not already in parameters add key=keyValue in params - * @param params - * @param context - * @param key - * @param parameters - */ - public static void addToParamsIfInContext(StringBuilder params, Map<String, Object> context, String key, Map<String, String> parameters) { - if (parameters.containsKey(key)) return; - - String paramValue = (String) context.get(key); - if (UtilValidate.isEmpty(paramValue)) { - Map<String, Object> contextParameters = UtilGenerics.checkMap(context.get("parameters")); - paramValue = (String) contextParameters.get(key); - } - if (UtilValidate.isNotEmpty(paramValue)) { - if ("idDescription".equals(key)) { - addToParams(params, key, UtilURL.removeBadCharForUrl(paramValue)); - } - else { - addToParams(params, key, paramValue); - } - } - } - public static void addToParams(StringBuilder params, String key, String oneParam) { - if (UtilValidate.isNotEmpty(params)) { - params.append("&"); - } - params.append(key).append("=").append(oneParam); - } - //#Eam# portletWidget } Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java Sat Aug 4 18:11:00 2012 @@ -39,7 +39,6 @@ public class WidgetContextCacheKey { fieldNamesToSkip.add("globalContext"); fieldNamesToSkip.add("delegator"); fieldNamesToSkip.add("dispatcher"); - fieldNamesToSkip.add("authz"); fieldNamesToSkip.add("security"); fieldNamesToSkip.add("webSiteId"); fieldNamesToSkip.add("userLogin"); Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java Sat Aug 4 18:11:00 2012 @@ -48,7 +48,6 @@ import org.ofbiz.widget.form.ModelFormFi import org.ofbiz.widget.form.ModelFormField.RadioField; import org.ofbiz.widget.form.ModelFormField.RangeFindField; import org.ofbiz.widget.form.ModelFormField.ResetField; -import org.ofbiz.widget.form.ModelFormField.ShowPortletLink; import org.ofbiz.widget.form.ModelFormField.SubmitField; import org.ofbiz.widget.form.ModelFormField.TextField; import org.ofbiz.widget.form.ModelFormField.TextFindField; @@ -423,7 +422,4 @@ public class FoFormRenderer extends Html public void renderContainerFindField(Appendable writer, Map<String, Object> context, ContainerField containerField) throws IOException { } - - public void renderShowPortletLink(Appendable writer, Map<String, Object> context, ShowPortletLink showPortletLink) { - } } Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java Sat Aug 4 18:11:00 2012 @@ -93,6 +93,4 @@ public interface FormStringRenderer { public void renderContainerFindField(Appendable writer, Map<String, Object> context, ModelFormField.ContainerField containerField) throws IOException; public void renderFieldGroupOpen(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup) throws IOException; public void renderFieldGroupClose(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup) throws IOException; -// public void renderShowPortletField(Appendable writer,Map<String, Object> context, ModelFormField.ShowPortletField showPortletField) throws IOException; - public void renderShowPortletLink(Appendable writer,Map<String, Object> context, ModelFormField.ShowPortletLink showPortletLink) throws IOException; } |
| Free forum by Nabble | Edit this page |
