Liferay - export sitemap to human-readable form - liferay

We would like to put our Liferay sitemap to VCS, so new developers can start developing more quickly. So far, I was unable to find out how to export Liferay's sitemap to some human-readable form. Any ideas?

One simple method is to simply access [myserver.com]/sitemap.xml. Although I'm not certain it is clean enough for you. You can see it in action on Liferay's website, http://www.liferay.com/sitemap.xml.

Site Map can be retrieved in two ways. (None of them actually are designed to be human-readable but they can use)
1- XML
Liferay Portal makes this very simple for administrators by generating the sitemap XML automatically for all public web sites.
2- LAR file (Liferay Archive)
The Export / Import tab allows you to export the pages you create into a single file, called a LAR (Liferay Archive). You can then import this file into any server running Liferay, and all of your pages will be copied.
Using the first format, you can generate any kind of human-readable format (like trees), and attaching the second file, you can send the information, and others can upload it.
I hope it works :)
Quotes are from Liferay documentation

Related

How can I create Liferay web content structure's outside of Liferay configuration?

I'm very new to Liferay theme development and i'm trying to find the most optimal workflow for development.
So I've been experimenting with creating Web Content Templates and Web Content Structures within Liferay CMS configuration.
What I would ideally like to do is create my view "Web Content Structure" outside of Liferay configuration and instead have it as a view/template inside my theme files so that I can have my code peer reviewed and version controlled in Bitbucket.
Is this possible?
Alternatively is there a way to output the values of a given web content instance within my theme?
I'm building a theme for Liferay 7 by the way.
Thanks in advance
Richard
You can copy and paste the structure when you create them form the LFR editors into your source code repository.
Also if you know how to define the JSON you can do it straight in the file. The free market templates are even easier to edit in file format. When you're done, you need to go and upload the artefacts to the portal via the editor/file upload option.
You can't stick it into the theme because that approach would not allow you to do updates.
You can search for a community plugin or write your own one that would do structure/template updates during deploy.

Automatic way of export / import pages from liferay

I have created portlets for liferay and prepare couple of pages. Now I want to create installation script, which create pages definition in customer liferay server. I know that pages export/import is possible using LAR file, but this could be done only manualy, or using remote publishing which i am not able to do.
I was searching on net and found ddm tool. Which should be able to do that. Unfortunately i'm not able to get it work as it export only web content, blogs, wikis, etc, but not pages with portlets. It is probably because one of the condition is "Every Template must be assigned to a Structure. Don't create any templates on the Liferay server which does not have a structure connected to it.
". But how can I assign page to structure ? Cant find anything.
Or is there any other option for automatic page creation, which could be used ?
In case you created a custom theme, you can easily use the "resources importer" to create an entire site via the "sitemap.json" file (define pages: choose layout, assign portlets to the columns, ...). You can also export existing content as xml from the current instance and import them via the theme. Same thing for web content structures and templates.
for more details: https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-1/importing-resources-with-your-themes
Unfortunately theme is produced by another supplier, so this solution isn't suitable for me.
at the end i find working solution which consist of following steps:
create plugin hook
in hook setup upgrade process
in the upgrade process create pages with appropriate layout, friendlyUrl, etc. All these is possible to do using liferay api
Don't have enough reputation, so at least two links
https://www.liferay.com/de/web/james.falkner/blog/-/blogs/7cogs-is-dead-long-live-7cogs-
https://github.com/azzazzel/liferay-official-plugins/tree/master/hooks/sevencogs-hook/docroot/WEB-INF/src/com/liferay/sevencogs/hook/upgrade

Packaging Document Structures and templates in Liferay plugin wars

Is there a way to include Liferay document or web-content structures and templates in portlet plugin war files and have them become available to users like the standard ones are?
The use-case would be that you are writing a portlet that takes advantage of a custom Document Library structure that you are providing. But you don't want to distribute this structure as a separate thing with its own installation procedure (such as providing a LAR just for the structure), you just want your plugin to make the custom structure available whenever it is installed.
You can achieve your goal by adding a portal.properties file to the WEB-INF/classes directory of your portlet. This file should contain the following line:
application.startup.events=com.yourcompany.whatever.YourCustomStartupAction
This custom startup action should be a class that extends from com.liferay.portal.kernel.events.SimpleAction. In it you will be able to leverage all the Liferay service utils to do things in Liferay at the moment your portlet is started. The class you need to use to work with the Liferay document library specifically is DLAppLocalServiceUtil. This util class has all the necessary methods to work with files/folders in the document library.
For web content related stuff, such as structures, templates and articles, just use JournalStructureLocalServiceUtil, JournalTemplateLocalServiceUtil and JournalArticleLocalServiceUtil.
I hope i got your question right ;)
You could create the folder Structure via the DLFolderService when the portlet is deployed.
To run a method when the Server starts you will have to use the CustomAction i think, check it out : here

SharePoint 2010 site template with a form library - the form template contains site URL

I am working on a site template that will be used to create hundreds of sites for different org units. The site should contain a form library, with an InfoPath form template.
My question is - is it possible to create a template and let power users create sites, without any administrator or developer involvement? If not - what's the easiest alternative?
The problem is that the form template contains the site URL and I don't know if this can be avoided. As a consequence, when a site is created and a form submitted - it ends up in the library of the original site.
I have created a handful of sites for the pilot project and what I've been doing so far is to uncab the XSN file, edit the URL manually, repackage into XSN and publish to the new library. This works, but involves a manual step in the site creation process that I wish to avoid. Here are the lines I'm editing:
<xsf:submit caption="Submit" disableMenuItem="no" onAfterSubmit="close" showStatusDialog="no">
<xsf:davAdapter name="SharePoint Library Submit" submitAllowed="yes" overwriteAllowed="no">
<xsf:folderURL value="http://my_farm_url/subsite1/form_lib"
Also here:
<xsf2:solutionPropertiesExtension branch="wss">
<xsf2:wss path="http://my_farm_url/subsite1/form_lib"
I'm changing subsite1 to subsite2.
I tried to set a relative URL, first to the submit element, then to both, to no avail. The form was being rendered (in browser), the submit worked (no errors) but then the submitted form was not in the library. Looking further into this, the forms ended up being submitted to a form library on the root site - http://my_farm_url/form_lib! It makes sense when you think about it, that's where a relative url of form_lib takes you to, from the site, from the root site perspective.
For the moment the only solution I envision is to create a tool that will help users create sites based on the template, fixing the XSN behind the curtains. I don't know how to publish a form template programmatically but it should be possible. Apart from this unknown, it's also not very automated and I'll be very happy if a proper solution is possible that will work with SharePoint/InfoPath tools only.
You need to schedule a EventReceiver there is no way to do it for configuration.
In EventReceiver you have to read the file "Manifest.xsf", update the XML node is defined where the url and save the file "Manifest.xsf".
To read the XML node is necessary to use System.Xml.dll

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