cancel
Showing results for 
Search instead for 
Did you mean: 

sharingreference and jar?

Former Member
0 Kudos

hi,

i am new to portal development and have a couple of questions.

i wrote a program and it is expecting a jar file named for example umapi.jar. so i included this jar in the javabuild path of the project and compiled it. also i found that we should mention this in PORTALAPP.XML file as follows:

sharingreference="usermanagement"

how could i know that the alias for umapi.jar is usermanagement.

for example if i am using PRTCORESERVICE.jar for source code compilation, what should i put in sharingreference?

any tips and tricks?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi,

I apologize if this has already been answered, but I just wanted to add something.

When you are using a portal API, you are using Java code from an existing portal application (generally a portal service).

  • If you want to use Java code from another portal application during runtime, the Portal Runtime needs to know this. Therefore, you must put a reference to this other application in your portalapp.xml. Once you put this reference, you can call any public Java code in this other application.

  • In order to be able to compile your portal project, you need the JAR file in your classpath.

As for your original question, about knowing the alias:

Hope this alll helps.

Daniel

Former Member
0 Kudos

Hi All,

Thank you all for your replies. I am sorry, if my question was not clear. I understand the importance of portalapp.xml and sharingreference in portalapp.xml, what i dont get is

i created a project and am using a class file. when the class file is not found, i use classlocator to find out the jar file. i copied *.jar from server and put in a folder and set the classlocator path to that.

so my project compiles sucessfully.

\but my concern is what is the value that i use in the sharingreferences field.

i.e. as Divakar said, if the name of jar is 'com.sap.portal.usermapping_api.jar', i can use "com.sap.portal.usermapping" in sharingreferences.

what is the value that i should put in sharingreferences, if i used for example PRTCORESERVICE.JAR file. Please tell me the exact string that i should put in the sharingreferences field.

likewise, is there a place where i can find, if i use xyz.jar use "abc" in the sharingreferences field. for few of them it is easy, like if it ends with "xyz_api.jar", i can use "xyz" taking out "_api.jar".

hope i am clear.

thanks

kai_unewisse3
Active Contributor
0 Kudos

Hi Yogi,

if you know the jar/par file, try to locate and open the portalapp.xml of this JAR/PAR with a winzip or other Zip program (e.g. 7zip).

You should see there a reference called "PrivateSharingReference". That is the sharing reference name you should use when you want to use the JAR in a custom component .

Thanks,

Kai

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi Yogi,

You asked if there is a way to know the sharingreference if you know the JAR. Technically, there is no relationship.

  • The sharingrefrence is a reference to the portal application that contains the Java class you need.

  • The JAR file is, well, the JAR file that contains the Java classes.

They do not have to be related at all. Some out-of-the-box portal applications try to create a relationship -- for example, as you said, the JAR file some portal applications simple add _api at the end. But I do not think this standard throughout the portal.

You have to simply check what are the names.

Hope this helps.

Daniel

Former Member
0 Kudos

ok, thanks again.. last clarification to close the thread

ok..so can you tell me now, what should i put in the sharingreference of my portal application, which is using "PRTCORESERVICE.jar".

also,please tell me the steps how you found that.

Daniel,

you said "You have to simply check what are the names".. i know only name of a jar file, how could i get the name of the PAR that contains this JAR, so that i could open the portalapp.xml file and find it out.

Kai,

you told to open a jar file using winzip or something, would a jar file really contains portalapp.xml file at all? i dont think so.

my problem is, i know only name of jar that i want, how could i know the name of par file that contains this jar, so that i could open the portalapp.xml file to find the "string" that i should use in my custom portal app.

sorry, if i am askign silly questions, but it is a million dollor question for me. hope you understand.

thank you

Message was edited by: yogi

Message was edited by: yogi

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi,

PRTCORESERVICE.jar is one of the core files of the PRT, and does not need a sharingreference.

To find the par with this JAR, all I would do is search the \irj\root\WEB-INF\portal\portalapps directory on the portal machine for the JAR, and based on the folder in which it is located, I would know the PAR that contains it.

Hope this helps.

Daniel

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

The sharingreference references the name of the project which contains the jar..

you can refer to jar 'com.sap.portal.usermapping_api.jar' available in the project 'com.sap.portal.usermapping'

refer:

Hope that helps.

Regards,

S.Divakar

Former Member
0 Kudos

sharingreference in portalapp.xml is used to define what components from other portal applications are needed in the current project. therefore you'd have to look at the code and know which components are required (this is acuatlly a list of multiple component names, not limited to one component).

read more here:

http://help.sap.com/saphelp_nw04/helpdata/en/53/c8af42a6f6cb6ae10000000a155106/content.htm