Foren

Preconfigured asset publisher usage

thumbnail
Martin Steinorth, geändert vor 12 Jahren.

Preconfigured asset publisher usage

New Member Beiträge: 9 Beitrittsdatum: 18.08.11 Neueste Beiträge
Hi!

I am currently working on a portal which makes vast usage of the asset publisher. Most of the content inside the publisher portlet is read dynamically from various fix (!) categories and sources (document storage, blogs etc.). But the user should also be able to publish different hand chosen links at the bottom of a page to provide further information (e.g. documents, links, blog articles).

The current problem is that the asset publisher configuration section will be too complex for 95% of the future portal users. Therefore i am searching for an easier solution to handle the portlet.

No. 1 - perfect solution!

Make preconfigured versions of the asset publisher accessible as discrete portlets via the "Add" dropdown in the dockbar. To achieve this I must be able to extend the asset publisher portlet and create a new standalone portlet out of this extension. It's somehow the concept of portlet inheritance what I am searching for.

No. 2 - all right solution

Create a portlet hook from the asset publisher and offer a dropdown with preconfigured scopes. If the scope "classic" is chosen, show the default configuration view.

No. 3 - would be ok but doesn't work solution (right?)

Save the current configuration as an archived configuration, so everybody can access and restore it, according to his needs when placing a new asset publisher portlet. As far as i know, those configurations are bound to the user, so there is no "global scope" for archived setups.

Does anybody know if solution 1 might be possible and how to do this? Is solution 2 possible whithout creating an ext plugin? Am I wrong with solution 3?

Or maybe someone has any better ideas on how to deal with this situation. Discussion is welcome.

Regards
Martin
Oliver Bayer, geändert vor 12 Jahren.

RE: Preconfigured asset publisher usage

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi Martin,

regarding #1: here my answer from another thread
Theoretically all you have to do is to copy all config files plus the jsps and folders of the portlet you want to modify and change the name to sth new.

For the more technical description on how to copy an existing Liferay portlet I would suggest reading my answers of the following thread even if it's for Liferay v5.2.3. Maybe you can use them at least as a starting point for solving your requirement in Liferay v6.


#2 and #3:
For the preconfigured scopes you can maybe use portlet init-params (if you don't have any dynamic parameters determining the configuration) and check in the ConfigurationActionImpl class which one was choosen in the UI.

Greets Oli
thumbnail
jelmer kuperus, geändert vor 12 Jahren.

RE: Preconfigured asset publisher usage

Liferay Legend Beiträge: 1191 Beitrittsdatum: 10.03.10 Neueste Beiträge
I think in your case i would create my own portlets in the sdk and use the AssetEntryService / AssetEntryQuery classes to retrieve the data. Like i show in this thread :

http://www.liferay.com/community/forums/-/message_boards/message/10852122
thumbnail
Martin Steinorth, geändert vor 12 Jahren.

RE: Preconfigured asset publisher usage

New Member Beiträge: 9 Beitrittsdatum: 18.08.11 Neueste Beiträge
Hey Jelmer,

alright, what i did now is to create a new portlet which reads the assets of different categories and shows them in a tabbed view, whereas the tabs represent the categories. So far so good.

As I mentioned, the assets assigned to these categories can be of various types (e.g. documents, blog posts, bookmarks). How can I retrieve the detail URLs for these assets in order show a specific blog article, redirect to a bookmark or offer a document download?

The asset publisher has two modes to show detailed content about assets: In the asset publisher itself or in the designated portlets based on the asset type. Now what I don't want to do is to implement a detail view for all asset types that can occur in my portlet.

Thanks for your help!

Regards
Martin
thumbnail
jelmer kuperus, geändert vor 12 Jahren.

RE: Preconfigured asset publisher usage

Liferay Legend Beiträge: 1191 Beitrittsdatum: 10.03.10 Neueste Beiträge
Every asset (blog, document etc) has an associated AssetRenderer and AssetRendererFactory. \

You can do

AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(yourClassName);


To obtain an AssetRendererFactory

and

assetRendererFactory.getAssetRenderer(classPK);


To obtain an AssetRenderer for a specific instance

AssetRenderer.getURLViewInContext will give you a link to a portlet on another page (you typically use this for linking to things like the blog page)

AssetRenderer.getTitle() will give you the title, AssetRenderer.getSummary() will give you the summary etc for displaying in line
thumbnail
Martin Steinorth, geändert vor 12 Jahren.

RE: Preconfigured asset publisher usage

New Member Beiträge: 9 Beitrittsdatum: 18.08.11 Neueste Beiträge
Ok, thats the part where it gets a bit messy emoticon I created a community to allow certain users to create content, that can be show on every users private page. The community actually has no own pages as its just existing to encapsulate the content that will be aggregated in other communities (my communities). Its easy to assign new users to that community, in order to allow them to create this specific content.

So the community doesn't have any pages to which i could redirect the user when he wants to view the blog post. But I found out that, when linked in the asset publisher, certain content types (e.g. imagegalleries) can create portlets "on the fly" without the need to access existing pages. The URL then looks like this:

http://localhost:8080/de/web/mais/budget-service?
p_p_auth=EvdwUH7o&
p_p_id=31&
p_p_lifecycle=0&
p_p_state=maximized&
p_p_mode=view&
p_p_col_id=column-1&
p_p_col_count=2&
_31_struts_action=%2Fimage_gallery%2Fview&
_31_groupId=11351&
_31_folderId=0

Thats exactly what I need. I tried to modify the URL by replacing the struts actions, parameters and portlet ids but, of course, without luck. Actually i am taken to a page where the blog portlet is maximized but i get a message that i don't have the rights to view this portlet.

Is there a way that i can access the content like image galleries are adressed over the asset publisher?
thumbnail
jelmer kuperus, geändert vor 12 Jahren.

RE: Preconfigured asset publisher usage

Liferay Legend Beiträge: 1191 Beitrittsdatum: 10.03.10 Neueste Beiträge
but i get a message that i don't have the rights to view this portlet.


Most likely you can solve that by adding portlet id you are using (eg. whatever is in the p_p_id parameter) to the portlet.add.default.resource.check.whitelist property in portal-ext.properties

But i am not sure if this approach will work for you, because the scopeGroupId will be the active group, and the data is actually located in another group, in the url you pasted this is something they work around by specifying the groupId as a parameter, but i am pretty sure not all portlets support that