Package pierre.reports

Examples of pierre.reports.Report


   */
 

  public Report execute( QueryFeature queryFeature, DeploymentForm deploymentForm, User user )
  {
    Report report = null;
    Tuple[] tuples= null;
 
    if( authenticateUser( user ) )
    {
      try
      {
        String queryFeatureName = queryFeature.getName();
       
        if ( queryFeatureName.equals("Query by Experimenter")) {
       
          QueryByExperimenter experimenterQuery = new QueryByExperimenter(databaseOperations, statementExecutor, queryFeature, getTimeStamp(), user.getID());
          tuples = experimenterQuery.getTuples();

        }
       
        if (queryFeatureName.equals("Query by Start Date")) {
          QueryByDate dateQuery = new QueryByDate(databaseOperations, statementExecutor, queryFeature, getTimeStamp(), user.getID());
          tuples = dateQuery.getTuples();

        }
       
        if (queryFeatureName.equals("Query by Keyword")) {
          QueryByKeyword keywordQuery = new QueryByKeyword(databaseOperations, statementExecutor, queryFeature, getTimeStamp(), user.getID());
          tuples = keywordQuery.getTuples();
        }
       
        if (queryFeatureName.equals("Query by Plasmid")){
          QueryByPlasmid plasmidQuery = new QueryByPlasmid(databaseOperations, statementExecutor, queryFeature, getTimeStamp(), user.getID());
          tuples = plasmidQuery.getTuples();
        }
        if (queryFeatureName.equals("Query by Multiple Plasmids")){
         
        }
        if (queryFeatureName.equals("Query by Compound")) {
         
        }
        if (queryFeatureName.equals("Query by Plasmid and Compound")) {
         
        }
       
        if( tuples.length == 0 )
        {
          return new NoResultsFoundReport( deploymentForm );
        }
       
        report = new ExtendedTupleReport( deploymentForm, queryFeature.getName(), queryFeature.getName(), tuples );
        ( (ExtendedTupleReport)report ).setTimeStamp( getTimeStamp() );
        ( (ExtendedTupleReport)report ).setUserID( user.getID() );
      }
      catch( Exception e )
      {
        e.printStackTrace();
        report = new ErrorReport( deploymentForm );
        ( (ErrorReport)report ).addError( e );
      }
    }
    else
    {
      report = new ErrorReport( deploymentForm );
    }
   
      report.setIdentifier( generateReportIdentifier() );
    caterReportForDeploymentForm( report, deploymentForm );
    return report;
  }
View Full Code Here


 
 
 
  public Report execute( LinkObject linkObject, DeploymentForm deploymentForm, User user )
  {
    Report report = null;
   
    if( authenticateUser( user ) )
    {
      try
      {
        String actionType = linkObject.getParameterValue( ACTION );
        TupleProvider[] tupleProviders = null;
       
        if( actionType.equals( SHOW ) )
        {
          final String LINK = resourceBundle.getString( "AbstractDataRepository.link" ); //$NON-NLS-1$
          tupleProviders = databaseOperations.getTupleProviders( LINK, LINK, linkObject.getParameterValue( ID ), Integer.parseInt( linkObject.getParameterValue( DEPTH ) ) );
        }
       
        if( tupleProviders == null || tupleProviders.length == 0 )
        {
          report = new NoResultsFoundReport( deploymentForm );
        }
        else
        {
          report = new DefaultTupleReport( deploymentForm, tupleProviders );
          ( (DefaultTupleReport)report ).setTimeStamp( getTimeStamp() );
          ( (DefaultTupleReport)report ).setUserID( user.getID() );
        }
      }
      catch( Exception e )
      {
        report = new ErrorReport( deploymentForm );
        ( (ErrorReport)report ).addError( e );
      }
    }
    else
    {
      report = new ErrorReport( deploymentForm );
    }
   
      report.setIdentifier( generateReportIdentifier() );
      caterReportForDeploymentForm( report, deploymentForm );
   
    report = new ErrorReport( deploymentForm );
    return report;
  }
View Full Code Here

   * @see pierre.db.DataRepository#execute(java.lang.String, java.lang.String, pierre.system.DeploymentForm, pedro.security.User)
   */
 
  public Report execute( String dataBase, String query, DeploymentForm deploymentForm, User user )
  {
    Report report = null;
   

      report = new ErrorReport( deploymentForm );
 
    return report;
View Full Code Here

TOP

Related Classes of pierre.reports.Report

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.