You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@hlmksw.com> on 2008/07/03 18:04:27 UTC
Re: svn commit: r673673 - in /ofbiz/trunk: framework/common/config/
specialpurpose/mypage/ specialpurpose/mypage/data/ specialpurpose/mypage/script/org/
specialpurpose/mypage/script/org/ofbiz/ specialpurpose/mypage/script/org/ofbiz/mypage/
specialpurpose/m...
Hans,
This is great! An excellent use of user preferences.
-Adrian
hansbak@apache.org wrote:
> Author: hansbak
> Date: Thu Jul 3 06:18:53 2008
> New Revision: 673673
>
> URL: http://svn.apache.org/viewvc?rev=673673&view=rev
> Log:
> various mypage enhancements including user configurable main screen
>
> Added:
> ofbiz/trunk/specialpurpose/mypage/script/org/
> ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/
> ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/
> ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml (with props)
> Modified:
> ofbiz/trunk/framework/common/config/CommonUiLabels.xml
> ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml
> ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml
> ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml
> ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml
> ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
> ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml
>
> Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=673673&r1=673672&r2=673673&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
> +++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Thu Jul 3 06:18:53 2008
> @@ -4149,6 +4149,9 @@
> <value xml:lang="th">à¹à¸à¸ªà¸à¹à¸§à¸±à¸à¸à¸µà¹</value>
> <value xml:lang="zh">è¿è´¦æ¥æ</value>
> </property>
> + <property key="CommonPreferences">
> + <value xml:lang="en">Preferences</value>
> + </property>
> <property key="CommonPrepared">
> <value xml:lang="ar">Ù
عدة</value>
> <value xml:lang="en">Prepared</value>
>
> Modified: ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml?rev=673673&r1=673672&r2=673673&view=diff
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml (original)
> +++ ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml Thu Jul 3 06:18:53 2008
> @@ -20,5 +20,11 @@
> <entity-engine-xml>
>
> <WorkEffortType description="Company Events" hasTable="N" parentTypeId="EVENT" workEffortTypeId="COMPANY_EVENT"/>
> +
> + <UserPrefGroupType userPrefGroupId="MyPage" description="User settings of the MyPage component"/>
> + <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myTasks" userPrefValue="Y"/>
> + <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myTimesheet" userPrefValue="Y"/>
> + <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myCommunications" userPrefValue="Y"/>
> + <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myCompanyComms" userPrefValue="Y"/>
>
> </entity-engine-xml>
>
> Modified: ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml?rev=673673&r1=673672&r2=673673&view=diff
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml (original)
> +++ ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml Thu Jul 3 06:18:53 2008
> @@ -23,20 +23,10 @@
> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
> <resource-loader name="main" type="component"/>
> <classpath type="dir" location="config"/>
> - <!--
> <classpath type="dir" location="script"/>
> - <classpath type="jar" location="build/lib/*"/-->
>
> - <!--entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
> - <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup.xml"/>
> - <entity-resource type="data" reader-name="seed" loader="main" location="data/ProjectMgrTypeData.xml"/>
> - <entity-resource type="data" reader-name="seed" loader="main" location="data/ProjectMgrSecurityData.xml"/>
> - <entity-resource type="data" reader-name="demo" loader="main" location="data/ProjectMgrDemoData.xml"/-->
> <entity-resource type="data" reader-name="seed" loader="main" location="data/MyPageTypeData.xml"/>
>
> - <!--service-resource type="model" loader="main" location="servicedef/services.xml"/>
> - <service-resource type="eca" loader="main" location="servicedef/secas.xml"/-->
> -
> <webapp name="mypage"
> title="MyPage"
> server="default-server"
>
> Added: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml?rev=673673&view=auto
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml (added)
> +++ ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml Thu Jul 3 06:18:53 2008
> @@ -0,0 +1,54 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<!--
> +Licensed to the Apache Software Foundation (ASF) under one
> +or more contributor license agreements. See the NOTICE file
> +distributed with this work for additional information
> +regarding copyright ownership. The ASF licenses this file
> +to you under the Apache License, Version 2.0 (the
> +"License"); you may not use this file except in compliance
> +with the License. You may obtain a copy of the License at
> +
> +http://www.apache.org/licenses/LICENSE-2.0
> +
> +Unless required by applicable law or agreed to in writing,
> +software distributed under the License is distributed on an
> +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> +KIND, either express or implied. See the License for the
> +specific language governing permissions and limitations
> +under the License.
> +-->
> +
> +<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
> + <simple-method method-name="updatePreferences"
> + short-description="Update the user preferences">
> + <if-compare operator="equals" value="Y" field="parameters.myCompanyComms">
> + <set field="parameters.userPrefMap.myCompanyComms" value="Y" />
> + <else>
> + <set field="parameters.userPrefMap.myCompanyComms" value="N" />
> + </else>
> + </if-compare>
> + <if-compare operator="equals" value="Y" field="parameters.myTimesheet">
> + <set field="parameters.userPrefMap.myTimesheet" value="Y" />
> + <else>
> + <set field="parameters.userPrefMap.myTimesheet" value="N" />
> + </else>
> + </if-compare>
> + <if-compare operator="equals" value="Y" field="parameters.myTasks">
> + <set field="parameters.userPrefMap.myTasks" value="Y" />
> + <else>
> + <set field="parameters.userPrefMap.myTasks" value="N" />
> + </else>
> + </if-compare>
> + <if-compare operator="equals" value="Y" field="parameters.myCommunications">
> + <set field="parameters.userPrefMap.myCommunications" value="Y" />
> + <else>
> + <set field="parameters.userPrefMap.myCommunications" value="N" />
> + </else>
> + </if-compare>
> + <set-service-fields service-name="setUserPreferenceGroup"
> + map-name="parameters" to-map-name="inMap" />
> + <call-service service-name="setUserPreferenceGroup"
> + in-map-name="inMap" />
> + </simple-method>
> +
> +</simple-methods>
>
> Propchange: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml
> ------------------------------------------------------------------------------
> svn:eol-style = native
>
> Propchange: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml
> ------------------------------------------------------------------------------
> svn:keywords = "Date Rev Author URL Id"
>
> Propchange: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml
> ------------------------------------------------------------------------------
> svn:mime-type = text/xml
>
> Modified: ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml?rev=673673&r1=673672&r2=673673&view=diff
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml (original)
> +++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml Thu Jul 3 06:18:53 2008
> @@ -80,7 +80,22 @@
> <response name="success" type="view" value="main"/>
> <response name="error" type="view" value="main"/>
> </request-map>
> + <request-map uri="preferences">
> + <security https="true" auth="true"/>
> + <response name="success" type="view" value="preferences"/>
> + </request-map>
> + <request-map uri="updatePreferences">
> + <security https="true" auth="true"/>
> + <event invoke="updatePreferences" path="org/ofbiz/mypage/Events.xml" type="simple"/>
> + <response name="success" type="view" value="main"/>
> + <response name="error" type="view" value="preferences"/>
> + </request-map>
> +
> +
> +
> +
>
> <view-map name="main" type="screen" page="component://mypage/widget/CommonScreens.xml#main"/>
> + <view-map name="preferences" type="screen" page="component://mypage/widget/CommonScreens.xml#preferences"/>
> <view-map name="newEvent" type="screen" page="component://mypage/widget/MyPageScreens.xml#newEvent"/>
> </site-conf>
>
> Modified: ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml?rev=673673&r1=673672&r2=673673&view=diff
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml (original)
> +++ ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml Thu Jul 3 06:18:53 2008
> @@ -178,22 +178,83 @@
> </widgets>
> </section>
> </screen>
> -
> - <screen name="main">
> + <screen name="main">
> + <section>
> + <actions>
> + <set field="headerItem" value="main" />
> + <!-- refresh every 3 minutes -->
> + <!--
> + set field="layoutSettings.extraHead" value="<META
> + HTTP-EQUIV="REFRESH" CONTENT="180">"/
> + -->
> + <service service-name="getUserPreferenceGroup"
> + result-map-name="preferences">
> + <field-map field-name="userPrefGroupId" value="MyPage" />
> + </service>
> + </actions>
> + <widgets>
> + <decorator-screen name="main-decorator"
> + location="${parameters.mainDecoratorLocation}">
> + <decorator-section name="body">
> + <section>
> + <condition>
> + <if-compare field-name="preferences.userPrefMap.myCommunications"
> + operator="equals" value="Y" />
> + </condition>
> + <widgets>
> + <include-screen name="MyMessages"
> + location="component://mypage/widget/MyPageScreens.xml" />
> + </widgets>
> + </section>
> + <section>
> + <condition>
> + <if-compare field-name="preferences.userPrefMap.myCompanyComms"
> + operator="equals" value="Y" />
> + </condition>
> + <widgets>
> + <include-screen name="CalendarUpcoming"
> + location="component://mypage/widget/MyPageScreens.xml" />
> + </widgets>
> + </section>
> + <section>
> + <condition>
> + <if-compare field-name="preferences.userPrefMap.myTasks"
> + operator="equals" value="Y" />
> + </condition>
> + <widgets>
> + <include-screen name="MyTaskList"
> + location="component://mypage/widget/MyPageScreens.xml" />
> + </widgets>
> + </section>
> + <section>
> + <condition>
> + <if-compare field-name="preferences.userPrefMap.myTimesheet"
> + operator="equals" value="Y" />
> + </condition>
> + <widgets>
> + <include-screen name="CurrentTimesheet"
> + location="component://mypage/widget/MyPageScreens.xml" />
> + </widgets>
> + </section>
> + </decorator-section>
> + </decorator-screen>
> + </widgets>
> + </section>
> + </screen>
> + <screen name="preferences">
> <section>
> <actions>
> - <set field="headerItem" value="main"/>
> - <!-- refresh every 3 minutes -->
> - <!--set field="layoutSettings.extraHead" value="<META HTTP-EQUIV="REFRESH" CONTENT="180">"/-->
> + <set field="headerItem" value="preferences"/>
> + <service service-name="getUserPreferenceGroup" result-map-name="preferences">
> + <field-map field-name="userPrefGroupId" value="MyPage"/>
> + </service>
> </actions>
> <widgets>
> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
> <decorator-section name="body">
> - <!--include-screen name="CompanyMessages" location="component://mypage/widget/MyPageScreens.xml"/-->
> - <include-screen name="MyMessages" location="component://mypage/widget/MyPageScreens.xml"/>
> - <include-screen name="CalendarUpcoming" location="component://mypage/widget/MyPageScreens.xml"/>
> - <include-screen name="MyTaskList" location="component://mypage/widget/MyPageScreens.xml"/>
> - <include-screen name="CurrentTimesheet" location="component://mypage/widget/MyPageScreens.xml"/>
> + <screenlet title="${uiLabelMap.CommonPreferences}: pages visible on the main screen">
> + <include-form name="preferences" location="component://mypage/widget/MyPageForms.xml"/>
> + </screenlet>
> </decorator-section>
> </decorator-screen>
> </widgets>
>
> Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml?rev=673673&r1=673672&r2=673673&view=diff
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml (original)
> +++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml Thu Jul 3 06:18:53 2008
> @@ -72,4 +72,12 @@
> <field name="add"><submit/></field>
> </form>
>
> + <form name="preferences" type="single" target="updatePreferences" default-map-name="preferences.userPrefMap">
> + <field name="userPrefGroupId"><hidden value="MyPage"/></field>
> + <field name="myCompanyComms"><check/></field>
> + <field name="myTimesheet"><check/></field>
> + <field name="myTasks"><check/></field>
> + <field name="myCommunications"><check/></field>
> + <field name="updateButton"><submit/></field>
> + </form>
> </forms>
> \ No newline at end of file
>
> Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml?rev=673673&r1=673672&r2=673673&view=diff
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml (original)
> +++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml Thu Jul 3 06:18:53 2008
> @@ -45,6 +45,9 @@
> <condition><if-empty field-name="userLogin"/></condition>
> <link target="${checkLoginUrl}"/>
> </menu-item>
> + <menu-item name="preferences" title="${uiLabelMap.CommonPreferences}" align-style="opposed">
> + <link target="preferences"/>
> + </menu-item>
> </menu>
>
> <menu name="EventMenu">
>
>
>