留言板

Basic question: How do I reference default parameters?

Bob Dietrich,修改在9 年前。

Basic question: How do I reference default parameters?

Regular Member 帖子: 221 加入日期: 05-5-16 最近的帖子
I tried researching this via Google and the forum, but I've drawn a blank. I've also looked on alloyui.com, but since I don't work 10 hours a day with YUI or AlloyUI, I find the "documentation" totally and utterly incomprehensible.

The question is, how do I reference Default Parameters like userId and companyId (see https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/json-web-services-liferay-portal-6-2-dev-guide-05-en)?

Thanks.
thumbnail
David H Nebinger,修改在9 年前。

RE: Basic question: How do I reference default parameters?

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
The ThemeDisplay has everything you need.
Bob Dietrich,修改在9 年前。

RE: Basic question: How do I reference default parameters?

Regular Member 帖子: 221 加入日期: 05-5-16 最近的帖子
Thanks for replying, David. However, I wasn't clear in describing what I'm trying to do. For various reasons I have a view page only containing HTML and JavaScript. It is not a JSP. So I'm not clear how AlloyUI makes anything like userId or ThemeDisplay available, as well as how it would be referenced. Perhaps something like Y.userId?

Or am I required to use a JSP in order to get these values plugged into the page?
thumbnail
David H Nebinger,修改在9 年前。

RE: Basic question: How do I reference default parameters?

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
If you're loading a straight HTML page that happens to include some JS (even AUI), it won't have any of the portal objects defined, so normally you won't have access to any of the portal objects.

When the JSP is being processed, the ThemeDisplay object is accessed out of the incoming request attributes and can be used within the page. HTML/JS, on the other hand, is just in the browser and the request attributes from the server are long gone.

You could either wrap your content in a JSP page to include the portal objects, or you could embed within a web content article; when the page is rendered, the outer frame will ensure that the the objects are injected already (as long as you can get to them emoticon).
Bob Dietrich,修改在9 年前。

RE: Basic question: How do I reference default parameters? (答复)

Regular Member 帖子: 221 加入日期: 05-5-16 最近的帖子
Guess I'll have to resort to a JSP wrapper to do the injection, or a filter if I get ambitious. I was trying to keep things simple, but got too simple.

I also misread the document I cited earlier. It mentioned default parameters are available to web services, not the view pages. It's probably referring to the methods defined in BaseServiceImpl.