Author: adrianc
Date: Mon Jul 14 07:20:03 2008 New Revision: 676600 URL: http://svn.apache.org/viewvc?rev=676600&view=rev Log: Product Subscription UI layout fixes and conversion to permission services. Note: The original code checked for CATALOG_READ permission - which doesn't exist. I changed that to CATALOG_VIEW, but it still checks for CATALOG_READ also. Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/subscription/SubscriptionServices.xml ofbiz/trunk/applications/product/servicedef/services_subscription.xml ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml ofbiz/trunk/applications/product/widget/catalog/SubscriptionMenus.xml ofbiz/trunk/applications/product/widget/catalog/SubscriptionScreens.xml Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/subscription/SubscriptionServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/subscription/SubscriptionServices.xml?rev=676600&r1=676599&r2=676600&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/subscription/SubscriptionServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/subscription/SubscriptionServices.xml Mon Jul 14 07:20:03 2008 @@ -21,9 +21,6 @@ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> <simple-method method-name="createSubscription" short-description="Create a Subscription"> - <set value="_CREATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <make-value entity-name="Subscription" value-name="newEntity"/> <if-empty field="parameters.subscriptionId"> <sequenced-id-to-env sequence-name="Subscription" env-name="newEntity.subscriptionId"/> <!-- get the next sequenced ID --> @@ -52,26 +49,15 @@ <create-value value-name="newEntity"/> </simple-method> <simple-method method-name="updateSubscription" short-description="Update a Subscription"> - <set value="_UPDATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <entity-one entity-name="Subscription" value-name="lookedUpValue"/> <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/> <store-value value-name="lookedUpValue"/> </simple-method> <simple-method method-name="isSubscribed" short-description="check if a party has a subscription"> - <set value="_READ" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <set field="pfInput.inputFields" from-field="parameters"/> <set field="pfInput.entityName" value="Subscription"/> - <if-empty field="parameters.filterByDate"> - <set field="pfInput.filterByDate" value="Y"/> - <else> - <set field="pfInput.filterByDate" from-field="parameters.filterByDate"/> - </else> - </if-empty> + <set field="pfInput.filterByDate" from-field="parameters.filterByDate" default-value="Y"/> <call-service service-name="performFindList" in-map-name="pfInput"> <result-to-field result-name="list" field-name="pfResultList"/> @@ -90,9 +76,6 @@ </simple-method> <simple-method method-name="getSubscription" short-description="Get Subscription data"> - <set value="_READ" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><accept-userlogin-party/><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <entity-one entity-name="Subscription" value-name="subscription"/> <field-to-result field-name="parameters.subscriptionId" result-name="subscriptionId"/> <if-not-empty field="subscription"> @@ -101,9 +84,6 @@ </simple-method> <simple-method method-name="createSubscriptionResource" short-description="Create a SubscriptionResource"> - <set value="_CREATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <make-value entity-name="SubscriptionResource" value-name="newEntity"/> <sequenced-id-to-env sequence-name="SubscriptionResource" env-name="newEntity.subscriptionResourceId"/> <field-to-result field-name="newEntity.subscriptionResourceId" result-name="subscriptionResourceId"/> @@ -111,18 +91,12 @@ <create-value value-name="newEntity"/> </simple-method> <simple-method method-name="updateSubscriptionResource" short-description="Update a SubscriptionResource"> - <set value="_UPDATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <entity-one entity-name="SubscriptionResource" value-name="lookedUpValue"/> <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/> <store-value value-name="lookedUpValue"/> </simple-method> <simple-method method-name="createProductSubscriptionResource" short-description="Create a ProductSubscriptionResource"> - <set value="_CREATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <make-value entity-name="ProductSubscriptionResource" value-name="newEntity"/> <set-pk-fields map-name="parameters" value-name="newEntity"/> <if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty> @@ -130,24 +104,15 @@ <create-value value-name="newEntity"/> </simple-method> <simple-method method-name="updateProductSubscriptionResource" short-description="Update a ProductSubscriptionResource"> - <set value="_UPDATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <entity-one entity-name="ProductSubscriptionResource" value-name="lookedUpValue"/> <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/> <store-value value-name="lookedUpValue"/> </simple-method> <simple-method method-name="deleteProductSubscriptionResource" short-description="Delete a ProductSubscriptionResource"> - <set value="_DELETE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <entity-one entity-name="ProductSubscriptionResource" value-name="lookedUpValue"/> <remove-value value-name="lookedUpValue"/> </simple-method> <simple-method method-name="updateSubscriptionAttribute" short-description="Create (when not exist) or update (when exist) a Subscription attribute"> - <set value="_UPDATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <field-to-result field-name="parameters.subscriptionId" result-name="subscriptionId"/> <entity-one entity-name="SubscriptionAttribute" value-name="lookedUpValue"/> <if-empty field="lookedUpValue"> @@ -163,19 +128,35 @@ </simple-method> <simple-method method-name="createSubscriptionCommEvent" short-description="Create a Subscription Communication Event"> - <set value="_CREATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <make-value value-name="newEntity" entity-name="SubscriptionCommEvent"/> <set-pk-fields map-name="parameters" value-name="newEntity"/> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> <create-value value-name="newEntity"/> </simple-method> <simple-method method-name="removeSubscriptionCommEvent" short-description="Remove a Subscription Communication Event"> - <set value="_CREATE" field="securityAction"/> - <check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission> - <check-errors/> <entity-one entity-name="SubscriptionCommEvent" value-name="eventSubscription"/> <remove-value value-name="eventSubscription"/> </simple-method> + + <!-- ============== Permission Checking Service ============= --> + <simple-method method-name="subscriptionPermissionCheck" short-description="Subscription permission checking logic"> + <set field="primaryPermission" value="CATALOG"/> + <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/script/org/ofbiz/common/permission/CommonPermissionServices.xml"/> + <!-- Backwards compatibility - check for non-existent CATALOG_READ permission --> + <if> + <condition> + <and> + <if-compare field="hasPermission" value="false" operator="equals" type="Boolean"/> + <if-compare field="mainAction" value="VIEW" operator="equals"/> + </and> + </condition> + <then> + <if-has-permission permission="CATALOG_READ"> + <set field="hasPermission" type="Boolean" value="true"/> + <field-to-result field-name="hasPermission"/> + </if-has-permission> + </then> + </if> + </simple-method> + </simple-methods> Modified: ofbiz/trunk/applications/product/servicedef/services_subscription.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_subscription.xml?rev=676600&r1=676599&r2=676600&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_subscription.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_subscription.xml Mon Jul 14 07:20:03 2008 @@ -26,19 +26,22 @@ <service name="createSubscription" default-entity-name="Subscription" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="createSubscription"> <description>Create a Subscription Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="CREATE"/> <auto-attributes include="pk" mode="INOUT" optional="true"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="updateSubscription" default-entity-name="Subscription" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="updateSubscription"> <description>Update a Subscription Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="UPDATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="isSubscribed" default-entity-name="Subscription" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="isSubscribed"> - <description>check if a particular party has at this moment a subscription</description> + <description>Check if a particular party has at this moment a subscription</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="VIEW"/> <auto-attributes include="all" mode="IN" optional="true"/> <attribute name="filterByDate" type="String" mode="IN" optional="true"/><!-- default is "Y" --> <attribute name="isSubscribed" type="Boolean" mode="OUT"/> @@ -49,6 +52,7 @@ <service name="getSubscriptionEnt" default-entity-name="Subscription" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="getSubscription"> <description>Retrieve a single Subscription Entity Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="VIEW"/> <auto-attributes include="pk" mode="INOUT" optional="false"/> <attribute name="subscription" type="GenericValue" mode="OUT" optional="true"/> </service> @@ -56,12 +60,14 @@ <service name="createSubscriptionResource" default-entity-name="SubscriptionResource" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="createSubscriptionResource"> <description>Create a SubscriptionResource Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="CREATE"/> <auto-attributes include="pk" mode="OUT" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="updateSubscriptionResource" default-entity-name="SubscriptionResource" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="updateSubscriptionResource"> <description>Update a SubscriptionResource Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="UPDATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> @@ -69,6 +75,7 @@ <service name="createProductSubscriptionResource" default-entity-name="ProductSubscriptionResource" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="createProductSubscriptionResource"> <description>Create a ProductSubscriptionResource Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="CREATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> <override name="fromDate" optional="true"/> @@ -76,12 +83,14 @@ <service name="updateProductSubscriptionResource" default-entity-name="ProductSubscriptionResource" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="updateProductSubscriptionResource"> <description>Update a ProductSubscriptionResource Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="UPDATE"/> <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> <service name="deleteProductSubscriptionResource" default-entity-name="ProductSubscriptionResource" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="deleteProductSubscriptionResource"> <description>Delete a ProductSubscriptionResource Record</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="DELETE"/> <auto-attributes include="pk" mode="IN" optional="false"/> </service> @@ -122,6 +131,7 @@ <service name="updateSubscriptionAttribute" default-entity-name="SubscriptionAttribute" auth="true" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="updateSubscriptionAttribute"> <description>Create (when not exist) or update (when exist) a Subscription attribute</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="UPDATE"/> <attribute name="subscriptionId" type="String" mode="INOUT" optional="false"/> <attribute name="attrName" type="String" mode="IN" optional="false"/> <attribute name="attrValue" type="String" mode="IN" optional="true"/> @@ -129,12 +139,20 @@ <service name="createSubscriptionCommEvent" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="createSubscriptionCommEvent" auth="true"> - <description>Create a Subscription Communication Event </description> + <description>Create a Subscription Communication Event</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="CREATE"/> <auto-attributes entity-name="SubscriptionCommEvent" include="pk" mode="IN" optional="false"/> </service> <service name="removeSubscriptionCommEvent" engine="simple" location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="removeSubscriptionCommEvent" auth="true"> - <description>Remove a Subscription Communication Event </description> + <description>Remove a Subscription Communication Event</description> + <permission-service service-name="subscriptionPermissionCheck" main-action="DELETE"/> <auto-attributes entity-name="SubscriptionCommEvent" include="pk" mode="IN" optional="false"/> </service> + + <service name="subscriptionPermissionCheck" engine="simple" + location="org/ofbiz/product/subscription/SubscriptionServices.xml" invoke="subscriptionPermissionCheck" auth="true"> + <description>Subscription Permission Checking Logic</description> + <implements service="permissionInterface"/> + </service> </services> Modified: ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml?rev=676600&r1=676599&r2=676600&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml Mon Jul 14 07:20:03 2008 @@ -88,7 +88,7 @@ <field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> <form name="ListFindSubscription" target="" type="list" list-name="listIt" - odd-row-style="alternate-row" default-table-style="basic-table" + header-row-style="header-row-2" odd-row-style="alternate-row" default-table-style="basic-table" paginate-target="FindSubscription" paginate="true"> <actions> <service service-name="performFind" result-map-list-name="listIt" result-map-name="performFindResult"> @@ -262,7 +262,7 @@ <!-- SubscriptionResource Forms --> <form name="ListSubscriptionResources" type="list" list-name="examples" - odd-row-style="alternate-row" default-table-style="basic-table" + header-row-style="header-row-2" odd-row-style="alternate-row" default-table-style="basic-table" paginate-target="FindSubscriptionResource"> <actions> <entity-condition entity-name="SubscriptionResource"> @@ -315,7 +315,7 @@ <!-- ProductSubscriptionResource --> <form name="ListSubscriptionResourceProducts" type="list" list-name="productSubscriptionResource" target="updateProductSubscriptionResourceSr" - odd-row-style="alternate-row" default-table-style="basic-table"> + header-row-style="header-row-2" odd-row-style="alternate-row" default-table-style="basic-table"> <actions> <entity-condition entity-name="ProductSubscriptionResource"> <condition-expr field-name="subscriptionResourceId" env-name="subscriptionResourceId"/> @@ -374,7 +374,7 @@ <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> <form name="EditSubscriptionAttributes" type="list" list-name="subscriptionAttributes" target="UpdateSubscriptionAttribute" - odd-row-style="alternate-row" default-table-style="basic-table"> + header-row-style="header-row-2" odd-row-style="alternate-row" default-table-style="basic-table"> <auto-fields-service service-name="updateSubscriptionAttribute"/> <field name="subscriptionId"><hidden/></field> @@ -389,7 +389,7 @@ <!-- Subscription Communication Event --> <form name="listSubscriptionCommEvent" type="list" list-name="subscriptionCommEvent" target="ListSubscriptionCommEvent" - odd-row-style="alternate-row" default-table-style="basic-table"> + header-row-style="header-row-2" odd-row-style="alternate-row" default-table-style="basic-table"> <actions> <entity-condition entity-name="SubscriptionAndCommEvent"> <condition-expr field-name="subscriptionId" env-name="subscriptionId"/> Modified: ofbiz/trunk/applications/product/widget/catalog/SubscriptionMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/SubscriptionMenus.xml?rev=676600&r1=676599&r2=676600&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/SubscriptionMenus.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/SubscriptionMenus.xml Mon Jul 14 07:20:03 2008 @@ -34,7 +34,7 @@ </menu-item> </menu> <menu name="EditSubscriptionResource" default-selected-style="selected" type="simple" - menu-container-style="button-bar tab-bar"> + menu-container-style="button-bar tab-bar" selected-menuitem-context-field-name="tabButtonItem"> <menu-item name="EditSubscriptionResource" title="${uiLabelMap.ProductSubscriptionResource}"> <link target="EditSubscriptionResource?subscriptionResourceId=${subscriptionResourceId}"/> </menu-item> Modified: ofbiz/trunk/applications/product/widget/catalog/SubscriptionScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/SubscriptionScreens.xml?rev=676600&r1=676599&r2=676600&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/SubscriptionScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/SubscriptionScreens.xml Mon Jul 14 07:20:03 2008 @@ -31,74 +31,40 @@ <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <section> - <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> - </condition> - <widgets> - <label text="${uiLabelMap.PageTitleFindSubscription}"/> - </widgets> - <fail-widgets> - <label>${uiLabelMap.SubscriptionViewPermissionError}</label> - </fail-widgets> - </section> - </container> - </container> - <container style="screenlet-body"> - <section> - <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> - </condition> - <widgets> - <container> + <section> + <condition> + <if-service-permission service-name="subscriptionPermissionCheck" main-action="VIEW"/> + </condition> + <widgets> + <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml"> + <decorator-section name="menu-bar"> + <container style="button-bar"> <link target="EditSubscription" text="${uiLabelMap.ProductNewSubscription}" style="buttontext"/> <link target="FindSubscriptionResource" text="${uiLabelMap.PageTitleFindSubscriptionResource}" style="buttontext"/> </container> + </decorator-section> + <decorator-section name="search-options"> <include-form name="FindSubscription" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <section> - <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> - </condition> - <widgets> - <label text="${uiLabelMap.PageTitleFindSubscription}"/> - </widgets> - <fail-widgets> - <label>${uiLabelMap.SubscriptionViewPermissionError}</label> - </fail-widgets> - </section> - </container> - </container> - <container style="screenlet-body"> - <section> - <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> - </condition> - <widgets> + </decorator-section> + <decorator-section name="search-results"> <include-form name="ListFindSubscription" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> + </decorator-section> + </decorator-screen> + </widgets> + <fail-widgets> + <label>${uiLabelMap.SubscriptionViewPermissionError}</label> + </fail-widgets> + </section> </decorator-section> </decorator-screen> </widgets> </section> </screen> + <screen name="CommonSubscriptionDecorator"> <section> <actions> <set field="headerItem" value="Subscription"/> - <set field="subscriptionId" from-field="parameters.subscriptionId"/> <entity-one entity-name="Subscription" value-name="subscription"/> </actions> @@ -106,9 +72,8 @@ <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <section> - <!-- do check for CATALOG, _VIEW permission --> <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> + <if-service-permission service-name="subscriptionPermissionCheck" main-action="VIEW"/> </condition> <widgets> <section> @@ -117,9 +82,12 @@ </condition> <widgets> <include-menu name="EditSubscription" location="component://product/widget/catalog/SubscriptionMenus.xml"/> - <container><link target="EditSubscription" text="${uiLabelMap.ProductNewSubscription}" style="buttontext"/></container> - <container><label style="h1">${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} [${subscriptionId}]</label></container> + <container style="h1"><label>${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} ${subscription.description} [${subscriptionId}]</label></container> + <container style="button-bar"><link target="EditSubscription" text="${uiLabelMap.ProductNewSubscription}" style="buttontext"/></container> </widgets> + <fail-widgets> + <container style="h1"><label>${uiLabelMap.${titleProperty}}</label></container> + </fail-widgets> </section> <decorator-section-include name="body"/> </widgets> @@ -132,43 +100,35 @@ </widgets> </section> </screen> + <screen name="EditSubscription"> <section> <actions> <set field="titleProperty" value="PageTitleEditSubscription"/> <set field="tabButtonItem" value="EditSubscription"/> - <set field="subscriptionId" from-field="parameters.subscriptionId"/> <entity-one entity-name="Subscription" value-name="subscription"/> </actions> <widgets> - <decorator-screen name="CommonSubscriptionDecorator"> + <section> + <condition><if-empty field-name="subscriptionId"/></condition> + <actions><set field="titleProperty" value="ProductNewSubscription"/></actions> + <widgets/> + </section> + <decorator-screen name="CommonSubscriptionDecorator" location="${parameters.subscriptionDecoratorLocation}"> <decorator-section name="body"> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleEditSubscription}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="EditSubscription" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> + <include-form name="EditSubscription" location="component://product/widget/catalog/SubscriptionForms.xml"/> </decorator-section> </decorator-screen> </widgets> </section> </screen> + <screen name="EditSubscriptionAttributes"> <section> <actions> <set field="titleProperty" value="PageTitleEditSubscriptionAttributes"/> <set field="tabButtonItem" value="EditSubscriptionAttributes"/> - <set field="subscriptionId" from-field="parameters.subscriptionId"/> <entity-and entity-name="SubscriptionAttribute" use-cache="false" list-name="subscriptionAttributes"> <field-map field-name="subscriptionId"/> @@ -176,43 +136,18 @@ </entity-and> </actions> <widgets> - <decorator-screen name="CommonSubscriptionDecorator"> + <decorator-screen name="CommonSubscriptionDecorator" location="${parameters.subscriptionDecoratorLocation}"> <decorator-section name="body"> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleEditSubscriptionAttributes}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="EditSubscriptionAttributes" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleAddSubscriptionAttributes}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="AddSubscriptionAttribute" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> + <screenlet id="addSubscriptionAttribute" title="${uiLabelMap.PageTitleAddSubscriptionAttributes}" collapsible="true"> + <include-form name="AddSubscriptionAttribute" location="component://product/widget/catalog/SubscriptionForms.xml"/> + </screenlet> + <include-form name="EditSubscriptionAttributes" location="component://product/widget/catalog/SubscriptionForms.xml"/> </decorator-section> </decorator-screen> </widgets> </section> </screen> - <!-- SubscriptionResource Screens --> <screen name="FindSubscriptionResource"> <section> @@ -223,44 +158,33 @@ <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <section> - <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> - </condition> - <widgets> - <label text="${uiLabelMap.PageTitleFindSubscriptionResource}"/> - </widgets> - <fail-widgets> - <label>${uiLabelMap.SubscriptionResourceViewPermissionError}</label> - </fail-widgets> - </section> + <section> + <condition> + <if-service-permission service-name="subscriptionPermissionCheck" main-action="VIEW"/> + </condition> + <widgets> + <container style="h1"> + <label text="${uiLabelMap.PageTitleFindSubscriptionResource}"/> </container> - </container> - <container style="screenlet-body"> - <section> - <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> - </condition> - <widgets> - <container><link target="EditSubscriptionResource" text="${uiLabelMap.ProductNewSubscriptionResource}" style="buttontext"/></container> - <include-form name="ListSubscriptionResources" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> + <container style="button-bar"> + <link target="EditSubscriptionResource" text="${uiLabelMap.ProductNewSubscriptionResource}" style="buttontext"/> + </container> + <include-form name="ListSubscriptionResources" location="component://product/widget/catalog/SubscriptionForms.xml"/> + </widgets> + <fail-widgets> + <label>${uiLabelMap.SubscriptionViewPermissionError}</label> + </fail-widgets> + </section> </decorator-section> </decorator-screen> </widgets> </section> </screen> + <screen name="CommonSubscriptionResourceDecorator"> <section> <actions> - <set field="headerItem" value="SubscriptionResource"/> - + <set field="headerItem" value="Subscription"/> <set field="subscriptionResourceId" from-field="parameters.subscriptionResourceId"/> <entity-one entity-name="SubscriptionResource" value-name="subscriptionResource"/> </actions> @@ -268,9 +192,8 @@ <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <section> - <!-- do check for CATALOG, _VIEW permission --> <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> + <if-service-permission service-name="subscriptionPermissionCheck" main-action="VIEW"/> </condition> <widgets> <section> @@ -279,14 +202,16 @@ </condition> <widgets> <include-menu name="EditSubscriptionResource" location="component://product/widget/catalog/SubscriptionMenus.xml"/> - <container> + <container style="h1"><label>${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} "${subscriptionResource.description}" [${subscriptionResourceId}]</label></container> + <container style="button-bar"> <link target="EditSubscriptionResource" text="${uiLabelMap.ProductNewSubscriptionResource}" style="buttontext"/> <link target="FindSubscription?subscriptionResourceId=${subscriptionResourceId}" text="${uiLabelMap.ProductFindResourceSubscriptions}" style="buttontext"/> </container> - <container><label style="h1">${uiLabelMap.${titleProperty}}</label><label style="h2"> ${uiLabelMap.CommonFor} "${subscriptionResource.description}" [${subscriptionResourceId}]</label></container> </widgets> + <fail-widgets> + <container style="h1"><label>${uiLabelMap.${titleProperty}}</label></container> + </fail-widgets> </section> - <decorator-section-include name="body"/> </widgets> <fail-widgets> @@ -298,81 +223,50 @@ </widgets> </section> </screen> + <screen name="EditSubscriptionResource"> <section> <actions> <set field="titleProperty" value="PageTitleEditSubscriptionResource"/> <set field="tabButtonItem" value="EditSubscriptionResource"/> - <set field="subscriptionResourceId" from-field="parameters.subscriptionResourceId"/> <entity-one entity-name="SubscriptionResource" value-name="subscriptionResource"/> </actions> <widgets> - <decorator-screen name="CommonSubscriptionResourceDecorator"> + <section> + <condition><if-empty field-name="subscriptionResourceId"/></condition> + <actions><set field="titleProperty" value="ProductNewSubscriptionResource"/></actions> + <widgets/> + </section> + <decorator-screen name="CommonSubscriptionResourceDecorator" location="${parameters.subscriptionResourceDecoratorLocation}"> <decorator-section name="body"> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleEditSubscriptionResource}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="EditSubscriptionResource" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> + <include-form name="EditSubscriptionResource" location="component://product/widget/catalog/SubscriptionForms.xml"/> </decorator-section> </decorator-screen> </widgets> </section> </screen> + <screen name="EditSubscriptionResourceProducts"> <section> <actions> <set field="titleProperty" value="PageTitleEditSubscriptionResourceProducts"/> <set field="tabButtonItem" value="EditSubscriptionResourceProducts"/> - <set field="subscriptionResourceId" from-field="parameters.subscriptionResourceId"/> </actions> <widgets> - <decorator-screen name="CommonSubscriptionResourceDecorator"> + <decorator-screen name="CommonSubscriptionResourceDecorator" location="${parameters.subscriptionResourceDecoratorLocation}"> <decorator-section name="body"> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleEditSubscriptionResourceProducts}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="ListSubscriptionResourceProducts" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleAddSubscriptionResourceProducts}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="AddSubscriptionResourceProduct" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> + <screenlet id="addSubscriptionResourceProduct" title="${uiLabelMap.PageTitleAddSubscriptionResourceProducts}" collapsible="true"> + <include-form name="AddSubscriptionResourceProduct" location="component://product/widget/catalog/SubscriptionForms.xml"/> + </screenlet> + <include-form name="ListSubscriptionResourceProducts" location="component://product/widget/catalog/SubscriptionForms.xml"/> </decorator-section> </decorator-screen> </widgets> </section> </screen> + <screen name="EditSubscriptionCommEvent"> <section> <actions> @@ -384,39 +278,16 @@ </entity-and> </actions> <widgets> - <decorator-screen name="CommonSubscriptionDecorator"> + <decorator-screen name="CommonSubscriptionDecorator" location="${parameters.subscriptionDecoratorLocation}"> <decorator-section name="body"> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleEditSubscriptionCommEvent}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="listSubscriptionCommEvent" location="component://product/widget/catalog/SubscriptionForms.xml" /> - </widgets> - </section> - </container> - </container> - <container style="screenlet"> - <container style="screenlet-title-bar"> - <container style="h3"> - <label text="${uiLabelMap.PageTitleAddSubscriptionCommEvent}"/> - </container> - </container> - <container style="screenlet-body"> - <section> - <widgets> - <include-form name="createSubscriptionCommEvent" location="component://product/widget/catalog/SubscriptionForms.xml"/> - </widgets> - </section> - </container> - </container> + <screenlet id="addSubscriptionCommEvent" title="${uiLabelMap.PageTitleAddSubscriptionCommEvent}" collapsible="true"> + <include-form name="createSubscriptionCommEvent" location="component://product/widget/catalog/SubscriptionForms.xml"/> + </screenlet> + <include-form name="listSubscriptionCommEvent" location="component://product/widget/catalog/SubscriptionForms.xml" /> </decorator-section> </decorator-screen> </widgets> </section> </screen> + </screens> |
Free forum by Nabble | Edit this page |