You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Ronny <Ro...@t-online.de> on 2003/05/23 01:37:32 UTC

Accessing objects in Parameters

Hello list,

i want to access the objects stored in the Rundata-Object.

I have the following code:

Log.debug("object in rundata: " +
data.getParameters().getObject("choosenmessage"));
Log.debug("object is instance of class: "	 +
(data.getParameters().getObject("choosenmessage")).getClass());

In Logfile I have:
[23 Mai 2003 01:15:40 DEBUG] - object in rundata:
de.centerice.om.Content@31
[23 Mai 2003 01:15:40 DEBUG] - object is instance of class: class
java.lang.String

That's correct, but how can I get the instance of the
de.centerice.om.Content-Object?

I've looked at velocity and Jetspeed doku but didn't find anything.

Greetings
Ronny



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: PopupCalendar

Posted by teru kohama <te...@mctv.ne.jp>.
Thaks a lot for the reply.
I have been struggling for having PopupCalendar.
I found my lack of knowledge of mapping.
I need to learn the basic concept of Jetspeed more.
Then I will try again.
Thanks Mark.
I learned a lot.

Best regard.
teru
----- Original Message ----- 
From: "Mark Orciuch" <ma...@ngsltd.com>
To: "Jetspeed Users List" <je...@jakarta.apache.org>
Sent: Saturday, May 24, 2003 4:12 AM
Subject: RE: PopupCalendar


> Teru,
>
> You want to use PopupCalendar within the body of your portlet, right? If
so,
> here's an example from parameter-demo-portlet.jsp (CVS head):
>
> <P>
> Here's an example of using parameter style within the body of a portlet:
> <P>
> <%
> Hashtable map = new Hashtable();
> map.put("skin-list.style.registry", "Skin");
> %>
> Available skins: <%=ParameterLoader.getInstance().eval(data,
> "RegistryEntryListBox","skin-list", null, map)%>
>
> Replace "RgistryEntryListBox" with "PopupCalendar" and pass any parameter
> options in the map. Also, make sure to remove the "classname" attribute
from
> your portlet definition. I'll probably create a JSP tag for this when I
get
> around to it.
>
> Best regards,
>
> Mark Orciuch - morciuch@apache.org
> Jakarta Jetspeed - Enterprise Portal in Java
> http://jakarta.apache.org/jetspeed/
>
> > -----Original Message-----
> > From: teru kohama [mailto:teru0928@mctv.ne.jp]
> > Sent: Friday, May 23, 2003 1:08 PM
> > To: Jetspeed Users List
> > Subject: PopupCalendar
> >
> >
> > Hello,
> > I need to use PopupCalendar so that I wrote something like this written
> > bellow on demo-portlets.xreg.
> > ------------------------------------------------------------------
> > ----------
> > ----
> > <portlet-entry name="PopupCalendar" hidden="false"
> >         type="ref" parent="JSP" application="false">
> >
> >         <meta-info>
> >                 <title>Battle of Waterloo</title>
> >                 <description>some Japanese are written here:
> > mm/dd/yyyy</description>
> >         </meta-info>
> >
> > <classname>org.apache.jetspeed.modules.parameters.PopupCalendar</c
> > lassname>
> > <parameter name="date2" value="06/18/1812" type="style"
> >             hidden="false" cachedOnName="true" cachedOnValue="true"/>
> >         <media-type ref="html"/>
> >     </portlet-entry>
> > ------------------------------------------------------------------
> > ----------
> > ----
> >
> > I added "Battle of Waterloo" on my customise.
> > But it didn't turn out.
> > I would appreciate any help on this problem.
> > Thanks in advance for your help.
> > Regards
> >
> > Teru
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: PopupCalendar

Posted by Mark Orciuch <ma...@ngsltd.com>.
Teru,

You want to use PopupCalendar within the body of your portlet, right? If so,
here's an example from parameter-demo-portlet.jsp (CVS head):

<P>
Here's an example of using parameter style within the body of a portlet:
<P>
<%
Hashtable map = new Hashtable();
map.put("skin-list.style.registry", "Skin");
%>
Available skins: <%=ParameterLoader.getInstance().eval(data,
"RegistryEntryListBox","skin-list", null, map)%>

