You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Anil Patel <an...@hotwaxmedia.com> on 2009/07/15 11:06:06 UTC
Re: svn commit: r794195 - in /ofbiz/trunk/specialpurpose/projectmgr/widget: ProjectScreens.xml forms/ProjectForms.xml
Hans,
I am interested to know motivation for renaming project variable to
projectInfo. Ofbiz best practices (declared or assumed) recommend
using entity name for the variable name.
Unless there is specific reason I like to use project as variable name
instead.
Regards
Anil Patel
On Jul 15, 2009, at 2:17 PM, hansbak@apache.org wrote:
> Author: hansbak
> Date: Wed Jul 15 08:47:29 2009
> New Revision: 794195
>
> URL: http://svn.apache.org/viewvc?rev=794195&view=rev
> Log:
> project create/update problem and some cleanup
>
> Modified:
> ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
> ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
>
> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/
> ProjectScreens.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=794195&r1=794194&r2=794195&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
> (original)
> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
> Wed Jul 15 08:47:29 2009
> @@ -89,7 +89,7 @@
> <service service-name="getProject" result-
> map="result">
> <field-map field-name="projectId" from-
> field="projectId"/>
> </service>
> - <set field="project" from-
> field="result.projectInfo"/>
> + <set field="projectInfo" from-
> field="result.projectInfo"/>
> </actions>
> <widgets>
> <decorator-screen name="CommonProjectDecorator"
> location="${parameters.mainDecoratorLocation}">
>
> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> ProjectForms.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=794195&r1=794194&r2=794195&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> ProjectForms.xml (original)
> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> ProjectForms.xml Wed Jul 15 08:47:29 2009
> @@ -19,25 +19,25 @@
> -->
> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd
> ">
> - <form name="EditProject" type="single" target="updateProject"
> default-map-name="project"
> + <form name="EditProject" type="single" target="updateProject"
> default-map-name="projectInfo"
> header-row-style="header-row" default-table-style="basic-
> table">
> <actions>
> <entity-one entity-name="PartyGroup" value-
> field="partyGroup">
> <field-map field-name="partyId" from-field="partyId"/>
> </entity-one>
> - <entity-and entity-name="WorkEffortPartyAssignment"
> list="assigns" filter-by-date="true">
> - <field-map field-name="workEffortId" from-
> field="parameters.projectId"/>
> + <entity-and entity-name="WorkEffortPartyAssignment"
> list="workEffortPartyAssignments" filter-by-date="true">
> + <field-map field-name="workEffortId" from-
> field="projectInfo.projectId"/>
> <field-map field-name="roleTypeId"
> value="CLIENT_BILLING"/>
> </entity-and>
> - <set field="project.clientBillingPartyId" from-
> field="assigns[0].partyId"/>
> - <entity-and entity-name="WorkEffortPartyAssignment"
> list="assignsOrg" filter-by-date="true">
> - <field-map field-name="workEffortId" from-
> field="parameters.projectId"/>
> + <set field="projectInfo.clientBillingPartyId" from-
> field="workEffortPartyAssignments[0].partyId"/>
> + <entity-and entity-name="WorkEffortPartyAssignment"
> list="workEffortPartyAssignments" filter-by-date="true">
> + <field-map field-name="workEffortId" from-
> field="projectInfo.projectId"/>
> <field-map field-name="roleTypeId"
> value="INTERNAL_ORGANIZATIO"/>
> </entity-and>
> - <set field="project.organizationPartyId" from-
> field="assignsOrg[0].partyId"/>
> + <set field="projectInfo.organizationPartyId" from-
> field="workEffortPartyAssignments[0].partyId"/>
> </actions>
> - <alt-target use-when="project==null" target="createProject"/>
> - <field use-when="project==null" name="templateId">
> + <alt-target use-when="projectInfo==null"
> target="createProject"/>
> + <field name="templateId" use-when="projectInfo==null">
> <drop-down allow-empty="true">
> <entity-options entity-name="WorkEffort"
> description="${workEffortName}" key-field-name="workEffortId">
> <entity-constraint name="workEffortTypeId"
> value="PROJECT_TEMPLATE"/>
> @@ -49,8 +49,8 @@
> <field name="workEffortId"><hidden value="${projectId}"/></
> field>
> <field name="projectName" parameter-name="workEffortName"
> title="${uiLabelMap.ProjectMgrProjectName}*"><text/></field>
> <field name="projectDescription" parameter-
> name="description" title="${uiLabelMap.CommonDescription}"><text/></
> field>
> - <field use-when="project!=null" name="currentStatusId"
> title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
> entity entity-name="StatusItem" key-field-name="statusId"/></field>
> - <field use-when="project==null"
> name="currentStatusId"><hidden value="_NA_"/></field>
> + <field name="currentStatusId" use-when="projectInfo!=null"
> title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
> entity entity-name="StatusItem" key-field-name="statusId"/></field>
> + <field name="currentStatusId" use-
> when="projectInfo==null"><hidden value="_NA_"/></field>
> <field name="clientBillingPartyId">
> <lookup target-form-name="LookupPartyGroup">
> <sub-hyperlink target="viewprofile" description="$
> {partyGroup.groupName}">
> @@ -80,10 +80,10 @@
> </entity-options>
> </drop-down>
> </field>
> - <field use-when="project!=null" name="estimatedStartDate"
> title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display
> description="${bsh:project.get("estimatedStartDate")!=null?
> project
> .get
> ("
> ;estimatedStartDate
> ").toString().substring(0,10):"";}"/></field>
> - <field use-when="project!=null"
> name="estimatedCompletionDate" title="$
> {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
> description="${bsh:project.get("estimatedCompletionDate")!
> =null?
> project
> .get
> ("
> ;estimatedCompletionDate
> ").toString().substring(0,10):"";}"/></field>
> - <field use-when="project!=null" name="actualStartDate"
> title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
> description="${bsh:project.get("actualStartDate")!=null?
> project
> .get
> ("
> ;actualStartDate").toString().substring(0,10):"";}"/
> ></field>
> - <field use-when="project!=null" name="actualCompletionDate"
> title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
> description="${bsh:project.get("actualCompletionDate")!
> =null?
> project
> .get
> ("
> ;actualCompletionDate
> ").toString().substring(0,10):"";}"/></field>
> + <field use-when="projectInfo!=null"
> name="estimatedStartDate" title="$
> {uiLabelMap.FormFieldTitle_estimatedStartDate}"><display type="date"/
> ></field>
> + <field use-when="projectInfo!=null"
> name="estimatedCompletionDate" title="$
> {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
> type="date"/></field>
> + <field use-when="projectInfo!=null" name="actualStartDate"
> title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
> type="date"/></field>
> + <field use-when="projectInfo!=null"
> name="actualCompletionDate" title="$
> {uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
> type="date"/></field>
> <field name="save" title="${uiLabelMap.CommonSave}"><submit/
> ></field>
> </form>
> <form name="AddSubProject" type="single" target="AddSubProject"
>
>
Re: svn commit: r794195 - in
/ofbiz/trunk/specialpurpose/projectmgr/widget: ProjectScreens.xml
forms/ProjectForms.xml
Posted by Tim Ruppert <ti...@hotwaxmedia.com>.
I guess the question remains that either it's a pattern we've employed as a best practice in OFBiz or not. If it is - then Hans do the needful and stop making up your own practices - if not, then Anil let Hans decide on the variable names when he's making commits. My personal vote is that we should not be adding additional things onto variable names - project seems more relevant than the projectInfo nomenclature.
On the FTLs to Forms discussion, I believe this has still been left with questions around whether or not the forms can do what is being asked of it - which as far as I can see - hasn't been disproven in any way and we're still at an impasse. Would love to see more information here instead of just jabs ....
Regardless, no need to take a recommendation and turn it into a defensive response - no one enjoys a community like that gentlemen. So, what is the answer - is it a best practice to not add suffixes to variable names in order for them to be more clear or not?
Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com
o:801.649.6594
f:801.649.6595
----- "Hans Bakker" <ma...@antwebsystems.com> wrote:
> On Wed, 2009-07-15 at 15:29 +0530, Anil Patel wrote:
> > Hans,
> > Sure I will not mind if you change ftl's into form widget as long as
>
> > FUNCTIONALITY is not lost.
> >
>
> the same is true when you change the projectInfo variable...
>
> --
> Antwebsystems.com: Quality OFBiz services for competitive rates
Re: svn commit: r794195 - in
/ofbiz/trunk/specialpurpose/projectmgr/widget: ProjectScreens.xml
forms/ProjectForms.xml
Posted by Hans Bakker <ma...@antwebsystems.com>.
On Wed, 2009-07-15 at 15:29 +0530, Anil Patel wrote:
> Hans,
> Sure I will not mind if you change ftl's into form widget as long as
> FUNCTIONALITY is not lost.
>
the same is true when you change the projectInfo variable...
--
Antwebsystems.com: Quality OFBiz services for competitive rates
Re: svn commit: r794195 - in /ofbiz/trunk/specialpurpose/projectmgr/widget: ProjectScreens.xml forms/ProjectForms.xml
Posted by Anil Patel <an...@hotwaxmedia.com>.
Correction inline.
On Jul 15, 2009, at 3:29 PM, Anil Patel wrote:
> Hans,
> Sure I will not mind if you change ftl's into form widget as long as
> FUNCTIONALITY is not lost.
>
> Rest Inline.
>
> Regards
> Anil Patel
>
> On Jul 15, 2009, at 3:15 PM, Hans Bakker wrote:
>
>> I do not understand your variable hunting.
>>
>> both project and projectinfo are not entities..... :-)
>
> In context of Project component WORKEFFORT is deemed to be project
> hence I recommend using project for variable name over
> "projectInfo". "Info"
Suffix.
> does not add any meaning to the code.
>
>
>>
>> Feel free to change them, i hope then that you do not mind if i
>> change
>> your ftl's into forms....
>>
>> Regards,
>> Hans
>>
>>
>> On Wed, 2009-07-15 at 14:36 +0530, Anil Patel wrote:
>>> Hans,
>>> I am interested to know motivation for renaming project variable to
>>> projectInfo. Ofbiz best practices (declared or assumed) recommend
>>> using entity name for the variable name.
>>>
>>> Unless there is specific reason I like to use project as variable
>>> name
>>> instead.
>>>
>>> Regards
>>> Anil Patel
>>>
>>>
>>> On Jul 15, 2009, at 2:17 PM, hansbak@apache.org wrote:
>>>
>>>> Author: hansbak
>>>> Date: Wed Jul 15 08:47:29 2009
>>>> New Revision: 794195
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=794195&view=rev
>>>> Log:
>>>> project create/update problem and some cleanup
>>>>
>>>> Modified:
>>>> ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
>>>> ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>>> ProjectForms.xml
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/
>>>> ProjectScreens.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=794195&r1=794194&r2=794195&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
>>>> (original)
>>>> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
>>>> Wed Jul 15 08:47:29 2009
>>>> @@ -89,7 +89,7 @@
>>>> <service service-name="getProject" result-
>>>> map="result">
>>>> <field-map field-name="projectId" from-
>>>> field="projectId"/>
>>>> </service>
>>>> - <set field="project" from-
>>>> field="result.projectInfo"/>
>>>> + <set field="projectInfo" from-
>>>> field="result.projectInfo"/>
>>>> </actions>
>>>> <widgets>
>>>> <decorator-screen name="CommonProjectDecorator"
>>>> location="${parameters.mainDecoratorLocation}">
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>>> ProjectForms.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=794195&r1=794194&r2=794195&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>>> ProjectForms.xml (original)
>>>> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>>> ProjectForms.xml Wed Jul 15 08:47:29 2009
>>>> @@ -19,25 +19,25 @@
>>>> -->
>>>> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd
>>>> ">
>>>> - <form name="EditProject" type="single" target="updateProject"
>>>> default-map-name="project"
>>>> + <form name="EditProject" type="single" target="updateProject"
>>>> default-map-name="projectInfo"
>>>> header-row-style="header-row" default-table-style="basic-
>>>> table">
>>>> <actions>
>>>> <entity-one entity-name="PartyGroup" value-
>>>> field="partyGroup">
>>>> <field-map field-name="partyId" from-
>>>> field="partyId"/>
>>>> </entity-one>
>>>> - <entity-and entity-name="WorkEffortPartyAssignment"
>>>> list="assigns" filter-by-date="true">
>>>> - <field-map field-name="workEffortId" from-
>>>> field="parameters.projectId"/>
>>>> + <entity-and entity-name="WorkEffortPartyAssignment"
>>>> list="workEffortPartyAssignments" filter-by-date="true">
>>>> + <field-map field-name="workEffortId" from-
>>>> field="projectInfo.projectId"/>
>>>> <field-map field-name="roleTypeId"
>>>> value="CLIENT_BILLING"/>
>>>> </entity-and>
>>>> - <set field="project.clientBillingPartyId" from-
>>>> field="assigns[0].partyId"/>
>>>> - <entity-and entity-name="WorkEffortPartyAssignment"
>>>> list="assignsOrg" filter-by-date="true">
>>>> - <field-map field-name="workEffortId" from-
>>>> field="parameters.projectId"/>
>>>> + <set field="projectInfo.clientBillingPartyId" from-
>>>> field="workEffortPartyAssignments[0].partyId"/>
>>>> + <entity-and entity-name="WorkEffortPartyAssignment"
>>>> list="workEffortPartyAssignments" filter-by-date="true">
>>>> + <field-map field-name="workEffortId" from-
>>>> field="projectInfo.projectId"/>
>>>> <field-map field-name="roleTypeId"
>>>> value="INTERNAL_ORGANIZATIO"/>
>>>> </entity-and>
>>>> - <set field="project.organizationPartyId" from-
>>>> field="assignsOrg[0].partyId"/>
>>>> + <set field="projectInfo.organizationPartyId" from-
>>>> field="workEffortPartyAssignments[0].partyId"/>
>>>> </actions>
>>>> - <alt-target use-when="project==null"
>>>> target="createProject"/>
>>>> - <field use-when="project==null" name="templateId">
>>>> + <alt-target use-when="projectInfo==null"
>>>> target="createProject"/>
>>>> + <field name="templateId" use-when="projectInfo==null">
>>>> <drop-down allow-empty="true">
>>>> <entity-options entity-name="WorkEffort"
>>>> description="${workEffortName}" key-field-name="workEffortId">
>>>> <entity-constraint name="workEffortTypeId"
>>>> value="PROJECT_TEMPLATE"/>
>>>> @@ -49,8 +49,8 @@
>>>> <field name="workEffortId"><hidden value="${projectId}"/></
>>>> field>
>>>> <field name="projectName" parameter-name="workEffortName"
>>>> title="${uiLabelMap.ProjectMgrProjectName}*"><text/></field>
>>>> <field name="projectDescription" parameter-
>>>> name="description" title="${uiLabelMap.CommonDescription}"><text/
>>>> ></
>>>> field>
>>>> - <field use-when="project!=null" name="currentStatusId"
>>>> title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
>>>> entity entity-name="StatusItem" key-field-name="statusId"/></field>
>>>> - <field use-when="project==null"
>>>> name="currentStatusId"><hidden value="_NA_"/></field>
>>>> + <field name="currentStatusId" use-when="projectInfo!=null"
>>>> title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
>>>> entity entity-name="StatusItem" key-field-name="statusId"/></field>
>>>> + <field name="currentStatusId" use-
>>>> when="projectInfo==null"><hidden value="_NA_"/></field>
>>>> <field name="clientBillingPartyId">
>>>> <lookup target-form-name="LookupPartyGroup">
>>>> <sub-hyperlink target="viewprofile" description="$
>>>> {partyGroup.groupName}">
>>>> @@ -80,10 +80,10 @@
>>>> </entity-options>
>>>> </drop-down>
>>>> </field>
>>>> - <field use-when="project!=null" name="estimatedStartDate"
>>>> title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display
>>>> description="${bsh:project.get("estimatedStartDate")!
>>>> =null?
>>>> project
>>>> .get
>>>> ("
>>>> ;estimatedStartDate
>>>> ").toString().substring(0,10):"";}"/></field>
>>>> - <field use-when="project!=null"
>>>> name="estimatedCompletionDate" title="$
>>>> {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
>>>> description="$
>>>> {bsh:project.get("estimatedCompletionDate")!
>>>> =null?
>>>> project
>>>> .get
>>>> ("
>>>> ;estimatedCompletionDate
>>>> ").toString().substring(0,10):"";}"/></field>
>>>> - <field use-when="project!=null" name="actualStartDate"
>>>> title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
>>>> description="${bsh:project.get("actualStartDate")!=null?
>>>> project
>>>> .get
>>>> ("
>>>> ;actualStartDate").toString().substring(0,10):"";}"/
>>>>> </field>
>>>> - <field use-when="project!=null"
>>>> name="actualCompletionDate"
>>>> title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
>>>> description="${bsh:project.get("actualCompletionDate")!
>>>> =null?
>>>> project
>>>> .get
>>>> ("
>>>> ;actualCompletionDate
>>>> ").toString().substring(0,10):"";}"/></field>
>>>> + <field use-when="projectInfo!=null"
>>>> name="estimatedStartDate" title="$
>>>> {uiLabelMap.FormFieldTitle_estimatedStartDate}"><display
>>>> type="date"/
>>>>> </field>
>>>> + <field use-when="projectInfo!=null"
>>>> name="estimatedCompletionDate" title="$
>>>> {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
>>>> type="date"/></field>
>>>> + <field use-when="projectInfo!=null" name="actualStartDate"
>>>> title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
>>>> type="date"/></field>
>>>> + <field use-when="projectInfo!=null"
>>>> name="actualCompletionDate" title="$
>>>> {uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
>>>> type="date"/></field>
>>>> <field name="save" title="${uiLabelMap.CommonSave}"><submit/
>>>>> </field>
>>>> </form>
>>>> <form name="AddSubProject" type="single" target="AddSubProject"
>>>>
>>>>
>>>
>> --
>> Antwebsystems.com: Quality OFBiz services for competitive rates
>>
>
Re: svn commit: r794195 - in /ofbiz/trunk/specialpurpose/projectmgr/widget: ProjectScreens.xml forms/ProjectForms.xml
Posted by Anil Patel <an...@hotwaxmedia.com>.
Hans,
Sure I will not mind if you change ftl's into form widget as long as
FUNCTIONALITY is not lost.
Rest Inline.
Regards
Anil Patel
On Jul 15, 2009, at 3:15 PM, Hans Bakker wrote:
> I do not understand your variable hunting.
>
> both project and projectinfo are not entities..... :-)
In context of Project component WORKEFFORT is deemed to be project
hence I recommend using project for variable name over "projectInfo".
"Info" prefix does not add any meaning to the code.
>
> Feel free to change them, i hope then that you do not mind if i change
> your ftl's into forms....
>
> Regards,
> Hans
>
>
> On Wed, 2009-07-15 at 14:36 +0530, Anil Patel wrote:
>> Hans,
>> I am interested to know motivation for renaming project variable to
>> projectInfo. Ofbiz best practices (declared or assumed) recommend
>> using entity name for the variable name.
>>
>> Unless there is specific reason I like to use project as variable
>> name
>> instead.
>>
>> Regards
>> Anil Patel
>>
>>
>> On Jul 15, 2009, at 2:17 PM, hansbak@apache.org wrote:
>>
>>> Author: hansbak
>>> Date: Wed Jul 15 08:47:29 2009
>>> New Revision: 794195
>>>
>>> URL: http://svn.apache.org/viewvc?rev=794195&view=rev
>>> Log:
>>> project create/update problem and some cleanup
>>>
>>> Modified:
>>> ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
>>> ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>> ProjectForms.xml
>>>
>>> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/
>>> ProjectScreens.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=794195&r1=794194&r2=794195&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
>>> (original)
>>> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
>>> Wed Jul 15 08:47:29 2009
>>> @@ -89,7 +89,7 @@
>>> <service service-name="getProject" result-
>>> map="result">
>>> <field-map field-name="projectId" from-
>>> field="projectId"/>
>>> </service>
>>> - <set field="project" from-
>>> field="result.projectInfo"/>
>>> + <set field="projectInfo" from-
>>> field="result.projectInfo"/>
>>> </actions>
>>> <widgets>
>>> <decorator-screen name="CommonProjectDecorator"
>>> location="${parameters.mainDecoratorLocation}">
>>>
>>> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>> ProjectForms.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=794195&r1=794194&r2=794195&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>> ProjectForms.xml (original)
>>> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
>>> ProjectForms.xml Wed Jul 15 08:47:29 2009
>>> @@ -19,25 +19,25 @@
>>> -->
>>> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd
>>> ">
>>> - <form name="EditProject" type="single" target="updateProject"
>>> default-map-name="project"
>>> + <form name="EditProject" type="single" target="updateProject"
>>> default-map-name="projectInfo"
>>> header-row-style="header-row" default-table-style="basic-
>>> table">
>>> <actions>
>>> <entity-one entity-name="PartyGroup" value-
>>> field="partyGroup">
>>> <field-map field-name="partyId" from-
>>> field="partyId"/>
>>> </entity-one>
>>> - <entity-and entity-name="WorkEffortPartyAssignment"
>>> list="assigns" filter-by-date="true">
>>> - <field-map field-name="workEffortId" from-
>>> field="parameters.projectId"/>
>>> + <entity-and entity-name="WorkEffortPartyAssignment"
>>> list="workEffortPartyAssignments" filter-by-date="true">
>>> + <field-map field-name="workEffortId" from-
>>> field="projectInfo.projectId"/>
>>> <field-map field-name="roleTypeId"
>>> value="CLIENT_BILLING"/>
>>> </entity-and>
>>> - <set field="project.clientBillingPartyId" from-
>>> field="assigns[0].partyId"/>
>>> - <entity-and entity-name="WorkEffortPartyAssignment"
>>> list="assignsOrg" filter-by-date="true">
>>> - <field-map field-name="workEffortId" from-
>>> field="parameters.projectId"/>
>>> + <set field="projectInfo.clientBillingPartyId" from-
>>> field="workEffortPartyAssignments[0].partyId"/>
>>> + <entity-and entity-name="WorkEffortPartyAssignment"
>>> list="workEffortPartyAssignments" filter-by-date="true">
>>> + <field-map field-name="workEffortId" from-
>>> field="projectInfo.projectId"/>
>>> <field-map field-name="roleTypeId"
>>> value="INTERNAL_ORGANIZATIO"/>
>>> </entity-and>
>>> - <set field="project.organizationPartyId" from-
>>> field="assignsOrg[0].partyId"/>
>>> + <set field="projectInfo.organizationPartyId" from-
>>> field="workEffortPartyAssignments[0].partyId"/>
>>> </actions>
>>> - <alt-target use-when="project==null"
>>> target="createProject"/>
>>> - <field use-when="project==null" name="templateId">
>>> + <alt-target use-when="projectInfo==null"
>>> target="createProject"/>
>>> + <field name="templateId" use-when="projectInfo==null">
>>> <drop-down allow-empty="true">
>>> <entity-options entity-name="WorkEffort"
>>> description="${workEffortName}" key-field-name="workEffortId">
>>> <entity-constraint name="workEffortTypeId"
>>> value="PROJECT_TEMPLATE"/>
>>> @@ -49,8 +49,8 @@
>>> <field name="workEffortId"><hidden value="${projectId}"/></
>>> field>
>>> <field name="projectName" parameter-name="workEffortName"
>>> title="${uiLabelMap.ProjectMgrProjectName}*"><text/></field>
>>> <field name="projectDescription" parameter-
>>> name="description" title="${uiLabelMap.CommonDescription}"><text/></
>>> field>
>>> - <field use-when="project!=null" name="currentStatusId"
>>> title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
>>> entity entity-name="StatusItem" key-field-name="statusId"/></field>
>>> - <field use-when="project==null"
>>> name="currentStatusId"><hidden value="_NA_"/></field>
>>> + <field name="currentStatusId" use-when="projectInfo!=null"
>>> title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
>>> entity entity-name="StatusItem" key-field-name="statusId"/></field>
>>> + <field name="currentStatusId" use-
>>> when="projectInfo==null"><hidden value="_NA_"/></field>
>>> <field name="clientBillingPartyId">
>>> <lookup target-form-name="LookupPartyGroup">
>>> <sub-hyperlink target="viewprofile" description="$
>>> {partyGroup.groupName}">
>>> @@ -80,10 +80,10 @@
>>> </entity-options>
>>> </drop-down>
>>> </field>
>>> - <field use-when="project!=null" name="estimatedStartDate"
>>> title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display
>>> description="${bsh:project.get("estimatedStartDate")!
>>> =null?
>>> project
>>> .get
>>> ("
>>> ;estimatedStartDate
>>> ").toString().substring(0,10):"";}"/></field>
>>> - <field use-when="project!=null"
>>> name="estimatedCompletionDate" title="$
>>> {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
>>> description="${bsh:project.get("estimatedCompletionDate")!
>>> =null?
>>> project
>>> .get
>>> ("
>>> ;estimatedCompletionDate
>>> ").toString().substring(0,10):"";}"/></field>
>>> - <field use-when="project!=null" name="actualStartDate"
>>> title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
>>> description="${bsh:project.get("actualStartDate")!=null?
>>> project
>>> .get
>>> ("
>>> ;actualStartDate").toString().substring(0,10):"";}"/
>>>> </field>
>>> - <field use-when="project!=null" name="actualCompletionDate"
>>> title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
>>> description="${bsh:project.get("actualCompletionDate")!
>>> =null?
>>> project
>>> .get
>>> ("
>>> ;actualCompletionDate
>>> ").toString().substring(0,10):"";}"/></field>
>>> + <field use-when="projectInfo!=null"
>>> name="estimatedStartDate" title="$
>>> {uiLabelMap.FormFieldTitle_estimatedStartDate}"><display
>>> type="date"/
>>>> </field>
>>> + <field use-when="projectInfo!=null"
>>> name="estimatedCompletionDate" title="$
>>> {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
>>> type="date"/></field>
>>> + <field use-when="projectInfo!=null" name="actualStartDate"
>>> title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
>>> type="date"/></field>
>>> + <field use-when="projectInfo!=null"
>>> name="actualCompletionDate" title="$
>>> {uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
>>> type="date"/></field>
>>> <field name="save" title="${uiLabelMap.CommonSave}"><submit/
>>>> </field>
>>> </form>
>>> <form name="AddSubProject" type="single" target="AddSubProject"
>>>
>>>
>>
> --
> Antwebsystems.com: Quality OFBiz services for competitive rates
>
Re: svn commit: r794195 - in
/ofbiz/trunk/specialpurpose/projectmgr/widget: ProjectScreens.xml
forms/ProjectForms.xml
Posted by Hans Bakker <ma...@antwebsystems.com>.
I do not understand your variable hunting.
both project and projectinfo are not entities..... :-)
Feel free to change them, i hope then that you do not mind if i change
your ftl's into forms....
Regards,
Hans
On Wed, 2009-07-15 at 14:36 +0530, Anil Patel wrote:
> Hans,
> I am interested to know motivation for renaming project variable to
> projectInfo. Ofbiz best practices (declared or assumed) recommend
> using entity name for the variable name.
>
> Unless there is specific reason I like to use project as variable name
> instead.
>
> Regards
> Anil Patel
>
>
> On Jul 15, 2009, at 2:17 PM, hansbak@apache.org wrote:
>
> > Author: hansbak
> > Date: Wed Jul 15 08:47:29 2009
> > New Revision: 794195
> >
> > URL: http://svn.apache.org/viewvc?rev=794195&view=rev
> > Log:
> > project create/update problem and some cleanup
> >
> > Modified:
> > ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
> > ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
> >
> > Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/
> > ProjectScreens.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=794195&r1=794194&r2=794195&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
> > (original)
> > +++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
> > Wed Jul 15 08:47:29 2009
> > @@ -89,7 +89,7 @@
> > <service service-name="getProject" result-
> > map="result">
> > <field-map field-name="projectId" from-
> > field="projectId"/>
> > </service>
> > - <set field="project" from-
> > field="result.projectInfo"/>
> > + <set field="projectInfo" from-
> > field="result.projectInfo"/>
> > </actions>
> > <widgets>
> > <decorator-screen name="CommonProjectDecorator"
> > location="${parameters.mainDecoratorLocation}">
> >
> > Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> > ProjectForms.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=794195&r1=794194&r2=794195&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> > ProjectForms.xml (original)
> > +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> > ProjectForms.xml Wed Jul 15 08:47:29 2009
> > @@ -19,25 +19,25 @@
> > -->
> > <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd
> > ">
> > - <form name="EditProject" type="single" target="updateProject"
> > default-map-name="project"
> > + <form name="EditProject" type="single" target="updateProject"
> > default-map-name="projectInfo"
> > header-row-style="header-row" default-table-style="basic-
> > table">
> > <actions>
> > <entity-one entity-name="PartyGroup" value-
> > field="partyGroup">
> > <field-map field-name="partyId" from-field="partyId"/>
> > </entity-one>
> > - <entity-and entity-name="WorkEffortPartyAssignment"
> > list="assigns" filter-by-date="true">
> > - <field-map field-name="workEffortId" from-
> > field="parameters.projectId"/>
> > + <entity-and entity-name="WorkEffortPartyAssignment"
> > list="workEffortPartyAssignments" filter-by-date="true">
> > + <field-map field-name="workEffortId" from-
> > field="projectInfo.projectId"/>
> > <field-map field-name="roleTypeId"
> > value="CLIENT_BILLING"/>
> > </entity-and>
> > - <set field="project.clientBillingPartyId" from-
> > field="assigns[0].partyId"/>
> > - <entity-and entity-name="WorkEffortPartyAssignment"
> > list="assignsOrg" filter-by-date="true">
> > - <field-map field-name="workEffortId" from-
> > field="parameters.projectId"/>
> > + <set field="projectInfo.clientBillingPartyId" from-
> > field="workEffortPartyAssignments[0].partyId"/>
> > + <entity-and entity-name="WorkEffortPartyAssignment"
> > list="workEffortPartyAssignments" filter-by-date="true">
> > + <field-map field-name="workEffortId" from-
> > field="projectInfo.projectId"/>
> > <field-map field-name="roleTypeId"
> > value="INTERNAL_ORGANIZATIO"/>
> > </entity-and>
> > - <set field="project.organizationPartyId" from-
> > field="assignsOrg[0].partyId"/>
> > + <set field="projectInfo.organizationPartyId" from-
> > field="workEffortPartyAssignments[0].partyId"/>
> > </actions>
> > - <alt-target use-when="project==null" target="createProject"/>
> > - <field use-when="project==null" name="templateId">
> > + <alt-target use-when="projectInfo==null"
> > target="createProject"/>
> > + <field name="templateId" use-when="projectInfo==null">
> > <drop-down allow-empty="true">
> > <entity-options entity-name="WorkEffort"
> > description="${workEffortName}" key-field-name="workEffortId">
> > <entity-constraint name="workEffortTypeId"
> > value="PROJECT_TEMPLATE"/>
> > @@ -49,8 +49,8 @@
> > <field name="workEffortId"><hidden value="${projectId}"/></
> > field>
> > <field name="projectName" parameter-name="workEffortName"
> > title="${uiLabelMap.ProjectMgrProjectName}*"><text/></field>
> > <field name="projectDescription" parameter-
> > name="description" title="${uiLabelMap.CommonDescription}"><text/></
> > field>
> > - <field use-when="project!=null" name="currentStatusId"
> > title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
> > entity entity-name="StatusItem" key-field-name="statusId"/></field>
> > - <field use-when="project==null"
> > name="currentStatusId"><hidden value="_NA_"/></field>
> > + <field name="currentStatusId" use-when="projectInfo!=null"
> > title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-
> > entity entity-name="StatusItem" key-field-name="statusId"/></field>
> > + <field name="currentStatusId" use-
> > when="projectInfo==null"><hidden value="_NA_"/></field>
> > <field name="clientBillingPartyId">
> > <lookup target-form-name="LookupPartyGroup">
> > <sub-hyperlink target="viewprofile" description="$
> > {partyGroup.groupName}">
> > @@ -80,10 +80,10 @@
> > </entity-options>
> > </drop-down>
> > </field>
> > - <field use-when="project!=null" name="estimatedStartDate"
> > title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display
> > description="${bsh:project.get("estimatedStartDate")!=null?
> > project
> > .get
> > ("
> > ;estimatedStartDate
> > ").toString().substring(0,10):"";}"/></field>
> > - <field use-when="project!=null"
> > name="estimatedCompletionDate" title="$
> > {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
> > description="${bsh:project.get("estimatedCompletionDate")!
> > =null?
> > project
> > .get
> > ("
> > ;estimatedCompletionDate
> > ").toString().substring(0,10):"";}"/></field>
> > - <field use-when="project!=null" name="actualStartDate"
> > title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
> > description="${bsh:project.get("actualStartDate")!=null?
> > project
> > .get
> > ("
> > ;actualStartDate").toString().substring(0,10):"";}"/
> > ></field>
> > - <field use-when="project!=null" name="actualCompletionDate"
> > title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
> > description="${bsh:project.get("actualCompletionDate")!
> > =null?
> > project
> > .get
> > ("
> > ;actualCompletionDate
> > ").toString().substring(0,10):"";}"/></field>
> > + <field use-when="projectInfo!=null"
> > name="estimatedStartDate" title="$
> > {uiLabelMap.FormFieldTitle_estimatedStartDate}"><display type="date"/
> > ></field>
> > + <field use-when="projectInfo!=null"
> > name="estimatedCompletionDate" title="$
> > {uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display
> > type="date"/></field>
> > + <field use-when="projectInfo!=null" name="actualStartDate"
> > title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display
> > type="date"/></field>
> > + <field use-when="projectInfo!=null"
> > name="actualCompletionDate" title="$
> > {uiLabelMap.FormFieldTitle_actualCompletionDate}"><display
> > type="date"/></field>
> > <field name="save" title="${uiLabelMap.CommonSave}"><submit/
> > ></field>
> > </form>
> > <form name="AddSubProject" type="single" target="AddSubProject"
> >
> >
>
--
Antwebsystems.com: Quality OFBiz services for competitive rates