You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Angelo Immediata <an...@libero.it> on 2005/10/23 10:26:36 UTC

Increasing Cocoon Portal speed at stat-up

Hi all.
I'm using cocoon 2.1.7 and the portal block.
I have the configuration files portal-user-anonymous.xml and portal.xml in the layout directory that are at about 20000 rows; there are a lots of coplets and pags declared in them.
Now i have seen that when i try to go to the first time in the page of my portal i must wait at about 60 seconds in order to see the page; then when i try to log-in i must wait another 60 seconds in order to load the logged-in page.
How can i avoid this feature? It seems to methat this is due to the fact that portal handler must load all the coplets configuration... is it true? Can this thing be avoided?
Thanks to all.
Angelo



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


Re: Java and JavaScript in Cocoon app

Posted by Oleg Konovalov <ol...@yahoo.com>.
Jason,

Yes, I am using sitemap actions which execute Java code.

I do have some experience with JSP & servlets
(but much more of Applets, that's why I thought of LiveConnect).
So let me tell what I understood from your advice:
- since the name="inclusions" for all my checkboxes
(but each has a different "value"), I should declare
String [] inclusions = request.getParameterValues("inclusions");
- replace that JS function getCheckedValues(inclusions,true) 
with the one in Java;
- use it to create flags to be passed to the Stored Procedure
for creating dynamic query.

Did I get it right ?

Thank you,
Oleg.

--- Jason Johnston <co...@lojjic.net> wrote:

> What are you using on the server-side to process the request
> and build the
> SQL?  Sitemap actions?  I'm assuming it's not Flowscript or
> JavaFlow since
> you're using such an old version of Cocoon.
> 
> I don't think the JavaScript you describe is going to be of
> much use to
> you; IIUC the JS you're talking about is client-side (as
> opposed to
> server-side JS which later versions of Cocoon use for handling
> flow). 
> Since it's client-side it therefore cannot execute code on the
> server
> directly.  (LiveConnect would only allow your JS to talk to a
> client-side
> Java applet embedded in your page, not the Java code on the
> server.)
> 
> What you need to do instead is in your server-side Java code
> that handles
> the request, get the request parameters sent by the HTML
> checkboxes; this
> is the request.getParameterValues("exclusions") you asked
> about, and
> "exclusions" should match the name="" attribute of the
> checkboxes.  The
> Java array returned by that method consists of the values of
> the
> checkboxes that were checked by the user.
> 
> Am I on the right track at all here?  Let me know if I'm not
> understanding
> your situation; it feels a bit odd explaining basic concepts
> like request
> parameters (these concepts are not unique to Cocoon by the
> way, and are
> usually already prerequisite knowledge for people working with
> web apps)
> so I'm sorry if I'm just misunderstanding you and telling you
> stuff you
> already know.
> 
> --Jason
> 
> 
> >>it builds [in Javascript] an array of checkboxes checked
> >>called valueArray, which is not used now).
> > Correction: actually, it seems that there is an attempt
> > in the existing code to pass Javascript array to Java:
> >
>
onsubmit="if(this.inclusions)excludes.value=getCheckedValues(inclusions,true);return
> > true;"
> >
> > Interestingly, "inclusions" is a name of all checkboxes in
> XSL
> > page. But on Java side it doesn't use "inclusions",
> "excludes"
> > or "valueArray", but uses:
> > String [] exclusions =
> request.getParameterValues("exclusions");
> > - I don't see where request parameter "exclusions" is coming
> > from;
> > - later instead of that array exclusions[] they pass NULL to
> the
> > method which is supposed to create SQL based on that.
> >
> > I checked a few Javascript books, and it looks like one has
> to
> > use LiveConnect technology to use JavaScript variables in
> Java,
> > that requires "import netscape.javascript.*" package.
> > There are no such imports in the code.
> >
> > Are there other ways to use JavaScript vars in Java ?
> >
> > What does "(this.inclusions)" means in
> >
>
"if(this.inclusions)excludes.value=getCheckedValues(inclusions,true);return
> > true;" ?
> > Is that a sort of casting ?  Passing array from JS to Java ?
> >
> > Is that a legitimate way to pass variables JS->Java ?
> >
> > Please advise.
> >
> > Thank you in advance,
> > Oleg.
> >
> >
> > --- Oleg Konovalov <ol...@yahoo.com> wrote:
> >
> >> Hi,
> >>
> >> I am trying to enhance somebody's Cocoon 2.0.4 application
> >> (tons of XSL and XML, Java and a bit of Javascript).
> >>
> >> On my page there is a bunch of checkboxes (defined in XSL),
> >> and based on which of them user selects,
> >> it supposed to dynamically build SQL stament
> >> (in Stored Procedure with flags as parameters),
> >> called from Java.
> >>
> >> There is a little bit of manipulation on these checkboxes
> >> currently done in JavaScript (e.g. it builds an array
> >> of checkboxes checked called valueArray, which is not used
> >> now).
> >> I think, I can use that JavaScript array,
> >> but not sure how to access it from Java. How ?
> >> something with LiveConnect (have no experience with that),
> >> any sample ?
> >>
> >> Would that be a normal thing to do in Cocoon application
> >> or is there a better and easier way (since XSL will
> generate
> >> Java bytecode) ?
> >>
> >> Sorry for the newbie question.
> >>
> >>
> >> Thank you in advance,
> >> Oleg.
> >>
> >>
> >>
> 
> 
>
---------------------------------------------------------------------
> 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: Java and JavaScript in Cocoon app

