cancel
Showing results for 
Search instead for 
Did you mean: 

Use pictograms for roles in L-SHAPE API

Former Member
0 Kudos

Hi,

I was wondering how I can pass pictorgrams to roles and use them in the L-SHAPE API.

Kind regards,

Jonas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jonas,

Can you elaborate a little more? You can set a pictogram from most PCD objects (folders, pages, iviews, worksets etc...) that is stored in the PCD properties for that object and is used by standard navigation iViews like Workset Map and Service Map. What do you mean by "Pass pictograms to roles"?

I recently developed a navigation iView that displays a user's portal favourites with the associated Pictogram from the PCD - to do this I needed find the associated pictogram from the PCD object associated with the favourite item. The LSAPI has a favourites API but it didn't include the pictogram from the PCD.

A bit more info and I am sure someone can help you,

Thanks,

Simon

Former Member
0 Kudos

Hi Simon,

I'm working with the L-SHAPE API and I'm rendering the navigation via tiles. In this tile I want to display the title and the pictogram associated with the role (I only can retrieve the title). Is it possible to retrieve the pictogram aswell or another aproach to display it?

Kind regards,

Jonas

Former Member
0 Kudos

Hi Jonas,

So this is exactly the same scenario I was dealing with but instead of rendering the navigation as tiles I was rendering the favorites as tiles (using the favorites API of the LSAPI). I guess you are following the guide that SAP released showing how to build a totally custom Framework using the Ajax Framework Page concept, in that example they just randomly choose an image (not the pictogram from the PCD).

There is no easy way (that I could find) to get the pictogram so I had to use write a portal component that got the pictogram using the PCD API. Here is what I did:

First get I got the NavgationNodes for the user:

INavigationService service = (INavigationService) PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);

                    NavigationNodes initialNodes = null;

                    try {

                              initialNodes = service.getInitialNodes(getEnvironment(request));

                    } catch (NamingException ne) {

                              error_texts[0] = ne.getLocalizedMessage();

                              error_texts[1] = "Could not get the set of initial navigation nodes";

                              error_texts[2] = "Check the detailed error message and try to remedy the problem";

                              loc.errorT(error_template, error_texts);

                    }

Then get the pictogram:

try {

 

                                        //Get the image attribute - this is the pictogram that can be set in the PCD properties

                                        img = (String) navNode.getAttributeValue("com.sapportals.portal.navigation.Pictogram");

 

                                        //If no image is found use the default overview.gif

                                        if(img.length() == 0) {

                                                  loc.debugT("No image found using default overview.gif");

                                                  img = "overview.gif";

                                        }

 

                              } catch (NoSuchAttributeException e) {

                                        error_texts[0] = e.getLocalizedMessage();

                                        error_texts[1] = "Could not find the Pictogram attribute for the navigation node";

                                        error_texts[2] = "Check the detailed error message and try to remedy the problem";

                                        loc.errorT(error_template, error_texts);

                              }

All the pictograms can be accessed via the follow URL:

http://portal.com/irj/portal/com.sap.portal.navigation.mimeservice/images/<image file name>

I hope that gets you started. Or gives you some clues how to do what you want. It would be nice if the LSAPI would give the link to the PCD pictogram (hint, hint, hint... if SAP is listening! )

BRgds,

Simon