If you're using Sling API 2.2.0 you can put the session into the
authentication map:

map.put( "user.jcr.session", session);

and then call

getResourceResolver(map) on the ResourceResolverFactory.

Carsten

Alexander Klimetschek  wrote
> On 15.02.11 16:14, "sam lee" <[email protected]> wrote:
> 
>> Actually, I am writing Day CQ workflow:
>>
>> public void execute(WorkItem item, WorkflowSession workflowSession,
>> MetaDataMap map) throws WorkflowException {
>>
>> I get Session like:
>>
>> final Session session = workflowSession.getSession();
>>
>>
>> Maybe this is Day specific. I'll open a customer support ticket on Day
>> side.
> 
> Not really, workflows are a background scenario where you have no request
> and thus pre-defined resource resolver available.
> 
> Unless the Sling guys have a replacement for it (i.e. wrapping an existing
> jcr session), I would continue to use the JcrResourceResolverFactory at
> the moment.
> 
> Regards,
> Alex
> 


-- 
Carsten Ziegeler
[email protected]

Reply via email to