You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Martin Wendel <co...@it.dk> on 2004/07/02 00:12:33 UTC

getId() returns object?

How come that user.getId() returns an object, instead of the value in the id
column of the user table?

And how do I extract that value from the object? Everywhere I looked, they
all used long as return value, not Object...

/Martin


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


RE: getId() returns object?

Posted by Eric Pugh <ep...@upstate.com>.
You need to cast it because the underlying value depends on what your
backend persitence mechanism..  For example, if your backend is LDAP, then
getId() would return something quite different from a database.  And
inmemory could return a hash as the id...

ERic

> -----Original Message-----
> From: Henning P. Schmiedehausen [mailto:hps@intermeta.de]
> Sent: Saturday, July 03, 2004 3:13 PM
> To: turbine-user@jakarta.apache.org
> Subject: Re: getId() returns object?
>
>
> "Martin Wendel" <co...@it.dk> writes:
>
> >How come that user.getId() returns an object, instead of the
> value in the id
> >column of the user table?
>
> On 2.3 or on 2.4-dev ?
>
> >And how do I extract that value from the object? Everywhere I
> looked, they
> >all used long as return value, not Object...
>
> cast it?
>
> 	Regards
> 		Henning
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
>
> RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
>    Linux, Java, perl, Solaris -- Consulting, Training, Development
>
> "Fighting for one's political stand is an honourable action, but re-
>  fusing to acknowledge that there might be weaknesses in one's
>  position - in order to identify them so that they can be remedied -
>  is a large enough problem with the Open Source movement that it
>  deserves to be on this list of the top five problems."
>                        -- Michelle Levesque, "Fundamental Issues with
>                                     Open Source Software Development"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org


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


RE: SessionService working?

Posted by Martin Wendel <co...@it.dk>.
Nothing on this?

/Martin

-----Original Message-----
From: Martin Wendel [mailto:coder@it.dk] 
Sent: 6. juli 2004 01:24
To: 'Turbine Users List'
Subject: RE: SessionService working?

I've been trying to dig through the code, and reading up on the different
stuff. It looks like it does listen, it should initialize, and I call the
TurbineService statically to get the information.

So perhaps it is something with the Antelope/2.4 pipeline that hooks into
this and changes it? I would have thought a listener wouldn't really care as
to what it did use.. but maybe I'm wrong.

Seems really odd...

/Martin

-----Original Message-----
From: Martin Wendel [mailto:coder@it.dk] 
Sent: 5. juli 2004 17:46
To: 'Turbine Users List'
Subject: SessionService working?

Calling TurbineSession.getActiveUsers().size() returns 0...

I have setup a listner in the web.xml:

        <listener>
          <listener-class>
            org.apache.turbine.services.session.SessionListener
          </listener-class>
        </listener>

Put in the following in TR.props:
services.SessionService.classname=org.apache.turbine.services.session.Turbin
eSessionService
services.SessionService.earlyInit=true

tool.session.sessionmgt = org.apache.turbine.services.session.SessionTool


So I should be all set to go?
Btw, how does this work if you use multiple tomcat's for load balancing?

/Martin


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



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



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


RE: SessionService working?

Posted by Martin Wendel <co...@it.dk>.
I've been trying to dig through the code, and reading up on the different
stuff. It looks like it does listen, it should initialize, and I call the
TurbineService statically to get the information.

So perhaps it is something with the Antelope/2.4 pipeline that hooks into
this and changes it? I would have thought a listener wouldn't really care as
to what it did use.. but maybe I'm wrong.

Seems really odd...

/Martin

-----Original Message-----
From: Martin Wendel [mailto:coder@it.dk] 
Sent: 5. juli 2004 17:46
To: 'Turbine Users List'
Subject: SessionService working?

Calling TurbineSession.getActiveUsers().size() returns 0...

I have setup a listner in the web.xml:

        <listener>
          <listener-class>
            org.apache.turbine.services.session.SessionListener
          </listener-class>
        </listener>

Put in the following in TR.props:
services.SessionService.classname=org.apache.turbine.services.session.Turbin
eSessionService
services.SessionService.earlyInit=true

tool.session.sessionmgt = org.apache.turbine.services.session.SessionTool


So I should be all set to go?
Btw, how does this work if you use multiple tomcat's for load balancing?

/Martin


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



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


SessionService working?

Posted by Martin Wendel <co...@it.dk>.
Calling TurbineSession.getActiveUsers().size() returns 0...

I have setup a listner in the web.xml:

        <listener>
          <listener-class>
            org.apache.turbine.services.session.SessionListener
          </listener-class>
        </listener>