Replace "RgistryEntryListBox" with "PopupCalendar" and pass any parameter
options in the map. Also, make sure to remove the "classname" attribute from
your portlet definition. I'll probably create a JSP tag for this when I get
around to it.

Best regards,

Mark Orciuch - morciuch@apache.org
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/

> -----Original Message-----
> From: teru kohama [mailto:teru0928@mctv.ne.jp]
> Sent: Friday, May 23, 2003 1:08 PM
> To: Jetspeed Users List
> Subject: PopupCalendar
>
>
> Hello,
> I need to use PopupCalendar so that I wrote something like this written
> bellow on demo-portlets.xreg.
> ------------------------------------------------------------------
> ----------
> ----
> <portlet-entry name="PopupCalendar" hidden="false"
>         type="ref" parent="JSP" application="false">
>
>         <meta-info>
>                 <title>Battle of Waterloo</title>
>                 <description>some Japanese are written here:
> mm/dd/yyyy</description>
>         </meta-info>
>
> <classname>org.apache.jetspeed.modules.parameters.PopupCalendar</c
> lassname>
> <parameter name="date2" value="06/18/1812" type="style"
>             hidden="false" cachedOnName="true" cachedOnValue="true"/>
>         <media-type ref="html"/>
>     </portlet-entry>
> ------------------------------------------------------------------
> ----------
> ----
>
> I added "Battle of Waterloo" on my customise.
> But it didn't turn out.
> I would appreciate any help on this problem.
> Thanks in advance for your help.
> Regards
>
> Teru
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


PopupCalendar

Posted by teru kohama <te...@mctv.ne.jp>.
Hello,
I need to use PopupCalendar so that I wrote something like this written
bellow on demo-portlets.xreg.
----------------------------------------------------------------------------
----
<portlet-entry name="PopupCalendar" hidden="false"
        type="ref" parent="JSP" application="false">

        <meta-info>
                <title>Battle of Waterloo</title>
                <description>some Japanese are written here:
mm/dd/yyyy</description>
        </meta-info>

<classname>org.apache.jetspeed.modules.parameters.PopupCalendar</classname>
<parameter name="date2" value="06/18/1812" type="style"
            hidden="false" cachedOnName="true" cachedOnValue="true"/>
        <media-type ref="html"/>
    </portlet-entry>
----------------------------------------------------------------------------
----

I added "Battle of Waterloo" on my customise.
But it didn't turn out.
I would appreciate any help on this problem.
Thanks in advance for your help.
Regards

Teru


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: Accessing objects in Parameters

Posted by Jason Weiss <ja...@omnicoders.com>.
<input type="hidden" name="choosenmessage" value="$choosenmessage">  will
store a string, not an object.  You can't serialize an object into HTML
like that and expect it to come back as an object.  That's the problem.
You'll need to either explicitly store all of the individual values that
you want in hidden fields and re-assemble, or come up with a different
approach.  This fills in the gap from your last post.  If you were to look
at the raw HTML generated from this code you would see the literal
toString() method of the object written out, not the serialization of that
object.  See the difference?

HTH,
Jason

-----Original Message-----
From: Ronny Walter [mailto:mailinglists@freenet.de] 
Sent: Friday, May 23, 2003 1:28 AM
To: 'Jetspeed Users List'
Subject: AW: Accessing objects in Parameters


That was my idea too, but I only get a String. If I try the cast, I get a
ClassCastException. This parameter is an object of type
.centerice.om.Content.

In the previous method I code:

context.put(CHOOSEN_MESSAGE_KEY, message);

In the template I access the object like this:

<input name="topic" type="text" value="$choosenmessage.topic"/> <textarea
name="value" rows="20" cols="50">$choosenmessage.value</textarea>
.....
and send the object back to the Server, when I call the next method:

<input type="hidden" name="choosenmessage" value="$choosenmessage"> <input
type="submit" name="eventSubmit_doSubmitmessage" value="Submit Changes">

