You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by JD Daniels <jd...@datatrio.com> on 2004/03/11 23:35:44 UTC

[cforms] v2 flow api bind repeater to dom at onaddrow

I am getting closer...

using the v2 flow api:

    model.inventory.onAddRow = function(row) {
        var uri = "cocoon:/load-InventoryItem?id=" + 
model.inventoryId.value;
        var resolver = 
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
        var source = resolver.resolveURI(uri);
        var parser = 
cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
        var document = 
parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil.getInputSource(source));

       //How do I give the row widgets the value of the  xml nodes in 
the dom document here?
    }


JD


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: how to convert password format from unix to windows?

Posted by Lechael Han <ha...@hotmail.com>.
Thank you for your reply.
I am new to cocoon. I searched the cocoon document and wiki, but I didn't
find some component which could do this kind of encoding. I also searched
the Tomcat docs, it seems that tomcat could only digest its password in
three kinds of format.
So would you please tell me which component I can use to encode the
password?
Or should I make a component myself and plug in?

thank you

Lechael
----- Original Message ----- 
From: "Stephen Winnall" <st...@winnall.ch>
To: <us...@cocoon.apache.org>
Sent: Monday, March 15, 2004 4:45 AM
Subject: Re: how to convert password format from unix to windows?


> The usual way of doing this is to encode the password input by the user
> with the Unix crypt function and comparing the result with what you have
> stored in the database.
>
> Steve
>
> On 15 Mar 2004, at 08:41, Han, Liqiao wrote:
>
> > the username and password are stored in mysql on a Unix server, which
> > encodes password in a Unix's classic password format(the same as it
> > does
> > with its os password)
> > cocoon is installed on windows,
> > then how can I compare the password input by users with the one pulled
> > from
> > the database?
> > Thanks for your time and information!!
> >
> > Lechael
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: how to convert password format from unix to windows?

Posted by Stephen Winnall <st...@winnall.ch>.
The usual way of doing this is to encode the password input by the user
with the Unix crypt function and comparing the result with what you have
stored in the database.

Steve

On 15 Mar 2004, at 08:41, Han, Liqiao wrote:

> the username and password are stored in mysql on a Unix server, which
> encodes password in a Unix's classic password format(the same as it 
> does
> with its os password)
> cocoon is installed on windows,
> then how can I compare the password input by users with the one pulled 
> from
> the database?
> Thanks for your time and information!!
>
> Lechael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


how to convert password format from unix to windows?

Posted by "Han, Liqiao" <ha...@hotmail.com>.
the username and password are stored in mysql on a Unix server, which
encodes password in a Unix's classic password format(the same as it does
with its os password)
cocoon is installed on windows,
then how can I compare the password input by users with the one pulled from
the database?
Thanks for your time and information!!

Lechael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms] v2 flow api bind repeater to dom at onaddrow

Posted by JD Daniels <jd...@datatrio.com>.
Oops.. i sent the wrong thread.. that seems to be a little earlier ...

but i see in the carselector sample under v2:

wid.model.setSelectionList("cocoon:/cars/"+ wid.make.value + "/" + 
newValue);


JD Daniels wrote:

> A selectionlist is a little easier i think...
>
> http://archives.real-time.com/pipermail/cocoon-users/2003-November/041614.html 
>
>
> Look at the carselector sample.....
>
> JD
>
>
> Mark Lundquist wrote:
>
>>
>> On Mar 11, 2004, at 4:15 PM, JD Daniels wrote:
>>
>>> Yup I got that part.. its the dom that is making me bang my head...
>>>
>>> row.mywidget.value = "Blah Blah";
>>>
>>> No worries... Its getting the value from the DOM that is irking me :(
>>>
>>> row.mywidget.value = document(/path/to/node/i/wish);
>>
>>
>>
>> Guess what — I now have exactly the same need!  My XML isn't 
>> generated by XSP, it's just a static resource... but same as you, I 
>> need to get a handle on it somehow from within the flowscript, in 
>> order to populate a dropdown menu.
>>
>> I see where you grabbed that code from — from the bindings sample, 
>> right?
>>
>> Anyway... I'll let you know whatever I find out, and you let me know 
>> whatever you find out, OK?
>>
>> Cheers,
>> Mark
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms] v2 flow api bind repeater to dom at onaddrow

Posted by JD Daniels <jd...@datatrio.com>.
A selectionlist is a little easier i think...

http://archives.real-time.com/pipermail/cocoon-users/2003-November/041614.html

Look at the carselector sample.....

JD


Mark Lundquist wrote:

>
> On Mar 11, 2004, at 4:15 PM, JD Daniels wrote:
>
>> Yup I got that part.. its the dom that is making me bang my head...
>>
>> row.mywidget.value = "Blah Blah";
>>
>> No worries... Its getting the value from the DOM that is irking me :(
>>
>> row.mywidget.value = document(/path/to/node/i/wish);
>
>
> Guess what — I now have exactly the same need!  My XML isn't generated 
> by XSP, it's just a static resource... but same as you, I need to get 
> a handle on it somehow from within the flowscript, in order to 
> populate a dropdown menu.
>
> I see where you grabbed that code from — from the bindings sample, right?
>
> Anyway... I'll let you know whatever I find out, and you let me know 
> whatever you find out, OK?
>
> Cheers,
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms] v2 flow api bind repeater to dom at onaddrow

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Mar 11, 2004, at 4:15 PM, JD Daniels wrote:

> Yup I got that part.. its the dom that is making me bang my head...
>
> row.mywidget.value = "Blah Blah";
>
> No worries... Its getting the value from the DOM that is irking me :(
>
> row.mywidget.value = document(/path/to/node/i/wish);

Guess what — I now have exactly the same need!  My XML isn't generated 
by XSP, it's just a static resource... but same as you, I need to get a 
handle on it somehow from within the flowscript, in order to populate a 
dropdown menu.

I see where you grabbed that code from — from the bindings sample, 
right?

Anyway... I'll let you know whatever I find out, and you let me know 
whatever you find out, OK?

Cheers,
Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms] v2 flow api bind repeater to dom at onaddrow

Posted by JD Daniels <jd...@datatrio.com>.
Yup I got that part.. its the dom that is making me bang my head...

row.mywidget.value = "Blah Blah";

No worries... Its getting the value from the DOM that is irking me :(

row.mywidget.value = document(/path/to/node/i/wish);

JD

Mark Lundquist wrote:

>
> On Mar 11, 2004, at 3:45 PM, JD Daniels wrote:
>
>> Thanks for the input :)
>>
>> The thing is , for this i don't *have* any business objects. The 
>> xsp's are xsps simply because xsp has esql.. They are plain data 
>> views from a rdbms. I need to do this on the add row function because 
>> i don't want to load an xml file with every single item in it. I just 
>> want to load up one item.. the one the user has chosen, and fill the 
>> row with the values assigned to that item. these are going to be used 
>> elsewhere, so I do not need to write them back.
>
>
> Ah, gotcha...
>
> I suggested encapsulating that in a Java class, so it seems like you 
> might as well just have that Java class use JDBC to do your query 
> directly, and once again skip the ESQL logicsheet stuff.  But you 
> probably thought of that already and decided not to for some reason... 
> :-)
>
> Anyway, to answer you question... you have access to the whole widget 
> tree of your form, by way of
>
>     form.getWidget()
>
> which returns the root of the widget tree.  Take a look at the v2 
> sample, and the light will turn on in no time! :-)  Actually you 
> probably did that and have it figured out by now...
>
> Cheers,
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms] v2 flow api bind repeater to dom at onaddrow

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Mar 11, 2004, at 3:45 PM, JD Daniels wrote:

> Thanks for the input :)
>
> The thing is , for this i don't *have* any business objects. The xsp's 
> are xsps simply because xsp has esql.. They are plain data views from 
> a rdbms. I need to do this on the add row function because i don't 
> want to load an xml file with every single item in it. I just want to 
> load up one item.. the one the user has chosen, and fill the row with 
> the values assigned to that item. these are going to be used 
> elsewhere, so I do not need to write them back.

Ah, gotcha...

I suggested encapsulating that in a Java class, so it seems like you 
might as well just have that Java class use JDBC to do your query 
directly, and once again skip the ESQL logicsheet stuff.  But you 
probably thought of that already and decided not to for some reason... 
:-)

Anyway, to answer you question... you have access to the whole widget 
tree of your form, by way of

	form.getWidget()

which returns the root of the widget tree.  Take a look at the v2 
sample, and the light will turn on in no time! :-)  Actually you 
probably did that and have it figured out by now...

Cheers,
Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms] v2 flow api bind repeater to dom at onaddrow

Posted by JD Daniels <jd...@datatrio.com>.
Thanks for the input :)

The thing is , for this i don't *have* any business objects. The xsp's 
are xsps simply because xsp has esql.. They are plain data views from a 
rdbms. I need to do this on the add row function because i don't want to 
load an xml file with every single item in it. I just want to load up 
one item.. the one the user has chosen, and fill the row with the values 
assigned to that item. these are going to be used elsewhere, so I do not 
need to write them back.

JD

Mark Lundquist wrote:

> Hi JD,
>
> On Mar 11, 2004, at 2:35 PM, JD Daniels wrote:
>
>     I am getting closer...
>
>     using the v2 flow api:
>
>
> That's the spirit! :-)
>
> I was going to suggest that, but hadn't gotten around to it. Nice to 
> see you chose that way.
>
>
>     model.inventory.onAddRow = function(row) {
>     var uri = "cocoon:/load-InventoryItem?id=" + model.inventoryId.value;
>     var resolver =
>     cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
>
>     var source = resolver.resolveURI(uri);
>     var parser =
>     cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
>
>     var document =
>     parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil.getInputSource(source));
>
>
>     //How do I give the row widgets the value of the xml nodes in the
>     dom document here?
>     }
>
>
> A couple of observations (I'm a newbie too, BTW, so my high-horse 
> isn't so high... :-):
>
> 1) If it were me, and parsing a DOM tree were going to be part of this 
> deal, then I would immediately switch to Java for that part 
> — encapsulate it in a Java class and give myself a nice method or two 
> to call from the flowscript. You're basically programming in Java 
> here, with the Java code hoisted up into the flowscript anyway, but 
> that's not really the right idiom for flow IMHO. Maybe it's just a 
> matter of taste, I don't know. To me, parsing a DOM tree is not 
> something that should be exposed in the presentation layer.
>
> 2) If I were going to do this for some reason, I don't think I'd do it 
> right there in the onAddRow function. I'd do it in the setup (and then 
> maybe use org.apache.xpath.XPathAPI where I needed it, like in this 
> function...)
>
> 3) BUT — and this is the big one I think — Why not skip the whole 
> XSP-generating-XML-from-model-data part of this plumbing, and just 
> access your business objects directly from the flow? (Or am I 
> mis-reading between the lines here?)
>
> (Note, I'm kinda biased against XSP anyway, since it's on the outs and 
> I never learned it anyway... jumped right into flow+Java when I 
> started w/ Cocoon)
>
> I think (3) hopefully answers your question, that's the idea anyway 
> ("Doc, it hurts when I do /this/"... "Well, don't do that!" :-)
>
> Best Regards,
> Mark
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms] v2 flow api bind repeater to dom at onaddrow

Posted by Mark Lundquist <ml...@wrinkledog.com>.
Hi JD,

On Mar 11, 2004, at 2:35 PM, JD Daniels wrote:

> I am getting closer...
>
> using the v2 flow api:

That's the spirit! :-)

I was going to suggest that, but hadn't gotten around to it.  Nice to  
see you chose that way.


>    model.inventory.onAddRow = function(row) {
>        var uri = "cocoon:/load-InventoryItem?id=" +  
> model.inventoryId.value;
>        var resolver =  
> cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver 
> .ROLE);
>        var source = resolver.resolveURI(uri);
>        var parser =  
> cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROL 
> E);
>        var document =  
> parser.parseDocument(Packages.org.apache.cocoon.components.source.Sourc 
> eUtil.getInputSource(source));
>
>       //How do I give the row widgets the value of the  xml nodes in  
> the dom document here?
>    }

A couple of observations (I'm a newbie too, BTW, so my high-horse isn't  
so high... :-):

1) If it were me, and parsing a DOM tree were going to be part of this  
deal, then I would immediately switch to Java for that part  
— encapsulate it in a Java class and give myself a nice method or two  
to call from the flowscript.  You're basically programming in Java  
here, with the Java code hoisted up into the flowscript anyway, but  
that's not really the right idiom for flow IMHO.  Maybe it's just a  
matter of taste, I don't know.  To me, parsing a DOM tree is not  
something that should be exposed in the presentation layer.

2) If I were going to do this for some reason, I don't think I'd do it  
right there in the onAddRow function.  I'd do it in the setup (and then  
maybe use org.apache.xpath.XPathAPI where I needed it, like in this  
function...)

3) BUT — and this is the big one I think — Why not skip the whole  
XSP-generating-XML-from-model-data part of this plumbing, and just  
access your business objects directly from the flow?  (Or am I  
mis-reading between the lines here?)

(Note, I'm kinda biased against XSP anyway, since it's on the outs and  
I never learned it anyway... jumped right into flow+Java when I started  
w/ Cocoon)

I think (3) hopefully answers your question, that's the idea anyway  
("Doc, it hurts when I do this"... "Well, don't do that!" :-)

Best Regards,
Mark