Questions & Answers

SOLVED
zava
Elite Observer

urlCreatorProvider without context

Jump to solution

Hi Community,

anyone know how to get a urlCreatorProvider object without a "context" object.

I have with a remote connection a project and userservice objects.

best regards

Antonio

0 Kudos
1 Solution

Accepted Solutions
marro
Crownpeak employee

Ciao Antonio,

the easiest way to retrieve a url for a page is to use

refEle.getStoredUrl(lang, selectedTemplateSet, null);

But the page has to be generated once before with a SEO-UrlCreator (you can set the used UrlCreator within the GenerationTask properties of the schedule entry).

Best regards,

Donato

View solution in original post

0 Kudos
6 Replies
marro
Crownpeak employee

Ciao Antonio,

which FirstSpirit version do you use? And what would you like to do with the UrlCreatorProvider respectively a UrlCreator?

Tanti saluti

Donato

0 Kudos
zava
Elite Observer

Ciao Donato,

FS 5, I'm using a local class runned on eclipse with a remote connection to the server, in this case I not have a context obejct.

I need a urlCreatorProvider here

  String url = refEle.getUrl(urlCreatorProvider, lang, selectedTemplateSet, pageParams, UrlCreator.Mode.RELATIVE_URL.ordinal())

for testing purposes only.

Best,

Antonio.

0 Kudos
marro
Crownpeak employee

Ciao Antonio,

the easiest way to retrieve a url for a page is to use

refEle.getStoredUrl(lang, selectedTemplateSet, null);

But the page has to be generated once before with a SEO-UrlCreator (you can set the used UrlCreator within the GenerationTask properties of the schedule entry).

Best regards,

Donato

0 Kudos
zava
Elite Observer

Great,

sorry I dind't see the method... the page is already generated.

Saluti,

Antonio

0 Kudos

Hallo zusammen,

sorry, wenn ich den Thread nochmal ausgrabe.

Es geht ebenfalls um die URL Generierung fรผr Medien.

Wir holen uns die URL zu einem Medium via UrlCreator aus dem Generierungs-Context.

UrlCreator.getUrl(media, null, resolution, UrlCreator.ABSOLUTE_URL);

Das funktioniert soweit sehr gut.

Einziges Problem: Wir mรถchten einzig die URL zu dem jeweiligen Medium, ohne jedoch, dass beim Erfragen der URL dann auch direkt das Medium mit rausgeneriert wird.

Gibt es dafรผr eine Lรถsung, oder wird jedes รผber UrlCreator.getUrl erfragte Medium auch direkt mit deployt?

Beste GrรผรŸe und Danke schon mal im Voraus

Dominic

0 Kudos

Einziges Problem: Wir mรถchten einzig die URL zu dem jeweiligen Medium, ohne jedoch, dass beim Erfragen der URL dann auch direkt das Medium mit rausgeneriert wird.

Das ist korrekt, die Referenzierung innerhalb einer Generierung ist der Trigger dafรผr, das das entsprechende Medium generiert und deployed wird. Ein "opt out" dafรผr gibt es nicht. Ich empfehle dafรผr einen Feature-Request zu stellen.

Peter
0 Kudos

Type a product name