on 05-15-2012 12:17 PM
Hello Experts,
I have developed a Web Dynpro Java application in NWDS 7.0.1 to connect KM repository.
For importing external jars I have created External Library DC and added the below jars to the public part (Assembly and Compilation)
bc.rf.framework_api.jar
bc.rf.global.service.urlgenerator_api.jar
bc.sf.framework_api.jar
bc.util.public_api.jar
com.sap.security.api.ep5.jar
com.sap.security.api.ep.jar
prtapi.jar
After adding assembly public part to the deployable unit of the External Library DC, the deployable unit has been added successfully to the WD application as a used dc. Library and sharing references have been added. WD dc built successfully but for implementation I cannot import the following:
import com.sapportals.portal.security.usermanagement.IUserFactory;
import com.sapportals.wcm.repository.ICollection;
import com.sapportals.wcm.repository.IResource;
import com.sapportals.wcm.repository.IResourceContext;
import com.sapportals.wcm.repository.IResourceFactory;
import com.sapportals.wcm.repository.IResourceList;
import com.sapportals.wcm.repository.IResourceListIterator;
import com.sapportals.wcm.repository.ResourceContext;
import com.sapportals.wcm.util.uri.RID;
import com.sapportals.wcm.util.usermanagement.WPUMFactory;
I am using the below code for my application:
IWDClientUser currentWDUser = null;
currentWDUser = WDClientUser.getCurrentUser();
com.sapportals.portal.security.usermanagement.IUser ep5User = null;
com.sap.security.api.IUser user = currentWDUser.getSAPUser();
IUserFactory portalUserFactory = WPUMFactory.getUserFactory();
ep5User = portalUserFactory.getEP5User(user);
IResourceContext context = new ResourceContext(ep5User);
String resourceID = wdContext.currentContextElement().getConditionOfSupplyFolder();
IResourceFactory resourceFactory = com.sapportals.wcm.repository.ResourceFactory.getInstance();
RID rid = RID.getRID(resourceID);
ICollection collection = (ICollection)resourceFactory.getResource(rid,context);
IResourceList resourceList = collection.getChildren();
IResourceListIterator resourceListIterator = resourceList.listIterator();
wdContext.nodeKMContent().invalidate();
while (resourceListIterator.hasNext()) {
IPublicPspclDocsComp.IKMContentElement contentElem = null;
contentElem = wdContext.nodeKMContent().createKMContentElement();
com.sapportals.wcm.repository.IResource tempResource = resourceListIterator.next();
contentElem.setConditionOfSupply(tempResource.getName());
wdContext.nodeKMContent().addElement(contentElem);
}
if(wdContext.nodeKMContent().size()<6){
wdContext.currentContextElement().setLineItem(wdContext.nodeKMContent().size());
}else{
wdContext.currentContextElement().setLineItem(5);
}
Any help you can provide on this problem is very much appreciated.
Thanks in advance
Ghanshyam.
After creating the "AssemblyPP" as you've mentioned in your problem
statement, did you update its purpose to “Assembly” in properties window?
If not, please do it and try once as I feel that the Jars are not properly refer
enced due to which you are not able to use them in your WD Java comp.
Moreover, as Sandip has suggested you can also add the following SCA's
to your existing custom SC as build time dependencies. Once added, the
SCA's will be visible in the track. This way you do not need to create any
external library DC to reference the JARs in your WD DC.
KMC BASE COMPONENTS 7.01
KMC COLLABORATION 7.01
KMC CONTENT MANAGEMENT 7.01
Please let me know if you face any further issues on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Anurag for your reply.
The issue has been resolved after adding the compilation pp to the deployable unit as a used DC. Previously I have added the assembly part only.
But now I am getting a new error while trying to run my application.
java.lang.NullPointerException
It comes because of the IResourceList resourceList = collection.getChildren(); line of the code.
Please help me out.
Thanks and Regards,
Ghanshyam
Hi Ghansyam,
go to DC MetaData->UsedDCs and right click you will get Add used dc ..now select
Local Devlopments->SAP-JEE and choose com.sap.security.api.sda .
then try to orgenise Import shift+ctrl+o.
Regards,
Trilochan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have you add dependency to the compilation pp?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After creating the "AssemblyPP" as you've mentioned in your problem
statement, did you update its purpose to “Assembly” in properties window?
If not, please do it and try once as I feel that the Jars are not properly refer
enced due to which you are not able to use them in your WD Java comp.
Moreover, as Sandip has suggested you can also add the following SCA's
to your existing custom SC as build time dependencies. Once added, the
SCA's will be visible in the track. This way you do not need to create any
external library DC to reference the JARs in your WD DC.
KMC BASE COMPONENTS 7.01
KMC COLLABORATION 7.01
KMC CONTENT MANAGEMENT 7.01
Please let me know if you face any further issues on this.
After creating the "AssemblyPP" as you've mentioned in your problem
statement, did you update its purpose to “Assembly” in properties window?
If not, please do it and try once as I feel that the Jars are not properly refer
enced due to which you are not able to use them in your WD Java comp.
Moreover, as Sandip has suggested you can also add the following SCA's
to your existing custom SC as build time dependencies. Once added, the
SCA's will be visible in the track. This way you do not need to create any
external library DC to reference the JARs in your WD DC.
KMC BASE COMPONENTS 7.01
KMC COLLABORATION 7.01
KMC CONTENT MANAGEMENT 7.01
Please let me know if you face any further issues on this.
Are you not able to import only the following class
com.sapportals.portal.security.usermanagement.IUserFactory or all the classes?
Moreover, all these are already available as part of SAP's standard DCs..I dnt think you need to add them explicitly..
Moreover I dnt think so there is any jar with name - com.sap.security.api.ep.jar, rather its com.sap.security.api.jar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are not able to import all classes, looks like some issue with the public part compilation or reference..did you add the external DC as used DC and assign the references (design time, build time, run time) correctly???
On the standard DCs, if I can remember the names (hard ..) - those are
1) com.sap.security.api.sda - under the SCA ENGINEAPI
Similarly find out the name for other JARs..Most of the time it would be the same with .sda..
All these are available under the following SAP SCAs
1)ENGINEAPI
2) EP-RUNTIME
3) EP-BUILDT
4) WD-RUNTIME
Add these SCAs/SDAs for your WD JaVA DC..
Just do some ground work, you can get it easily...Have the passion of Exploring...
Thanks Sandip for your reply.
The problem has been resolved after adding the compilation pp to the deployable unit as a used DC. Previously I have added the assembly part only.
But now I am getting a new error while trying to run my application.
java.lang.NullPointerException
It comes because of the IResourceList resourceList = collection.getChildren(); line of the code.
Please help me out.
Thanks and Regards,
Ghanshyam
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.