Hi Scott,

Thanks for the pointer. I think it should be on the money.... However after
some tweaking I got following error:

<p>Problems with the response writer&#47;output stream&#58;
 org.ofbiz.widget.screen.ScreenRenderException&#58;
 Error rendering screen
&#91;component&#58;&#47;&#47;profiler&#47;widget&#47;ProfilerPrintScreens.xml&#35;PrintProfilePDF&#93;&#58;
 groovy.lang.MissingPropertyException&#58; No such property&#58;
 EntityCondition for class&#58; ProfileExperiences &#40;No such
property&#58; EntityCondition for class&#58; ProfileExperiences&#41;
</p>


The complete code in the groovy file is:
import org.ofbiz.base.util.*;
import org.ofbiz.entity.*;
import org.ofbiz.entity.util.*;
import org.ofbiz.party.contact.*;
import javolution.util.FastMap;

List experienceItems = [];

profileOwnerId = profileSummary.profileOwnerId;
selectedExperiences = parameters.experienceSelected;

condList = [];
condList.add(EntityCondition.makeCondition("profileOwnerId",
profileOwnerId));
if (selectedExperiences) {
   condList.add(EntityCondition.makeCondition("experienceId",
EntityOperator.IN, selectedExperiences as List));
}
cond = EntityCondition.makeCondition(condList);
experienceItemList = delegator.findList("ProfileExperience", cond, null,
null, null, false);

if (experienceItemList) {
    experienceItemList.each { profileExperience ->
        experienceDesc = profileExperience.experienceDesc;
        experienceStartDate = profileExperience.experienceStartDate;
        experienceEndDate = profileExperience.experienceEndDate;
        experienceCustomerId = profileExperience.experienceCustomerId;
        experienceIndustryId = profileExperience.experienceIndustryId;
        experienceProjectId = profileExperience.experienceProjectId;
        experienceTaskId = profileExperience.experienceTaskId;
        experienceBackground = profileExperience.experienceBackground;
        experienceContext = profileExperience.experienceContext;
        experienceTask = profileExperience.experienceTask;
        experienceMethods = profileExperience.experienceMethods;
        experienceTools = profileExperience.experienceTools;

        Map experienceItemMap = FastMap.newInstance();
        experienceItemMap.putAll((Map) profileExperience);

        experienceItems.add(experienceItemMap);
    }
    context.experienceItems = experienceItems;
    }

Any suggestions?

Regards,

Pierre


2010/8/21 Scott Gray <scott.g...@hotwaxmedia.com>

> Hi Pierre,
>
> See my other response to Michal for the correct code, it was only from
> memory though so may not actually work without tweaking.
>
> Regards
> Scott
>
> On 21/08/2010, at 12:02 AM, Pierre Smits wrote:
>
> > Hi Scott,
> >
> > Thanks for the pointer!
> >
> > Unfortunately, I am a total groovy-newbie....
> >
> > Would
> > selectedExperiences = parameter.selectedExperiences;
> > if (selectedExperiences==""){
> >    experienceItemList = delegator.findByAnd("ProfileExperience",
> > [profileOwnerId : profileOwnerId]);
> >    }
> >    else{
> >    experienceItemList = delegator.findList("ProfileExperience",
> > [experienceId : selectedExperiences]);
> >
> >    }
> >
> > do the trick?
> >
> > Regards,
> >
> > Pierre
> >
> >
> > 2010/8/20 Scott Gray <scott.g...@hotwaxmedia.com>
> >
> >> Hi Pierre,
> >>
> >> You'll want to use delegator.findList(...) with an EntityOperator.IN
> >> condition for the experience field.
> >>
> >> Regards
> >> Scott
> >>
> >> HotWax Media
> >> http://www.hotwaxmedia.com
> >>
> >> On 20/08/2010, at 10:31 PM, Pierre Smits wrote:
> >>
> >>> In a url I pass following parameters:
> >>>
> >>> ?profile=10000&experience=10000,100010
> >>>
> >>> In a groovy file I get the parameters....
> >>> parameter.profile
> >>> parameter.experience
> >>>
> >>> My question is: how do I get the delegator to find entities in the
> >> database
> >>> based on both parameter.profile and parameter.experience?
> >>>
> >>> In all the other codes in groovy files that I see it seems that
> >> parameters
> >>> have only 1 value... Or I might be overlooking one...
> >>>
> >>> Regards,,
> >>>
> >>> Pierre
> >>
> >>
>
>

Reply via email to