I want to disable loading on start up of all portlets I deployed to the Liferay portal and want to load them on demand i.e., when a request or any dependent portlet is loaded.
How can I do this? Is there any settings available for this?
Thanks.
Related
We have a application built on Hybris 2205 OCC along with Spartacus 4. The requirement is to customize the default site url ie from https://localhost:9002 to https://localhost:9002/mySite . Usually Hac gets loaded with https://localhost:9002 but with this requirement it should get loaded with https://localhost:9002/mySite & similarly
Backoffice https://localhost:9002/mySite/backoffice. We have tried with couple of changes at tomcat configuration but nothing seems to be working as files gets reloaded with ant clean. Kindly provide your valuable inputs and help us to resolve the issue.
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.
Three simple questions...
Question 1.
I have a JSR168 portlet that is deployed over IBM Websphere Portal server at my company. I was using a version of IBM Portal server for my development but strictly speaking I don't think I am allowed to use these at my company. So now my plan is to do my development and testing on my local machine using liferay and then deploy to IBM Portal Server.
From what I have read about liferay since it supports jsr168 I should not have any problems. Is this correct?
Question 2.
I've just finished installing the liferay 6.2-5 stack on my mac from the Bitnami site. It is running but I am having troubles understanding how I can deploy my first portlet (which by the way works under IBM Portal Server).
After logging in I go to Admin> Control Panel> Apps> App Manager. I then hit Install and select my war file and then put in a context root. But I keep getting an error message "Please enter a valid url".
What is the problem here?
Question 3.
After the Portlet has been installed how can I see it in liferay?
thanks in advance
for 1: correct, Liferay supports JSR-168
for 2: You can either drop your WAR file in Liferay's "deploy" folder, which will cause Liferay to deploy it from there. If it disappears from that folder within a few seconds, it has been deployed.
The administrative UI allows you to do a similar thing through the Web UI - you can either upload your plugin or point to a URL where Liferay can download it: Don't mix it up with Websphere's admin UI where you give the context name for an uploaded application. In Liferay you'll either have to use the upload OR the URL. The context name is derived from the name of the WAR file.
for 3: You'll find your plugin when you choose the "Add" button - login as Administrator and you'll find a "+" labelled button on the left side of the screen. Choose "Application" and look for your portlet (you can filter the list). If you include some Liferay-specific deployment descriptors (look up WEB-INF/liferay-display.xml) you can also influence which section/headline it appears under.
I am developing Liferay portal and I have one portlet which handles the administrator side of the portal and one the client side. The thing is that the clients cannot see the administrator page (including the portlet). Also I have created custom DataBase for the portal (I included my own tables in the Liferay database using Service Builder). Now I want to use the same database so I can take info from it using the client portlet.
Any ideas?
I am using Liferay 6.1 with Tomcat and Liferay SDK plugin for Eclipse.
You can copy the [portlet name]-service.jar from Web-Inf/lib, and paste it to any other portlet's lib folder. Even better if you can do this with maven and add this jar as a dependency. This way you can have access to the Util Classes that your service provides, to any other Portlet
All portlets in a plugin project share the service builder service made by that plugin (because they end up in one war file and thus share runtime context). So you could just put both your portlets in the same plugin and they can both access that plugin's service builder services/tables. I think you will find this is a commonly used approach. The permission and visibility issues you mention are not impacted by this organization.
Doing it this way keeps the deployment simple -- just deploy the plugin's war, done.
If there are reasons beyond your control that require the portlets to be in separate plugins, then it becomes harder -- yannicuLar's approach is one way.
If you have two portlets sharing same tables/entities , you can copy the service.jar to
tomcat-7.0.27\lib\ext a common location where these two portlets can access this .jar at runtime.
I succed to deploy a liferay 6.1.1 on cloudbees thanks to this tutorial :
http://blog.cloudbees.com/2011/09/15-minutes-to-liferay-on-cloudbees-paas.html
Now, I'm asking how to deploy themes and custom portlets in this environment is there a way, or should I switch to another Paas solution?
Thanks,
You can either repackage liferay with the portlets into the "stack" and deploy that - or you can have liferay load the portlets from something other than the file system (filesystem support is needed for this to load dynamically, which is a work in progress).