I am using Liferay version 6.06. I have developed a Login Portlet using Liferay plugins SDK under which the View JSP consists of a login screen. Upon submitting credentials from this view JSP it will be received by the processAction Method of my Custom Portlet class. All this works good.
I have two questions:
Currently the Login Portlet is being part of Sample Category under Liferay screen (I want to have my own screen, where initially upon entering http://localhost:8080/mycontext, I want to show that Login screen).
And once the credentials are received inside the processAction method of my Custom Portlet class, I want to display my own two portlets.
Could anybody tell me how to achieve this?
Beside you don't need a customized login for your Usecase, in case you still need to customize the login process you should:
build a hook which is a kind of plugin able to interact with Liferay's core functionalities.
In case you don't know take a look [here] http://www.liferay.com/it/documentation/liferay-portal/6.0/development/-/ai/hooks
or just use the property login.events.post=my.custom.PortletAction
and put your business logic after successfull user login
Related
When a user logs into the Liferay Portal I want to show a visualization of the list of files that they have access to. This visualization would be done using Javascript, but preferably not inside a portlet, but just being run on the Portal homepage.
I was looking into some of the JSON web service examples, but I was a bit confused on how to invoke some of the Liferay remote services to access the document files from an application that doesn't extend the Liferay portlet class.
Is this possible to do this from outside a portlet or would I need to implement something using URL parameters as referred in one of the Liferay examples? I don't know there is something I'm not understanding here.
EDIT: I want to implement these remote service requests for the visualization inside of a custom theme that I am using. Yet, due to Olaf's recommendation, I will look to see if implementing my visualization and service requests inside of a portlet would be a better solution to my needs.
Yes, it's possible. I'm not sure what you mean with "not inside a portlet, but just being run on the portal homepage" - typically everything that's displayed on the UI is encapsulated within a portlet (well, or within the theme - but for maintainability reasons I'd keep it out of the theme)
You'll need the p_auth token - how to obtain it is part of the documentation that you link (or the surrounding chapters)
If you run into specific problems, please edit your question and list them (and your code). Currently your question reads "Is this possible...?" and the answer to this is "Yes".
I have a requirement in liferay portal to allow user to add some specific portlets on a particular page. Same can be done in 2 ways:
This will require some custom code to be plugged in add panel code
create a custom portlet which will be present on left hand
side of page and allows portlet to be added and dragged on page.
On add of portlet it checks if the page can have this portlet and accordingly remove it
The question I have is which of these 2 approaches shall be used, and how?
Note: I was unable to find much about this on google as well
I believe Liferay permission system is strong enough to express what you need.
The portlet list shown in "Add more portlets" menu can be customized through a Regular Role. See How to customize which portlets to show in “Add more portlets” menu for detailed info.
To restrict the options for a single page (or several pages), modify its permissions, so that only the new Regular Role is be able to update it.
Based on your comment to Tomáš Piňos's answer, my suggestion would be to create a custom portlet that uses Liferay's API and enables you to do just this: On the page where it's available, use it to enable/disable the portlets you'd like to be there by use of Liferay's API. You'll find quite a lot of sample when you're looking for the old sevencogs example (that sadly does not compile any more, but in general the API has only changed marginally). The most up to date resources with further links to the ancient code are these 2 blog articles.
About your third option (as you ask in the comments): Yes, it's possible: You can override Liferay's Services as well as react to model changes. This means that you could add your own check on updates. However, I'd feel it inappropriate to offer the option to add any portlet only to prohibit it whenever a user indeed uses the offered option. That's why I didn't include this option in my initial answer.
I'm new to liferay, trying to create web app using liferay protlets. I'm trying to create a custom login portlet. In html file, using form action method I'm trying to call a jsp file, which is giving error. help me out. can you give suggest some tuts so tat I can learn how to design dynamic liferay protlets and to deploy in the liferay portal server.
You can achive login in liferay by
An AutoLogin hook http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins#section-Portal+Hook+Plugins-Portal+Properties
Extending authentication pipeline http://www.liferay.com/community/wiki/-/wiki/Main/Developing+a+CAS#section-Developing+a+CAS-Authenticaton+Pipeline
By your custom implementation http://www.liferay.com/it/community/forums/-/message_boards/message/16008439
Extending Liferay itself (by EXT plugin) https://www.liferay.com/community/wiki/-/wiki/Main/Ext+Plugin
I would suggest doing them in the order I specified, as they increase in complexity.
Please do let me know of any specific queries in these.
I'm trying to create a custom login portlet for liferay because I also need to do some other things such as logging. However the problem I've stumbled on is that the portal-impl.jar seems to be shielded off so I can't use the loginutil class.
Now I don't want to modify how the actual login works so this is quite a bummer.
I've read something about being able to use something like ext(the explanation was quite vague) but that didn't seem like the cleanest solution.
I've got some experience at developing portlets, but I'm new at developing for liferay.
creating an "ext plugin", as it is called, is the best way to solve your problem.
This part of the documentation should be your first step.
First, you should identify in the portal.properties the properties to modify : be it another autologin in the pipeline, or an action triggered by the login action. I often use the first one for custom SSO actions, and the latter for auditing purposes.
Then create an ext plugin with your custom class (extending loginutil, for example) and create embed the portal-ext.properties needed to reference it.
That way, you should be able to have a clean package to deploy and undeploy ; customizing the jsps of the login portlet can also be done.
Arnaud
Why do you want to use the LoginUtil class?
If you really just want to add logging to the login you can maybe just create a post-login hook. This hook will intercept each user login so you can do your custom logic such as adding some logging with the user's information.
The advantage of this approach is that your code is completely separated from Liferay.
I want to develop an application like LifeRay control panel which has right navigation menu and a page that renders the clicked menu.
My question is how to develop at for example as one portlet or multi portlet taking into considaration (portlet communication)? and how to handle navigation inside portlet?
I'm using Icefaces(JSF) for portlet development and there is a section repeated for other pages(template)
Is there an example in liferay source for this?
Can't you just adjust a theme to have the navigation at the side as opposed to the default (at the top)? This way you'd be developing a plain portal application without any special magic - probably the most intuitive way to go.
Also, others will likely be able to quickly understand what you did and are able to add functionality.