Get the ecommerce Url within a java method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Get the ecommerce Url within a java method

Robert Gan
This post was updated on .
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
Reply | Threaded
Open this post in threaded view
|

Re: Get the ecommerce Url within a java method

Robert Gan
any ideas? :)
Reply | Threaded
Open this post in threaded view
|

Re: Get the ecommerce Url within a java method

Paul Piper
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.
Reply | Threaded
Open this post in threaded view
|

Re: Get the ecommerce Url within a java method

Robert Gan
perfect thank you, i searched a lot, but could not find it :)

great!
Reply | Threaded
Open this post in threaded view
|

Re: Get the ecommerce Url within a java method

Paul Piper
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
Reply | Threaded
Open this post in threaded view
|

Re: Get the ecommerce Url

Rishi Solanki
In reply to this post by Robert Gan
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. <[hidden email]> 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.
>