cancel
Showing results for 
Search instead for 
Did you mean: 

Portal Component .class file

Former Member
0 Kudos

Hi,

I imported the PAR file os com.sap.netweaver.bc.util.ui and when i tried to open the .class files which was under the dist\PORTAL-INF\.. i get an error popup telling that "Problems Opening Editor, The classFile is not on the classpath" .

I don't find any .java files giving the details about the differents functions used in the UWL.

How do i change the class file and the properties insided the class?

Have any of em done custom development with UWL par file?

Thank you

arun

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

UWL provided by SAP doesn't show the Details screen below. So we need to modify some of the basic properties like texts,width of the component.

If you see this is the code for JSP to show the UWL main inbox. There is an method called by this code to display the gridlayour which is SessionUtilities.getMainComponent() i want to modify the width and height and the number of rows in the inbox to make it look better.

<hbj:gridLayout id="mainUniversalNavigationGrid" width="100%" cellSpacing="2" cellPadding="2">

<%

GridLayout folderArea = (GridLayout)SessionUtilities.getMainComponent(componentRequest);

GridLayoutCell folderLayout = new GridLayoutCell(folderArea);

folderLayout.setHAlignment(com.sapportals.htmlb.enum.CellHAlign.LEFT);

folderLayout.setVAlignment(com.sapportals.htmlb.enum.CellVAlign.TOP);

// Add this grid are to the main grid.

mainUniversalNavigationGrid.addCell(1, 1, new GridLayoutCell(folderArea));

%>

</hbj:gridLayout>

I see a class file called SessionUtilities.class under dist\PORTAL-INF\private\classes\... But i don't find any SessionUtilities.java file where i can set the properties of the the Layout.

Is this the correct way to do it?

Thank you

arun

Former Member
0 Kudos

Hi Arun,

of course there are no .java files, when the source code isn't shipped in the par file.

You also shouldn't rework .class files via reverse engineering.

What you can do is modifying the ui by adapting the gridLayout tag in the jsp page.

Detailed documentation about the htmlb controls can be found in your pdk. Depending on the version it's located at "Java Development -> Examples" or at "Java Development -> User Interface Development"

Former Member
0 Kudos

Do you know if there is an official SAP viewpoint that :

1) It is okey to modify jsp pages

2) It is not okey to decompile java class, change them and compile then again

?

detlev_beutner
Active Contributor
0 Kudos

Hi Dagfinn, hi Karsten,

like Dagfinn, I have been also a bit estonished by your answer, Karsten, but I'm not sure if it was meant in the sense Dagfinn understood and I at least considered.

<i>If</i> it was meant in this way, I wouldn't know how to call it, but I have some words in mind... But I'll be quiet as long you don't answer "yes" to Dagfinn's question...

I'm very curious to your answer

Detlev

Former Member
0 Kudos

Hi Dagfinn and Detlev,

I'm sorry that I found your questions that late.

Unfortunately, I'm not the right guy to give official statements (I think Oliver could), but here is mine as an EP consultant:

I understand, that it's sometimes necessary to touch standard code in order to achieve customer requirements. But everybody has to be aware that modifying standard components carries drawbacks (and I hope that you can at least agree on that).

- it can be expensive. In case of portal updates (SP/patch/hotfix) regression tests have to be planned, changes may have to be done over again. This will generate additional costs in any way.

- it may reduce supportability!

