How to get SEO url in java

Hi
My requirement is to generate a product feed which has its product url as one of the fields.
Now does anybody know how to get the SEO url of a product in a java file.
I know form front end we generate it via ItemLinkDroplet.
But is there a way i can generate it in my java class?
Thanks

Assuming you have used ATG SEO Repository and ATG DirectUrlTemplate and IndirectUrlTemplate etc..for SEO URL generation.
Now, create a standalone jsp, example, seolinkbuilder.jsp.
Let it take following parameters,
productId
categoryId
brandId
siteId
and any other ids as needed by your application.
Suppose you just needed SEO url for a given product id.
/contextpath/seolinkbuilder.jsp?productId=12345
The JSP would contain a droplet which would construct a SEO url and set it as oparam which can be written to JSP.
Finally, from an independent JAVA program, using Apache HTTPClient API, call seolunkbuilder.jsp by passing productId. Read the response for SEO url.
Let me know if you have further questions.

Similar Messages

  • How to get full URL in java?

    Hi,
    I am working in a spring & hibernate project. For the AJAX request to bookmark, I used RSH (Really Simple Framework) framework. So, my URL changes for the AJAX request as
    http://localhost:8080/courses#/medicaltranscription/cardiology
    If I bookmark this and open in a new window, I can’t get full URL in Servlet. If I use methods in Servlet, it gets only, upto http://localhost:8080/courses. I can’t get the whole URL. Please, help me to find a solution.
    Thank you

    The hash part is entirely client side. You cannot get it on the server side. You need to pass it as request parameter or as part of real URL.

  • How to get browser URL

    Dears
    We are working with system with 2 application server IPs and one Real IP (which is able to be accessed through internet)
    I would like to know the URL is the user using in order to use his IP to open something else from the system.
    Chcking the host name not usesful because if user connect from home using Real IP it return the AS host name which real IP redirct to it.
    I need to know how to get the URL of the session from the form or to know whether the user connected using the Real IP or not.
    (Oracle forms 10gR2)

    I think you can get a URL from/with a PJC (java pluggable component) from/with IHandler interface..
    Try this bean.. You have a property with name HOST_URL.. (with some modification you can also read applet parameters).. (I have done this now but I have not jet tested it)....but I thik this should work...
    You have also other parameters to get client IP addres and hostname...
    package in2.client;
    import java.io.PrintStream;
    import java.net.InetAddress;
    import oracle.forms.handler.IHandler;
    import oracle.forms.properties.ID;
    import oracle.forms.ui.VBean;
    public class ClientInfo extends VBean
      private static final ID CLIENT_IP = ID.registerProperty("CLIENT_IP");
      private static final ID CLIENT_NAME = ID.registerProperty("CLIENT_NAME");
      private static final ID CLIENT_OS = ID.registerProperty("CLIENT_OS");
      private static final ID CLIENT_USER = ID.registerProperty("CLIENT_USER");
      private static final ID HOST_URL = ID.registerProperty("HOST_URL");
      private IHandler mHandler;
      private String hostAddress = "";
      private String hostName = "";
      private String hostOs = "";
      private String hostUser = "";
      private String hostURL = "";
      public ClientInfo()
        try
          System.out.println("+----------------------+");
          System.out.println("+  ClientInfro PJC     +");
          System.out.println("+  Peter Valencic      +");
          System.out.println("+----------------------+");
          System.out.println("+Dat spr: 10.09.2007   +");
          System.out.println("+Dat spr: 04.07.2008   +");
          System.out.println("+Dat spr: 10.07.2008   +");
          System.out.println("+Dat spr: 15.11.2010   +");
          System.out.println("+----------------------+\n");
          this.hostAddress = InetAddress.getLocalHost().getHostAddress();
          this.hostName = InetAddress.getLocalHost().getHostName();
          this.hostOs = System.getProperty("os.name");
          this.hostUser = System.getProperty("user.name");
          System.out.println("Host   adress: " + this.hostAddress);
          System.out.println("Host     name: " + this.hostAddress);
          System.out.println("Host op. syst: " + this.hostOs);
          System.out.println("Host username: " + this.hostUser);
          System.out.println("+----------------------+\n");
        catch (Exception e)
          System.out.println("Napaka pri inicializaciji beana: " + e.toString());
      public void init(IHandler handler)
        super.init(handler);
        this.mHandler = handler;
      public Object getProperty(ID pid)
        if (pid == CLIENT_IP) {
          System.out.println("Client IP: " + this.hostAddress);
          return "" + this.hostAddress;
        if (pid == CLIENT_NAME) {
          System.out.println("Client Name: " + this.hostName);
          return "" + this.hostName;
        if (pid == CLIENT_OS) {
          System.out.println("Client os: " + this.hostOs);
          return "" + this.hostOs;
        if (pid == CLIENT_USER) {
          System.out.println("Clientuser: " + this.hostUser);
          return "" + this.hostUser;
        if (pid == HOST_URL) {
          hostURL = this.mHandler.getApplet().getDocumentBase();
          System.out.println("Host Url: " + this.hostURL);
          return "" + this.hostURL;
        return super.getProperty(pid);
    }

  • How to generate SEO URLs in ATG 10.0.1..?

    how to generate SEO URLs in ATG.. pls explain how it works..?
    Thanks in advance,
    Vishnu & Nithin Kayithi

    There are different ways of doing SEO and generate crawler friendly URLs. Go through with the following to understand SEO options provided in ATG and proceed with whichever is matching with your requirements:
    http://docs.oracle.com/cd/E35318_02/Platform.10-1-1/ATGPlatformProgGuide/html/s1501searchengineoptimization01.html

  • How to get Target URL

    Hallo,
    In my Dynpage portal application.I use 3 Jsp's.One of the Jsp having a Iframe element.This iframe source is an External HTTP address.In the source tag i have to supply the Results frame as some Iframe name and result-url as my 3rd jsp url,so that i can unpack the XML and process the data.
    All the 3 Jsp's are in /pagelet/ folder.Does anybody know how to get the url for the Jsp inside the pagelet folder.
    Further more pagelet folder is private folder,will it be a problem for the external website to post the result to this private /pagelet/3rd.jsp.
    Example src tag for Iframe
    http://demo.mygraphics.nl/nbgint/NBG_INT_main.asp?action=CHART&datas
    ource=NBGMV&product=INTERNET&size_x=300&size_y=300&result_frame=Results&
    result_url="Here i have to give my 3rd jsp url"&defa
    ult_centre_x=256000&default_centre_y=471000&default_width=0.5

    Hi gaurav,
    You are right,it is Jspdynpage.I have already read about the Urlgenerator that it can generate url's only for components and pages.So i have created 2 components in one PAR but havent tested yet.
    Anyway thanks for your reply.
    I have tested it and it works fine.Here is the code
          try {
              IUrlGeneratorService urlGen = (IUrlGeneratorService) PortalRuntime.getRuntimeResources().getService(IUrlGeneratorService.KEY);
             IPortalUrlGenerator portalGen = null;
                                    ISpecializedUrlGenerator specUrlGen = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);
                                    if (specUrlGen instanceof IPortalUrlGenerator) {
                                         portalGen = (IPortalUrlGenerator) specUrlGen;
                                         // generate Component Url
                                         try {
                                              String url = null;
                                              url = portalGen.generatePortalComponentUrl(request,"NewUrlProj.NewUrlComp");
                                              HttpServletRequest srq = request.getServletRequest();
                                              String vorUrl = srq.getScheme()"://"srq.getServerName()":"srq.getServerPort();
                                            myBean.setUrl(vorUrl+url);
                                         } catch (NullPointerException e) {
                                              myBean.setErrorMsg("Unexpected Nullpointer. This should not happenend, but it did! Something must have gone wrong :-(");
           catch(Exception e){
              myBean.setErrorMsg(e.getLocalizedMessage());
    Message was edited by: Baskaran Senthivel

  • How to get php content with java ??

    i have made a php file what will display a number,
    here's a example
    <?php
    if ($action == "answer"){
    echo "18274926";
    ?>
    no i want to get the number with java
    so here's my java code
    import java.io.*;
    import java.net.*;
    import java.util.Date;
    class URLConnecties
        public static void main(String args[]) throws Exception
            int teken;
            URL url = new URL("http://www.gamer.mineurwar.nl/net/javachallenge.php?command=DaTe");
            URLConnection urlconnection = url.openConnection();
            System.out.println("Type inhoud: " +
                urlconnection.getContentType());
            System.out.println("Datum document: " +
                new Date(urlconnection.getDate()));
            System.out.println("Laatst gewijzigd: " +
                new Date(urlconnection.getLastModified()));
            System.out.println("Document vervalt: " +
                urlconnection.getExpiration());
            int lengteinhoud = urlconnection.getContentLength();
            System.out.println("Lengte inhoud: " + lengteinhoud);
            if (lengteinhoud > 0) {
                InputStream in = urlconnection.getInputStream();
                while ((teken = in.read()) != -1) {
                    System.out.print((char) teken);
                in.close();
    }if you change the url ro a .html file it displays the code correctly(source),
    but when trying to get the content of a php file (the number)
    it says that there is no content from the php file
    yhe source of the original php file what's in the code can be found at
    www.gamer.mineurwar.nl/net/javachallenge.txt

    The 'content' is generated dynamically by a PHP script so the "content lenght" can't be known in advance by the server. For this reason connection.getContentLenght() returns -1; it doesn't mean that there is no content, only that it can't be known how much there will be.
    To solve the issue, remove the if statement from around the while-loop:// if (lengteinhoud > 0) { DELETE THIS LINE
    InputStream in = urlconnection.getInputStream();
    while ((teken = in.read()) != -1) {
        System.out.print((char) teken);
    // } and this too

  • How to get the URL of an iView using AbstractPortalComponent

    Hi All,
    I need to get the URL of an iView using AbstractPortalComponent using the following code.
    But i am unable to open the URL from the Browser
    This is the following code snippet
    public class AbsClass extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    IPortalComponentURI componentURI = request.createPortalComponentURI();
    componentURI.setContextName("pcd:portal_content/LOG_Viewer/LogViewer");
    String URI=componentURI.toString();
    response.write(URI);
    The output i got from the browser is:
    /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fLOG_Viewer!2fLogViewer
    Actual Path: pcd:portal_content/LOG_Viewer/LogViewer
    Output Path: /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fLOG_Viewer!2fLogViewer
    Why some extra numerics are embeded in the output path when compare with the Actual Path.
    Can any one send me the modified code and your suggestions, how to achieve this problem.
    Regards
    Phani

    Hi,
    Now i need to get the URL of this component.
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentURI componentURI = request.createPortalComponentURi();
    componentURI.setContextName("com.sap.portal.appintegrator.sap.bwc.Transaction");
    String URI=componentURI.toString();
    response.write(URI);
    I export this component into Portal and i tested with an iView based on this par file, i got the URL in the Preview.
    But when i tried to run this URL by adding the http://<IPADDRESS>:<PORTNO>+URL
    I am facing one AccessDenied Exception for this Object. ( USER/GUEST)
    Is there any security zone, or other Permissions Problem, if so can you plz guide me what are the settings i have to change inorder to resolve this exception
    Regards
    Phani

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

  • How to get the parameter from Java Script into the Parameter crystal Report

    Hi All,
    Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
    My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
    FYI.
    Java script sends the right parameter value.There is no issue in java script.
    This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • How to get page URL in a dynamic page in 10.1.4?

    Does anyone know how to get the page URL in a Dynamic Page in 10.1.4 without using javascript.
    I know that you can use a PL/SQL portlet and the portlet_record, but this is specifically for a Dynamic Page.
    Regards
    Jenny

    Hi,
    I am trying the suggested approach in 10.1.4 but unfortunatley I get the following error:
    PLS-00302: component 'SHOW_INTERNAL' must be declared
    In my Dynamic Page I have the following code
    htp.p(cms_context.urlpage);
    In the '... before displaying the page' I have the following
    schema_name.cms_context.urlpage := schema_name.dynamic_page_name.show_internal.p_page_url;
    Can anyone help?
    Cheers
    Chris

  • How to get rid of the java update virus?

    Everytime i go on a web page something pops up saying to install Java Runtime Environment in order to web content and it gives me the option to click more info (to go to the page to download the Java Runtime Environment) OR ok. Before i clicked ok until it continued to pop and and began to annoy me so i decided to install it. It still pops up and won't go away. I found out it is a virus and i don't know how to get rid of it.
    PLEASE HELP!

    Most likely, you have a web plugin that depends on the Java runtime distributed by Apple, such as the Facebook video calling plugin or the "NexDef" plugin for watching baseball streams. If you no longer need the plugin, remove it. Otherwise, install Java.

  • How to get rid of the java icon on the window

    There is a java icon(top right habd corner) on every window panel.
    How to get rid of it?

    What r u using, AWT r JAVA Swing? would please explain
    ur problem clearlyLOL. No offense, but you might consider phrasing your responses clearly as well...
    r == "are" || r == "or" || r == "argh" :o)
    &#167;

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • How to get printer IPAddress using java code

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

  • How to get stylesheet object from JAVA RESOURCE stored in DB

    Hi,
    I stored a xslt file in the database and have a JAVA RESOURCE file now. How can i get a stylesheet object from this resource file?
    I took the following class to get an impression how to get the contents of the resource but -although the name of the resource was spelled correctly- i got a file not found exception.
    Whats wrong?
    public class PrintRessource {
    public static void print (String p_ressource){
    try {
    Class c = PrintRessource.class;
    System.out.println(c.toString());
    InputStream file = c.getResourceAsStream(p_ressource);
    if (file == null)
    throw new FileNotFoundException("XSLT file not in DB");
    byte[] buffer = new byte[4096];
    int bytes_read;
    while ((bytes_read = file.read(buffer)) != -1)
    System.out.println(new String(buffer, 0 , buffer.length));
    catch (Exception exp) {
    System.out.println(exp);
    Thanks

    The code works as is. I just forgot to add the slash in front of the Resource file name.

Maybe you are looking for

  • Restore file to a different folder than original?

    Hi I work with a lot of password protected word documents (can't be viewed in quick look)... and often want to look at the changes that are made with previous versions. Is there a way to be able to restore time machine backups to a different folder s

  • Officejet Pro 8500 does not print

    This 8500 is the 4th HP printer that I have owned.  Absolutely the worst printer ever.  It quits printing, but will not tell you why.  Print or copy using the scanner and I get no black ink.  Just a blank page with no error message.  Put in new ink,

  • Lost printing from iPad with B210a

    Lost iPad printing capability on B210a after cartridge change; worked perfectly before.  Using airport router tied to a Zytel router, iPad Bluetooth disabled. No problem with IMac printing over same wireless network immediately following failed iPad

  • ACR VS RAW Developer for image detail

    I am an avid/loyal ACR fan who makes mural sized landscape prints from digital capture.  I keep hearing on various forums how Raw Developer (Mac) is the best out there for extracting every ounce of discernable detail from a raw file to a print.  I am

  • IBook G4 spits out DL DVD's

    I burned a Verbatim DL DVD-R, works fine on my MacBook. But my iBook ejects the DVD after 5 seconds or so.