How to render a web page in a portlet view? - liferay

Can any one please guide me that how can we render the custom web page view in the portlet?
For example, I have a input text box in my where user can enter the target URL and on click of the submit button the portlet content should display the target URL page.
I don't want to use the existing core portlet (IFrame). I need to design my own with some business logic.
Any guidelines or suggestions on how to render a webpage in the portlet?

This sounds like a question on how to build a basic portlet. Please check a tutorial (step-by-step).
If this is not your question, please specify further - your question is way too broad to assume that you have a specific (other) problem.

Related

Call Custom aAction from Liferay Theme

I have A Custom Theme project & A Custom portlet project in liferay.
I want to call a custom action which is in Custom portlet from navigation.vm File of Theme Project.
actionurl is : /c/journal/upload_article which is called from same portlet project successfully.
How to call this from theme project?
Any help is really appreciated.
It sounds weird to "call" an action from a theme. If you embed a form to upload content on every page, naturally, you'd need a target for the upload. But still, the theme seems to be the wrong place to do so.
Nevertheless: It seems that you're using a non-custom URL for uploading (/c/journal/upload_article). You can do so from wherever in HTML. The big question then is: Where will you end up after the upload, as it doesn't happen from within a page.
If you need a proper portlet URL on an individual page, and want to return to the same page, the best way forward is to embed a portlet in the theme (which makes a great search term for Liferay's documentation). From that portlet you can utilize Liferay's API to do what you're trying to achieve. Make it a very lightweight portlet, because, well, it will be embedded on every single page.

How to add preference option to the liferay portlet

I want to create a portlet where the portlet allow access to the remote application. That is the content of the portlet should be dynamic so for the same reason I want to add one option "Preferences" in the portlet (Where the look and feel and configuration options exists). In that preference page If will give some http url (http://localhost:8080/Myapp/Mypage) then on click of save button, the URL page should display in the portlet. How can I do that? Note I am going to use same portlet in different pages with different URLs.
Liferay's "Preferences" link shows the portlet in JSR-286 "edit" mode. That's all there is: If you implement this mode, you'll automatically get the Preferences link.
Why are they named differently? IMHO Edit-Mode is rather misleading as you're editing the preferences rather than any data displayed in the portlet.
You can use Liferay Iframe Portlet which allow access to the remote application.
Refer following url for detail description of look and feel and configuration options : Iframe Portlet

Finding specfic jsp page and extenting functionality using hook

I am using liferay. I want to add new functionality to existing jsp page.
I will be using hooks for that purpose.
The problem is how to find existing jsp pages locations?
For example
I want to locate "Add regular Organization" page.
Pls help
Thank you
jsp files under source folder : html\portlet\users_admin\organization and html\portlet\users_admin\edit_organization.jsp are jsps for "Add regular Organization" page.
There are certain ways, liferay provides its functionalities using default portlets that comes with liferay-bundle. You can look at folder portal-web\docroot\html\portlet under portal-src, it will give you idea to locate jsp page locations.
Moreover you can look at portal-web\docroot\WEB-INF\portlet-custom.xml, portal-web\docroot\WEB-INF\struts-config.xml and portal-web\docroot\WEB-INF\tiles-defs.xml for portlet specific actions and respective jsps.

Use a web content portlet

I am using web content portlet to develop a portal.
Each page has common theme (which includes header and footer) and we have many portlets placed on each page.
One of the portlet on right side is menu which is common on many pages.
I could have kept it as a part of theme but the menu can be subject to change in future and the end user who will be handling the portal is non-developer.
So if they want to change some data in that menu portlet, they will have to change it on every page which leads to duplication of effort.
Like I said, since end user is a non-developer, I cannot make that portlet part of the theme.
So is there any way where one web content portlet be created once and used on many pages?
You can embed web-content in theme as per link
Here articleId as in above link, you can set in theme-setting, refer to link
I have found a solution right now. If anyone has abetter solution than this..they are most welcome. I would like people to share alternate and better solutions
I am using Liferay 6.2
What I did was added a new web content display portlet which like I said created a new blank web content display portlet.
So my usual method was to add content to this portlet. THis was the method I followed. You can click on Select Web Content button and then select the already created portal from the list and you are done. NO need to create duplicate portlets

Liferay portlet for creating web content

I use Liferay to manage web content. I would like my end users to create web content but I don't want them to go to back office to manage it.
So I would like a portlet that I can setup in public pages and which allows the end users to create web content directly in public pages.
Is there a simple way to do it using Liferay 6.1 or code is needed ?
Have you tried OOTB Web Content Display portlet? You can add Web Content Display portlet on any page and content can be created in that portlet itself which on publishing(if no workflow involved) will be visible on the page.
If Sandeep's answer is not what you're after (but I suspect it is) then you can write a custom portlet that uses Liferay's JournalArticleLocalServiceUtil methods to interact with Liferay Web Content. However I'd go with Sandeep's suggestion first as it doesn't involve coding! :)
If you want to develope another webcontent portlet as avaiable in control panel. You have to go for custom portlet creation and use the db tables like JournalArticle, JournalArticleImage, JournalArticleStructure and JournalArticleTemplate.

Resources