consuming portal services in abstract portal component 7.0

Upload: nkskn

Post on 06-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    1/18

    Consuming Por t a l Serv ic es inAbst rac t Por ta l Component 7 .0

    Applies to:

    SAP NetWeaver 7.0 Abstract Portal Component. For more information, visit the Portal and Collaborationhomepage.

    Summary

    This article explains step by step procedure of consuming standard portal services in Abstract Portalcomponent and also Describes key components of the User Management Engine (UME) and use the UME

    API to work with user.

    Author: Sunaina Reddy T

    Company: Yash Technologies Pvt LtdCreated on: 1 September 2009

    Author Bio

    Sunaina Reddy is Consultant for Yash Technologies Pvt.Ltd based in India. He has more than 3 years of ITexperience. He has good knowledge in Java, Webdynpro Java, EP and Mobile Infrastructure 7.0.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

    https://www.sdn.sap.com/irj/sdn/nw-portalandcollaborationhttps://www.sdn.sap.com/irj/sdn/nw-portalandcollaborationhttps://www.sdn.sap.com/irj/sdn/nw-portalandcollaborationhttps://www.sdn.sap.com/irj/sdn/nw-portalandcollaboration
  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    2/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Table of Contents

    1) Creating Portal Application:- ....................................................................................................................... 32) Creating the Portal Object (Abstract Portal Component) ............................................................................ 43) Code ........................................................................................................................................................... 84) Exporting the PAR file ................................................................................................................................. 95) Deploying the PAR file in the Portal .......................................................................................................... 106) Testing the application .............................................................................................................................. 117) Output of the application ........................................................................................................................... 128) Creating the Iview ..................................................................................................................................... 139) Creating the page ..................................................................................................................................... 1510) Running the Iview ................................................................................................................................... 16

    Related Content ................................................................................................................................................ 17Disclaimer and Liability Notice .......................................................................................................................... 18

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    3/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Developing Portal Component Using Standard Portal Service (UME)

    1) Creating Portal Application:-

    Open NWDSGo to EP perspective

    FilenewProjectPortal ApplicationCreate a Portal Application

    Click Next -> Enter Project name -> Click Finish.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    4/18

    Consuming Portal Services in Abstract Portal Component 7.0

    2) Creating the Portal Object (Abstract Portal Component)

    Right click on the created projectNewOthersPortal ApplicationsCreate new portal application object

    Click next -> Select the Project

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    5/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Click next -> Select Abstract Portal Component

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    6/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Click next -> Give name and package name

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    7/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Click finish.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    8/18

    Consuming Portal Services in Abstract Portal Component 7.0

    3) Code

    Open Userinfocomponent.java file and write this code in doContent() method.

    package com.sap.training.portal;

    import com.sap.security.api.IUser;

    importcom.sapportals.portal.prt.component.AbstractPortalComponent;import com.sapportals.portal.prt.component.IPortalComponentRequest;

    import com.sapportals.portal.prt.component.IPortalComponentResponse;

    publicclass Userinforcomponent extends AbstractPortalComponent

    {

    publicvoid doContent(IPortalComponentRequest request, IPortalComponentResponse

    response)

    {

    IUser user = request.getUser();

    String firstName = user.getFirstName();

    String lastName = user.getLastName();

    String displayname = user.getDisplayName();

    response.write("Your details:
    ");response.write("FirstName: "+ firstName +"
    ");

    response.write("LastName: "+ lastName+ "
    ");

    response.write("displayName: "+displayname+"
    ");

    }

    }

    Save the file

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    9/18

    Consuming Portal Services in Abstract Portal Component 7.0

    4) Exporting the PAR file

    Right click on the project and click Export

    Click next -> select your project name -> click next -> click finish

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    10/18

    Consuming Portal Services in Abstract Portal Component 7.0

    5) Deploying the PAR file in the Portal

    Log in to Portal

    Go to Java developerPortal Archive Deployer and Removerbrowse

    Select the appropriate par file from the workspace and click Finish.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    11/18

    Consuming Portal Services in Abstract Portal Component 7.0

    6) Testing the application

    Go to Java developerpdkcomponent Starter and viewer -->Select your component

    Click on details

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    12/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Click on start

    7) Output of the application

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    13/18

    Consuming Portal Services in Abstract Portal Component 7.0

    8) Creating the Iview

    Now the PAR file is deployed in the Portal

    Create iviews and embed this iview in a page .

    Logon to portalcontent administrationportal contentright clickNewiview

    Select Portal component radio button and click next

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    14/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Select the proper Portal archive nextgive iview detailsand click finish.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    15/18

    Consuming Portal Services in Abstract Portal Component 7.0

    9) Creating the page

    Logon to portalcontent administrationportal contentright clickNewpage

    And give the page details

    Select Default page Template

    Select one column equal width layout and click finish.

    Adding the iview to the PageRight click on the iviewAdd iview to page.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    16/18

    Consuming Portal Services in Abstract Portal Component 7.0

    10) Running the Iview

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    17/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Related Content

    http://help.sap.com/saphelp_nw04/helpdata/en/17/14b140c6ecee0fe10000000a1550b0/frameset.htm

    For more information, visit the Portal and Collaboration homepage

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

    http://help.sap.com/saphelp_nw04/helpdata/en/17/14b140c6ecee0fe10000000a1550b0/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/17/14b140c6ecee0fe10000000a1550b0/frameset.htmhttps://www.sdn.sap.com/irj/sdn/nw-portalandcollaborationhttps://www.sdn.sap.com/irj/sdn/nw-portalandcollaborationhttps://www.sdn.sap.com/irj/sdn/nw-portalandcollaborationhttp://help.sap.com/saphelp_nw04/helpdata/en/17/14b140c6ecee0fe10000000a1550b0/frameset.htm
  • 8/3/2019 Consuming Portal Services in Abstract Portal Component 7.0

    18/18

    Consuming Portal Services in Abstract Portal Component 7.0

    Disclaimer and Liability Notice

    This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is notsupported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

    SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,and anyone using these methods does so at his/her own risk.

    SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article orcode sample, including any liability resulting from incompatibility between the content within this document and the materials andservices offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of thisdocument.