Package pierre.model

Examples of pierre.model.CannedQuery


    final Collection conditionValues = new HashSet();
    final CannedQuery[] queries = queryFeature.getQueries();
   
    for( int i = 0; i < queries.length; i++ )
    {
      final CannedQuery query = queries[ i ];
     
      for( Iterator iterator = query.getMetaQueryFields().iterator(); iterator.hasNext(); )
      {
        final MetaQueryField queryField = (MetaQueryField)iterator.next();
        final String fieldValue = queryField.getValue();
       
        if( fieldValue.length() > 0 )
        {
          conditionValues.add( getCondition( normaliseQueryContext( query.getSchemaContext() ), queryField.getName(), null, fieldValue ) );
        }
      }
     
      for( Iterator iterator = query.getQueryFields().iterator(); iterator.hasNext(); )
      {
        final QueryField queryField = (QueryField)iterator.next();
        final DataFieldModel dataFieldModel = queryField.getEditFieldModel();
        final String fieldValue = queryField.getValue();
       
        if( fieldValue.length() > 0 )
        {
          conditionValues.add( getCondition( normaliseQueryContext( query.getSchemaContext() ), dataFieldModel.isAttribute() ? asAttribute( queryField.getName() ) : queryField.getName(), queryField.getOperator(), fieldValue ) );
        }
      }
    }
   
    final Collection returnValues = new HashSet();
    final QueryResult[] queryResultTemplates = queryFeature.getQueryResultTemplates();
   
    for( int i = 0; i < queryResultTemplates.length; i++ )
    {
      final QueryResult queryResult = queryResultTemplates[ i ];
      RecordModel recordModel = queryResult.getRecordModel();
     
      if( recordModel == null )
      {
        recordModel= recordModelFactory.createRecordModel( queryResult.getRecordClassName() );
      }
     
      final Collection editFields = recordModel.getEditFields();
     
      for( Iterator iterator = editFields.iterator(); iterator.hasNext(); )
      {
        final DataFieldModel dataFieldModel = (DataFieldModel)iterator.next();
       
        if( dataFieldModel.isAttribute() )
        {
          returnValues.add( stripAttribute( SEPARATOR + normaliseQueryContext( queryResult.getSchemaContext() ) + SEPARATOR + dataFieldModel.getName() ) );
        }
        else
        {
          returnValues.add( SEPARATOR + normaliseQueryContext( queryResult.getSchemaContext() ) + SEPARATOR + dataFieldModel.getName() );
        }
      }
    }

    final StringBuffer query = ( isTamino ) ? new StringBuffer( "declare namespace tf=\"http://namespaces.softwareag.com/tamino/TaminoFunction\" " ) : new StringBuffer(); //$NON-NLS-1$;
    query.append( generateQuery( conditionValues, returnValues ) );
    return query.toString();
  }
View Full Code Here


    this.execute();
  }
 
  private void execute() {
    for (int i=0; i<queries.length;i++) {
      CannedQuery query = queries[i];
      String start_date = query.getQueryField("start_date").getValue();

      //Here goes:
      StringBuffer queryString = new StringBuffer("declare namespace tf=\"http://namespaces.softwareag.com/tamino/TaminoFunction\"");
      queryString.append("declare namespace xs=\"http://www.w3.org/2001/XMLSchema\" ");
      queryString.append("for $a in input()/Experiment where $a/start_date=xs:date(\"");
View Full Code Here

    this.execute();
  }
 
  private void execute() {
    for (int i=0; i<queries.length;i++) {
      CannedQuery query = queries[i];
      String keywords = query.getQueryField("keywords").getValue();
      String[] wordlist = keywords.split("[\\s,;]");
      String whereClause ="";
      //Here goes:
      if (wordlist.length==0){
        whereClause = "where tf:containsText($a/keywords, \""+keywords+"\") ";
View Full Code Here

    this.execute();
  }

  private void execute() {
    for (int i=0; i<queries.length;i++) {
      CannedQuery query = queries[i];
      String plasmidName = query.getQueryField("name").getValue();

      StringBuffer queryString = new StringBuffer("declare namespace tf=\"http://namespaces.softwareag.com/tamino/TaminoFunction\"");
      queryString.append("for $a in input()/Experiment ");
      queryString.append("where tf:containsText($a//Plasmid/name,\"");
      queryString.append(plasmidName);
View Full Code Here

  }

  private void execute() {

    for (int i=0; i<queries.length;i++) {
      CannedQuery query = queries[i];
      String firstName = query.getQueryField("firstName").getValue();
      String lastName = query.getQueryField("lastName").getValue();
      //Here goes:
      StringBuffer queryString = new StringBuffer("declare namespace tf=\"http://namespaces.softwareag.com/tamino/TaminoFunction\"");
      queryString.append("for $a in input()/Experiment where $a/Person/firstName=\"");
      queryString.append(firstName);
      queryString.append("\" and $a/Person/lastName=\"");
View Full Code Here

TOP

Related Classes of pierre.model.CannedQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.