Fórum

How (or where) can I get the portlets' properties to put in a sitemap.json?

Bruno Lima, modificado 9 Anos atrás.

How (or where) can I get the portlets' properties to put in a sitemap.json?

Junior Member Postagens: 49 Data de Entrada: 20/05/14 Postagens Recentes
Hi

I'm using sitemap.json to make a custom theme but I was looking for the configurations of the asset publisher portlet to put it directly in the sitemap.json but I didn't find any Wiki, documentation or example to help me. Does anybody know where can I get the portlets' configs to pass it onto sitemap.json?

In my case, I'd like to put in the asset publisher portlet to exhibit only the "news-interna" tag:

[
	{
	 "portletId": "101",
	 "portletPreferences": {
                            "tagId": "news-interna",
                            "portletSetupShowBorders": "false"
                         }
	}
]
 


Does anyone can help me? Thank you!
thumbnail
Byrån Zaugg, modificado 9 Anos atrás.

RE: How (or where) can I get the portlets' properties to put in a sitemap.j

Expert Postagens: 252 Data de Entrada: 06/04/12 Postagens Recentes
The two methods I know of are, via MySQL or exporting a Portlet LAR.

First setup the Portlet properties how you want them, in Portal via the UI.

Via exported LAR
  • Click the Gear/Config Icon on the Portal border.
  • Click Import/Export
  • In the popup, click Export
  • Download the generated file.
  • Open the LAR like it's a ZIP file.
  • You need to file a file called portlet-preferenes.xml (I think)
  • In that file you'll find the properties you want.


Via MySQL
I've not tried this myself, but one of my coworkers uses this method.

	mysql> show databases;
	mysql> use lportal;
	mysql> show tables;
	mysql> SELECT content FROM `JournalArticle`;
	mysql> SELECT content FROM `JournalArticle` INTO OUTFILE 'fileName.xml';


Instead of JournalArticle, you'd use whatever table Asset Publisher uses.

The portal properties you want should be in this XML file.
Bruno Lima, modificado 9 Anos atrás.

RE: How (or where) can I get the portlets' properties to put in a sitemap.j

Junior Member Postagens: 49 Data de Entrada: 20/05/14 Postagens Recentes
Thank you so much!
I think that all the portlets embedded in liferay should had been more documented!
For example:

Asset Publisher
- Basic Usage
- Methods
- sitemap.json usage
...

These things are the basics that all theme's developer want to know but these informations are fragmented in Wikis, Blog posts (inside and outside liferay's portal) and posts like this. Even better, the theme's developers deserve his own portal with this kind of documentation... but it's just my two cents.

Here's my final code

                 {
						"portletId": "101",
     					        "portletPreferences": {
	  		 				"portletSetupShowBorders": "false",
							"scopeIds": "[$COMPANY_GROUP_SCOPE_ID$]",
	  		 				"delta": "5",
	  		 				"queryValues0": "news-interna",
	  		 				"queryName0": "assetTags",
	  		 				"queryAndOperator0": "false",
	  		 				"queryContains0": "true"	
					   }
thumbnail
Byrån Zaugg, modificado 9 Anos atrás.

RE: How (or where) can I get the portlets' properties to put in a sitemap.j

Expert Postagens: 252 Data de Entrada: 06/04/12 Postagens Recentes
Bruno Lima:
Thank you so much!
I think that all the portlets embedded in liferay should had been more documented!


Oh, I agree.

We have some internal guides, that we try to make public, if possible. But a lot of those come with disclaimers that they are not official and may refer you to the official docs, which are sometimes inadequate.

It's a difficult and slow process, to update the official docs/guides, that we are trying to improve.