Show only working hours in calendar portlet - liferay

I'm using Liferay 6.2 GA 4 CE and I want to change the default hours view in the calendar portlet from 24 hours to just working hours (8 am - to 7 pm).
I've looked into the configuration and couldn't find anything related.
How could I change this?

You can't accomplish your target via portlet configuration, you have to modify the plugin.
The Calendar portlet is an external plugin (it is not a core Liferay portlet) so you can't hook his JSPs, you have to retrieve the source (source on GitHub), create a project inside your IDE and make the changes you need.

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>

Migrating to Liferay 7 from liferay 6.1.2

I have been reading the liferay documentation about migrating from liferay 6 to liferay 7 (https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/from-liferay-6-to-liferay-7).
I have a basic liferay 6.1.2 application bundle with tomcat that contains a few portlets and all I need is to make it work the same way, without using any new feature (OSGI and all) with liferay 7.
Do you know where I could find a list of new configuration files and a list of the ones that have been deleted?
Is there a place where I can find the new dependencies required by liferay 7 for each of my portlets?
I used the liferay tool to generate the new theme so that's a start...
Any links or advices would be appreciated,
Thanks
EDIT :
I can start liferay 7 with the portlet inside the /deploy. I get no errors, only info like "portlet1.war does not have a WEB-INF/liferay-plugin-package.xml or liferay-plugin-package.properties."
The localhost_host_access.log show a few 404 but not as an error...
I really dont know how to proceed to have information (errors, logs,....) to make this work : my portal is still empty.
You can follow the upgrade procedure (read through the link you've provided) and it should be able to
upgrade your database
upgrade parts of your code
If you are using Liferay IDE or Developer Studio there is code migration wizard. It will not solve all issues but will examine your code and advise you how to change things it can not change itself. This recording in an year old but it will give you an idea of what IDE does (probably more by now). It uses a database of breaking changes, most of which is published here so you can check what is relevant to you.
I do not recommend you do that. First migrates from 6.1 to 6.2 and after 6.2 to 7 or you can redo the entire portal, from Liferay we do not recommend making such low migrations. I recommend you look at the community and OSGI ...

Editing multiple themes in Liferay already deployed on the server

I'm still familiarizing myself with Liferay. I currently have liferay 6.1, running on Glassfish on a linux server. Right now, I'm trying to edit and view the edits of multiple themes that I have downloaded and included in my themes location of a deployed Liferay instance.
My question is, what is the directory convention and best practices for theme customization. I've added the themes through the Liferay GUI itself but for more custom editing I'm directly editing CSS files in the themes/ directory.
I'm having trouble finding information regarding the build and directory information. How does liferay know which theme is active at a given time? Is this reflected in the directory? Is there an 'Current Theme' folder? Is there an easy way to easily swap out themes that I'm editing? Should I be using the __diff directory or is this only used when editing from the GUI?
You shouldn't edit a deployed theme in the appserver's directory. If you edit/develop a theme, you're typically editing files in the _diffs folder. Each theme is built as "the difference" to a base theme, typically one of Liferay's _styled or _unstyled themes. Everything that is different from them (typically you start with css/custom.css goes into the _diffs folder. Upon build (and prior to deployment) everything gets merged and subsequently used by Liferay.
There's no "current" theme, as Liferay can have a theme per page, or per site (e.g. Liferay can maintain many sites - and pages - each with their own theme). You choose the active theme per site or page in the page administration (Manage/Page, select Look&Feel).
Please read more in the Developer's Guide and Wiki.
Also, the 6.1 branch (if you're speaking of CE) is discontinued, you might want to upgrade to 6.2 unless you're using Enterprise Edition, which is still supported for a few years.

Importing Existing Eclipse Projects into Liferay IDE

I'm trying to convert a Dynamic Web Project in Eclipse into a Liferay Project (ultimately a portlet).
I create my DWP, but I don't see the option to Convert to Liferay project when I right-clilck.
In the Liferay Docs, it states:
Note: If you don't have a convert action available it means either
that the project is already a Liferay IDE project, or that it is not
faceted (i.e., Java and Dynamic Web project facets are not yet
configured). Configure accordingly before moving on.
What do they mean by "Configure accordingly" and how can I accomplish this?

Liferay : custom Web content Display List Portlet

I'm beginner in Liferay, and I need to customize the portlet webcontent display list.
I added a portlet in my page Home, and I managed to see the recent news that I created.
The news is displayed in a table (title, author and date display).
I want to display the news like this:
- The date of the news (above the title of the news)
- The title of the news (which is a link to the news)
I tried to create a structure, but I do not see commits its work?
Thank you to enlighten me?
PS: sorry for this English !!
Liferay is available in source - did you look at the implementation of the webcontent list portlet? You can either create a jsp hook for that portlet or just reimplement a similar one based on what you find in there...
As you say you'd like to customize Webcontent display list I assume you don't want its default behaviour. Once you know what to change in this portlet, read about jsp hooks, create a hook with the jsp changes you'd like (if it's limited to jsp changes) and deploy it.
Liferay's development documentation should have the information that you need, otherwise continue in the wiki on liferay.com
Edit: Also, you might want to look at AssetPublisher - maybe this provides a few more options for formatting your output.
Generally Liferay web content in journalarticle table. I have referred Liferay 6.0 Version.
Now, for showing liferay custom portlet view, you should use Liferay Portlet Creation and Liferay Service Builder.
Here are two useful article on those -
1> Liferay MVC Portlet
2> Liferay Service Builder
Now make the service for journalarticle table and use those in your portlet.
Some useful fields of journalarticle table for your reference are - title, createDate etc.

Resources