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.
Related
I have been using Liferay for work for 2 weeks. I noticed that it's a bit difficult to find good documentation and tutorials.
Until now I created pages from the web portal. After I create them, I drag and drop portlets. I don't really like this approach, I would prefer to use a coding approach. Is there a way to create a website or page programmatically by defining a project as I do to create portlets?
Moreover, I am using Liferay with WebLogic 10.3.6. I want to know where liferay puts pages I created via web-portal on the file system. I suppose that a file, or something similar, is created when I declare a new site on the Liferay web-portal.
Thank you all,
Marco
Yes Liferay has it's Database, all data of any Liferay object is stored in the database and / or on the file system depending on your configuration.
However, one of the functionality of Liferay is to let you create pages / sites through the UI. As documented in the Java Portal Specification and Liferay Server Documents your approach to create pages in an alternative way is possible but it is part of Liferay's Portal Services. You can use Liferay's Service (HTTP REST) API to call the related service. To access those APIs you need to configure your Liferay Server.
In case you want to do programmatically you still need to configure, enable and call those external HTTP services from your code. You should not create Liferay Objects from your own code hosted as an extension inside your Liferay Instance as that will result inconsistency in your Liferay Database / filesystem. (As in case of page creation Liferay creates a set of other related objects in it's database / filesystem.)
In your liferay bundle you will find two plugins of interest.
First is resources-importer-web for which description says
The Resources Importer app allows front-end developers to package web
content, portlet configurations, and layouts together in a theme
without saving it as a compiled .LAR file thereby allowing for greater
flexibility in its usage between Liferay Portal versions.This app will automatically create associated content when other
plugins are deployed that are configured to make use of the Resource
Importer app.This app installs as a Liferay service.
Second is welcome-theme which declares resources to be created by resources-importer-web. This on should be example how to create your own. Take a look at
welcome-theme\WEB-INF\src\resources-importer\*
welcome-theme\WEB-INF\liferay-plugin-package.properties
This feature is described at importing-resources-with-themes
As mentioned by gabor_the_kid, Liferay stores all objects in its tables. For example, User related objects would be in user table. Liferay exposed services or API's to change the default/to add new behaviors by program but not easier than achieving it through UI. Also maintenance should be considered for going program way of creating pages or layouts etc.
You can describe your changes using xml and use the Liferay Portal DB Setup core to create the changes in DB.
The library defines the list of available xml configurations.
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.
There is a guide on the Liferay site Developing a Portlet with Multiple Actions
Do you know where I should place the code of the MyGreetingPortlet class?
What should be the file name and in which folder I should place it?
Check out the Anatomy of a portlet in the same tutorial.
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
is there a way to create/export a LAR from liferay server A and import this in liferay server B with a script or even a maven/hudson plugin? I'm using Liferay 6.0.5.
thanks,
Stijn
The best way to achieve what you want is to make use of scheduling for remote publication. You can find this option in the manage pages portlet.
Keep in mind that you can deploy servlets in Liferay. I would package the war file as a "web" plugin as described in this article on Nabble in order to access the Liferay APIs. From here you could perform whatever units of work you want, of which exporting a lar file. Call the servlet URL with the appropriate parameters and you're g2g.
You may refer to following Liferay resources to get details of Liferay API:
http://docs.liferay.com/portal/6.1/javadocs/com/liferay/portal/service/LayoutLocalServiceUtil.html
https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portal/staging/StagingImpl.java