Package eu.planets_project.tb.gui

Examples of eu.planets_project.tb.gui.UserBean


        // If none, create one and pass it back.
        if( me == null ) {
            log.info("Creating Manual Measurement Event.");
            me = new MeasurementEventImpl(res);
            res.getMeasurementEvents().add(me);
            UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
            me.setAgent( new MeasurementAgent( user ));
            ExperimentPersistencyImpl.getInstance();
            ExperimentInspector.persistExperiment();
        }
        me.getMeasurements();
View Full Code Here


    /**
     */
    public void storeManualMeasurement() {
        // Look up the definition:
        ManuallyMeasuredPropertyHandlerImpl mm = ManuallyMeasuredPropertyHandlerImpl.getInstance();
        UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
        ManualMeasurementBackingBean mmbb = (ManualMeasurementBackingBean)JSFUtil.getManagedObject("ManualMeasurementBackingBean");
        List<ManuallyMeasuredProperty> mps = mm.loadAllManualProperties(user.getUserid());
        ManuallyMeasuredProperty mp = null;
        for( ManuallyMeasuredProperty amp : mps ) {
            if( amp.getURI().equals(mmbb.getNewManProp()) ) mp = amp;
        }
        if( mp == null ) {
View Full Code Here

            title = getComment();
            if ( title.length() > CommentBacking.TITLE_LENGTH )
                title = getComment().substring(0, CommentBacking.TITLE_LENGTH );
        }
        // User is?
        UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
        // Existing comment?
        if( ! "".equals(commentId) && commentId != null ) {
            cmt = cm.getComment(this.getlCommentID());
        } else {
            cmt.setAuthorID(user.getUserid());
            cmt.setExperimentPhaseID( expBean.getCurrentPhaseName() );
        }
        // Edit/update the comment:
        cmt.setParentID( getlParentID() );
        cmt.setExperimentID(exp.getEntityID());
View Full Code Here

    public static void approveExperimentManually(Experiment exp) {
        if( exp == null ) return;
        if( exp.getExperimentExecutable() == null ) return;

        // Find out who is responsible:
        UserBean currentUser = (UserBean) JSFUtil.getManagedObject("UserBean");
       
        // Approve it
        if( exp.getExperimentApproval().getExplanation() == null ||
                "".equals(exp.getExperimentApproval().getExplanation()))
            exp.getExperimentApproval().setExplanation("Experiment was approved for execution.");
        exp.getExperimentApproval().setDecision(APPROVAL_DECISION_APPROVED);
        exp.getExperimentApproval().setGo(true);
        exp.getExperimentApproval().addApprovalUser(currentUser.getUserid());
        exp.getExperimentApproval().setState(Experiment.STATE_COMPLETED);
        exp.getExperimentExecution().setState(Experiment.STATE_IN_PROGRESS);
       
        TestbedManager testbedMan = (TestbedManager) JSFUtil.getManagedObject("TestbedManager");
        testbedMan.updateExperiment(exp);
View Full Code Here

    public static void denyExperimentManually(Experiment exp) {
        if( exp == null ) return;
        if( exp.getExperimentExecutable() == null ) return;
       
        // Find out who is responsible:
        UserBean currentUser = (UserBean) JSFUtil.getManagedObject("UserBean");
       
        // Deny approval
        if( exp.getExperimentApproval().getExplanation() == null ||
                "".equals(exp.getExperimentApproval().getExplanation()))
            exp.getExperimentApproval().setExplanation("Experiment was denied approval for execution.");
        exp.getExperimentApproval().setDecision(APPROVAL_DECISION_DENIED);
        exp.getExperimentApproval().setGo(false);
        exp.getExperimentApproval().addApprovalUser(currentUser.getUserid());
       
        TestbedManager testbedMan = (TestbedManager) JSFUtil.getManagedObject("TestbedManager");
        testbedMan.updateExperiment(exp);
       
        // Mail the user:
View Full Code Here

            SelectItem option = new SelectItem(tmp[0],tmp[1]);
            dtypeList.add(option)
        }
       
        // Add in default data:
        UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
        this.setUserData(user);
       
        // Default spaces:
        this.litrefdesc.add("");
        this.litrefuri.add("");
View Full Code Here

 
    this.expRating = rating;
    //set the rating for this experiment
    this.getExperiment().getExperimentEvaluation().setExperimentRating(this.expRating);
    //also treat the experimenter's rating as first user vote
        UserBean currentUser = (UserBean) JSFUtil.getManagedObject("UserBean");
    this.getExperiment().setUserRatingForExperiment(currentUser.getUserid(), (double)this.expRating);
    }
View Full Code Here

        if ((expBean.getID() <= 0)) {
            // Create new Experiment if necessary
            if( exp == null )
                exp = new ExperimentImpl();
            // Get userid info from managed bean
            UserBean currentUser = (UserBean) JSFUtil.getManagedObject("UserBean");
            // set current User as experimenter
            exp.getExperimentSetup().getBasicProperties().setExperimenter(currentUser.getUserid());
            try {
                log.debug("New experiment, setting name: " + expBean.getEname() );
                exp.getExperimentSetup().getBasicProperties().setExperimentName(expBean.getEname());       
            } catch (InvalidInputException e) {
                // add message-tag for duplicate name
View Full Code Here

  
   /**
    * @return
    */
   public boolean isCurrentUserAnExperimenter() {
       UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
       if( user == null || user.getUserid() == null ) return false;
       // Admins can always edit:
       if( user.isAdmin() ) return true;
       // Check if this user is authorised:
       if( this.getExperiment() == null ) return false;
       log.info("Exp not null");
       if( this.getExperiment().getExperimentSetup() == null ) return false;
       log.info("Setup not null");
       if( this.getExperiment().getExperimentSetup().getBasicProperties() == null ) return false;
       log.info("BasicProp not null");
       if( this.getExperiment().getExperimentSetup().getBasicProperties().getInvolvedUserIds() == null ) return false;
       log.info("InvolvedUsers not null");
       for( String authUser : this.getExperiment().getExperimentSetup().getBasicProperties().getInvolvedUserIds()) {
           if( user.getUserid().equals(authUser)) return true;
       }
       return false;
   }
View Full Code Here

        // Pair back to the 'editor' stage.
        ExperimentImpl.resetToApprovedStage(exp);
        ExperimentImpl.resetToEditingStage(exp);
       
        // Make the current user the owner:
        UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
        if( user != null ) {
            BasicProperties props = exp.getExperimentSetup().getBasicProperties();
            props.setExperimenter(user.getUserid());
            props.setContact(user.getFullname(), user.getEmail(), user.getTelephone(), user.getAddress());
        }

        // Place new experiment bean into session:
        ExperimentBean newExpBean = ExperimentInspector.putExperimentIntoRequestExperimentBean(exp);
        newExpBean.setUserData(user);
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.gui.UserBean

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.