on 12-31-2015 10:42 AM
Hello Experts,
I have a requirement like I need to get the navigation target like below inside my WD Java application.
I will send this as return URL data to the master head through Portal Eventing. The Javascript method redirects to another site and comes back. After certain operations are done, the portal will redirect to my WD Java application using this URL.
My question is how to get the Navigation target -- my WDJ's pcd path and the role that it resides in? Hardcoding this path works perfectI don't want to hard code this path since my App can be moved under any role.
I use EP version 7.4
Sujai,
Can you give me more explanation regarding Navigation Target.
Mean while Please refer these documents .it may be useful. Navigation Target-1 and Navigation Target-2
Kindly let me know if you need any more information
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much Vijay Kumar for the reply.
This Navigation Target I am able to get by Copy-ID option under Content Admin.
My requirement is I need to get it in my WD Java application. Is there anyway to achieve it?
My Case is:
1. I have a WDJ application under some role say for eg., Role-2
2. I will redirect it to an external site in the same window(which I am able to achieve) on some button action. After some operation there, that external site will redirect to my WDJ application under Role-2
3. When redirecting, I am giving a return URL as a parameter to that site. I give the redirect URL like http://<hostname>:<port>/irj/portal?NavigationTarget=pcd:portal_content/other_vendors/<sub-folder1>/...
(Now I hard-code the URL when redirecting and it works perfect as expected)
My problem is:
In the future, my WDJ application might get moved under any Role (say- Role-3 or something). So hard coding the return URL is not the way to follow. I need to get this url (NavigationTarget part particularly) programatically inside my WDJ application.
PS: I am able to get this part: http://<hostname>:<port>/irj/portal
Any guidance on this part will be really helpful for me. If there is another way to achieve my case, please let me know that also.
Hi Sujai,
Role information we can get dynamical though code.I am giving some example code try this.
Iterator rolelist = myuser.getRoles(true);
if (null != rolelist) {
IRole userRole = null;
while (rolelist.hasNext()) {
String roleVal = (String) rolelist.next();
userRole = roleFact.getRole(roleVal);
if (userRole.getDescription().equalsIgnoreCase("welcome")) {
String path = userRole.getUniqueName().replace("pcd:", "ROLES://");
String navigationTarget ="https://host:port/irj/portal?NavigationTarget="+path;
break;
}
}
}
Please refer these blogs .it may be useful. How to get the Groups/Roles and Users from the Enterprise Portal using Webdynpro JAVA and Dynamic Role Assignment Using WebDynpro application
Kindly let me know if you need any more information
Hi Sujai,
Try this code in wdj application.But embedded WebDynpro page level.
Map<String, String> parameterMap = WDWebContextAdapter.getWebContextAdapter().getRequestParameterMap();
wdComponentAPI.getMessageManager().reportSuccess("parameterMap: " + parameterMap);
if (parameterMap != null && !parameterMap.isEmpty()) {
Iterator<?> keys = parameterMap.keySet().iterator();
while (keys.hasNext()) {
String key = (String) keys.next();
Object value = parameterMap.get(key);
if (value instanceof String[]) {
wdComponentAPI.getMessageManager().reportSuccess("Key: " + key + " = String array:");
String[] sa = (String[]) value;
for (int ix = 0; ix < sa.length; ix++) {
wdComponentAPI.getMessageManager().reportSuccess(" Value[" + ix + "] = " + sa[ix]);
}
} else {
wdComponentAPI.getMessageManager().reportSuccess("Key: " + key + " = " + parameterMap.get(key));
}
}
}
Here parameterMap :{PagePath}
Key: PagePath = String array:
Value[0] = pcd:portal_content/xx................xxx/_page_id
on more option is there u can get navigation information in site map code.Try this one.
User | Count |
---|---|
84 | |
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.