Fórumok

Basic question: How do I reference default parameters?

Bob Dietrich, módosítva 9 év-val korábban

Basic question: How do I reference default parameters?

Regular Member Bejegyzések: 221 Csatlakozás dátuma: 2005.05.16. Legújabb bejegyzések
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, módosítva 9 év-val korábban

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

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
The ThemeDisplay has everything you need.
Bob Dietrich, módosítva 9 év-val korábban

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

Regular Member Bejegyzések: 221 Csatlakozás dátuma: 2005.05.16. Legújabb bejegyzések
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, módosítva 9 év-val korábban

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

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
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, módosítva 9 év-val korábban

RE: Basic question: How do I reference default parameters? (Válasz)

Regular Member Bejegyzések: 221 Csatlakozás dátuma: 2005.05.16. Legújabb bejegyzések
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.