Converting Vignette Portlets to Liferay Portlets - liferay

As the title states, i'm trying to convert these Vignette portlets into Liferay portlets.
Is there any documentation on this anywhere? I've searched the entire Internet
-When trying to deploy my WARs right off the bat, I'm getting a "missing liferay.plugin.packet.xml" which tells me the entire portlet must be reconfigured to work with Liferay.
-Running Liferay 6.1.1 ga2 on Web Logic 12c server
Cheers!

You mean "liferay-plugin-package.xml", don't you?
You will find such a file in the source of Liferay at /portal-web/docroot/WEB-INF/liferay-plugin-package.xml. For other examples just download sources from other Portlets (Github or Liferay-Marketplace).
Besides some other values, this file defines how Liferay should handle your war (layout-template, portlet, theme).
EDIT: As the marketplace does not allow (plz see the comment in: liferay-plugin-package_6_1_0.dtd) portlets having an liferay-plugin-package.xml, I would recommend to use the corresponding properties file.
Reference file (in the portal sources): /definitions/liferay-plugin-package_6_1_0.properties

Related

Liferay Portal customization

I'm new to the Liferay Portal and I have been assigned to develop a Liferay application with the following structure:
logo
search bar
result list
We plan is to sell the application to different customers so the resources like images (logo and so on) and css need to be customizable. According to this tutorial resources like images and style sheets are part of the portal apps which are deployed to Liferay. So in my case for 2 different customers I would need 2 different app versions. Instead I'd like to have one version of the portlet which would load all the resources from a database (maybe via a rest call to an appropriate configuration service). That would give us an opportunity of a better provisioning.
Furthermore I'd like to be able to share css resources between different portlets.
Any ideas how I can achieve this 2 goals?
You seem to be talking about themes. You need to create a Liferay Theme. You can Extend an existing Liferay theme or create a brand new. Themes are like portlets meaning you deploy them the same way only they are specific for what you seem to be descibing. Take a look at https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/theme-builder.
Here you have lots of examples https://github.com/liferay/liferay-plugins/tree/master/themes and scripts for generating new themes.
Hope it helps
As Sudakatux said, you're talking about themes. I'd just like to add a couple of things:
If you're talking about styling portlet content (i.e. what should it look like when you display content in a portlet), you want to search for Application Display Templates (see links below).
If you're talking about styling portlet itself, i.e. what it looks like when you place portlets on your LR, you can do that within a theme.
Themes in Liferay 6.2 and 7.x are incompatible. You tagged the question LR-6 and LR7; I'd recommend choosing one (LR7 is vastly easier and faster to develop themes for, in my experience)
If you are creating your own portlet, and you want to style the content of your own portlet, you'll have to do that within JSPs. Edit: You can also use Freemarker with your portlets; however, I personally still prefer JSPs due to the sheer power of what you can do within it.
Useful links:
Liferay 6.2 Lunar Theme tutorial - shows how to create and deploy LR 6.2 theme
Liferay 7 Theme sample - LR7 has a Blade project that shows a lot by example. You can change Maven to Gradle and vice versa. Very useful.
Application Display Template LR7
Application Display Template LR6
This is how your theme directory structure should be laid out in Liferay 7 DXP. Make sure though you create a Liferay Workspace and create a Liferay module ( theme ) in that workspace. If you do not, you will have lots of errors and cause yourself much confusion.
You can put all your css changes in the _custom.scss file and they will overwrite the default css styles.
Blade CLI will generate the core freemarker templates. I recommend a header/footer template as well.
Lastly, this is how you reference the logo in your freemarker template
<a class="${logo_css_class}" href="${site_default_url}" title="<#liferay.language_format arguments="${site_name}" key="go-to-x" />">
<img alt="${logo_description}" class="logo1" src="${site_logo}" />
</a>

Liferay : How to see which portlets are composing a page?

I'm new to liferay.
I imported a big lar into my liferay instance but, for the moment, have none of the required portlets : there are a lot of portlets in the project I'm joining.
Currently, I have the site structure, but the pages display the message that the portlet is not here (logical).
For comprehension purposes, I wanted to build my portlets one after the other, on the need, to see them appear by the grace of liferay ;-)
But for that I wanted to know which portlet is missing.
This thread : How can i find - which portlets are deployed on which pages in Liferay 6.1? explain how to achieve this through the DB.
Is there really no built-in solution to do it through the liferay interface? Have we really to hack in the DB to get the info or install plugin?
Thanks!
In your browser console, Liferay.Portlet.list contains all portlets in the page.
This value is generated by themeDisplay.getLayoutTypePortlet().getAllPortlets() on the server.
As an alternative you can also look at the HTML code of the page and look for elements with the class portlet-boundary. For example this belongs to an instance of the Journal Content Portlet (Portlet name 56):
<div class="portlet-boundary portlet-boundary_56_ portlet-static portlet-static-end portlet-borderless portlet-journal-content full-screen" id="p_p_id_56_INSTANCE_WdRdMGe86kDa_">

