You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ro...@vodafone.com on 2004/02/13 16:54:27 UTC
Dynamically generate queries from user input
Hi all,
I have build several xsp:pages which contain forms holding textboxes and
dropdownboxes. The dropdownboxes are filled with values from a query.
I will explain my problem with a real life example. The form offers a way
to search/filter for, let's say, trouble tickets. A trouble ticket is of a
certain type (incident, change or problem). It also has a severitycode (low,
middle, heavy) and it has a description for example.
Suppose I have a form with two dropdownboxes (ddb)
* ddbType has following options : (SELECT DISTINCT TYPE FROM TROUBLES)
* -- any type
* incident
* change
* problem
* ddbSeverityCode has following options: (SELECT DISTINCT
SEVERITYCODE FROM TROUBLES)
* -- any severity code
* low
* middle
* heavy
* tbDescription (is empty)
Now i want depending of the userinput to run following query :
String MyDynamicQuery = "SELECT TROUBLEID FROM TROUBLES "
<!-- conditional If any parameters are filled in -->
+ " WHERE "
<!-- conditional if ddbType contains valid value (this means not
empty and not starts with '--' -->
TYPE = ?
<!-- conditional if ddbType contains valid value (this means not
empty and not starts with '--' -->
<!-- conditional if ddbSeverityCode contains valid value (this
means not empty and not starts with '--' -->
SEVERITYCODE = ?
<!-- conditional if ddbSeverityCode contains valid value (this
means not empty and not starts with '--' -->
<!-- conditional if tbDescription contains valid value (this means
not empty -->
DESCRIPTION LIKE %?%
<!-- conditional if tbDescription contains valid value (this
means not empty -->
<!-- conditional If any parameters are filled in -->
Did anyone already do some nice work on this issue ?? I'm looking for ways
to do this kind of thing without having to do a lot of coding. Any
suggestions, please post it !!
Robby Pelssers
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Cocoon XSP Documentation : Access to servlet object and core logicsheets
Posted by Matteo <tu...@email.it>.
I'm new to Cocoon, I browsed all the documentation distributed with
Cocoon but I coundn't find how to access servlet object in XSP page.
Question 1
----------
how I cae access the various "request", "response", "session", "context"
objects in an XSP logic?
I couldn't find any official reference and I tried a lot as :
<xsp:logic>
ServletContext app = getServletContext();
</xsp:logic>
Question 2
----------
Someone knows if there is a documentation to the cocoon included
logicsheet library (such as the 'util' used in the examples?, I means a
complete API documentation or something like it).
thank you in advance,
Matteo
--
people fall into 10 categories,
who knows the binary and who doesn't
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org