Package org.sete.domain.type

Examples of org.sete.domain.type.AttachmentType


  public void createNewScienceProjectFileType(CreateScienceProjectFileTypeVo cspftvo) {
    if(cspftvo == null || cspftvo.getKey() == null ||cspftvo.getKey().length()< 1 ){
      throw new IllegalArgumentException("Science Project File Type cannot be null.");     
    }
    AttachmentType attachment = new AttachmentType();
    attachment.setDescription(cspftvo.getDescription());
    attachment.setLabel(cspftvo.getType());
    attachment.setKey(cspftvo.getKey());   
    projectDao.saveScienceProjectFileType(attachment);   
  }
View Full Code Here


   
    else if(cspftvo.getKey() == null){
      throw new IllegalArgumentException("Science Project File Type Key cannot be null for update.");     
    }
    //The VO contains data, and the Key is not NULL so we can update the attachment
    AttachmentType attachment = TypeUtil.forKey(AttachmentType.class, cspftvo.getKey());
      //AttachmentType attachment = projectDao.findByAttachmentTypeKey(cspftvo.getKey()) ;
      attachment.setDescription(cspftvo.getDescription()) ;
      attachment.setLabel(cspftvo.getType());
      projectDao.saveScienceProjectFileType(attachment);
 
  }
View Full Code Here

    throw new IllegalArgumentException("Project Document File cannot be null.");       
  }
 
  //derive the AttachmentType
  String key = ufvo.getMyFileTypeId();
  AttachmentType type = TypeUtil.forKey(AttachmentType.class,key )
 
  //create a new Attachment for insertion.
  Attachment att = new Attachment();
  att.setName(ufvo.getMyFile().getFileName());
  att.setDescription(type.getDescription());
  att.setType(type);
  try {
    att.setContents(ufvo.getMyFile().getFileData());
  } catch (IOException e) {
    e.printStackTrace();
View Full Code Here

  public void createNewScienceProjectFileType(CreateScienceProjectFileTypeVo cspftvo) {
    if(cspftvo == null || cspftvo.getKey() == null ||cspftvo.getKey().length()< 1 ){
      throw new IllegalArgumentException("Science Project File Type cannot be null.");     
    }
    AttachmentType attachment = new AttachmentType();
    attachment.setDescription(cspftvo.getDescription());
    attachment.setLabel(cspftvo.getType());
    attachment.setKey(cspftvo.getKey());   
    projectDao.saveScienceProjectFileType(attachment);   
  }
View Full Code Here

   
    else if(cspftvo.getKey() == null){
      throw new IllegalArgumentException("Science Project File Type Key cannot be null for update.");     
    }
    //The VO contains data, and the Key is not NULL so we can update the attachment
    AttachmentType attachment = TypeUtil.forKey(AttachmentType.class, cspftvo.getKey());
      //AttachmentType attachment = projectDao.findByAttachmentTypeKey(cspftvo.getKey()) ;
      attachment.setDescription(cspftvo.getDescription()) ;
      attachment.setLabel(cspftvo.getType());
      projectDao.saveScienceProjectFileType(attachment);
 
  }
View Full Code Here

    throw new IllegalArgumentException("Project Document File cannot be null.");       
  }
 
  //derive the AttachmentType
  String key = ufvo.getMyFileTypeId();
  AttachmentType type = TypeUtil.forKey(AttachmentType.class,key )
 
  //create a new Attachment for insertion.
  Attachment att = new Attachment();
  att.setName(ufvo.getMyFile().getFileName());
  att.setDescription(type.getDescription());
  att.setType(type);
  try {
    att.setContents(ufvo.getMyFile().getFileData());
  } catch (IOException e) {
    e.printStackTrace();
View Full Code Here

        throw new IllegalArgumentException("Template Project Document File cannot be null.");       
      }
     
      //derive the AttachmentType
      final String key = ufvo.getMyFileTypeId();
      final AttachmentType type = TypeUtil.forKey(AttachmentType.class,key )
     
      //create a new Attachment for insertion.
      final Attachment att = new Attachment();
        {
          att.setName(ufvo.getMyFile().getFileName());
          att.setDescription(type.getDescription());
          att.setType(type);
          try
            {
            att.setContents( ufvo.getMyFile().getFileData() );
          }
View Full Code Here

        at.setLongDescription("Third Place Long Description");
        types.add(at);
    }

    private static void createAttachmentTypes(List<AbstractLookupType> types) {
        AttachmentType attachType = new AttachmentType();
        attachType.setId(28);
        attachType.setKey("attachmentTypeOne");
        attachType.setLabel("Attachment Type One Label");
        attachType.setDescription("Attachment Type One Description");
        attachType.setLongDescription("Attachment Type One Long Description");
        types.add(attachType);

        attachType = new AttachmentType();
        attachType.setId(29);
        attachType.setKey("attachmentTypeTwo");
        attachType.setLabel("Attachment Type Two Label");
        attachType.setDescription("Attachment Type Two Description");
        attachType.setLongDescription("Attachment Type Two Long Description");
        types.add(attachType);

        attachType = new AttachmentType();
        attachType.setId(30);
        attachType.setKey("attachmentTypeThree");
        attachType.setLabel("Attachment Type Three Label");
        attachType.setDescription("Attachment Type Three Description");
        attachType.setLongDescription("Attachment Type Three Long Description");
        types.add(attachType);
    }
View Full Code Here

   */
  @Test
  public void testUpdateProjectFileType() {
    //load Types
      List<AbstractLookupType> types = new ArrayList<AbstractLookupType>();
      AttachmentType att = new AttachmentType();
        att.setDescription("Description");
        att.setId(1);
        att.setKey("des");
        att.setLabel("Des");
        att.setLongDescription("Description");
      types.add(att);
      TypeUtil.initialize(types);
     
     
    CreateScienceProjectFileTypeVo cspftvo = new CreateScienceProjectFileTypeVo();
View Full Code Here

                                                 HttpServletResponse response) throws Exception {

        //checkAuthorization(userHasPrivilege(request.getSession(), getPrivileges()));

        CreateProjectFileTypeForm fileTypeForm = (CreateProjectFileTypeForm) form;
        AttachmentType type = TypeUtil.forKey(AttachmentType.class, request.getParameter("key"));
        fileTypeForm.setKey(request.getParameter("key"));
        fileTypeForm.setDescription(type.getDescription());
        fileTypeForm.setType(type.getLabel());

        return mapping.findForward(WebConstants.FORWARD_VIEW);
    }
View Full Code Here

TOP

Related Classes of org.sete.domain.type.AttachmentType

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.