Use WebDynpro JCO Destination in Abstract Portal Component

Hello,
I was wondering if it is possible to use a WebDynpro JCo Destination in an Abstract Portal Component? I have a portal component that make as JCO call to run an rfc. I get the MYSAPSSO2 ticket from the cookie and pass this in to the JCO client. This works fine. Now I need to be able to run this for anonymous users as well. I was hoping to be able to retrieve a WebDynpro JCo destination that is set up as a userid/password type and use this to make the connection to run my RFC. This way I could avoid having to store the userid and password somewhere and encrypt/decrypt  it etc...
Thanks,
Bert

Yes Asusha
You can use JSP , JSPDyn pages in Abstract portal component.
You can call a Jsp file from the abstract portal component.
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
     com.sapportals.portal.prt.resource.IResource somePage =          
               request.getResource("jsp", "pagelet/test.jsp");
               response.include(request, somePage);
Then you can made your desired UI in JSP.
Hope this helps..
Cheers
Chinmaya
Reward for helpful answers

Similar Messages

  • How to use UI elements in abstract portal component

    hi all
    i am new to portal development..i want to use different UI elements such as textbox,buttons using abstract portal component.can anyone telme how to use them.

    Yes Asusha
    You can use JSP , JSPDyn pages in Abstract portal component.
    You can call a Jsp file from the abstract portal component.
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
         com.sapportals.portal.prt.resource.IResource somePage =          
                   request.getResource("jsp", "pagelet/test.jsp");
                   response.include(request, somePage);
    Then you can made your desired UI in JSP.
    Hope this helps..
    Cheers
    Chinmaya
    Reward for helpful answers

  • Event Handling in Abstract Portal Component

    Hi Friends,
    I am using HTMLB Classlib in an Abstract Portal Component to develop a Dropdownlistbox. Now I want to handle the event of change of selection in this dropdown. However, this event is not getting captured. Sample code is as follows:
    public class dropdownsimple extends AbstractPortalComponent
                           public void onClick(Event event)
                           public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
                                                    IPageContext myContext1 = PageContextFactory.createPageContext(request, response);
              Form myForm = myContext1.createFormDocument("CRMForm");
              GridLayout myGrid = new GridLayout();
              DropdownListBox drp = new DropdownListBox("drp");
              drp.addItem("Key 1","Item 1");
              drp.addItem("Key 2","Item 2");
              drp.setOnSelect("onClick");
                                                     myGrid.addComponent(1, 1, drp);
              myForm.addComponent(myGrid);
              myContext1.render();
    I am able to see the dropdown box along with values when I preview the PAR iView created from this component. Please let me know how to capture the event of change of selection in the dropdown?
    Edited by: Shetul Chothani on Jun 21, 2011 6:37 AM

    Hi,
    Change this line
    drp.setOnSelect("onClick");
    to
    drp.setOnSelect("click");
    and leave the line
    public void onClick(Event event)
    as it is, and it should work just fine.
    I.e., if you name your event "fooBar", the event handler should be named "onFooBar"
    Cheers,
    Robin

  • Urgent Please help me... How to access BAPIs from abstract portal component

    I am developing an application in Abstract Portal Component (in
    PDK).
    In that application I can able to acess BAPIs from my Componets
    using the code like
    inputPopSearchBapi = new Zad_Bapi_Pop_Search_Form_Input();
    outputPopSearchBapi = new Zad_Bapi_Pop_Search_Form_Output();
    popSearchBapi = new DropBox_PortType();
    colorList = new Tjj12Type_List();
    inputPopSearchBapi.setIm_Agencyid("0010000001");
    try {
    jcoClient.connect();
    outputPopSearchBapi =
    popSearchBapi.zad_Bapi_Pop_Search_Form(inputPopSearchBapi);
    colorList = outputPopSearchBapi.get_as_listIt_Color();
    request.getComponentContext().putValue("color",colorList.iterat
    or());
    jcoClient.disconnect();
    But I am not able to Access the data that is comming from the
    BAPI in my JSP Page. Pleeeeeeease help me. If you want any
    clarification about my problem then ask for further
    clarifications

    Hi,
      You can refer this link, to connecting the BAPI from Abstract Portal Component <a href="http://www.huihoo.org/openweb/jco_api/com/sap/mw/jco/JCO.html">JCo Tutorial1</a>
    <a href="http://www.apentia-forum.de/viewtopic.php?t=1962&sid=9ac1506bdb153c14edaf891300bfde25">JCo Tutorial2</a>
    With Regards,
    Venkatesh. K
    /* Points are Welcome */

  • Reading Session Variables in Abstract Portal Component/ JSP Dynpage or Java

    Hi All,
    I have a web dynpro for Java component which passes parameters in a session and also navigates to a Java application.
    Now when I try to read the session parameters in the Java application (JSPDynpage or Abstract Portal Component) I cannot retrieve the values.
    Can someone throw light on how I can achieve this within a Java application.
    Code is as enclosed below -
    WD for Java Code
      public void onActionClicked(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionClicked(ServerEvent)
    IClientSession session = Utils.getCurrentClientSession();
    IScope scope = session.getScope();
    scope.put("TestSession", wdContext.currentContextElement().getTxtValue());
    WDPortalNavigation.navigateAbsolute(
    "ROLES:portal_content/com.be.pct.cr.Test/DynProToNet",
    WDPortalNavigationMode.SHOW_INPLACE,
    (String)null,
    (String)null,
    WDPortalNavigationHistoryMode.NO_DUPLICATIONS,
    (String)null,
    (String)null,
    (String)null);
        //@@end
    Code within the Abstract Portal Component doContent method is -
    IPortalComponentSession ses;          
    ses = request.getComponentSession();
    String TestSession = new String();
    String sTest = new String();
    String sTesting = new String();
    if(ses.getValue("TestSession")!= null){
    TestSession = ses.getValue("TestSession").toString();
    if(request.getParameter("TestSession")!= null){
    sTest = request.getParameter("TestSession");
    if( request.getValue("TestSession")!= null)
    sTesting = request.getValue("TestSession").toString();
    response.write("Display"TestSessionsTest+sTesting);
    Any help is highly appreciated.
    Thanks in advance,
    Divya

    Hi,
      Why not use eventing between webdynpro and portal applications? That would be more easy. Check these documents.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60d7d690-0201-0010-e581-9c4fc69cec0e
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d48eaa90-0201-0010-58a8-887fc8632c3c
    Regards,
    Harini S

  • Difference between Abstract portal Component and JSPDyn page.

    Hi Experts,
    What is the difference between Abstract portal Component and JSPDyn page.
    Thanks,
    Jay.

    Hi,
    The PDK provides two methods for creating a portal component:
    Abstract Portal Component
    The Abstract Portal Component class offers a lean method for writing HTML commands to the Web client as well as for basic event handling. It is an implementation of the IPortalComponent, which is the central abstraction of the Portal Component API.
    DynPage
    The Page Processor Component, which extends the Abstract Portal Component, returns a DynPage. It provides more sophisticated event handling. Controls that produce events (such as buttons and checkboxes) have an event attribute that contains the name of the event handling method. This event handling method is invoked by the DynPage when it occurs.
    The JSPDynPage is an implementation of the DynPage and allows the use of the DynPage in combination with JSP (Java Server Pages).
    The PDK documentation and examples focus on the DynPage. Easier event handling and the separatation of content development (JSP) from application development (Java) make the DynPage a better choice for components with interaction and changing content.
    For more details, Refer thes thread,
    https://fortress.wa.gov/dop/portal/irj/portalapps/com.sap.portal.pdk.basic.portalcomponentimplementation/docs/jspdynpage.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0b3e9d5-b2af-2a10-20ba-9f6ce6b1a27f
    Hop it helps..
    GS
    Edited by: Sathishkumar GS on Apr 14, 2008 2:07 PM

  • Stop/Kill a Abstract portal component

    Hi All,
    I am working on EP 7.0 version.
    I have created a Abstract Portal component and uploaded the par file using Portal Archive tool.
    I ran the component by executing the url as below:
    http://<hostname>:<Port no>/irj/servlet/prt/portal/prtroot/Parfilename.ComponentName.
    The componet is having a bug and it is running in an infinite loop.
    Please let me know how to stop/kill this component as its logging some statements infinitely.
    Thanks in Advance,
    -Pavan

    Hi,
    You'll need to restart the server.
    Regards,
    Alex

  • Machines with same Hostnames overwrite WebDynpro JCo Destinations (SLD)

    Hello,
    we are working with NWDI and virtualized Developer Workplace Machines (on VMWare Images). By this, all Developer Workplace machines have the same hostname. This works fine until teams start developing with Webdynpro JCo Destinations (i.e. for Adaptive RFC).
    This is what I think what I figured out what is going on:
    - Webdynpro JCo Destinations are managed on the configured SLD (in our case the NWDI SLD)
    - SLD identifies the JCo Destination by hostname and destination name
    - JCo Destinations are communicated from host to SLD, even though the SLD Data Supplier is configured only for reading SLD content
    In our environment with all developer workplaces having the same hostname, we have the effect, that all devlopers workplaces MUST work with the same JCo Destination. Each time a developer updates the destination for his workplace, this update is written to SLD and therefore the destination of all other workplaces is changed as well.
    So my question is: Is there any option to stop developer workplaces writing their JCo Destinations to the central SLD without loosing the functionality to read other CIM Data from their (Name Reservation, Tehcnical System Landscape) ?
    We are operating Developer Workplaces on following Releases: 6.40 SP15, 6.40 SP17, 7.00 SP12 and 7.10 SP5.
    Any help appreciated,
    Stefan

    Hi Stefan
          As of now we are using Content Administrator to manage and maintaing the JCO destinations to the systems which are configured in SLD.
          If you eliminate this jco destinations or if you want to decide not to use these JCOs ,You have option with JCO API.
    Manually you need to code in your programs to connect any R/3 System.As there is no option to maintain JCO destinations other than Content Admin with SLD configured with land scape.
    Regards
    Kalyan

  • Writing HTML tags in Abstract Portal Component?

    Hi,
    I am trying to write some HTML tags in an Abstract Portal Component and I am facing problem to write  "/"
    Pls. let me know if there is any escape character or any other way of printing a "/" in a tag like as follows....
    response.write("</td>")
    <b>New Addition:</b>
      SORRY ... WE CAN Write </td> without any problem ..
      Due to some error on the top of the program this is wrongly shown...
    Thanks 
    Mrutyunjay
    Thanks & Regards
    Mrutyunjay

    Hi Nari,
    Follow the below steps:
    1. Store your properties files (test.properties, test_en.properties, test_xx.properties where xx is the locale ) in the folder PORTAL-INF ->Private ->classes
    2. In portalapp.xml for component-config, add this
    <property name="ResourceBundleName" value="test"/>
    3. In your abstract portal component you can use the below code to fetch the value for the key "SERVER_NAME".
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
             ResourceBundle resourceBundle = request.getResourceBundle();
             if(resourceBundle!=null)
                  response.write(resourceBundle.getString("SERVER_NAME"));
             else
                  response.write("Error");
    Let me know if you still face any issue.
    Thanks
    Prashant

  • Read properties file in abstract portal component

    Hi,
    i have test.properties file, i want to read information on this file and its located in src.api/properties . if any one knows How to read this  properties file in abstract portal component please tell me.
    Regards,
    nari.

    Hi Nari,
    Follow the below steps:
    1. Store your properties files (test.properties, test_en.properties, test_xx.properties where xx is the locale ) in the folder PORTAL-INF ->Private ->classes
    2. In portalapp.xml for component-config, add this
    <property name="ResourceBundleName" value="test"/>
    3. In your abstract portal component you can use the below code to fetch the value for the key "SERVER_NAME".
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
             ResourceBundle resourceBundle = request.getResourceBundle();
             if(resourceBundle!=null)
                  response.write(resourceBundle.getString("SERVER_NAME"));
             else
                  response.write("Error");
    Let me know if you still face any issue.
    Thanks
    Prashant

  • Page Imports in Abstract Portal Component

    Hi,
    I have created an abstract portal component where I have called a JSP using IResource.
    The JSP is called and displayed.
    <%@ page import = "java.util.*;" %>
    <%@ page import = "com.sapportals.portal.prt.component.*;" %>
    <html>
    <body>
    hello
    </body>
    </html>
    In my JSP the moment I add the second import i.e. prt.runtime, it throws an error when I run the application:
    Error when rendering jsp.
    Am I missing out something?

    Hi Prem,
    Add that particular jar file in the lib folder of your application and also add it to the build path of your project properties.
    <b>Project -> Properties -> Java Build Path -> Libraries</b>
    Add to this build path as well.
    I hope this helps you.!!
    Regards
    Pravesh
    PS: Please consider rewarding points if solved and helpful.

  • Redirecting to external website from abstract portal component?

    Hi,
    I have developed an abstract portal component and trying to be redirected to an external website ex : www.google.com
    here is the code...
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    HttpServletRequest req = request.getServletRequest();
    String queryString = req.getQueryString();
    String redirectURL = queryString.substring(queryString.indexOf("=")+1);
    HttpServletResponse resp = request.getServletResponse(true);
    resp.sendRedirect(redirectURL);
    OR
    RequestDispatcher rd = req.getRequestDispatcher("www.google.com");
    rd.forward(req, resp);
    But couldn't able to redirect in either ways ..
    exception was ... iView not found: www.google.com.
    Any help?
    Thanks
    MMK

    Hi Mohan,
    When you do a redirect you need to provide a URL. From javadocs
    Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container will convert the relative URL to an absolute URL before sending the response to the client.
    Thus when you provide just "www.google.com" the converted complete URL will be something like http://portalserver/irj....www.google.com whcih of course does not exist as a portal component. Thus you get the error iview not found.
    Hence you need to give a full URL and not a relative URL.
    Akhilesh

  • Access KeyStoreManager within an Abstract Portal Component

    Hi together,
    we have a X.509 compliant certificate located in the keystore on the j2ee engine.
    The private key is used to create the digital signature on the ticket content.
    We need to transfer user credentials to an external portal. This portal only supports SHA1 with RSA. The key-pair was created with the RSA algorithm.
    The problem is following:
    I need to use an Abstract Portal Component. It is no problem to get all the needed user credentials.
    But i don´t have a clue how to get to the certificate for singing the ticket content with RSA/SHA1.
    I have already read the help on http://help.sap.com/saphelp_nw04/helpdata/en/a4/d0201854fb6a4cb9545892b49d4851/frameset.htm , but it did not work.
    Has anyone of you specialists a solution for this problem?
    If you need more details, don´t hesitate to ask
    Thanks in advance

    Perhaps I can do it with
      public void doOnNodeReady(IPortalComponentRequest request){
        request.redirect("http://www.google.de");
    But like in this Tread, it didn't work AbstractPortalComponent and doOnNodeReady

  • Problem accessing webservice from abstract portal component

    Hi,
       I have created a webservice from a portal service.  So i have created one more portal application to accessing that web service.  In that, i have done the following:
    -> Portal Service from Wsdl file - Client Side
    -> I have entered the Wsdl file name as, the location of the WebService
    -> I have selected the methods what i want to use in my application
    -> Finally i have given my ServiceName, Alias and Package as well.
    -> I have created one application object (Abstract Portal Component) to access the Web Service.
    -> Inside that AbstractPortalComponent, i have written the coding to access the methods.
    -> I have created one system with System Alias, i used this Alias name in my portalapp.xml
    While running it shows the error as,
                        <b>com.sapportals.portal.prt.service.ServiceException: Service not found: com.sap.portal.prt.soap.Alias</b>
    Help me in this, Thanks in Advance.,
    With Regards,
    Venkatesh.K.

    Hi venkatesh I ahve similar problem please could you share with us how did you sort out this error?
    Sreekanth

  • Adding UI elements to Abstract Portal Component??

    Hi,
    I want to create an abstract portal component in PDK with a textarea and a submit button..On clicking the submit button I want to store the textarea content in a file..So can anyone provide me the solution to this soon??
    Regards,
    Udit

    Hi Udit,
    take a look at
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/ce/e0a341354ca309e10000000a155106/frameset.htm">this</a>
    example.
    Mofify the OutputSuccessText.jsp in away, that it will not print the given text to the screen but stores it in a file. This can be done with standard java coding.
    HTH,
    Carsten
    P.S.: Please consider rewarding points for useful answers in SDN. Doing so the question will be remarked as answered and the assistance will be rewarded!
    Message was edited by:
            Carsten Buechert

Maybe you are looking for