Posted by Jason Johnston <co...@lojjic.net>.
What are you using on the server-side to process the request and build the
SQL?  Sitemap actions?  I'm assuming it's not Flowscript or JavaFlow since
you're using such an old version of Cocoon.

I don't think the JavaScript you describe is going to be of much use to
you; IIUC the JS you're talking about is client-side (as opposed to
server-side JS which later versions of Cocoon use for handling flow). 
Since it's client-side it therefore cannot execute code on the server
directly.  (LiveConnect would only allow your JS to talk to a client-side
Java applet embedded in your page, not the Java code on the server.)

What you need to do instead is in your server-side Java code that handles
the request, get the request parameters sent by the HTML checkboxes; this
is the request.getParameterValues("exclusions") you asked about, and
"exclusions" should match the name="" attribute of the checkboxes.  The
Java array returned by that method consists of the values of the
checkboxes that were checked by the user.

Am I on the right track at all here?  Let me know if I'm not understanding
your situation; it feels a bit odd explaining basic concepts like request
parameters (these concepts are not unique to Cocoon by the way, and are
usually already prerequisite knowledge for people working with web apps)
so I'm sorry if I'm just misunderstanding you and telling you stuff you
already know.

--Jason


>>it builds [in Javascript] an array of checkboxes checked
>>called valueArray, which is not used now).
> Correction: actually, it seems that there is an attempt
> in the existing code to pass Javascript array to Java:
> onsubmit="if(this.inclusions)excludes.value=getCheckedValues(inclusions,true);return
> true;"
>
> Interestingly, "inclusions" is a name of all checkboxes in XSL
> page. But on Java side it doesn't use "inclusions", "excludes"
> or "valueArray", but uses:
> String [] exclusions = request.getParameterValues("exclusions");
> - I don't see where request parameter "exclusions" is coming
> from;
> - later instead of that array exclusions[] they pass NULL to the
> method which is supposed to create SQL based on that.
>
> I checked a few Javascript books, and it looks like one has to
> use LiveConnect technology to use JavaScript variables in Java,
> that requires "import netscape.javascript.*" package.
> There are no such imports in the code.
>
> Are there other ways to use JavaScript vars in Java ?
>
> What does "(this.inclusions)" means in
> "if(this.inclusions)excludes.value=getCheckedValues(inclusions,true);return
> true;" ?
> Is that a sort of casting ?  Passing array from JS to Java ?
>
> Is that a legitimate way to pass variables JS->Java ?
>
> Please advise.
>
> Thank you in advance,
> Oleg.
>
>
> --- Oleg Konovalov <ol...@yahoo.com> wrote:
>
>> Hi,
>>
>> I am trying to enhance somebody's Cocoon 2.0.4 application
>> (tons of XSL and XML, Java and a bit of Javascript).
>>
>> On my page there is a bunch of checkboxes (defined in XSL),
>> and based on which of them user selects,
>> it supposed to dynamically build SQL stament
>> (in Stored Procedure with flags as parameters),
>> called from Java.
>>
>> There is a little bit of manipulation on these checkboxes
>> currently done in JavaScript (e.g. it builds an array
>> of checkboxes checked called valueArray, which is not used
>> now).
>> I think, I can use that JavaScript array,
>> but not sure how to access it from Java. How ?
>> something with LiveConnect (have no experience with that),
>> any sample ?
>>
>> Would that be a normal thing to do in Cocoon application
>> or is there a better and easier way (since XSL will generate
>> Java bytecode) ?
>>
>> Sorry for the newbie question.
>>
>>
>> Thank you in advance,
>> Oleg.
>>
>>
>>


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


Re: Java and JavaScript in Cocoon app

Posted by Oleg Konovalov <ol...@yahoo.com>.
>it builds [in Javascript] an array of checkboxes checked 
>called valueArray, which is not used now).
Correction: actually, it seems that there is an attempt 
in the existing code to pass Javascript array to Java:
onsubmit="if(this.inclusions)excludes.value=getCheckedValues(inclusions,true);return
true;"

