on 01-07-2009 7:30 AM
Hi
I am using the KM API where I try to get the url to an internal link.
myResource.getTargetURL();
myResou.
I am not sure what method should retrieve the URL.
Any help would be appreciated.
Regards
yuval
No real solution until now!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, getTargetURL() gives u the url.
getTargetURL
public URL getTargetURL()
throws ResourceExceptionReturns
the target URL of a link or null if the resource is not a link.
Returns:
the target URL of a link or null if the resource is not a link.
Throws:
ResourceException
Check this JavaDocs for [IResource|https://help.sap.com/javadocs/NW04s/current/km/com/sapportals/wcm/repository/IResource.html]
Regards
BP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will have do myResource.getProperty(<enter the name>); then retrive the value. I think the property would be access url.
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bp
1. First, RID of my resource retrieves the path to it userhome/userID/Favorites/nameOfmyLink
2. Code:
ICollection collection = (ICollection) myResource;
IResourceList list = collection.getChildren();
IResourceListIterator iter = list.listIterator();
While(iter.hasNext())
{
com.sapportals.wcm.repository.IResource doc = ( com.sapportals.wcm.repository.IResource ) iter.next();
doc.getTargetURL(): // not working
IURLGENERATORService ugs =
(IURLGeneratorService) ResourceFactory.getInstance().getServiceFactory(0.getService(
IServiceTypesConst.URLGENERATOR_SERVICE);
uniRef = ugs.getRelativeUri(PathKey.Content_Access_Path).appendPath(doc.getRID().ToExternalForm());
etc
Thank you for your support!!
yuval
}
Hi Julian
Very strange, then.
If I press this resouce in Favorites I get redirected to the page I added to my favorites.
I also tried to see if this resource has a collection under it. I got none.
Moreover when I studies the KM I saw this link is of 0 bytes i.e it holds nothing in it.
I tend to say that this is not a linktourl but a linktoaction. Once pressed the method behinds it goes to the PCD searches for this name and retrieves the url from there.....
But this is only a wild guess....
By the way can you check if your links arte of any size?
Thank you for yr support.!!!
regards
yuval
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
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.