Put in the following in TR.props:
services.SessionService.classname=org.apache.turbine.services.session.Turbin
eSessionService
services.SessionService.earlyInit=true

tool.session.sessionmgt = org.apache.turbine.services.session.SessionTool


So I should be all set to go?
Btw, how does this work if you use multiple tomcat's for load balancing?

/Martin


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


RE: Penguin extension...

Posted by Martin Wendel <co...@it.dk>.
Hmm you're probably right, I'll just look it over again, and I think it is
because I'm loading the values from database that it is a bit confusing...

/Martin

-----Original Message-----
From: Ben Gidley [mailto:ben.gidley@anite.com] 
Sent: 5. juli 2004 16:05
To: Turbine Users List
Subject: Re: Penguin extension...

Martin,
    I am slightly confused - I think what should happen is

1 - In your screen class you fill any values up you want. You set option 
objects onto field. You don't save field.values.
So you have a field object with a array of option objects.
The field object.values[] will give you what ever the user selected last 
time
The option[] will give you the possible options

The option.caption will give you the caption for a possible value and 
option.value will give you an id for a possible value.

Ben

Martin Wendel wrote:

>Well i did look at that, but the thing is that i'm using the Value as
holder
>of an ID number.
>
>In the MyScreen.java I load in values used in the MyScreen.vm from a
>database... And as I need the ID numbers of those values when I later
>associate the selections with my profile, I can't leave them unset.
>
>Unless im wrong and that when it return the values it only sends along
those
>who have been selected?
>
>/martin
>
>-----Original Message-----
>From: Ben Gidley [mailto:ben@gidley.co.uk] 
>Sent: 4. juli 2004 11:43
>To: Turbine Users List
>Subject: Re: Penguin extension...
>
>Martin,
>    You can figure out which one(s) are selected  by used the getValues 
>function on the field object. A helper function could be useful - (there 
>already is one for Checkboxes/radio buttons). I have added one to CVS 
>for penguin - I will put out a new version in a few days - once I have 
>checked for side effects.
>
>The code is
>private static final String SELECTED = "selected=\"selected\"";
>
>/**
>     * Returns the HTML attribute for selected within an option group
>     * @param value
>     * @return
>     */
>    public String isSelected(String value) {
>        // We can always uses the array as values is always filled by 
>validation
>        for (int i = 0; i < values.length; i++) {
>            if (values[i].equals(value)) { return SELECTED; }
>        }
>        return "";
>    }
>
>Ben
>
>Martin Wendel wrote:
>
>  
>
>>Hey guys, i think the penguin tool is nice, however it is missing the
value
>>of "selected" for options in select lists...
>>
>>I thought about just adding a Selected to the Option class, but I'm not
>>    
>>
>sure
>  
>
>>about what else to do. Any help here?
>>
>>/Martin
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>
>>
>> 
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
>
>Scanned for viruses by MessageLabs
>  
>



Scanned for viruses by MessageLabs. The integrity and security of this
message cannot be guaranteed. This email is intended for the named recipient
only, and may contain confidential information and proprietary material. Any
unauthorised use or disclosure is prohibited.


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


Re: Penguin extension...

Posted by Ben Gidley <be...@anite.com>.
Martin,
    I am slightly confused - I think what should happen is

1 - In your screen class you fill any values up you want. You set option 
objects onto field. You don't save field.values.
So you have a field object with a array of option objects.
The field object.values[] will give you what ever the user selected last 
time
The option[] will give you the possible options

The option.caption will give you the caption for a possible value and 
option.value will give you an id for a possible value.

Ben

Martin Wendel wrote:

>Well i did look at that, but the thing is that i'm using the Value as holder
>of an ID number.
>
>In the MyScreen.java I load in values used in the MyScreen.vm from a
>database... And as I need the ID numbers of those values when I later
>associate the selections with my profile, I can't leave them unset.
>
>Unless im wrong and that when it return the values it only sends along those
>who have been selected?
>
>/martin
>
>-----Original Message-----
>From: Ben Gidley [mailto:ben@gidley.co.uk] 
>Sent: 4. juli 2004 11:43
>To: Turbine Users List
>Subject: Re: Penguin extension...
>
>Martin,
>    You can figure out which one(s) are selected  by used the getValues 
>function on the field object. A helper function could be useful - (there 
>already is one for Checkboxes/radio buttons). I have added one to CVS 
>for penguin - I will put out a new version in a few days - once I have 
>checked for side effects.
>
>The code is
>private static final String SELECTED = "selected=\"selected\"";
>
>/**
>     * Returns the HTML attribute for selected within an option group
>     * @param value
>     * @return
>     */
>    public String isSelected(String value) {
>        // We can always uses the array as values is always filled by 
>validation
>        for (int i = 0; i < values.length; i++) {
>            if (values[i].equals(value)) { return SELECTED; }
>        }
>        return "";
>    }
>
>Ben
>
>Martin Wendel wrote:
>
>  
>
>>Hey guys, i think the penguin tool is nice, however it is missing the value
>>of "selected" for options in select lists...
>>
>>I thought about just adding a Selected to the Option class, but I'm not
>>    
>>
>sure
>  
>
>>about what else to do. Any help here?
>>
>>/Martin
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>
>>
>> 
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
>
>Scanned for viruses by MessageLabs
>  
>



