Re: svn commit: r931222 - in /ofbiz/trunk/framework/webtools/webapp/webtools: WEB-INF/actions/artifactinfo/ArtifactInfo.groovy artifactinfo/ArtifactInfo.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r931222 - in /ofbiz/trunk/framework/webtools/webapp/webtools: WEB-INF/actions/artifactinfo/ArtifactInfo.groovy artifactinfo/ArtifactInfo.ftl

Adam Heath-2
[hidden email] wrote:

> Author: lektran
> Date: Tue Apr  6 17:00:05 2010
> New Revision: 931222
>
> URL: http://svn.apache.org/viewvc?rev=931222&view=rev
> Log:
> Store the ArtifactInfo's Recently Viewed Artifacts list in the session as basic maps instead of ArtifactInfoBase objects that aren't serializable.
>
> Modified:
>     ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy
>     ofbiz/trunk/framework/webtools/webapp/webtools/artifactinfo/ArtifactInfo.ftl
>
> Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy?rev=931222&r1=931221&r2=931222&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy (original)
> +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy Tue Apr  6 17:00:05 2010
> @@ -49,15 +49,16 @@ if ("search".equals(parameters.findType)
>  }
>  
>  if (artifactInfo) {
> +    artifactInfoMap = [type : artifactInfo.getType(), uniqueId : artifactInfo.getUniqueId(), displayName : artifactInfo.getDisplayName()];

What is the ofbiz best practice for reading bean-type info?
artifactInfo.type, or artifactInfo.getType()?
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r931222 - in /ofbiz/trunk/framework/webtools/webapp/webtools: WEB-INF/actions/artifactinfo/ArtifactInfo.groovy artifactinfo/ArtifactInfo.ftl

Adam Heath-2
[hidden email] wrote:
> -    if (recentArtifactInfoList && recentArtifactInfoList.get(0).equals(artifactInfo)) {
> +    if (recentArtifactInfoList && recentArtifactInfoList.get(0).equals(artifactInfoMap)) {

Same here, recentArtifactInfoList[0] == artifactInfoMap.  Might be
able to do foo?[0] ==, but I haven't tried that.

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r931222 - in /ofbiz/trunk/framework/webtools/webapp/webtools: WEB-INF/actions/artifactinfo/ArtifactInfo.groovy artifactinfo/ArtifactInfo.ftl

Scott Gray-2
In reply to this post by Adam Heath-2
On 6/04/2010, at 11:04 AM, Adam Heath wrote:

> [hidden email] wrote:
>> Author: lektran
>> Date: Tue Apr  6 17:00:05 2010
>> New Revision: 931222
>>
>> URL: http://svn.apache.org/viewvc?rev=931222&view=rev
>> Log:
>> Store the ArtifactInfo's Recently Viewed Artifacts list in the session as basic maps instead of ArtifactInfoBase objects that aren't serializable.
>>
>> Modified:
>>    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy
>>    ofbiz/trunk/framework/webtools/webapp/webtools/artifactinfo/ArtifactInfo.ftl
>>
>> Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy?rev=931222&r1=931221&r2=931222&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy (original)
>> +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/artifactinfo/ArtifactInfo.groovy Tue Apr  6 17:00:05 2010
>> @@ -49,15 +49,16 @@ if ("search".equals(parameters.findType)
>> }
>>
>> if (artifactInfo) {
>> +    artifactInfoMap = [type : artifactInfo.getType(), uniqueId : artifactInfo.getUniqueId(), displayName : artifactInfo.getDisplayName()];
>
> What is the ofbiz best practice for reading bean-type info?
> artifactInfo.type, or artifactInfo.getType()?
I thought about using it briefly but figured it may just confuse people who aren't familiar with groovy.  I don't think we really need a best practice for something so minor.


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r931222 - in /ofbiz/trunk/framework/webtools/webapp/webtools: WEB-INF/actions/artifactinfo/ArtifactInfo.groovy artifactinfo/ArtifactInfo.ftl

Scott Gray-2
In reply to this post by Adam Heath-2
On 6/04/2010, at 11:05 AM, Adam Heath wrote:

> [hidden email] wrote:
>> -    if (recentArtifactInfoList && recentArtifactInfoList.get(0).equals(artifactInfo)) {
>> +    if (recentArtifactInfoList && recentArtifactInfoList.get(0).equals(artifactInfoMap)) {
>
> Same here, recentArtifactInfoList[0] == artifactInfoMap.  Might be
> able to do foo?[0] ==, but I haven't tried that.

I'm not sure if that would work, the safe navigation operator is ?. not just ? which I think it might confuse with part of a ternary operation.
I know groovy has a ton of useful stuff but I just don't use it often enough to get comfortable with most of them.

smime.p7s (3K) Download Attachment