Using different Stylebooks for different organizations/user groups in Liferay - liferay

I'm using Liferay 7.4 to renew our university portal.
For the different areas of studies we use different colors, so I made a stylebook for each area.
How can I assign the stylebooks to organizations or user groups?
I found a similar question for Liferay 6.2, but the link in the post isn't working anymore:
different Style for Users with different Roles in Liferay
Is it still possible in 7.4? If not, is there any other option?

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 or GateIn

Now our team is facing new project - creation of new company's intranet portal. Because of some reasons we are considering java open source portals and deciding between Liferay and GateIn.
One of very important requirements is following: portal representation for users must depend on country/language settings of customer computer, it means not only portlets localization but users in US subsidiaries of the company should see probably other structure than users in France.
Is it possible to implement the requirement in Liferay and GateIn?.
This can definitely be achieved through Liferay. Please have a look at the concepts of creating organisations.
Am not sure if this can be done in GateIn. However, there are many other things that you may need to keep in mind before choosing these Portals. I have tried to mention few of them here.
1. Check the stability of the Portal server that you will choose to run on a particular Container. GateIn initially was unstable.
2. You may have to override few files (for your customization) if required. GateIn uses GTMPL view technology for the same. Check how good are you in this. In this case, Liferay is easier (Liferay doesn't use any GTMPL UI framework)
3. Apart from developing a location based Portal, if you are also trying to achieve other things like fully Ajax based pages, a good UI framework (like JSF) etc then check if the Portal server you are choosing runs on a particular Container which supports Ajax, JSF (latest versions)
Above were few and list may grow. But, to conclude I would suggest to go for Liferay :)
This can be achieved with Gatein at different level :
Sites : you can declare multiple sites running on the same portal instance(sharing same User Base). In this case you can automatically redirect user to different country sites, based on the country/language of the user.
Sites Navigations : Gatein provides portal, group and user navigations. Navigation is created dynamically when a user connects to the portal. You can have only websites, navigation will created dynamically by user (based on group and user permissions).
Pages (Dynamics layout rendering): GateIn renders each page dynamically. A page is composed of multiple containers that contains portlets or gadgets.
By setting permissions on each container and by using User Group or Membership of the connected user, it's possible to have different page layout.
Of course, you can also mixed these 3 approaches to build your portal.
Liferay is very buggy, and community is very bad. Unless you pay the support.
GateIn promises much, but still lacks functionality.
You may consider JBoss Juzu and Apache Struts to develop generic portlets in order to void any portal vendor lock-in.
Struts provides features of internationalization, localization, timezones achieve my project.
I make use of struts2-portlet plugin to achieve a reporting portlet running on multiple portals. Here is my sample: code.google.com/p/jasperrocks/wiki/Features

Using Liferay for an already developed project

First of all, let me tell you what I am or my company is intended to do. We have already developed a project using Java, JSP and Servlet. We want it to integrate with Liferay so that we can change logo, css, images, themes or any other UI related component at run time using Liferay admin panel. But backend should be what we have developed.
In short, the UI of our project is controlled by Liferay, but control of data displayed on UI or submitted from UI should be from our developed backend code.
Now I have a few questions regarding above said approach of fulfilling the requirement:
What we are trying to do is possible?
Is this approach recommendable for what we intended to do?
Or do we need to develop our project from scratch to fit into Liferay? Like developing portlets and deploying in Liferay or other approach that has been given in Liferay documentation.
What about database integration? We have around 15 columns/fields in user table in database of our project which is completely different from that of Liferay's user table.
Liferay is a very new for us. We have checked the documentation section of Liferay but still few things like above said requirements and its implementation is not clear. Also, we would like to know in what scenarios/requirements Liferay is useful.
Ok let me try to answer your question point-wise and I would answer your last question first, which should automatically clear other questions:
Q. Also, we would like to know in what scenarios/requirements Liferay is useful.
This can have a very wide answer, but I have made it shorter for you:
If your site is content heavy and not data heavy then go for Portal
If you plan to use only a single web-application in a portal then I would suggest standalone custom developed web-application is much better.
I agree liferay portal will give you lot of things out-of-box like Single Sign-on, authorization, authentication, friendly-url and page creation and also lot of applications like Blogs, Wikis, Document library, some social networking apps etc. But think about it, do you really need all this? if not, then this is overkill
Here are some really nice links to better understand a portal's usage:
When to use a portal
Why to use portal technology
liferay tag wiki: It has nice description as to what is liferay and it also contains relevant links to Admin guide which will tell you what all functionalities liferay has and how you can manage it.
So still if you find your other questions unanswered, read-on ...
Q1. What we are trying to do is possible?
Nope. Portlet technology is different from Servlet technology. Liferay (or anyother portal) does not provide a way (atleast a simple one) to integrate servlets that would render pages inside a portal. For eg: Since with servlet you define URL mappings for a particular servlets before-hand in a web.xml but in a portal the URLs are generated by the Portlet Container. So portals work with portlets and not Servlets.
Q2. Is this approach recommendable for what we intended to do?
Nope. As I already explained in Q1.
Q3. Or do we need to develop our project from scratch to fit into Liferay? Like developing portlets and deploying in Liferay or other approach that has been given in Liferay documentation.
If you want to go the liferay way then Yes.
If you want to build applications that talk to your custom tables then portlets are the way to go.
Q4. What about database integration? We have around 15 columns/fields in user table in database of our project which is completely different from that of Liferay's user table.
If you go with Liferay. In this scenario you can create a combination of liferay-hook & portlet (may be using service-builder) to customize liferay's User creation mechanism and there by store data in both Liferay's User table and your custom tables.
Liferay's permission system is really fine-grained so you can also benefit from this system and put permission even on the data level.
In conclusion I would say:
Everything boils down to what your requirements are and what resources you have. And sometimes what future requirements you can have.
Note: All the terms used in this answer which are specific to liferay (like service-builder, hook etc) are explained in the liferay tag wiki.
Hope this helps. If you would like to know anything specific I would gladly update my answer.

