FlexibleUI - UICommands with Path KM and User KM from the context.

I need to write one new Java Portal Class, for new KM Command. This command should do the following action:
- get context information of KMC (specifically portal user and KM path)
- call URL with this data. (Example: http://domain:port/service?userkm=valueuserkm&pathkm=valuepathkm )
I have modify example of FlexibleUI - UICommands, and create a new class that call a URL, but can't find the class and method for get context and catch the user and path of KM user.
this is the code for the class of UICommands:
package com.sap.example.flexible.ui.command;
import java.util.List;
import com.sapportals.wcm.WcmException;
import com.sapportals.wcm.rendering.base.IRenderingEvent;
import com.sapportals.wcm.rendering.base.IScreenflowData;
import com.sapportals.wcm.rendering.uicommand.AbstractCommand;
import com.sapportals.wcm.rendering.uicommand.ICommand;
import com.sapportals.wcm.rendering.uicommand.LinkAttributes;
import com.sapportals.wcm.repository.IResourceContext;
import com.sapportals.wcm.repository.IResource;
* Copyright (c) 2005 by SAP AG. All Rights Reserved.
* SAP, mySAP, mySAP.com and other SAP products and
* services mentioned herein as well as their respective
* logos are trademarks or registered trademarks of
* SAP AG in Germany and in several other countries all
* over the world. MarketSet and Enterprise Buyer are
* jointly owned trademarks of SAP AG and Commerce One.
* All other product and service names mentioned are
* trademarks of their respective companies.
* This class is a sample implementation for a
* UICommand using external eventing.
* @author Thilo Brandt, SAP AG
* @version 1.0
public class SimpleExternalCommand extends AbstractCommand {
     protected String getLabel() {
        return "myButtonLabelDURO";
            protected String getTooltip() {
                    return " myButtonTooltipDURO";
     public SimpleExternalCommand() {
          //super("SimpleExternalCommand", "SimpleExternalCommand");
          super("myButtonTextKey", "myTooltipTextKey");
     public ICommand getNewInstance() {
          return this.initNewInstance(new SimpleExternalCommand());
     public IRenderingEvent execute(IScreenflowData arg0) throws WcmException {
          return null;
     public String[] getTargetParameters() throws WcmException {
          return new String[0];
     //public void setTargetParameters(List arg0, IResourceContext arg1)
     public void setTargetParameters(List list, IResourceContext context)
          throws WcmException {
     public boolean isExecutable() {
          return true;
     public boolean raisesEvent() {
          return false;
// Inicio de Modificación de Código para uso de Parámetros
        public LinkAttributes getLinkAttributes() {
          String Target = "_blank";
          String lURL1  = "http://www.google.com/search?hl=es&q=";
          String lURL2  = "PARAMETRO";
          String lURL3  = "&lr=";
// Get User KM from context
// lURL2 = UserKM;
// Get path KM from context
        String lURL   = lURL1 + lURL2 + lURL3;
          return new LinkAttributes(lURL, Target);
please helpme to get userKM and pathKM.
thank in advance.
Junior.

Hi,
To get the KM Path:
String path = getResource().getRID().getPath();
To get the present User:
IPortalComponentRequest pcr =
                (IPortalComponentRequest) getProxy().getDynamicPage().getPageContext().getRequest();
pcr.getUser();
To create URL call with datas when UICommand is clicked. You should modify your getLinkAttributes method.
Check this for an example:
https://forums.sdn.sap.com/thread.jspa?threadID=334529
Greetings,
Praveen Gudapati
[Points are always welcome for helpful answers]

Similar Messages

  • Slight roadblock in "DW 8 with ASP, ColdFusion, and PHP: Training from the Source"

    I'm working my way through Dreamweaver 8 with ASP,
    ColdFusion, and PHP:
    Training from the Source. I've come to the middle of Lesson 6
    and have hit
    my first obstacle in learning PHP. I'm following the
    instructions to format
    the output of the tour price calculator, but my issue is with
    where to place
    the following PHP code: <?php setlocale(LC_MONETARY,
    'en_US'); echo
    money_format('%i', $tourPrice); ?>
    I placed it before the DOCTYPE and when that didn't work, I
    tried inserting
    right before the code that retrieves the tour price (in the
    body of the
    page). That didn't work either.
    I also tried changing money_format to number_format and
    manually inserting
    the $, but when I tested everything, the output printed as
    follows:
    The estimated cost of your tour is
    $0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000500.
    I'm not quite sure where I've gone wrong.
    Thanks for any help,
    Heather

    Coach Bob wrote:
    > David,
    >
    > I would like to understand better your comment about the
    money_format. The
    > ability to use it is dependent on the host system's
    support of the C library
    > function strfmon(), correct? So if a user were
    developing on a windows box with
    > a local WAMP install it would not work while it may work
    on their *nix-based
    > Web host?
    Check the PHP documentation - it tells you all you need to
    know:
    http://www.php.net/manual/en/function.money-format.php
    > I will see to it that it gets corrected in the next
    version of the book!
    I've no idea what relationship you have with "Training from
    the Source",
    but I find it interesting - to say the least - that you need
    to the ask
    the author of a rival book.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Creating user accounts with OIDDAS and use them from the OS

    Hi,
    I have a customer that is experiencing an error creating user accounts from OIDDAS, and use that user accounts from the operating system.
    My customer is using OID/OAS4OS 10.1.4.2.0, and that version is not longer available to download, then, I will try in my own environment
    with OID/OAS4OS 10.1.4.3.0.
    And the question is the following: is supported to create user accounts with OIDDAS and expect that users can work with OAS4OS and be
    able to authenticate in the operating system?
    For the reference, SR# 7222351.993:
    Thanks,
    Luis Vivero.
    Edited by: LV in ORCL on Dec 11, 2008 6:47 AM

    Hi Jacco,
    I didn't see your post before.
    Nop, unfortulately I don't have a document with that. I just received that answer
    from development (related to the plugin for AD that is not certified, and DAS is
    not intended to work with OAS4OS).
    Anyway, about the plugin to work with AD, this is working for me; at least I tested
    it by configuring the plugin, I configured synchronization, the mapping file, I did
    the bootstrap, and the accounts that were bootstraped now shows the OS attributes
    on DAS.
    Regards,
    Luis Vivero.

  • How to read User ID from the request Form and pre populating in the AD User process form before provisioning

    I am trying to read the user Id from the submitted AD User request form( Catalogue AD User form. I need User Id,firstname and lastname inorder to prepopulate the common name as in this format - lastname,firstname (userid)  for the user to be provisioned in Active Directory.
    So after filling the AD User request form with User Id and Organization and submitting the request, I am trying to
    prepopulate the common name in the process form before the provisioning.
    The prepopulate adopter for the common name is configured to read the firstname, lastname and userid. firstname and
    lastname variables are mapped to User definition and user Id is mapped to Process Data. In this setup I am not getting the
    User Id value from process data, it is empty.
    Is this a bug with OIM 11g R2 or I need to do it differently in order to read the user Id that user has entered in the
    request form for populating the common name?
    Thanks

    Ghulam Yassen wrote:
    How to get USER_ID and IP_AddressWhy exactly do you need this data and what do you plan to do with it?
    The data is not reliable and trustworthy. IP addresses can easily be spoofed (a few seconds if you know what to do and how to do it). Also, IP addresses are not static. Users also do not use the same network device to access the database - different devices will have different IP addresses.
    The o/s user on the client is supplied by the client driver. This can also be spoofed.
    The user can also use a virtualised device - which means that recording the IP and o/s user seen from the server side, is pretty much useless and meaningless.
    So if this data is intended to be used for auditing for example - it would be pretty suspect data to use for that purpose.

  • I have 2 macbooks each with an account for me and one for my wife. I use one Macbook logged in with my account and my wife uses the other Macbook only loged in on her account. We both make regular time-machine back-ups each on a separate external disk

    I have 2 Macbooks each with an account for me and one for my wife. I use one Macbook logged in with my account and my wife uses the other Macbook only logged in on her account. We both make regular time-machine back-ups each on a separate external disk. Is it possible to update her account on my macbook using her external disk without overwriting my stuff on the same Macbook and vice versa?

    Time Machine does not do individual accounts. It records the complete drive. So if you were to use her TM backup on your Mac it would make your Mac just like hers. Both yours and her account on your MAC.
    Just copy the missing files over from her Mac to yours. If there are differennt programs on each then they would need to be installed on both.

  • Problem is with my iPhoto on my Macbook air.  I am trying to move my library from my airbag onto my passport drive.  I did it and deleted it from the airbag but it simply re appeared possibly from the cloud. Not sure what to do next.

    The problem is with my iPhoto on my Macbook air.  I am trying to move my library from my airbook onto my passport drive.  I did it and deleted it from the airbook but it simply re appeared possibly from the cloud. Not sure what to do next. Sorry I am not a techie.

    Sorry - we can not see you
    what do you have? Version of iPhoto? Of the OS? How is the passport connected to your Mac? What format is the passport (for the iphoto library it must be Mac OS extended (journaled)  )?  The iPhoto library is not and can not be on the cloud (maybe later with the Photos Application)
    LN

  • How can I login and retrieve my user file from the trash?

    I was trying to find out where all my HD had gone, which a did using ‘What Size’.
    I found what looked like an old backup file so I put the file in the trash.
    It turns out that the file was my user file. So now I can’t login to as the user.
    How can I login and retrieve my user file from the trash?

    The Digital Editions forum is here, in case this is what you are talking about:
    http://forums.adobe.com/community/adobe_digital_editions
    If you are not, I apologize for the misunderstanding.

  • I would like to have an email account that is password-protected that I can access on my Mac, Iphone and Ipad, separate from the Mail application, with an alert button that indicates unread messages

    I would like to have an email account that is password-protected that I can access on my Mac, Iphone and Ipad, separate from the Mail application, with an alert button that indicates unread messages

    Try a search... I'm sure if you put forth a little effort you can find a solution that will work for you.

  • My iPod Touch 5th generation says disabled connect to itunes but when we connect to itunes it says on itunes that the ipod is locked with a passcode and to go onto the ipod and type in the passcode to proceed. What do I do

    My iPod Touch 5th generation says disabled connect to itunes but when we connect to itunes it says on itunes that the ipod is locked with a passcode and to go onto the ipod and type in the passcode to proceed but the ipod is still locked. what do i do?

    http://support.apple.com/kb/HT1212

  • Is there any way to increase the font size in the Creative Cloud. Using a Lenovo Yoga 2 with 14" screen and care barely see the menus

    Is there any way to increase the font size in the Creative Cloud. Using a Lenovo Yoga 2 with 14" screen and care barely see the menus.

    In short, no. There is no fix yet. They only barely acknowledge there is a problem. The "fix" is to enable 200% UI scaling which makes everything comically huge and unusable. This is pretty much of a joke. A really, really EXPENSIVE joke.

  • I bought a iphone 4 from a guy on craigslist, I knew about ios 7.0 having the lock thing, but when I met him, his simcard was in the phone, I tested the phone with his simcard in from of him. The phone looked great with no problems and I even got the box

    I bought a iphone 4 from a guy on craigslist, I knew about ios 7.0 having the lock thing, but when I met him, his simcard was in the phone, I tested the phone with his simcard in from of him. The phone looked great with no problems and I even got the box with the accesories, so I knew it was his... I then did the reset on the phone (erase all data... from settings) and it went through and activated and everything was good... I used the phone for about a month with no problems at all, even had my apple ID in the icloud and everything... well ios 7.0.6 came out and I used my computer to restore the phone, because I feel that the cord and computer gives it a better restore, it did great no problems, and when it went to the part where I went to activate the phone, I get a enter your apple id and password to complete activation... Wait... why is this up i thought, I thought I did everything like I suppose to to succesfully switch it to me, the new owner... but now its asking for some C******@yahoo.com.... I only have @gmail.com emails and none start with a C... The guy sold me the phone because he was switching to Verizon, and I tried to call him, and now the number is disconnected... I guess he switched to Verizon with a new number... Now im stuck with a paperweight that costed me $200.00... What can I do at this point... Please help me... I restored it to give it to my Step Son as I just got me the iphone 5... Thank you for ANY HELP in advance... Thank you again.

    I bought a iphone 4 from a guy on craigslist, I knew about ios 7.0 having the lock thing, but when I met him, his simcard was in the phone, I tested the phone with his simcard in from of him. The phone looked great with no problems and I even got the box with the accesories, so I knew it was his... I then did the reset on the phone (erase all data... from settings) and it went through and activated and everything was good... I used the phone for about a month with no problems at all, even had my apple ID in the icloud and everything... well ios 7.0.6 came out and I used my computer to restore the phone, because I feel that the cord and computer gives it a better restore, it did great no problems, and when it went to the part where I went to activate the phone, I get a enter your apple id and password to complete activation... Wait... why is this up i thought, I thought I did everything like I suppose to to succesfully switch it to me, the new owner... but now its asking for some C******@yahoo.com.... I only have @gmail.com emails and none start with a C... The guy sold me the phone because he was switching to Verizon, and I tried to call him, and now the number is disconnected... I guess he switched to Verizon with a new number... Now im stuck with a paperweight that costed me $200.00... What can I do at this point... Please help me... I restored it to give it to my Step Son as I just got me the iphone 5... Thank you for ANY HELP in advance... Thank you again.

  • HT4718 I had a copy of Mountain Lion on my late 2008 MacBook Pro, having replaced Lion which it came with. But the drive,crashed, so I replaced the drive and reinstalled Lion from the original disks I had. How do I get another copy of Mountain Lion?

    I had a copy of Mountain Lion on my late 2008 MacBook Pro, having replaced Lion which it came with. But the drive crashed, so I replaced the drive and reinstalled Lion from the original disks I had. How do I get another copy of Mountain Lion?

    A 2008 Mac won't have originally shipped with Lion. You need to install 10.6.8 on the computer, log into the Mac App Store with the Apple ID you used to purchase Mountain Lion, click on the Purchases tab, and download it.
    (121465)

  • I am considering buying an iPad 3. I have an iMac with OSX 10.6.8. On the iMac I have many photos and work with iPhoto and Photoshop Elements on the computer. Can I interchange or transfer photos and other work from the iMac to the iPad? How?

    I am considering buying an iPad 3. I have an iMac with OSX 10.6.8. On the iMac I have many photos and work with iPhoto and Photoshop Elements on the computer. Can I interchange or transfer photos and other work from the iMac to the iPad? How?

    velma Monreal wrote:
    I am considering buying an iPad 3. I have an iMac with OSX 10.6.8. On the iMac I have many photos and work with iPhoto and Photoshop Elements on the computer. Can I interchange or transfer photos and other work from the iMac to the iPad? How?
    Yes you can. In iPhoto create a Album with the photos you want in it. You can drag them from your Events folder. In iTunes with your iPad connected go to Photos by cliking on your iPad. You can then select the album or events you want.

  • I am using Firefox with OS X and suddenly I lost the slot in which I type URL's in the top of the browser. How can I get it back?

    I am using FIREFOX with OS X and suddenly I lost the slot at the top of the browswer in which to type the URL's. It just disappeared.
    How can I get it back?

    View --> Toolbars --> Navigation Toolbar

  • I am working in pages with a template and want to keep the image but get rid of the black background?

    I am working in pages with a template and want to keep the image but get rid of the black background?

    Surprise surprise but we can't see what you are looking at and referring to.
    What black background?
    If it is black background in the actual photo:
    Menu > Format > Instant Alpha > drag the cursor over the colored background you wish to remove
    Peter

Maybe you are looking for

  • Is the MacBook Air as powerful as the MacBook Pro?

    I need a pretty powerful computer and it has to be apple because I need itunes for my job and I can only rely on itunes on a mac, but it has to run some pretty powerful software, so can an air handle it as well as a MBP with retina?

  • Can the skype logo be used in our company email si...

    Hello. I am currently tasked with revamping our company signatures and we were wondering if it would be ok to use the Skype logo in our signature so our customers can call us via Skype.

  • Table is missing in ms-access shutter

    when open the shutter bar tables is missing when I choose Query ti show tables all the line titles has moved other sumptuous is that the find box is  not show the title "serach doument" please help

  • How to convert mime file to JPG

    Can anyone tell me how to convert mime-attachments to JPG files? Photos that I take on my cell phone and that I send to my e-mail address show as photos when I receive them but the file is converted from a JPG file (in the phone) to a mime-attachment

  • HT204291 why has airplay stopped working

    Doese anyone know why airplay has gone from my 4GS and the Remote app will or itunes will detect apple tv.