Adding iview to role/folder  using wd

I am working on requirement  to add  iview to Role/Folder using
webDynpro.I have developed following code based on forums.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Constants.REQUESTED_ASPECT, IPcdAttribute.PERSISTENCY_ASPECT);
//env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
env.put(Context.SECURITY_PRINCIPAL,
WDClientUser.getCurrentUser().getSAPUser());
env.put(IPcdContext.PCD_PERSONALIZATION_PRINCIPAL,
WDClientUser.getCurrentUser().getSAPUser());
InitialContext iCtx = new InitialContext(env);
String iViewID =
"pcd:portal_content/wb.bidash.bi_dashboard/java_sap_com_km_com_kmapp_KmApp";
String iRoleID =
"pcd:portal_content/wb.bidash.bi_dashboard/com.wb.testRole";
try
IRole myrole = (IRole)iCtx.lookup(iRoleID);
IiView myIView =(IiView)iCtx.lookup(iViewID);
// add iview to role
// Here i need some code like  add iview to role
//myrole.addMember(myIView);
catch(NamingException e4)
     e4.printStackTrace();
it is giving  following exceptions    java.lang.ClassCastException
java.lang.ClassCastException
     at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
     at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
     at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
     at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
     at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:174)
     at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
     at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
     at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:

Hello ,
im getting similar issue can u got any solution .../
Regards ,
subbu

