com.raritantechnologies.marklogic
Class MarkLogicQueryParser

java.lang.Object
  extended bycom.raritantechnologies.xml.xQuery.XQueryParser
      extended bycom.raritantechnologies.marklogic.MarkLogicQueryParser
All Implemented Interfaces:
IConfigurable, IQueryParser

public class MarkLogicQueryParser
extends XQueryParser

Creates a MarkLogic compatible XQuery String from a query input map.

XML Configuration Template:
   <QueryParser class="com.raritantechnologies.xml.xPath.XQueryParser"
                   xQueryField="[ parameter field that gets the computed XQuery String ]" >

     <!-- One or more UseXQueryTemplate tags: -->
     <UseXQueryTemplate>

       <!-- Defines query or user parameters that will cause a specific XQuery template to be selected -->
       <QueryParams isAnd="[ true | false ]" >     
         <Param name="[ name of query parameter ]" >
           <ValidValues>
             <Value>[ a valid value ]</Value>
             <Value>[ another valid value ]</Value>
             <!-- etc... -->
           </ValidValues>
         </Param>

         <!-- Alternatively can use an IComparator -->
         <Param name="[ name of query parameter ]" >
           <Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >

           </Comparator>
         </Param>
       </QueryParams>

       <UserParams>
         <Param name="[ name of User parameter ]" >
           <ValidValues>
             <Value>[ a valid value ]</Value>
             <Value>[ another valid value ]</Value>
             <!-- etc... -->
           </ValidValues>
         </Param>

         <!-- Alternatively can use an IComparator -->
         <Param name="[ name of User parameter ]" >
           <Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >

           </Comparator>
         </Param>
       </UserParams>

       <XQueryTemplate >
         <![CDATA[
           XQuery Template - variables are inserted into {fieldiD} sections of the template.
         ]]>
       </XQueryTemplate>

     </UseXQueryTemplate>

     <UseXQueryTemplate>
       <!-- etc. . . -->
     </UseXQueryTemplate>

   </QueryParser>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
static java.lang.String PAGING_SECTION
           
 
Constructor Summary
MarkLogicQueryParser()
           
 
Method Summary
 boolean canParse(OrderedMap inputParameters, java.lang.String language, ILoginInfo userInfo)
           
 java.lang.String createQuery(OrderedMap params, java.lang.String language, ILoginInfo userInfo, java.lang.String pagingSection)
           
 
Methods inherited from class com.raritantechnologies.xml.xQuery.XQueryParser
createQuery, getErrors, haveParser, initialize, parse, parse, setLanguage, setSessionID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAGING_SECTION

public static final java.lang.String PAGING_SECTION
See Also:
Constant Field Values
Constructor Detail

MarkLogicQueryParser

public MarkLogicQueryParser()
Method Detail

createQuery

public java.lang.String createQuery(OrderedMap params,
                                    java.lang.String language,
                                    ILoginInfo userInfo,
                                    java.lang.String pagingSection)
                             throws QueryParseException,
                                    UnsupportedLanguageException
Throws:
QueryParseException
UnsupportedLanguageException

canParse

public boolean canParse(OrderedMap inputParameters,
                        java.lang.String language,
                        ILoginInfo userInfo)