Scanned for viruses by MessageLabs. The integrity and security of this message cannot be guaranteed. This email is intended for the named recipient only, and may contain confidential information and proprietary material. Any unauthorised use or disclosure is prohibited.

RE: Penguin extension...

Posted by Martin Wendel <co...@it.dk>.
Well i did look at that, but the thing is that i'm using the Value as holder
of an ID number.

In the MyScreen.java I load in values used in the MyScreen.vm from a
database... And as I need the ID numbers of those values when I later
associate the selections with my profile, I can't leave them unset.

Unless im wrong and that when it return the values it only sends along those
who have been selected?

/martin

-----Original Message-----
From: Ben Gidley [mailto:ben@gidley.co.uk] 
Sent: 4. juli 2004 11:43
To: Turbine Users List
Subject: Re: Penguin extension...

Martin,
    You can figure out which one(s) are selected  by used the getValues 
function on the field object. A helper function could be useful - (there 
already is one for Checkboxes/radio buttons). I have added one to CVS 
for penguin - I will put out a new version in a few days - once I have 
checked for side effects.

The code is
private static final String SELECTED = "selected=\"selected\"";

/**
     * Returns the HTML attribute for selected within an option group
     * @param value
     * @return
     */
    public String isSelected(String value) {
        // We can always uses the array as values is always filled by 
validation
        for (int i = 0; i < values.length; i++) {
            if (values[i].equals(value)) { return SELECTED; }
        }
        return "";
    }

Ben

Martin Wendel wrote:

>Hey guys, i think the penguin tool is nice, however it is missing the value
>of "selected" for options in select lists...
>
>I thought about just adding a Selected to the Option class, but I'm not
sure
>about what else to do. Any help here?
>
>/Martin
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
>
>  
>



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



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


Re: Penguin extension...

Posted by Ben Gidley <be...@gidley.co.uk>.
Martin,
    You can figure out which one(s) are selected  by used the getValues 
function on the field object. A helper function could be useful - (there 
already is one for Checkboxes/radio buttons). I have added one to CVS 
for penguin - I will put out a new version in a few days - once I have 
checked for side effects.

The code is
private static final String SELECTED = "selected=\"selected\"";

/**
     * Returns the HTML attribute for selected within an option group
     * @param value
     * @return
     */
    public String isSelected(String value) {
        // We can always uses the array as values is always filled by 
validation
        for (int i = 0; i < values.length; i++) {
            if (values[i].equals(value)) { return SELECTED; }
        }
        return "";
    }

Ben

Martin Wendel wrote:

>Hey guys, i think the penguin tool is nice, however it is missing the value
>of "selected" for options in select lists...
>
>I thought about just adding a Selected to the Option class, but I'm not sure
>about what else to do. Any help here?
>
>/Martin
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
>
>  
>



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


Penguin extension...

Posted by Martin Wendel <co...@it.dk>.
Hey guys, i think the penguin tool is nice, however it is missing the value
of "selected" for options in select lists...

I thought about just adding a Selected to the Option class, but I'm not sure
about what else to do. Any help here?

/Martin


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


Re: getId() returns object?

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Martin Wendel" <co...@it.dk> writes:

>How come that user.getId() returns an object, instead of the value in the id
>column of the user table?

On 2.3 or on 2.4-dev ?

>And how do I extract that value from the object? Everywhere I looked, they
>all used long as return value, not Object...

cast it?

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honourable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

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


RE: getId() returns object?

Posted by Martin Wendel <co...@it.dk>.
Useradapter...

-----Original Message-----
From: Martin Wendel [mailto:coder@it.dk] 
Sent: 2. juli 2004 00:13
To: 'Turbine Users List'
Subject: getId() returns object?

How come that user.getId() returns an object, instead of the value in the id
column of the user table?

And how do I extract that value from the object? Everywhere I looked, they
all used long as return value, not Object...

/Martin


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



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