blaka
I'm new here

PathLookup

Hi,

After I've published a page with a picture I would like to request in java the url of that page/picture. I have seen some examples with PathLookup in FS 5.

Here we still use 4.2.489. Does anyone know how I can solve this within this version?


Thank you.

Labels (1)
0 Kudos
4 Replies
broszeit
I'm new here

Re: PathLookup

Hi

an url is created during the generation. So you can get the url in FirstSpirit 4.2R4 only during the generation.

The easiest way is to create a page which references all the needed PageRefs and stores their urls in xml for example.

But if it is important to get the urls in Java-code, you could use a script in the template by using CMS_RENDER. This script will run in the GenerationScriptContext which enables you to get the UrlCreatorProvider used by the ContentProducer#getUrl(...) method.

Regards

Rouven

blaka
I'm new here

Re: PathLookup

Hi,

The UrlCreator I have seen now. But I have a challenge as I call a workflow from data sources in Java and then a schedule entry for generation. So we need to find out how we can reach the GenerationScriptContext in this context instead of the WorkflowScriptContext.

Thank you.

0 Kudos
broszeit
I'm new here

Re: PathLookup

Hi

int the ScheduleContext the UrlCreator is stored in a property. This property is only set if a generate task was performed before the script-execution.

Afterwards you can receive the UrlCreator with this code: (source: https://community.e-spirit.com/message/11438#11438 )

context.getProperty(GenerateTaskExecutor.CONTEXT_KEY_URLCREATOR);

Regards

Rouven

0 Kudos
blaka
I'm new here

Re: PathLookup

Thanks, I will try this :smileygrin:

0 Kudos