How to add Links in liferay - java

I am using Liferay 6.0.4 and I have a page which is available to all users including guests. The page is called "Information". The page has already been created.
Right now its an empty page.
I want to add these four links to that page on the left hand side:
1. Calender
2. Forums
3. Blogs
4. Docs
I have created that page with 30:70 layout so that I can place one Web Content showing these four url's on the left side and corresponding link content on the right side. The default content to show is the content of the link Calender.
I am not able to figure out how to achieve it as I am really new to Liferay. Please guide to me to the proper direction and if possible write some steps to follow...

If I understand correctly, you want a menu on the left hand side that updates the right hand side.
For this, you should use the Navigation Portlet on the left hand side, and create 4 child pages "Calendar", "Forums", "Blogs" and "Docs". On each of these pages, just drop the appropriate portlet and you're set.

Related

how to avoid blank page at the end of pdf report in BIRT?

I am using current BIRT version that is 4.5. I have two master pages in my report. I have huge data to display on a report so i have set some data to display on one master page and the remaining on another master page due to some reason. The problem is when there is no data to display on one of the master page it is rendering a blank page with header and footer of that master page which i want to avoid. In my pdf report how can i avoid this blank page?
Hi, all are pointing to hide tables or other components but my requirement here is, i need to hide the page itself. I dont think there is visibility option for page. even if it is there it is not so useful. Kindly understand that i dont want to display the page itself not only the components in it.so can i expect any help now?
I guess you added the tables directly on the masterpage?
That's not how it works. BIRT will render the (master)page and maybe hide the elements on them (for example a table that has no data. You can do this by setting the visibility property). The problem with this approach is that the Masterpage cannot be 'unrenderred'.
The proper way to fix this, is to add each element on the normal layout. In the properties for each table, grid, etc. you can set the pagebreak properties. Here you can select the Masterpage you want to use. If an element does not need to be rendered (by visibility settings), it wont trigger a 'blank' masterpage.
Hope that helps.

How to find out is a panel visible on page?

I use GWT 2.4.
I have a log of widgets on my web page, there are a huge tab panel with 13 elements, each element of tab has a panel. I use GWT framework. I have to make some logic when one of those elements is visible for user, how to implement it ???
I use Timer for "some logic" and to check whether the panel is visible or not.
I check :
if (somePanel.isVisible()) { do smth}
but it's not working because I also have other links and another elements and when I switch to another element it works but if I click on link - does not.
Thank you in advance :)
I suppose you're using MVP,
You should do the display logic on page load through a model that you write to the place url. links change place so your views are reinitialized (if you don't have a clientFactory)
Anyway, you don't give any details on why it doesn't work with links and what means
when I switch to another element it works

How to use Link - Command in jsp

I am new to jsp and trying to use link-command. I have a page where I need display links. But I was asked to display only 3 links on the page within a section and then provide a "more" link. When user clicks more, it takes them to a new page which will then list all the links that are coming from the database
Say, suppose the database provides 6 links for the product user had selected, the jsp page should link only 3 and a more link. Clicking the more will open a full page with all six links
Currently I am able to disaply all the links coming from the database in the same jsp
You can use JavaScript to dynamically show 3 last links and at jsp generation but some CSS class on all links over 3 first.
If you really want two pages, you can send a post or get parameter to tell the page to show all links or only first ones.

Dragging, Dropping & resizing elements

I have a web page which has three <div> elements:
Right_bar contains several layouts (nothing to do with this question)
Bottom_bar contains several components e.g. calculator, logo, a group of buttons etc. each component uses a <div> and must be resizable and draggable.
And a Working Area, where all the components are dropped & resized. Also a user can resize & change the location of components anywhere in the Working Area. Once a user sets a component then the page must be saved in same style and it shouldn't be changed even after refreshing the page.
My questions are:
Should I use a database to save the location of component.
Which one should I use: JQuery / AJAX / anyother?
If you know of any tutorials please let me know although I am beginner in JavaScript, Basically a Java programmer.
Note: on the server side I am using Servlet.
Whenever the user drops an element, launch a simple Ajax request that will pass the new value to the server.
try {
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // IE
}
catch(e)
{
var xmlhttp = new XMLHttpRequest(); // Other browsers
}
xmlhttp.open('GET', 'yourServerScript.url?param=value', true);
xmlhttp.send(null);
You may want to check if the request succeeded or failed by handling the "readystatechange" event of your http request, but that doesn't seem important in your case.
After that you just have to get the value server-side, store it in a session variable, and then on every page load, check if there is a session variable defined for the parameter before setting it to its default value.
What you can do is save the location of the control in a xml and save it in a table.
2.jquery UI has as build in framework that supports drag and drop div elements, check this link http://jqueryui.com/demos/droppable/
I did the same thing for an application. (but I used PHP, anyway it doesn't matter for what you need)
I used jQuery + jQuery UI drag & drop / resize
I used AJAX with 4 parameters (x,y, z-index and id of the element) for drag & drop on drag stop
I used XML as a database for this, but any database (or any persistance way) will do the trick. As #Thibault Witzig said, take the most pertinent for your project.

How to set webview area upon loading a link?

Ok so I have an rss reader that links to articles. One of the sites it links to doesn't have a mobile view. I was wondering if anyone knew if it was possible to set the "zoom" and position of the view once the page is loaded? So for instance if the following link were my article... http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7
Then how could I have the view focus on the article without the user having to zoom in and scroll the the top of the article. Thanks.
I think, you have to use an anchor, which are based on the ids of the HTML code. Then, you have to pass the Id you want to stick to after the url and a #.
With your example, it would give something like that :
http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7#c1256209263986
As the div you are looking for has an id (lucky you cause they don't have all the time)
<div id="c1256209263986" class="iw_component"><div xmlns:esi="http://www.edge-delivery.org
Hope this will help you (Try to click on the link I put, this should open the page at the start of the article.)
I never tried that but have a go a this, and come back to tell me if it worked.

Categories