If I encounter an official statement (what's allowed and what rather not) the next time, I will re-post it here.

Cheers, Karsten

detlev_beutner
Active Contributor
0 Kudos

Hi Karsten,

I think Dagfinn and I are experienced enough to know these drawbacks (and we are pointing out these problems whenever a solution would need changing original code). But sometimes decompiling / changing / compiling is needed (because a customer for example does not want to show up the "All Rooms" tab - but it's hardcoded and so not configurable; just an example from two days ago).

On the other hand, decompiling often is the only way to get behind undocumented features. And even if the doc situation continously is getting better since about six months or so, there are many undocumented things or hard to find docs (finding docs on SDN for example is a horror if you don't know the exact keywords to use within the search funtion).

So decompiling is a way of getting the right doc...

And if SAP would state that the way decompile/change/compile would be "forbidden", and if SAP would for example scramble the code in the future to prevent people from doing so, definitely many companies would say NO to SAP EP.

At least, I would stop being a developer for SAP EP. That would just be the end.

Hope it helps to understand our estonished reaction and our curiousity,

Detlev

PS: I don't know Dagfin personally (maybe changing this in Munich?), so I'm not really in the position to speak for him, but after "knowing" him from his presence on SDN, at least I think we are like-minded...

Former Member
0 Kudos

Hi,

There are some parts of the code (which has to do with licensing) which I am in fact a bit surprised that SAP hasn't:

a) signed (to avoid tampering)

b) obfuscated

As Detlev says, it is very vital to be able to decompile some of the code (especially the sap portal components). I have had many request asking if there is a way to do X, and have found the answer by looking at the decompiled code. Either you see that it is hardcoded (and I very very seldom do change the code) or you get a good clue on where to look.

It's probably through looking at decompiled code, I've learned the most about SAP EP.

But do we have a right to look at the code ?

Not so sure. I would maybe suggest that all of SAP's components became open-source, so that you could import the par file and make the changes you would like. But the problem is what are you going to do when you need to upgrade (I hope most people avoid upgrading for the reason that there is a new patch/hotfix available).

It might be just as well to have no official answer and continue working like we are used to.

Probably see you in Munich Detlev.

Cheers

Dagfinn

Oliver5
Advisor
Advisor
0 Kudos

> Hi Karsten,

>

>(finding docs on SDN for

> example is a horror if you don't know the exact

> keywords to use within the search funtion).

did you post this to SDN team?

> So decompiling is a way of getting the right doc...

right, esp. in java.

> And if SAP would state that the way

> decompile/change/compile would be "forbidden", and if

> SAP would for example scramble the code in the future

> to prevent people from doing so, definitely many

> companies would say NO to SAP EP.

no such plans. in contrary - I use to program in ABAP and anything is open there and easy to change.

Unfortenately java is comparably new for enterprise programming, but I could imagine the SAP Java environmentwill be competitive with ABAP soon.

However we never supported custom code. Thats clear.

Former Member
0 Kudos

Thanks for your comment Oliver.

@Detlev & Dagfinn:

I've never doubted your experience in EP development (the oppsite is the case), but I'm not sure if all readers know the drawbacks.

Moreover, I totally agree, that decompiling is the best way to understand rather undocumentated APIs. Jadclipse is installed on my NDS, too

So long, Karsten

Former Member
0 Kudos

I have to confess...

I actually decompiled the entire portal just to find the solution to a particularly hard problem (I don't actually remember what it was any more).

Ahh.. good to get that off my chest

detlev_beutner
Active Contributor
0 Kudos

Don't we all have the source at c:\ep_decompiled?!

For not being forced to wear a red rose on my jacket in Munich, Dagfinn, here something comes to recognize me... https://weblogs.sdn.sap.com/images/people/detlev_beutner.jpg ...

(I hope to get my first weblog published before Munich; however, I don't like to run within the mass actually hunting for weblog points...)

Have a nice weekend,

shut down your decompiler and enjoy the last sunbeams before the dark winter comes (at least in norway)

Detlev

Answers (3)

Answers (3)

raj_balakrishnan3
Participant
0 Kudos

Hi,

I am also faced with having to decompile the classes in ...bc.uwl.ui. but I am facing a difficult time trying to get all the libraries in the build path (for eg, for the life of me, I cannot figure out where the class IUrlGeneratorService is) Do I have to look into every jar file to figure out the location of the class? Please let me know what you put in your buildpath and where you found the jar files?

Thanks

Raj Balakrishnan

Former Member
0 Kudos

Thanks Oliver Stiefbold,

I didn't do any mistake with the UWL import. Because it works really good as it is.

What i need to do is that I should be able to change the layout of the Grid or add some intuitive text inside the layout used in those Portal Component.

I exported this com.sap.netweaver.bc.UWL.ui Portal component from EP and imported it in Eclipse for changing the contents of the GridLayout.

I am able to modify or open the Paglets(JSP Files) But when i try to access the .class file it couldn't open it.

Usually when a portal component is created there will be two type of files available .java and .class which will be under an package. I don't see any .java file in this SAP import.

I don't understand how to modify it, Any Idea?

Thank you

arun

Thank you

arun

Former Member
0 Kudos

just wondering , is it okey to modify the sap shipped java/jsp code?

Oliver5
Advisor
Advisor
0 Kudos

You made a mistake regarding servlet or Portal Component public and private pathes.

download PDk for examples or see PRT Guide on how to adress privates ressources.