Changeset 722


Ignore:
Timestamp:
09/27/10 21:50:06 (14 years ago)
Author:
oschonef
Message:
  • make owner property searchable
  • fix some typos
  • reorder some code
Location:
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ASTPredicate.java

    r556 r722  
    6767            sb.append("vc_created");
    6868            break;
     69        case QueryParserConstants.VC_OWNER:
     70            sb.append("vc_owner");
     71            break;
    6972        case QueryParserConstants.CR_NAME:
    7073            sb.append("cr_name");
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/WhereClauseBuilder.java

    r556 r722  
    1414
    1515import eu.clarin.cmdi.virtualcollectionregistry.model.Creator_;
     16import eu.clarin.cmdi.virtualcollectionregistry.model.User_;
    1617import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
    1718import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection_;
     
    104105                    node.getOperator(), node.getValue());
    105106            break;
    106         case QueryParserConstants.CR_NAME:
    107             predicate = makeStringPredicate(data,
    108                     root.get(VirtualCollection_.creator).get(Creator_.name),
    109                     node.getOperator(), node.getValue());
    110             break;
    111         case QueryParserConstants.CR_EMAIL:
    112             predicate = makeStringPredicate(data,
    113                     root.get(VirtualCollection_.creator).get(Creator_.email),
    114                     node.getOperator(), node.getValue());
    115             break;
    116         case QueryParserConstants.CR_ORGANIZATION:
    117             predicate = makeStringPredicate(data,
    118                     root.get(VirtualCollection_.creator)
    119                         .get(Creator_.organisation),
     107        case QueryParserConstants.VC_STATE:
     108            predicate = makeStatePredicate(data,
     109                    node.getOperator(), node.getValue());
     110            break;
     111        case QueryParserConstants.VC_PURPOSE:
     112            predicate = makePurposePredicate(data,
     113                    node.getOperator(), node.getValue());
     114            break;
     115        case QueryParserConstants.VC_REPRODUCIBILITY:
     116            predicate = makeReproducibilityPredicate(data,
    120117                    node.getOperator(), node.getValue());
    121118            break;
     
    130127                    node.getOperator(), node.getValue());
    131128            break;
    132         case QueryParserConstants.VC_STATE:
    133             predicate = makeStatePredicate(data,
    134                     node.getOperator(), node.getValue());
    135             break;
    136         case QueryParserConstants.VC_PURPOSE:
    137             predicate = makePurposePredicate(data,
    138                     node.getOperator(), node.getValue());
    139             break;
    140         case QueryParserConstants.VC_REPRODUCIBILITY:
    141             predicate = makeReproducibilityPredicate(data,
     129        case QueryParserConstants.VC_OWNER:
     130            predicate = makeStringPredicate(data,
     131                    root.get(VirtualCollection_.owner).get(User_.name),
     132                    node.getOperator(), node.getValue());
     133            break;
     134        case QueryParserConstants.CR_NAME:
     135            predicate = makeStringPredicate(data,
     136                    root.get(VirtualCollection_.creator).get(Creator_.name),
     137                    node.getOperator(), node.getValue());
     138            break;
     139        case QueryParserConstants.CR_EMAIL:
     140            predicate = makeStringPredicate(data,
     141                    root.get(VirtualCollection_.creator).get(Creator_.email),
     142                    node.getOperator(), node.getValue());
     143            break;
     144        case QueryParserConstants.CR_ORGANIZATION:
     145            predicate = makeStringPredicate(data,
     146                    root.get(VirtualCollection_.creator)
     147                        .get(Creator_.organisation),
    142148                    node.getOperator(), node.getValue());
    143149            break;
     
    167173        value = value.replace("*", "%");
    168174
     175        System.err.println("VALUE = " + value);
    169176        switch (operator) {
    170177        case QueryParserConstants.EQ:
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/jjtree/eu/clarin/cmdi/virtualcollectionregistry/query/QueryParser.jjt

    r556 r722  
    88PARSER_BEGIN(QueryParser)
    99package eu.clarin.cmdi.virtualcollectionregistry.query;
     10
    1011public class QueryParser {
    1112    public QueryParser(String s) {
     
    1516PARSER_END(QueryParser)
    1617/*
    17   (vc.)name:           STRING, EQ, NE
    18   (vc.)desciption:     STRING, EQ, NE
    19   (vc.)created:        ISO-DATE, EQ, NE, GT, GE, LT, LE
    20   {vc.}modified:       ISO-DATE, EQ, NE, GT, GE, LT, LE
    21   (vc.)state:          { "public", "private", "deleted" }, EQ, NE
     18  (vc.)name:           STRING (EQ, NE)
     19  (vc.)description:    STRING (EQ, NE)
     20  (vc.)state:          { "public", "private", "deleted" } (EQ, NE)
    2221  {vc.}purpose:        { "research", "reference",
    23                          "sample", "future-use" } EQ, NE
    24   {vc.}reproducability { "intended", "fluctuating", "untended"} EQ, NE
    25   (cr.)creator:      STRING, EQ, NE
    26   {cr.}email:        STRING, EQ, NE
    27   {cr.}organization: STRING, EQ, NE
     22                         "sample", "future-use" } (EQ, NE)
     23  {vc.}reproducibility { "intended", "fluctuating", "untended" } (EQ, NE)
     24  (vc.)created:        ISO-DATE (EQ, NE, GT, GE, LT, LE)
     25  {vc.}modified:       ISO-DATE (EQ, NE, GT, GE, LT, LE)
     26  {vc.}owner           STRING (EQ, NE)
     27  (cr.)creator:        STRING (EQ, NE)
     28  {cr.}email:          STRING (EQ, NE)
     29  {cr.}organization:   STRING (EQ, NE)
    2830*/
    2931SKIP: {
     
    4143    | <VC_PURPOSE: "purpose">
    4244    | <VC_REPRODUCIBILITY: "reproducibility">
     45    | <VC_OWNER: "owner">
    4346    | <CR_NAME: "creator">
    4447    | <CR_ORGANIZATION: "organization">
     
    104107     ( ( attribute = <VC_NAME>
    105108       | attribute = <VC_DESC>
     109       | attribute = <VC_OWNER>
    106110       | attribute = <CR_NAME>
    107111       | attribute = <CR_ORGANIZATION>
Note: See TracChangeset for help on using the changeset viewer.