How to get plid of specific portlet In Liferay velocity template - liferay-6

I am developing MVC Portlet and want to open specific page of my portlet through menu link via Controller.
In velocity template I have portlet name of my portlet.
How can i get plid of that portlet?
My code is as below:
#if ($nav_item.getName().equalsIgnoreCase("specific menu link"))
#set ($myURL = $portletURLFactory.create($request,"portletname_WAR_portletnameportlet",$getterUtil.getLong($plid),"RENDER_PHASE"))
$myURL .setParameter("view","methodName") //Controller paramter
<a href="$myURL" > $nav_item.getName()</a>
#end
Its appending my paramters to current url and staying on current page.
I have added my portlet on another page and tried using hard coded plid, it works fine but for different servers it will create problems.
So, How can i get my portlets plid at runtime in vm file to use while creating URL?

we have maintain some where else in configuration..
i can give you the tip some thing store PlId value in portlet preferences .. in the velocity get portlet preference by portlet id .. then get the plid.
some times portlet may be places in many pages so we may get multiple plids.
Use same page names across all portal based on page name fetch plid.

Related

common component across all CQ5 pages

I have created menu component, through which authors enter name, url field values.The component script renders the menu based on name, url entries.
Question : how to make this menu component common across all CQ5 pages, so it is not drag and dropped on each page.
Thank you,
Sri
ACS AEM Commons now supports this functionality without use of an iparsys - Shared Component Properties (http://adobe-consulting-services.github.io/acs-aem-commons/features/shared-component-properties.html)
Configure your menu with Shared and/or Global properties and you can simply template it directly onto all of your pages (no iparsys required). You can then edit the menu from any page on the site and it will by updated on all pages.

Providing Dynamic Hyper links in jasper server report embedded in webapplication to route within webapplication

I'm new to Jasper, I'm building a report and embedding it in my web application, which consist of List of names from my database, I want those names to be hyperlink so that if the user click on that name he must be able to view the details page about that person in my web application. Can some one please let me know is this feature possible ?
Yeah u have to create object id for each user and place that user with in html hyperlink tag then call function for showing the user page based on object id.

How to create a url link to connect with another application from my application in wicket

In wicket how can I move using link in one application to another application. I had my application url like this http://test.examplefree.com/hellohomepage/details now I want to create an url link in my application. so that when I click on that link it can go to other application whose url is like http://test.examplefree.com/statusreport/homepage. Both the applications have same domain name, but the links are different. And my both applications are on three different servers like dev/test/prod. So I don't want to hard code the entire url, only the part of it, like /statusreport/homepage or /homepage/anyapplication.
I tried with
html
Click Me to go to next application
java
add(new ExternalLink("externalLink1", "/statusreport/homepage", "Click Me"));
I believe what you've done should work. What does it produce in the final HTML ?
Another way is to use RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse("/statusreport/homepage")).

How to hide "User Information" options from "My Account" in Liferay 6.1?

I am trying to hide some options in "User Information" from My Account by using hook. I just want to hide it using CSS (style="display:none"). User Information is present in the right side of My Account Page.
I want to know, in which page I should make changes? While creating hook which page I should select for hiding those links like "Organizations, Sites, etc." Please help...
You have to choose the tab you want by writing them in the portal-ext.properties as follow :
#
# Input a list of sections that will be included as part of the user form
# when updating a user in the My Account portlet.
users.form.my.account.main=details,password,organizations,sites,user-groups,roles,personal-site,categorization
users.form.my.account.identification=addresses,phone-numbers,additional-email-addresses,websites,instant-messenger,social-network,sms,open-id
users.form.my.account.miscellaneous=announcements,display-settings,comments,custom-fields
Each field will be linked to its jsp. For exemple, "details" will display details.jsp.
Since your problem is finding the jsp file, you should do these :
download the Liferay source, and add the portal-trunk as a Liferay Project in Eclipse
Navigate through the portal to your desired file (manage my account), and get the url from your browser
Search for the "struts_action" attribute in the usl. For this case, it's "/my_sites/view"
This is very helpful as the first parameter indicates the portlet that controls the jsp page.
The second parameter usually is the jsp you are searching for
Find that file in the portal trunk and search for the html component you want to edit. it might be in the page itself, or it could be on an included one, or a sibling one (provided as a tab)
For your case, it's "/portal-trunk/portal-web/docroot/html/portlet/users_admin/edit_user.jsp"
It is not possible to remove those options using CSS. We can do the following simple java code for removing those tabs... The page which we need to edit is "/portal-trunk/portal-web/docroot/html/portlet/users_admin/edit_user.jsp".
List<String> identificationList = new ArrayList<String>();
for(String identificationItem : identificationSections){
identificationList.add(identificationItem);
System.out.println(identificationItem);
}
identificationList.remove("websites");
identificationList.remove("instant-messenger");
identificationList.remove("social-network");
identificationList.remove("sms");
identificationList.remove("open-id");
identificationSections = new String[identificationList.size()];
for(int i = 0; i < identificationList.size(); i++){
identificationSections[i] =identificationList.get(i);
}
Its easy to hide those links by using the simple java code written above.

Forcing page reload from Vaadin portlet

Is there an easy way to force the entire page to reload from Vaadin? I have a portlet which affects the header value displayed which is pulled from IBM WebSphere's dynamic cache in a separate JSP.
I am porting over an old JSF portlet to Vaadin which depending on page reloads between actions to reflect the new value in the header template. So now I need to force the entire page (not just the portlet) to reload to make it appear that the action took effect.
You can reload the hosting web page with JavaScript:
getMainWindow().executeJavaScript("window.location.reload();");
I think this should also do the trick in a portal.