/**
  * RWFException constructor
  *
  * @param - msg, String the error message to be used.
  * @param Document doc the context document.
  */
 public RWFException(String msg, Document doc) {
   Database db = null;
   try {
     db = doc.getParentDatabase();
   } catch (NotesException e) {
     e.printStackTrace();
   }
   new RWFException(msg, db, doc);
 }
Exemple #2
0
  static {
    try {
      session = NotesFactory.createSession((String) null, (String) null, Authentication.getInfo());
      thisDb = session.getCurrentDatabase();

    } catch (NotesException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
 /**
  * RWFException constructor
  *
  * @param Database d the current database
  */
 public RWFException(Database d) {
   super();
   try {
     Document e = d.createDocument();
     e.replaceItemValue("Form", EXCEPTION_FORM);
     e.replaceItemValue(EXCEPTION_TYPE_FIELD, "Workflow Exception");
     e.save();
   } catch (NotesException e) {
     e.printStackTrace();
     System.out.println(e.text);
   }
 }
 /**
  * Whether or not the effective user of the Session has access to read logs
  *
  * @param session Session (remember you can use sessionAsSigner / sessionAsSignerWithFullAccess)
  * @return boolean whether user has access
  * @since org.openntf.domino.xsp 2.5.0
  */
 private boolean canReadLogs(final lotus.domino.Session session) {
   boolean result = false;
   try {
     String username = session.getEffectiveUserName();
     DominoServer server = new DominoServer();
     result = server.checkServerAccess(username, ServerAccess.PROG_UNRESTRICTED);
     result = result || server.checkServerAccess(username, ServerAccess.VIEW_ONLY_ADMIN);
   } catch (NotesException ne) {
     ne.printStackTrace();
   }
   return result;
 }
 /**
  * RWFException constructor
  *
  * @param - msg, String the error message to be used.
  * @param Database d the current database
  * @param Document doc the context document.
  */
 public RWFException(String msg, Database d, Document doc) {
   super(msg);
   try {
     Document e = d.createDocument();
     e.replaceItemValue("Form", EXCEPTION_FORM);
     e.replaceItemValue(EXCEPTION_TYPE_FIELD, "Workflow Exception");
     e.replaceItemValue(EXCEPTION_MSG_FIELD, msg);
     RichTextItem rt = e.createRichTextItem(EXCEPTION_DOCLINK_FIELD);
     rt.appendDocLink(doc);
     e.save();
   } catch (NotesException e) {
     e.printStackTrace();
     System.out.println(e.text);
   }
 }