org.ow2.weblab.util
Class PortletQueryParser

java.lang.Object
  extended by org.ow2.weblab.util.WebLabQueryParser
      extended by org.ow2.weblab.util.PortletQueryParser

public class PortletQueryParser
extends WebLabQueryParser


Field Summary
 
Fields inherited from class org.ow2.weblab.util.WebLabQueryParser
ASCENDENT_ORDERING_MODE_EXPECTED, HAS_SCOPE, TO_BE_ORDERED_BY
 
Constructor Summary
PortletQueryParser()
           
 
Method Summary
 java.lang.String getComposedRequest(org.ow2.weblab.core.model.ComposedQuery q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Build a string query based on the content of a ComposedQuery.
 boolean getOrder(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Test if the property ASCENDENT_ORDERING_MODE_EXPECTED is set to true.
 java.lang.String getOrderBy(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Test if the property TO_BE_ORDERED_BY exists on the query and get its value if applicable.
 java.lang.String getRequest(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Build a string request based on the content of a Query.
 java.lang.String getRequestWithScope(org.ow2.weblab.core.model.Query q, org.ow2.weblab.core.helper.ResourceHelper hlpr)
          Extract the request from the StringQuery possibly using the property HAS_SCOPE to restrict request scope and adapt syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletQueryParser

public PortletQueryParser()
Method Detail

getRequest

public java.lang.String getRequest(org.ow2.weblab.core.model.Query q,
                                   org.ow2.weblab.core.helper.ResourceHelper hlpr)
                            throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Description copied from class: WebLabQueryParser
Build a string request based on the content of a Query.

Specified by:
getRequest in class WebLabQueryParser
Parameters:
q - a Query
hlpr - a JenaResourceHelper initialized on the Query
Returns:
the request as a string
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getComposedRequest

public java.lang.String getComposedRequest(org.ow2.weblab.core.model.ComposedQuery q,
                                           org.ow2.weblab.core.helper.ResourceHelper hlpr)
                                    throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Description copied from class: WebLabQueryParser
Build a string query based on the content of a ComposedQuery. This method is for now limited to simple composition (ie one level ComposedQuery) and only accepting StringQuery as sub- queries.

Specified by:
getComposedRequest in class WebLabQueryParser
Parameters:
q - the ComposedQuery
hlpr - a JenaResourceHelper initialized on the ComposedQuery
Returns:
the composed request as a string
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getRequestWithScope

public java.lang.String getRequestWithScope(org.ow2.weblab.core.model.Query q,
                                            org.ow2.weblab.core.helper.ResourceHelper hlpr)
                                     throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Description copied from class: WebLabQueryParser
Extract the request from the StringQuery possibly using the property HAS_SCOPE to restrict request scope and adapt syntax.

Specified by:
getRequestWithScope in class WebLabQueryParser
Parameters:
q - a StrinQuery
Returns:
the request as a String
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getOrderBy

public java.lang.String getOrderBy(org.ow2.weblab.core.model.Query q,
                                   org.ow2.weblab.core.helper.ResourceHelper hlpr)
                            throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Description copied from class: WebLabQueryParser
Test if the property TO_BE_ORDERED_BY exists on the query and get its value if applicable.

Specified by:
getOrderBy in class WebLabQueryParser
Parameters:
q - a StrinQuery
Returns:
The URI of the property to be used for ordering or null if empty.
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getOrder

public boolean getOrder(org.ow2.weblab.core.model.Query q,
                        org.ow2.weblab.core.helper.ResourceHelper hlpr)
                 throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Description copied from class: WebLabQueryParser
Test if the property ASCENDENT_ORDERING_MODE_EXPECTED is set to true.

Specified by:
getOrder in class WebLabQueryParser
Parameters:
q - a StrinQuery
Returns:
true of false, the value of the property (default is false)
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException


Copyright © 2004-2012. All Rights Reserved.