Find Source for Portlet

To learn more how to implement portlets in Liferay, I want to view the src of existing portlets, e.g. the "Documents and Media" Portlet. Where can I find this src code? I downloaded the src of Liferay but I cant find the relevant files.
The way to learn more about building portlets in Liferay is probably to check out the Liferay Plugins repository, rather than Liferay Portal source.
Some Liferay portlets come OOTB in Liferay Portal itself -- that's what #ArtemKhojoyan is mentioning above. However, as these portlets are pretty thoroughly integrated with the portal itself, they may not be super helpful in figuring out how to make a plugin to deploy on Liferay.
To check out some more standalone portlets, download the Plugins repo -- either by cloning the source on github with https://github.com/liferay/liferay-plugins.git, or downloading a plugins SDK at http://www.liferay.com/downloads/liferay-portal/additional-files -- and open up the portlets/ folder -- that's probably going to be more helpful in showing you hot-deployable portlets that will be more similar to something you'd make yourself.
For Liferay 6.2.0:
Java: \liferay-portal-src-6.2.0-ce-ga1\portal-impl\src
JSP: \liferay-portal-src-6.2.0-ce-ga1\portal-web\docroot\html\portlet
Your required case:
Java: \liferay-portal-src-6.2.0-ce-ga1\portal-impl\src\com\liferay\portlet\documentlibrary
JSP: \liferay-portal-src-6.2.0-ce-ga1\portal-web\docroot\html\portlet\document_library

Developing a Portlet with Multiple Actions in Liferay

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.

Setting up a new website with Liferay Portal - basic steps?

I know this is not specifically a programming question, but programmers will often have to do this work.
How do I create a website with Liferay portal - the docs are pretty light on this fundamental issue and are all for version 4.4. I am using version 5.2 and the docs don't seem to be relevant.
Do you know what the basic steps are. So far I have logged in as the bruno user and can see the 7cogs website and edit it. But I now need to create my own website (for my company) and be able to develop portlets to add to the parts of the page.
Further I notice that the docs talk about doing work in Eclipse. If our website is all static HTML, (the reason we want liferay is mainly so that we can edit content items using its content management tools), then will there be any need for Java dev, or will it all be drag n drop and clicking to get setup. Any guidance will be much appreciated.
Liferay can be used as a simple CMS, without much Java knowledge : creating, editing and positioning of web content fragments are drag'n'drop and use of the included rich text editor.
But to start using Liferay for your company, there are two main steps : a technical configuration (database, etc.), and a look'n'feel customization.
The technical part
First of all, you should get rid of the 7cogs website : this is called a hook in the Liferay wording. To do that, if you are using Tomcat for the application server, just delete the 7cogs directory as stated here.
You can now create the configuration file for your installation : it's a simple text properties file, named portal-ext.properties and placed in the webapps/ROOT/WEB-INF/classes folder of your tomcat installation.
This file handles most of the configuration of the Liferay portal, for example :
the name of your company
if you want to display a terms of use page on first login
if you want anybody to be able to create an account on your portal
the database where the data will be stored
To do this, the properties in the portal-ext.properties override default properties found in a embedded portal.properties file located in the jar file portal-impl.jar, in the webapps/ROOT/WEB-INF/lib directory. Just unzip the jar file in a temporary folder to access the portal.properties file.
A sample portal-ext.properties file :
company.default.web.id=yourcompany.com
terms.of.use.required=false
company.security.strangers=false
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root
Once done, you can startup your application server. As the default admin (named test, something you can change in the portal-ext.properties file), you can access to the centralized web "control center", located in the "dock" (the strange menu labelled "welcome Test" in the upper right part of any page once logged in).
I would advise you to read the administration guide, useful for most administrative tasks.
The "branding" part
Liferay uses "Themes" to automatically decorate the portal pages (logo, navigation, portlet borders...) using images, CSS, Javascript (JQuery) and the templating language Velocity. The themes are bundled in a .war file, like a standard web application, and deployed on the fly either via the control center or by dropping the file in the deploy directory of the server.
Liferay can use several themes at the same time, one for each community (a group of pages, users and content) for example.
Creating your own theme can be done afterwards, using the "Plugins SDK".
The Wiki, forums and blogs can be very useful.

Resources