then the method:
Content message =	(Content)
data.getParameters().getObject("choosenmessage"));
results in a ClassCastException.

Greetings Ronny



-----Ursprüngliche Nachricht-----
Von: Jason Weiss [mailto:jason@omnicoders.com] 
Gesendet: Freitag, 23. Mai 2003 04:42
An: 'Jetspeed Users List'
Betreff: RE: Accessing objects in Parameters

It has been a long day <rubbing eyes> but let me take a stab at this.
Can't you simply code this:

de.centerice.om.Content myContent = (de.centerice.om.Content)
data.getParameters().getObject("choosenmessage");

If that parameter really is an instance of de.centerice.om.Content, it
will easily cast and then just invoke your methods on myContent.

HTH,

Jason Weiss






-----Original Message-----
From: Ronny [mailto:Ronny-Walter@t-online.de] 
Sent: Thursday, May 22, 2003 6:38 PM
To: Jetspeed
Subject: Accessing objects in Parameters


Hello list,

i want to access the objects stored in the Rundata-Object.

I have the following code:

Log.debug("object in rundata: " +
data.getParameters().getObject("choosenmessage"));
Log.debug("object is instance of class: "	 +
(data.getParameters().getObject("choosenmessage")).getClass());

In Logfile I have:
[23 Mai 2003 01:15:40 DEBUG] - object in rundata:
de.centerice.om.Content@31 [23 Mai 2003 01:15:40 DEBUG] - object is
instance of class: class java.lang.String

That's correct, but how can I get the instance of the
de.centerice.om.Content-Object?

I've looked at velocity and Jetspeed doku but didn't find anything.

Greetings
Ronny



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


AW: Accessing objects in Parameters

Posted by Ronny <ma...@freenet.de>.
May be, i have to put this object somewhere in a cache, so that i can
access it in different requests. Or is there a better solution?

Thx,
Ronny


-----Ursprüngliche Nachricht-----
Von: Ronny Walter [mailto:mailinglists@freenet.de] 
Gesendet: Freitag, 23. Mai 2003 08:28
An: 'Jetspeed Users List'
Betreff: AW: Accessing objects in Parameters


That was my idea too, but I only get a String. If I try the cast, I get
a ClassCastException. This parameter is an object of type
.centerice.om.Content.

In the previous method I code:

context.put(CHOOSEN_MESSAGE_KEY, message);

In the template I access the object like this:

<input name="topic" type="text" value="$choosenmessage.topic"/>
<textarea name="value" rows="20"
cols="50">$choosenmessage.value</textarea>
.....
and send the object back to the Server, when I call the next method:

<input type="hidden" name="choosenmessage" value="$choosenmessage">
<input type="submit" name="eventSubmit_doSubmitmessage" value="Submit
Changes">

then the method:
Content message =	(Content)
data.getParameters().getObject("choosenmessage"));
results in a ClassCastException.

Greetings Ronny



-----Ursprüngliche Nachricht-----
Von: Jason Weiss [mailto:jason@omnicoders.com] 
Gesendet: Freitag, 23. Mai 2003 04:42
An: 'Jetspeed Users List'
Betreff: RE: Accessing objects in Parameters

It has been a long day <rubbing eyes> but let me take a stab at this.
Can't you simply code this:

de.centerice.om.Content myContent = (de.centerice.om.Content)
data.getParameters().getObject("choosenmessage");

If that parameter really is an instance of de.centerice.om.Content, it
will easily cast and then just invoke your methods on myContent.

HTH,

Jason Weiss






-----Original Message-----
From: Ronny [mailto:Ronny-Walter@t-online.de] 
Sent: Thursday, May 22, 2003 6:38 PM
To: Jetspeed
Subject: Accessing objects in Parameters


Hello list,

i want to access the objects stored in the Rundata-Object.

I have the following code:

Log.debug("object in rundata: " +
data.getParameters().getObject("choosenmessage"));
Log.debug("object is instance of class: "	 +
(data.getParameters().getObject("choosenmessage")).getClass());

