Thanks Matt,
I appreciate the leads. We're looking at Apache Struts and JSF as
possible frameworks. I can see now how pushing the xquery stuff onto
the ML server makes a lot of sense in that context because it keeps a
clean separation between these frameworks and the backend database.
Wrapping the xquery in modules to apply XHTML formatting means we can
reuse the core queries in contexts where we want XML rather than
XHTML (e.g. if we want to create Web services or feed the results
into an XMLHttpRequest object).
Alan
On 5-Apr-07, at 1:49 PM, Griffin, Matt wrote:
Hi Alan,
Most of our queries are in xqy modules on the server. For single-shot
formatting functions there's not much point but it's definitely a good
idea for data extraction functions that would be reused.
As far as interaction with java, we do everything with xdbc. The
resulting html fragment gets added to the model by the controller and
the jsp view renders the page and inserts the fragment in the proper
place. It's simple and works for us but I'd be interested if anyone
thinks there's a better approach.
-Matt
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alan
Darnell
Sent: Thursday, April 05, 2007 11:36 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] MarkLogic XQuery Tag
LibraryandJSTLXMLTag Library
Matt,
Do you store these queries as xqy files on the Mark Logic server and
bring the content into your servlet via HTTP or do you keep the query
logic in the servlet and grab the results from Mark Logic via XDBC?
Once you have the data from the ML server as an HTML fragment, do you
then pass this to a JSP page for rendering or do you do all the
rendering in the servlet? If you pass the HTML fragment to a JSP
page, what mechanism do you use to do this?
Sorry for the dim questions -- I'm trying to figure out how to apply
the "classic" MVC model to Mark Logic.
Alan
On 4-Apr-07, at 6:03 PM, Griffin, Matt wrote:
I've been trying to push this kind of content processing back into ML
wherever possible. I still try to be careful about separation of
concern so I write my queries as the result of two functions. The
first
selects relevant content and is reusable, the second wraps it for
formatting. Java can then just use the result as a stream and put it
where it needs to go.
The call would look something like this for an html fragment:
element ul {
for $j select-journals-by-term($term)
return
element li {
attribute id { $j//journal-id },
$j//title
}
-Matt
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general