eu.clarin.cmdi.mdservice.model
Class Query

java.lang.Object
  extended by eu.clarin.cmdi.mdservice.model.Query

public class Query
extends java.lang.Object


Field Summary
private  java.lang.String collection
          temporary default;
static java.lang.String COLLECTIONS
           
private  int maxdepth
           
static java.lang.String MODEL
           
private  java.lang.String msg
           
static java.lang.String PARSED
           
static java.lang.String PARSEERROR
           
private  org.z3950.zing.cql.CQLNode query_cql
           
private  java.lang.String query_string
           
static java.lang.String RECORDSET
           
private  Result result
          reference to the result-object
private  java.lang.String syntax
           
private  java.lang.String target
          meant a target url/service, allowing querying different services on per query basis not used yet
private  java.net.URL targetRequest
           
private  java.lang.String type
           
 
Constructor Summary
Query(java.lang.String queryString)
           
Query(java.lang.String queryString, java.lang.String type)
          another constructor, with user's querystring and type of the query; problematic not setting the collection!
Query(java.lang.String queryString, java.lang.String type, java.lang.String collection)
          main constructor, with user's querystring and type of the query, and context-collection (at the moment just one)
 
Method Summary
 java.lang.String getCollection()
           
 int getMaxdepth()
           
 java.lang.String getMsg()
           
 java.lang.String getQueryString()
           
 Result getResult()
           
 java.lang.String getStatus()
           
 java.lang.String getType()
           
 java.lang.Boolean isStatus(java.lang.String qstatus)
           
 org.z3950.zing.cql.CQLNode parse()
          tries to parse the query_string according the CQL-syntax if successful returns the root-node of the parse-tree
 void setCollection(java.lang.String collection)
           
 void setMaxdepth(int maxdepth)
           
 void setMsg(java.lang.String msg)
           
 void setQueryString(java.lang.String queryString)
           
 void setResult(Result result)
           
 void setType(java.lang.String type)
           
 java.lang.String toCMDIndex()
          if the query is just a path-like structure "transforms" to cmdIndex-format, means replace('
 java.lang.String toURLParam()
          construct the URL-Param
 java.lang.String toXCQL()
          provides a xml-version of the query (if parsed successfully) according to the XCQL-schema defined in the SRU/CQL standard
 java.lang.String toXPath()
          provides a xpath version of the query, based on the XCQL-version, applying a stylesheet on the XCQL-version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLLECTIONS

public static java.lang.String COLLECTIONS

MODEL

public static java.lang.String MODEL

RECORDSET

public static java.lang.String RECORDSET

PARSED

public static java.lang.String PARSED

PARSEERROR

public static java.lang.String PARSEERROR

type

private java.lang.String type

target

private java.lang.String target
meant a target url/service, allowing querying different services on per query basis not used yet


targetRequest

private java.net.URL targetRequest

syntax

private java.lang.String syntax

query_string

private java.lang.String query_string

query_cql

private org.z3950.zing.cql.CQLNode query_cql

msg

private java.lang.String msg

collection

private java.lang.String collection
temporary default;


maxdepth

private int maxdepth

result

private Result result
reference to the result-object

Constructor Detail

Query

public Query(java.lang.String queryString)

Query

public Query(java.lang.String queryString,
             java.lang.String type,
             java.lang.String collection)
main constructor, with user's querystring and type of the query, and context-collection (at the moment just one)

Parameters:
queryString -
type -
collection -

Query

public Query(java.lang.String queryString,
             java.lang.String type)
another constructor, with user's querystring and type of the query; problematic not setting the collection!

Parameters:
queryString -
type -
Method Detail

isStatus

public java.lang.Boolean isStatus(java.lang.String qstatus)

getStatus

public java.lang.String getStatus()

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

getQueryString

public java.lang.String getQueryString()

setQueryString

public void setQueryString(java.lang.String queryString)

setCollection

public void setCollection(java.lang.String collection)

getCollection

public java.lang.String getCollection()

setMaxdepth

public void setMaxdepth(int maxdepth)

getMaxdepth

public int getMaxdepth()

setResult

public void setResult(Result result)

getResult

public Result getResult()

getMsg

public java.lang.String getMsg()

setMsg

public void setMsg(java.lang.String msg)

toURLParam

public java.lang.String toURLParam()
                            throws java.net.MalformedURLException
construct the URL-Param

Returns:
Throws:
java.net.MalformedURLException

parse

public org.z3950.zing.cql.CQLNode parse()
tries to parse the query_string according the CQL-syntax if successful returns the root-node of the parse-tree


toXCQL

public java.lang.String toXCQL()
provides a xml-version of the query (if parsed successfully) according to the XCQL-schema defined in the SRU/CQL standard

Returns:

toXPath

public java.lang.String toXPath()
provides a xpath version of the query, based on the XCQL-version, applying a stylesheet on the XCQL-version

Returns:
XPath-query

toCMDIndex

public java.lang.String toCMDIndex()
if the query is just a path-like structure "transforms" to cmdIndex-format, means replace('.', '/') ;)

Returns: