on 2005 Jul 15 10:08 AM
Hello everyone,
we have created a PAR file and deployed it to the portal successfully. Inside the service we are reading a file named keywords.properties which is accessed via an absolute path on the file system.
We have now placed the keywords.properties inside the PAR file but are not quite sure how to access it.
Question:
We use a simple File class to access the file. Since we do not have a ServletContext or anything similar how do we read this file inside the PAR or how do we get a path where the file resides?
Points WILL be rewarded. Thank a lot in advance.
Thank you Detlev.
Our service implements the com.sapportals.wcm.service.IService interface, not com.sapportals.portal.prt.service.IService
How to I get an IServiceContext?
or
Should we use com.sapportals.portal.prt.service.IService interface?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prakash, hi Sebastian,
so, what you are developing is a "Global KM service", not a portal service. Prakash: Just putting an <i>init</i> method into it won't do it, for it wouldn't be called by the framework...
Anyhow, you will have a WrapperService within your project (implementing a portal service), at least for the need to register the application classloader, won't you?!
In this case, it might make sense to implement both interfaces together, or, if you still want to seperate them, implement a (portal)service method getPrivateResourcePath which just passes this call to the serviceContext (and returns the return value). This one you could call from the KM global service.
Hope it helps
Detlev
Hi,
Can somebody tell me that from where can I can I get the jar file for <b>com.sapportals.wcm.service.IService</b>
Regards,
Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My appologies. I am writing a "Global KM Service" and Detletv'slast post actually gave me the correct path. I will now try to read the file from this location. Thank you all for your help. Point rewards will follow shortly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sebastian,
Are you writing a portal service or a KM Service?
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sebastian,
> Inside the service we are reading a file
If you have the need to access the file from within a service, use <i>getPrivateServicePath</i> on the <i>IServiceContext</i> object; see https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/javadocs/nw04/sp12... runtime/com/sapportals/portal/prt/service/iservicecontext.html#getprivateservicepath() for details.
Hope it helps
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
13 | |
11 | |
10 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.