Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Antonio Martínez
asset publisher with scope, problem with add new content
November 9, 2009 3:38 AM
Answer

Antonio Martínez

Rank: Junior Member

Posts: 32

Join Date: January 14, 2009

Recent Posts

Hello, I'm using Liferay 5.2.3 and I have found this problem:

I add a page "Noticias", I add the asset publisher portlet, and I select "Curret Page (Noticias) in the scope tab.

If I go to the control panel, open web content, select scope "Noticias", click "Add Web Content" and create a content it works.

But if I use the "Add new ..." combo of the asset publisher portlet, the content is created in default context instead of "Noticias" context. I can view it in the control panel.

I guess that the form is looking for a parameter with the scope and it doesn´t arrive.

Can anybody help me? Thanks in advance and sorry for my english.
Lisa Simpson
RE: asset publisher with scope, problem with add new content
November 10, 2009 9:32 AM
Answer

Lisa Simpson

Rank: Liferay Legend

Posts: 2034

Join Date: March 5, 2009

Recent Posts

Go into the Configuration of your asset publisher and find the "Scope" tab and set it.
Antonio Martínez
RE: asset publisher with scope, problem with add new content
November 11, 2009 4:59 AM
Answer

Antonio Martínez

Rank: Junior Member

Posts: 32

Join Date: January 14, 2009

Recent Posts

Lisa Simpson:
Go into the Configuration of your asset publisher and find the "Scope" tab and set it.


Hi Lisa,

I have "Noticias" scope selected in the portlet, the problem is that I use the "Add new..." combo for add content and the content created is assigned to default scope instead of "Noticias" scope.
Antonio Martínez
RE: asset publisher with scope, problem with add new content
November 11, 2009 5:00 AM
Answer

Antonio Martínez

Rank: Junior Member

Posts: 32

Join Date: January 14, 2009

Recent Posts

I have created this ticket in jira:

http://issues.liferay.com/browse/LPS-5739
Lisa Simpson
RE: asset publisher with scope, problem with add new content
November 11, 2009 9:09 AM
Answer

Lisa Simpson

Rank: Liferay Legend

Posts: 2034

Join Date: March 5, 2009

Recent Posts

Yes, it will because the "Asset Publisher" portlet that you're using to create the content isn't scoped which means that it's set to "Default". Once you set the scope of the publisher, it will publish in the correct scope.
Antonio Martínez
RE: asset publisher with scope, problem with add new content
November 13, 2009 2:48 AM
Answer

Antonio Martínez

Rank: Junior Member

Posts: 32

Join Date: January 14, 2009

Recent Posts

Lisa Simpson:
Yes, it will because the "Asset Publisher" portlet that you're using to create the content isn't scoped which means that it's set to "Default". Once you set the scope of the publisher, it will publish in the correct scope.


My asset publisher portlet is scoped, I have already set the scope to "Noticias" in the scope tab. Then I try to create new content with the "Add new..." combo in the portlet and this new content has the default scope.

If I go to control panel, web content section, select "noticias" scope at the top of the page and create new content, this contents appears in the asset publisher with "noticias" scope.

The problem only happen when I try to create new content from the combo of the asset publisher.

I think that when I select "web content" option in combo and then a request is launched for open the form some parameter specifying the scope is lost.

Thanks.
Antonio Martínez
RE: asset publisher with scope, problem with add new content
November 16, 2009 3:57 AM
Answer

Antonio Martínez

Rank: Junior Member

Posts: 32

Join Date: January 14, 2009

Recent Posts

I have been investigating about the problem.

I have seen that when I select "web content" in the "add new..." combo, it sends a request with some parameters, one parameters is "&_15_groupId=10137". This number corresponds to the default scope, if I change this parameter in the request to 13422, that is the "noticias" scope, and I save the content it's well scoped and I can see it in asset publisher portlet with "noticias" scope.

I have found the code where this parameter is set, it´s in /portal/portal-web/docroot/html/portlet/asset_publisher/add_asset.jspf, line 128.

 1
 2    else if (assetType.equals(JournalArticle.class.getName())) {
 3        if (JournalPermission.contains(permissionChecker, themeDisplay.getScopeGroupId(), ActionKeys.ADD_ARTICLE)) {
 4            addURL = new PortletURLImpl(renderRequestImpl, PortletKeys.JOURNAL, themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
 5
 6            addURL.setParameter("struts_action", "/journal/edit_article");
 7            addURL.setParameter("groupId", String.valueOf(themeDisplay.getLayout().getGroupId()));
 8        }[color][/color]
 9    }


I have changed the last line and it seem to work:

 1
 2    else if (assetType.equals(JournalArticle.class.getName())) {
 3        if (JournalPermission.contains(permissionChecker, themeDisplay.getScopeGroupId(), ActionKeys.ADD_ARTICLE)) {
 4            addURL = new PortletURLImpl(renderRequestImpl, PortletKeys.JOURNAL, themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
 5
 6            addURL.setParameter("struts_action", "/journal/edit_article");
 7            //addURL.setParameter("groupId", String.valueOf(themeDisplay.getLayout().getGroupId()));
 8            addURL.setParameter("groupId", String.valueOf(themeDisplay.getScopeGroupId()));
 9        }[color][/color]
10    }


It works for me in development, but I don't know if it's the solution to the problem, and it only works with web content.

Some help? Thanks in advance.
Lisa Simpson
RE: asset publisher with scope, problem with add new content
November 16, 2009 1:44 PM
Answer

Lisa Simpson

Rank: Liferay Legend

Posts: 2034

Join Date: March 5, 2009

Recent Posts

Antonio Martínez:
Lisa Simpson:
Yes, it will because the "Asset Publisher" portlet that you're using to create the content isn't scoped which means that it's set to "Default". Once you set the scope of the publisher, it will publish in the correct scope.


My asset publisher portlet is scoped, I have already set the scope to "Noticias" in the scope tab. Then I try to create new content with the "Add new..." combo in the portlet and this new content has the default scope.

If I go to control panel, web content section, select "noticias" scope at the top of the page and create new content, this contents appears in the asset publisher with "noticias" scope.

The problem only happen when I try to create new content from the combo of the asset publisher.

I think that when I select "web content" option in combo and then a request is launched for open the form some parameter specifying the scope is lost.

Thanks.


If you have it scoped, then you should open a bug. Go to the "Issue Tracker" tab above and open a bug report.
Antonio Martínez
RE: asset publisher with scope, problem with add new content
November 17, 2009 12:16 AM
Answer

Antonio Martínez

Rank: Junior Member

Posts: 32

Join Date: January 14, 2009

Recent Posts

Lisa Simpson:
If you have it scoped, then you should open a bug. Go to the "Issue Tracker" tab above and open a bug report.


Lisa, could you read my posts before answer?

Five posts before this I said this:

Antonio Martinez:

I have created this ticket in jira:

http://issues.liferay.com/browse/LPS-5739


And since your first reply you haven't been saying anything related with my problem.

In my last post I write that I think I have a solution but I don't know if it's a good solution or not because I'm not an expert in Liferay code, and it only works for web content, not for blogs.

If you can help me, please reply, I will thank you very much.