URL issue; relative to page

Hi

i am facing an issue with a custom portlet on a page.

I have a home page with the thing id = /meta/default/folder/0000004683. I have assigned the alias / to it so after login user is sent to this page.

I have a different login page with a few of my custom portlets. The id of this page is /meta/default/folder/0000121266. I have opened up anonymous access to the containers that the custom portlet uses on this page so I am able to see the content without logging in.

The problem is on the login page minimize function for the custom portlets just ends up refreshing the page whereas if i put a HTML text portlet, it minimises fine.

On checking the URL, the minimise for the custom portlet is /meta/default/folder/0000004683?wmp121277.pca_l=default&wmp121277.wmp_ws=minimized&wmp121277.pca_p=default
which is pointing to the home page as base and the one for the html portlet is /meta/default/wm_htmltext/0000121270?portletlayout=widget&returnUrl=%2fmeta%2fdefault%2ffolder%2f0000004683%3f&wmp_ws=minimized&pca_p=widget&method=portletcontroller

If i replace 0000004683 with 0000121266 it minimises fine. Question is how is the minimize having a different base URL. How do i rectify it?

Thanks

I

check if you have given the same kind of access permissions for the portlets (html and custom portlet) that you have dropped in folder which you said you have anonymous access.

To do that you should “Apply to the Descendants” while changing the access permissions on the folder.

Hi Ganny,

Thanks, but I have kept the permissions of all to anonymous.

This seems to be a problem with the way the resource URL is formed; like i mentioned, if I change the thingid in the URL to the actual page, the minimize function works fine.

There must be something different between the custom and the in-built portlets that is causing the issue.

Any clues?

Thanks again.

I think there is an answer for you. There are indeed two types of portlets in MWS: ‘restful’ and ‘non-restful’. Some of the built-in portlets are non-restful and HTMLText is one of them. By default when you create new portlet in Developer it creates a restful portlet for you.

One of the differences between them is how these urls are constructed. For non-restful portlet the url path is portlet ID itself, for restful portlets the url is current resource.

I believe what is happening in the case of login page. Because of the login rule the current resource is not you login page, but the actual protected resource - like you noted the url path is different from login page. But because that resource is protected minimize link is not working for non-logged in user.

The only things you could do about this are:

  • change your portlet to be ‘non-restful’ in the portlet properties look for Portlet Controller type setting. If you do that it is important to retest all the functionality of the portlet.
  • not to use minimize functions on the login page. For this make sure the shell you have in use on this page uses Guest Titlebar

Thanks Alex,

Minimize is working.

Is there any change that I should so for links created using <portlet:controller portlet=“portlet” layout=“mylayout” context=“href” /> within that portlet because one of them is throwing a js error now. On mouseover that link i can see “javascript:doPortletMethod(” - nothing else.

What exact link does it complain about? Is that the link generated by your of WEBM code?

Alex

The link just opens another layout within the portlet view itself.

When the portlet was restful, clicking on this link would just refresh the page because like I mentioned the base URL was incorrect. After I changed it from restful to session, it is throwing a js error.

the code for the link is something like

<portlet:bean id=“portlet” className=“com.webmethods.portal.portlet.featuresportlet.FeaturesPortlet”>
.
.
.
.
.
.
<portlet:controller portlet=“portlet” layout=“archiveLayout” context=“href” />’>
View Archive
</portlet:bean>

reposting the code

<portlet:bean id=“portlet” className=“com.webmethods.portal.portlet.featuresportlet.FeaturesPortlet”>
.
.
.
.
.
.
<a href=""<<portlet:controller portlet=“portlet” layout=“archiveLayout” context=“href” />’>

Hi Alex,

I think I might have found a work around for this problem; please let me know your thoughts on the same.

I switched the portlet back to Restful and in the portlet:controller tag I used the “base” attribute with the value equal to the thingId of the current resource.

In this way when I click on the link it redirects me to the same page but to the requested layout.

Do you forsee any problems with this workaround.

Thank You.

Looks like your original syntax was not correct. Look at the mismatched starting
and ending quotes of the href= and an extra <

Hi Alex,

The syntax is correct. I guess it was a typo.

Ok, I’m a bit confused. You said that same link <portlet:controller />"/> worked when portlet was restful. And produces javascript error when you changed portlet to be non-restful. Is this correct?

And I wanted to investigate why is that.