Package org.sete.domain

Examples of org.sete.domain.ReferenceScienceProject


        createAllSystemUserRolePrivileges();
        createTestUsers();
    }

    public void loadReferenceProjects() {
        ReferenceScienceProject refScienceProject = new ReferenceScienceProject();
        refScienceProject.setDescription("You may use it as a reference for your project.");
        refScienceProject.setName("Template Project");
        refScienceProject.setScienceProjectCategoryType(TypeUtil.forKey(ScienceProjectCategoryType.class,
                                                                        "chemistry"));

        refScienceProject.setForms(new HashSet<Attachment>());
        baseDao.saveOrUpdate(refScienceProject);
    }
View Full Code Here


    private ReferenceProjectDao refProjDao;

    public TemplateProjectVo getTemplateProject()
    {
        final ReferenceScienceProject rsp = refProjDao.getReferenceScienceProject();
        if( null == rsp )
        {
            return null;
        }
       
        final TemplateProjectVo tpVoRet = new TemplateProjectVo();
        tpVoRet.setName(rsp.getName());
        tpVoRet.setDescription(rsp.getDescription());
       
        final List<AttachmentVo> files = formsToAttachementVo(rsp);
        tpVoRet.setFiles( files );
       
        return tpVoRet;
View Full Code Here

        return tpVoRet;
    }   

    public List<AttachmentVo> loadAllProjectFiles()
    {
        final ReferenceScienceProject rsp = refProjDao.getReferenceScienceProject();
        return formsToAttachementVo(rsp);
    }
View Full Code Here

        return formsToAttachementVo(rsp);
    }

    public AttachmentVo loadProjectFileData(int formID)
    {
        final ReferenceScienceProject rsp = refProjDao.getReferenceScienceProject();
       
        final AttachmentVo file = new AttachmentVo();
        final Set<Attachment> forms = rsp.getForms();
        for(Attachment a: forms)
        {
            if(a.getId().equals(formID))
            {
                file.setName(a.getName());
View Full Code Here

            e.printStackTrace();
          }
        }
       
      //get the reference project for update
      final ReferenceScienceProject refProject = refProjDao.getReferenceScienceProject();
     
      /*Get the existing project forms,
       * iterate and remove the AttachmentType being added if it exists
       * to avoid duplicate documents of the same AttachmentType.
       */
      final Set<Attachment> forms =  refProject.getForms();
      for(Iterator <Attachment> it = forms.iterator(); it.hasNext();)
        {   
        if(key.equalsIgnoreCase(it.next().getType().getKey()))
            {
          it.remove();     
        }   
      }
       
      forms.add(att);
        refProject.setForms(forms);
       
      //update the Science Project with the new/updated Attachment
      refProjDao.updateReferenceScienceProject(refProject);
    }
View Full Code Here

TOP

Related Classes of org.sete.domain.ReferenceScienceProject

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.