You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "Robert G." <ga...@mercon24.de> on 2012/11/17 16:04:10 UTC

Get the ecommerce Url

Hey, I have a question:
I need to get the URL for Categories or products in a java method. I have
the categoryId or productId, is there a method to return the Url with these
information?

I know, I can build it by my self, but I want to avoid to change lots of
files, just in case when I change the name i.ex. "ecommerce" within the Url.
I also believe, that there has to be those functions allready implemented,
cause the application lives from Urls :)

Thanks in advance.

Robert



--
View this message in context: http://ofbiz.135035.n4.nabble.com/Get-the-ecommerce-Url-tp4637705.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Get the ecommerce Url

Posted by Rishi Solanki <ri...@gmail.com>.
Robert,
Please take a look into the CatalogUtlServlet.java static method
makeCatalogUrl.
Method will take request, productId, categoryId, prevCategoryId as
parameters and return the url.

You may need to need to pass combination of parameters as null and actual
values to get the results you want.

Rishi Solanki
Manager, Enterprise Software Development
HotWax Media Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxmedia.com


On Sat, Nov 17, 2012 at 8:34 PM, Robert G. <ga...@mercon24.de> wrote:

> Hey, I have a question:
> I need to get the URL for Categories or products in a java method. I have
> the categoryId or productId, is there a method to return the Url with these
> information?
>
> I know, I can build it by my self, but I want to avoid to change lots of
> files, just in case when I change the name i.ex. "ecommerce" within the
> Url.
> I also believe, that there has to be those functions allready implemented,
> cause the application lives from Urls :)
>
> Thanks in advance.
>
> Robert
>
>
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Get-the-ecommerce-Url-tp4637705.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Re: Get the ecommerce Url within a java method

Posted by Paul Piper <pp...@ilscipio.com>.
Yea - well, the trick is to look into the freemarkerTransforms in this case,
since within freemarker the function is used the most. 

Glad I could be of help. Cheers



--
View this message in context: http://ofbiz.135035.n4.nabble.com/Get-the-ecommerce-Url-within-a-java-method-tp4637705p4637821.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Get the ecommerce Url within a java method

Posted by "Robert G." <ga...@mercon24.de>.
perfect thank you, i searched a lot, but could not find it :)

great!



--
View this message in context: http://ofbiz.135035.n4.nabble.com/Get-the-ecommerce-Url-within-a-java-method-tp4637705p4637820.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Get the ecommerce Url within a java method

Posted by Paul Piper <pp...@ilscipio.com>.
Try:   CatalogUrlServlet.makeCatalogUrl(request, productId,
currentCategoryId, previousCategoryId);


Though I must admit it is probably a wrong location for the function and
should be moved to a CatalogUtil class.




--
View this message in context: http://ofbiz.135035.n4.nabble.com/Get-the-ecommerce-Url-within-a-java-method-tp4637705p4637819.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Get the ecommerce Url within a java method

Posted by "Robert G." <ga...@mercon24.de>.
any ideas? :)



--
View this message in context: http://ofbiz.135035.n4.nabble.com/Get-the-ecommerce-Url-within-a-java-method-tp4637705p4637818.html
Sent from the OFBiz - User mailing list archive at Nabble.com.