Similar Messages

  • How to get latest added file from a folder using apple script

    Hi..
    I am trying to get a latest added file from a folder..and for this i have below script
    tell application "Finder"
        set latestFile to item 1 of (sort (get files of (path to downloads folder)) by creation date) as alias
        set fileName to latestFile's name
    end tell
    By using this i am not able to get latest file because for some files the creation date is some older date so is there any way to get latest file based on "Date Added" column of a folder.

    If you don't mind using GUI Scripting (you must enable access for assistive devices in the Accessibility System Preference pane), the following script should give you a reference to the last item added to any folder. Admittedly not the most elegant solution, but it works, at least under OS X 10.8.2.
    set theFolder to choose folder
    tell application "Finder"
        activate
        set theFolderWindow to container window of theFolder
        set alreadyOpen to exists theFolderWindow
        tell theFolderWindow
            open
            set theInitialView to current view
            set current view to icon view
        end tell
    end tell
    tell application "System Events" to tell process "Finder"
        -- Arrange by None:
        set theInitialArrangement to name of menu item 1 of menu 1 of menu item "Arrange By" of menu 1 of menu bar item "View" of menu bar 1 whose value of attribute "AXMenuItemMarkChar" is "✓"
        keystroke "0" using {control down, command down}
        -- Sort by Date Added:
        set theInitialSortingOrder to name of menu item 1 of menu 1 of menu item "Sort By" of menu 1 of menu bar item "View" of menu bar 1 whose value of attribute "AXMenuItemMarkChar" is "✓"
        keystroke "4" using {control down, option down, command down}
        -- Get the name of the last item:
        set theItemName to name of image 1 of UI element 1 of last scroll area of splitter group 1 of (window 1 whose subrole is "AXStandardWindow")
        -- Restore the initial settings:
        click menu item theInitialSortingOrder of menu 1 of menu item "Sort By" of menu 1 of menu bar item "View" of menu bar 1
        click menu item theInitialArrangement of menu 1 of menu item "Arrange By" of menu 1 of menu bar item "View" of menu bar 1
    end tell
    tell application "Finder"
        set current view of theFolderWindow to theInitialView -- restore the initial view
        if not alreadyOpen then close theFolderWindow
        set theLastItem to item theItemName of theFolder
    end tell
    theLastItem
    Message was edited by: Pierre L.

  • Adding SP Group to Folder using JSOM in O365

    Hi,
    Is it possible to add a SharePoint Group to a folder in a Document Library using client side javascript?
    We can't use the normal methods because SP.Folder object doesn't have get_roleAssignments() method. I'm looking to run a script from a page within a Script Editor wp to get this done from a button click.
    I'm not creating an app but trying to achieve this from an aspx page using a script editor webpart.
    PS: I have posted this query to another forum here but haven't got an answer hence thought I'll check with the developer forum
    -- The opinions expressed here represent my own and not those of anybody else -- http://manojvnair.blogspot.com

    I have cracked it now and here is how we can add SPGroup to a Folder in SharePoint using JSOM:
    var rdContribute = currentWeb.get_roleDefinitions().getByName('Contribute');
    var collContribute = SP.RoleDefinitionBindingCollection.newObject(clientContext);
    collContribute.add(rdContribute);
    var myFolder = currentWeb.getFolderByServerRelativeUrl(folderUrl);
    var assignments = myFolder.get_listItemAllFields().get_roleAssignments();
    var roleAssignmentContribute = assignments.add(mySpGroup, collContribute);
    clientContext.load(myFolder);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.AddingGroupToFolderSuccess), Function.createDelegate(this, this.AddingGroupToFolderFailed));
    Here I'm adding mySpGroup with Contribute rights to folder called folderUrl
    -- The opinions expressed here represent my own and not those of anybody else -- http://manojvnair.blogspot.com

  • Newly Added Iview now showing in MSS role

    Hi Experts,
    I have a strange issue which is bugging me since yesterday.
    I have a customized MSS role in my portal where i have added one WebDynpro Java Iview to this role. I can see the iview in the MSS role when open the role as object. But ! when i see the same role by assigning to me, i couldn't see the newly added iview in the same role.
    I have added the same iview in several places (worksets) but still couldn't see that iview in the role. I don't understand why it behaves all of the sudden.
    Is it cache problem? if so, i have waited 10 hours and couldn't see the iview still. Should i do something else to show that newly added iview ?
    Thanks in advance.
    Regards,
    Suresh

    Hi JYOTHI,
    As it is custom role , check with your Hr Team for dependency of portal display on backend .
    Gneerally for standard business packages, home page framewokr configuration in backend provides navigation in portal.For your custom role , there might be siimilar configuration whcih hr consultants in your organization knows.
    Regards,
    Koti Reddy

  • How to add iview to role using webdynpro

    Hi every one, Can you please tell me how to add iview to role using webdynpro code.
    Thanks
    TK

    Hi,
    could you copy / past your code ?
    if you need help on webdynpro and your beginner, try to watch the video on internet of WebBProfessor. It's really good videos !
    regards
    Fred

  • Portal role folder translation

    Hi all,
    I'm translating the portal content created in different languages with the worklist functionality (EP 6.0 sp2). All portal objects like iViews, pages, worksets and roles can be translated but I've not found so far the possibility to add to the traslation worklist objects like the portal role folders (object type com.sapportals.portal.rolefolder). The portal role folders are used to structure in trees the content in the detailed navigation.
    Can you please tell me how these can be translated?
    Thanks,
    Silvia .

    Hi Silvia,
    you don't have to use the RAW TEXTS for role folders. You can however translate role folder titles and descriptions in any available language. BUT you first have to translate them from source language: Raw Texts to target language (e.g.): English
    Then you can translate them from English to any other language you desire.
    The issue described in note 778884 is the following: When you create a role with master language "English" and you want to translate that role into other languages (e.g. Frensh, Spanish, etc.) and you choose English as source language in the translation tool, you won't see the texts for the role folders!
    As, due to a bug, texts for role folders are initially saved only as Raw Texts, they don't appear in English (master language).
    You first have to translate them from "Raw" to "English" and then everything is fine.
    Hope I could shed some light on this.
    Stefan

  • Creating a workflow to give permissions to a SharePoint folder using Impersonation Step

    Hi There,
    I have been tasked with creating a workflow in my organise that will allow our users with (Contributor access) to grant people access upon creating a folder in our Shared Documents library.
    Currently when our users create a folder, they need to logged a call with site administrators to granted the relevant people access to the folder and its contents.
    Is it possible to create a solution that will kick off automatically upon creation of a folder and allow the Creator Only to grant a subset of users permissions to the folder using the Impersonation Step?
    Any suggestions would be highly appreciated.
    Regards
    Tibz
    regards Tibz

    Hi There
    Thank you for your response.
    I managed to create a workflow that can be started automatically upon the creation of a folder in my document library. I then added an Impersonation step where I used the "Remove list Item Permissions" & "Add List Item Permissions" actions.
    The challenge I am faced with is on the Remove Permissions action, I want to remove all inherited permissions for all existing users and only leave Users with Full Control. Is there a way to select All Existing Users in one function and perhaps
    pass that as a "Selected Users" parameter? Currently I have to select the users/groups individually and there are over 100 existing users/groups to choose from.
    Any thoughts on how I can work around this?
    regards Tibz

  • How to remove transaction that was added under Menu - Role Menu

    We have roles that we need to remove some transactions.
    These transactions were added under Menu - Role Menu and expanded for ex: Logistics and Picked Miro transaction.
    When I go to PFCD and check under s_tcode I cannot remove Miro transactions since it's grayed out.
    The only way to remove this is to go back to the Menu and do a find on miro and work through the menu until I get to Miro transaction and then delete it.
    Is there another way to accomplish this.
    Thanks
    Joe

    This is the intended way a role built from a menu works. What might be the use of an authorization without any corresponding transaction to start it? It is only a risk...
    Unless of course you know better or design differently and don't make the effort to adjust SU24, then you can insert manually or cause "changed" authorizations, but PFCG will not look at it from a "your own fault" view and not adjust it or protect it against illogical changes.
    To use the discipline of the one approach but keep the flexibility of manual authorizations is not possible for S_TCODE, S_RFC and S_SERVICE objects (the entry points).
    Cheers,
    Julius
    PS:
    > Total Questions:  42 (36 unresolved) 
    Please follow-up on your unresolved questions. There is a limit now of 10 open questions asked since July 2008.

  • How to mass moving iviews from one folder hierachy to another within PCD?

    Hi,SDN fellows.
    I found that it is really not user-friendly to move iviews from one folder to another within PCD>
    I tried to use Multiple Property Replacement to move some iviews in one folder to different folder hierachy in PCD, but I don't really know how to do so.
    Do you mass moving iviews in PCD before? How do you able to do it more efficiently.
    Thanks for help.
    Kent

    Kyle, the PCD Inspector seems able to faster my process a lot.
    What if I want to mass edit some properties. (I thought Multiple Property Replacement would able to do some, but it couldn't)
    Said I need to change the Id of a set of iviews:
    my_iview_a
    my_iview_b
    my_iview_c
    my_iview_d
    to
    iview_a
    iview_b
    iview_c
    iview_d
    but the MPR doesn't able to use the asterisk (*) operation.
    Thanks.
    Kent
    Thanks.

  • PCD Attribute not saved for Role Folder

    Hello,
    I try to change a PCD-Attribute programmaticaly.
    If I do it on an iView  (e.g. MyIview) - it works fine.
    If i try on a Folder in a role (e.g. MyFolder) - it does not work !
    I tryed two different approches - same behavour...
    Apporach 1
    String pcdLocation = "portal_content/MyRole/MyFolder";
    //String pcdLocation = "portal_content/MyRole/MyIView";
    IUser principalObj = this.getServiceUser("pcd_service");
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
    env.put(Context.SECURITY_PRINCIPAL, principalObj);
    env.put("com.sap.portal.jndi.requested_aspect", "com.sap.portal.pcd.gl.PersistencyAspect");
    env.put("java.naming.factory.object", "__IPcdContext__");
    InitialContext initialContext = new InitialContext(env);
    IPcdContext pcmObj = (IPcdContext) initialContext.lookupLink(pcdLocation);
    IPcdObjectFactory pcdObjectFactory =
    ((IPcdGlService) PortalRuntime.getRuntimeResources().getService(IPcdGlService.KEY))
      .getPcdObjectFactory();
    IPcdAttribute newPcdAttr = pcdObjectFactory.createPcdAttribute(PcdAttributeValueType.BOOLEAN,
    "com.sap.portal.navigation.Invisible");
    newPcdAttr.set(0, new Boolean(true));
    ModificationItem[] mods = new ModificationItem[] {
    new ModificationItem(DirContext.REPLACE_ATTRIBUTE, (Attribute) newPcdAttr)};
    pcmObj.modifyAttributes("", mods);
    Apporach 2
    String pcdLocation = "portal_content/MyRole/MyFolder";
    //String pcdLocation = "portal_content/MyRole/MyIView";
    IUser principalObj = this.getServiceUser("pcd_service");
    Hashtable env = new Hashtable();
    env.put(Context.SECURITY_PRINCIPAL, principalObj);
    env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
    env.put("com.sap.portal.jndi.requested_aspect", PcmConstants.ASPECT_ADMINISTRATION);
    InitialContext initialContext = new InitialContext(env);
    IAdminBase result = (IAdminBase) initialContext.lookup(pcdLocation);
    IAttributeSet myIview = (IAttributeSet) result.getImplementation(IAdminBase.ATTRIBUTE_SET);
    myIview.putAttribute(IAttriView.ATTRIBUTE_NAVINVISIBLE, "true");
    myIview.save();
    Any idea how to get NAVINVISIBLE - Attribute saved on a role-folder ?
    tnx Johannes

    Hi Johannes,
    I guess you found a working alternative until now, but if not, you should try the other [modifyAttributes |http://help.sap.com/javadocs/NW04S/current/pc/com/sapportals/portal/pcd/gl/IPcdContext.html#modifyAttributes(java.lang.String,%20int,%20javax.naming.directory.Attributes] method on IPcdContext. Your code could look like this:
    IPcdUtils factory = PcdAccess.getPcdUtils();
    IPcdAttributes attributes = factory.createPcdAttributes();
    IPcdAttribute navInvisibleAttribute =
         factory.createPcdAttribute(
              PcdAttributeValueType.BOOLEAN,
              IAttrPcmNavigation.ATTRIBUTE_NAVINVISIBLE);
    navInvisibleAttribute.add(Boolean.TRUE);
    pcdContext.modifyAttributes(
         StringUtils.EMPTY,
         IPcdContext.REPLACE_ATTRIBUTE,
         modifiedAttributes);
    This works in my application, so I never tried working with ModificationItem again. Maybe the implementation is somehow insufficient, but I didn't investigate it further (time pressure kills us all). However, please notice that REPLACE_ATTRIBUTE will replace or create the attribute as specified in the DirContext. Hope that helps.
    Best regards,
    Fabian

  • Downloading images used to go automatically to the last folder used to save images, even when reopening Firefox. In just the past few days, possibly coinciding wih the most recent updates, the folder defaults to the 'Downloads' folder. This is most annoyi

    Downloading images used to go automatically to the last folder used to save images, even when reopening Firefox. In just the past few days, possibly coinciding wih the most recent updates, the folder defaults to the 'Downloads' folder. This is most annoying. What happened? Internet Explorer 8.0 did the same thing. This was one of the reasons why I started using Firefox to download all images. I went into Tools>Options and it only lets me set another folder. I dont want to set a specific folder I want it to always go to the last folder used. So what gives?
    == This happened ==
    Every time Firefox opened
    == possibly when the most recent updates were installed, a few days ago

    Thanks jscher 2000. I guess I didn't make it clear. "It restarts with all the addons activated, and resumes with the tabs that were open before closing it." IE, it's running fine now with all the extensions activated. Everything is OK now.
    So something in the Firefox code was causing the bad behavior. It's not essential that I find out what the problem was - I'm just curious. And if anybody else has this same problem, it might be nice to have it corrected at the source.

  • Can't save files to Last Folder Used

    I'm scanning items with a Kodak iQsmart3, running under Kodak's oXYgen 2.6.1 scan application. Late last week, the application suddenly stopped saving files to the last folder used. Now I have to re-select the destination folder for each scan.
    I have rebooted the computer several times, and have also re-installed the scan application, but nothing helps the problem. It seems now that the problem may be with OS 10.4.11. I've searched and searched for a solution within the OS, but can't find anything that helps.
    Does anyone have a suggestion on how to proceed? Is there a place where you can check to see if the saving options can be changed?

    Thanks for your suggestion. However, I did as you advised and still cannot save files to the last folder used, as I used to be able to do.
    This is the first time in the 2 1/2 years I've been using this system that I've had any trouble with it. When I opened Disk Utility, it showed me the size and type of three different drives, all identical in manufacture. The first holds the Operating system, and the other two are set up in a Raid Striped set. I selected Macintosh HD under the name of the first drive, since that's the name of the disk on my desktop, and ran the Repair Permissions function, moving the recentitems.plist file to the desktop and rebooting, as per your instructions. Was that the proper area to use or should I have selected the disk description above that?
    (Below is the disk information from the Disk Utility application)
    Disk Description : Hitachi HDS725050KLA360 Media Total Capacity : 465.8 GB (500,107,862,016 Bytes)
    Connection Bus : Serial ATA 2 Write Status : Read/Write
    Connection Type : Internal S.M.A.R.T. Status : Verified
    Connection ID : "Bay 1" Partition Scheme : GUID Partition Table
    (Below is the information on the Macintosh HD folder of that drive.)
    Mount Point : / Capacity : 465.4 GB (499,763,888,128 Bytes)
    Format : Mac OS Extended (Journaled) Available : 226.2 GB (242,855,989,248 Bytes)
    Owners Enabled : Yes Used : 239.3 GB (256,907,898,880 Bytes)
    Number of Folders : 133,296 Number of Files : 684,567

  • Adding data to multiple tables using one form in Access 2010?

    Hi All,
    I have a access database with two tables and I want to create a single form to enter data into that tables.
    How to adding data to multiple tables using one form in Access 2010?
    I don't have to much knowledge of access database?
    Please help me
    Thanks
    Balaji

    You really don't enter identical data into 2 tables.  You enter dat into one single table, and then you have an unique identifier that maps to another table (you have a unique relationship between two tables). 
    Maybe you need to read this.
    http://office.microsoft.com/en-001/access-help/database-design-basics-HA001224247.aspx
    Think about it this way...  What is you update data in 2 tables, and then the data in one of those tables changes, but the data in the other table does NOT change.  WHOOPS!!  Now, you've got a BIG problem.  For instance, you have a customer
    named Bill Gates.  In one Table you update Bill's address to 1835 73rd Ave NE, Medina, WA 98039 and in the other table you accidentally update Bill's address to 183 73rd Ave NE, Medina, WA 98039.  Now you have 2 addresses for Bill.  Why would
    you want that???  Which is right?  No one knows.  If you have one address, you just have to update one address and if there is a mistake, you just have to update one address, but you don't have to waste time trying to figure out which is right
    and which is wong...and then update the one that is wrong.
    Post back with specific questions.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How can I assign an icon to a folder using Powershell?

    How can I assign an icon to a folder using Powershell?

    I'm trying to make a script that goes through a folder recursively, checks for every folder if it's name is "template", and if so it changes the icon of that folder to an icon
    I chose.
    I searched for an answer here, and I've only managed to find a way to assign an icon to a shortcut, but not to an existing file.
    Thanks in advance (:

  • Hello.  How do I keep the actual size of a photo when adding to a Keepsake?  Used to do this but have forgotten how!

    Hello.  How do I keep the actual size of a photo when adding to a Keepsake?  Used to do this but have forgotten how!  Need help please!
    T.

    Here is my suggestion:
    Open a blank, new file (File>new>blank file) size 8.5x11"
    Open the collage
    Go to Select>all
    Go to Edit>copy
    Go back to the blank file created in step #1
    Go to Edit>paste. The collage will be on its own layer
    Access the move tool, and with the corner handles resize the collage. Using the corner handles should preserve the aspect ratio. If you open the rulers, you will have a point of reference as you go along.
    Print a draft copy to see if it will be suitable in the frame..
    Please report back with your progress.

Maybe you are looking for