In Logfile I have:
[23 Mai 2003 01:15:40 DEBUG] - object in rundata:
de.centerice.om.Content@31 [23 Mai 2003 01:15:40 DEBUG] - object is
instance of class: class java.lang.String

That's correct, but how can I get the instance of the
de.centerice.om.Content-Object?

I've looked at velocity and Jetspeed doku but didn't find anything.

Greetings
Ronny



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


AW: Accessing objects in Parameters

Posted by Ronny Walter <ma...@freenet.de>.
That was my idea too, but I only get a String. If I try the cast, I get
a ClassCastException. This parameter is an object of type
.centerice.om.Content.

In the previous method I code:

context.put(CHOOSEN_MESSAGE_KEY, message);

In the template I access the object like this:

<input name="topic" type="text" value="$choosenmessage.topic"/>
<textarea name="value" rows="20"
cols="50">$choosenmessage.value</textarea>
.....
and send the object back to the Server, when I call the next method:

<input type="hidden" name="choosenmessage" value="$choosenmessage">
<input type="submit" name="eventSubmit_doSubmitmessage" value="Submit
Changes">

then the method:
Content message =	(Content)
data.getParameters().getObject("choosenmessage"));
results in a ClassCastException.

Greetings Ronny



-----Ursprüngliche Nachricht-----
Von: Jason Weiss [mailto:jason@omnicoders.com] 
Gesendet: Freitag, 23. Mai 2003 04:42
An: 'Jetspeed Users List'
Betreff: RE: Accessing objects in Parameters

It has been a long day <rubbing eyes> but let me take a stab at this.
Can't you simply code this:

de.centerice.om.Content myContent = (de.centerice.om.Content)
data.getParameters().getObject("choosenmessage");

If that parameter really is an instance of de.centerice.om.Content, it
will easily cast and then just invoke your methods on myContent.

HTH,

Jason Weiss






-----Original Message-----
From: Ronny [mailto:Ronny-Walter@t-online.de] 
Sent: Thursday, May 22, 2003 6:38 PM
To: Jetspeed
Subject: Accessing objects in Parameters


Hello list,

i want to access the objects stored in the Rundata-Object.

I have the following code:

Log.debug("object in rundata: " +
data.getParameters().getObject("choosenmessage"));
Log.debug("object is instance of class: "	 +
(data.getParameters().getObject("choosenmessage")).getClass());

In Logfile I have:
[23 Mai 2003 01:15:40 DEBUG] - object in rundata:
de.centerice.om.Content@31 [23 Mai 2003 01:15:40 DEBUG] - object is
instance of class: class java.lang.String

That's correct, but how can I get the instance of the
de.centerice.om.Content-Object?

I've looked at velocity and Jetspeed doku but didn't find anything.

Greetings
Ronny



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: Accessing objects in Parameters

Posted by Jason Weiss <ja...@omnicoders.com>.
It has been a long day <rubbing eyes> but let me take a stab at this.
Can't you simply code this:

de.centerice.om.Content myContent = (de.centerice.om.Content)
data.getParameters().getObject("choosenmessage");

If that parameter really is an instance of de.centerice.om.Content, it
will easily cast and then just invoke your methods on myContent.

HTH,

Jason Weiss






-----Original Message-----
From: Ronny [mailto:Ronny-Walter@t-online.de] 
Sent: Thursday, May 22, 2003 6:38 PM
To: Jetspeed
Subject: Accessing objects in Parameters


Hello list,

i want to access the objects stored in the Rundata-Object.

I have the following code:

Log.debug("object in rundata: " +
data.getParameters().getObject("choosenmessage"));
Log.debug("object is instance of class: "	 +
(data.getParameters().getObject("choosenmessage")).getClass());

In Logfile I have:
[23 Mai 2003 01:15:40 DEBUG] - object in rundata:
de.centerice.om.Content@31 [23 Mai 2003 01:15:40 DEBUG] - object is
instance of class: class java.lang.String

That's correct, but how can I get the instance of the
de.centerice.om.Content-Object?

I've looked at velocity and Jetspeed doku but didn't find anything.

Greetings
Ronny



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org