Interestingly, "inclusions" is a name of all checkboxes in XSL
page. But on Java side it doesn't use "inclusions", "excludes"
or "valueArray", but uses:
String [] exclusions = request.getParameterValues("exclusions");
- I don't see where request parameter "exclusions" is coming
from; 
- later instead of that array exclusions[] they pass NULL to the
method which is supposed to create SQL based on that.

I checked a few Javascript books, and it looks like one has to
use LiveConnect technology to use JavaScript variables in Java,
that requires "import netscape.javascript.*" package.
There are no such imports in the code.

Are there other ways to use JavaScript vars in Java ?

What does "(this.inclusions)" means in
"if(this.inclusions)excludes.value=getCheckedValues(inclusions,true);return
true;" ?
Is that a sort of casting ?  Passing array from JS to Java ?

Is that a legitimate way to pass variables JS->Java ?

Please advise.

Thank you in advance,
Oleg.


--- Oleg Konovalov <ol...@yahoo.com> wrote:

> Hi,
> 
> I am trying to enhance somebody's Cocoon 2.0.4 application
> (tons of XSL and XML, Java and a bit of Javascript).
> 
> On my page there is a bunch of checkboxes (defined in XSL),
> and based on which of them user selects, 
> it supposed to dynamically build SQL stament 
> (in Stored Procedure with flags as parameters), 
> called from Java.
> 
> There is a little bit of manipulation on these checkboxes
> currently done in JavaScript (e.g. it builds an array
> of checkboxes checked called valueArray, which is not used
> now).
> I think, I can use that JavaScript array,
> but not sure how to access it from Java. How ?
> something with LiveConnect (have no experience with that),
> any sample ?
> 
> Would that be a normal thing to do in Cocoon application 
> or is there a better and easier way (since XSL will generate
> Java bytecode) ?
> 
> Sorry for the newbie question.
> 
> 
> Thank you in advance,
> Oleg.
> 
> 
> 
> 
>
---------------------------------------------------------------------
> 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


Java and JavaScript in Cocoon app

Posted by Oleg Konovalov <ol...@yahoo.com>.
Hi,

I am trying to enhance somebody's Cocoon 2.0.4 application
(tons of XSL and XML, Java and a bit of Javascript).

On my page there is a bunch of checkboxes (defined in XSL),
and based on which of them user selects, 
it supposed to dynamically build SQL stament 
(in Stored Procedure with flags as parameters), 
called from Java.

There is a little bit of manipulation on these checkboxes
currently done in JavaScript (e.g. it builds an array
of checkboxes checked called valueArray, which is not used now).
I think, I can use that JavaScript array,
but not sure how to access it from Java. How ?
something with LiveConnect (have no experience with that),
any sample ?

Would that be a normal thing to do in Cocoon application 
or is there a better and easier way (since XSL will generate
Java bytecode) ?

Sorry for the newbie question.


Thank you in advance,
Oleg.




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


Re: Increasing Cocoon Portal speed at stat-up

Posted by Carsten Ziegeler <cz...@apache.org>.
Ralph Goers wrote:
> Carsten actually mentioned something like this to me at the GetTogether. 
> I suspect that this is due to using castor to convert your layout into 
> objects.  This happens each time a user logs in.  With such a large site 
> I could imagine that that could be a problem.  This currently cannot be 
> avoided, but with some more details about how your site is laid out I'm 
> sure we could come with a solution.  I would recommend opening a defect 
> in jira (when it is available).  If you also want to discuss this on the 
> dev list that would be ok too.
> 
Cocoon 2.1.8(dev) uses a slightly improved version for the Castor part,
so this should be a little bit faster. But as Ralph noted it would be
good to have some more information about your site to see what's going
wrong.

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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


Re: Increasing Cocoon Portal speed at stat-up

Posted by Ralph Goers <Ra...@dslextreme.com>.
Carsten actually mentioned something like this to me at the GetTogether. 
I suspect that this is due to using castor to convert your layout into 
objects.  This happens each time a user logs in.  With such a large site 
I could imagine that that could be a problem.  This currently cannot be 
avoided, but with some more details about how your site is laid out I'm 
sure we could come with a solution.  I would recommend opening a defect 
in jira (when it is available).  If you also want to discuss this on the 
dev list that would be ok too.

Ralph

Angelo Immediata wrote:

>Hi all.
>I'm using cocoon 2.1.7 and the portal block.
>I have the configuration files portal-user-anonymous.xml and portal.xml in the layout directory that are at about 20000 rows; there are a lots of coplets and pags declared in them.
>Now i have seen that when i try to go to the first time in the page of my portal i must wait at about 60 seconds in order to see the page; then when i try to log-in i must wait another 60 seconds in order to load the logged-in page.
>How can i avoid this feature? It seems to methat this is due to the fact that portal handler must load all the coplets configuration... is it true? Can this thing be avoided?
>Thanks to all.
>Angelo
>
>
>
>---------------------------------------------------------------------
>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