PathLookup
Author: blaka
Publication Date: 10/23/2013 9:40
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.
-
Author: broszeit - 10/24/2013 10:14
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
0 -
Author: blaka - 10/29/2013 6:06
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 -
Author: broszeit - 10/29/2013 8:48
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 -
Author: blaka - 11/1/2013 6:48
Thanks, I will try this :smileygrin:
0
Please sign in to leave a comment.
Comments
4 comments