Exemplo n.º 1
0
  public UploadedFile[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
    try {

      UploadedFile file = getValue(objCurrent, def.getJavaField());

      if (file != null) {
        IUploadedFile FTemp = file.getUploadedFile();
        File SrFile = FTemp.getServerFile();

        File FNew =
            new File(
                SrFile.getParentFile().getAbsolutePath()
                    + File.separator
                    + FTemp.getClientFileName());
        SrFile.renameTo(FNew);
        RichTextItem rt = null;
        rt = (RichTextItem) docCurrent.getFirstItem(def.getNotesField());
        if (rt == null) rt = docCurrent.createRichTextItem(def.getNotesField());
        rt.embedObject(EmbeddedObject.EMBED_ATTACHMENT, "", FNew.getAbsolutePath(), null);
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
 public boolean hasAccess(Definition def, List<String> myRoles) {
   if (def.getEncRoles() != null) {
     String[] roles = def.getEncRoles();
     for (String role : roles) {
       if (myRoles.contains(role)) {
         return true;
       }
     }
     return false;
   }
   return true;
 }