User specific dashboard in Sharepoint

So I'm building dashboard that consists of more sections. I'm planning to build each section as a web-part. Dashboard is going to be Site Page. Problem is I have more levels of users, and these levels have different dashboards (different sections and layout). How to make site page dynamic and user specific?
there are two approaches you could use. I think the best one is the AudienceFilter where you could make elements available for various audiences.
Another apporach is to group users into SharePoint groups and build a GroupTrimmedControl SharePoint already offers the SPSecurityTrimmedControl which is a great starting point.
But when you're not limited to MSF (SharePoint Foundation) you should have a look at the AudienceFilter.

New to Liferay 6.0

I have only recently started using Liferay 6.0. I have downloaded liferay-portal-tomcat-6.0.4_1 community edition.
First of all can you please recommend me some website and books or articles for Liferay 6.0? (The ones available on the Internet are for earlier versions...)
Secondly. I don' t seem to get the structure of Liferay. For example, how do organisation, communities, users, pages all fit in together?
Lastly, could you tell me how I could make a link on a page to point to a directory on the file system at the local machine of the user?
Thanks.
To work through Liferay internals is really tough but it's not impossible. There's no main source of documentation and people has to google around and forget things very easily without possibility to get back to the original source...
Organizations can form hierarchies as real organizations would.
Communities has similar role as organizations but from a different point of view.
The main difference consists in :
persistence - persists in time in
contrast to communities which appears
and disappears
administration - users “belong”
to an organization which means that
the the admin of an organization is
able to edit his profile. On the other
hand users “join” a community which
means that the community admin can
only manage the membership.
Relationship - organizations can
form a hierarchy while communities are
independent of each other
membership - users “must” belong
to an organization while joining a
community is optional
User groups - Unlike organizations and locations, user groups have no context associated with them. They are purely a convenience grouping that aids administrators in assigning permissions and roles to a group of users instead of individual users or assigning a group of users to a community.
Roles define permissions across the portal, an organization or across a community. There are functions like creation of a thread in a discussion forum. Problem is that there are forums across scopes like community, organization or the entire portal. So that portal role grants access to creation of a new thread in each and every discussion forum and community role just within a particular community.
I'm also a Liferay newbie but here's the general structure of Liferay in case someone is interested.
Organizations are a portal administrator mandated hierarchy. Organizations may have sub organizations that are administered by organization administrators in each organization. Each organization can have it's own pages.
Communities are like organizations but can't have sub communities and non-administrator users may be allowed to create them. Each community can have it's own pages.
Users are registered users who may have their own pages and may belong to any number of organizations and/or communities.
Pages are web pages that users with certain permissions can edit simply by selecting a predefined layout and adding/removing portlets and sub-pages.
Portlet is a web application that usually "runs" as part of a page in it's own window like container.
can you please recommend me some website and books or articles for Liferay 6.0?
Our liferay tag is a good place to start with. It contains all the relevant information about some useful websites and also some good books suggestion. And it is continually being updated.
I don' t seem to get the structure of Liferay. For example, how do organisation, communities, users, pages all fit in together?
Unlike for previous versions, the user-guide is really a good place to know some basic administration concepts like these.
could you tell me how I could make a link on a page to point to a directory on the file system at the local machine of the user?
I don't know exactly what you want or what is the requirement to do this, but giving <input type="file" /> would open the file browser to select a file or else you can use flash to achieve this or construct a link like Click to pen local folder - but this only works for windows and it opens the folder structure inside the browser itself and with IE it opens the Windows explorer.
Now, you can access Liferay documentation to learn more about liferay. Starting from v6.1 there are no communities. Now it has organizations and sites.
As far as I know, currently there is only one book for Liferay 6, from Jonas Yuan:
http://www.liferay.com/web/jonas.yuan/blog/-/blogs/liferay-book:-liferay-portal-6-enterprise-intranets

Resources