Package lotus.domino

Examples of lotus.domino.Database


  private boolean doFuzzySearch(String sNID, String sNTitle, String sNLink) {
    boolean bCheck = false;
    DocumentCollection docs = null;
    try {
      Database db = ExtLibUtil.getCurrentDatabase();
      docs = db.FTSearch(sNTitle, 30, Database.FT_SCORES, Database.FT_FUZZY);
      Document doc = docs.getFirstDocument();
      while(doc != null) {
        if(!doc.getItemValueString("NID").equals(sNID)){
          // the document is not the current document
          bCheck = true;
View Full Code Here


    if (run) {
      HashSet<Click> clicksToBeSaved = _clicks;
      _clicks = new HashSet<Click>();
      _lastJob = new Date();
      try {
        Database db = ExtLibUtil.getCurrentDatabase();
        WriteCacheJob.start(clicksToBeSaved, db.getFilePath());
      } catch (NotesException e) {
        e.printStackTrace();
      }
    }
  } 
View Full Code Here

    _categories = new ArrayList<Category>();
    _captchaPublicKey = "";
    _captchaPrivateKey = "";
    _analyticsJS = "";

    Database db = ExtLibUtil.getCurrentDatabase();
    View viewTypesAll = null;
    View viewCategoriesAll = null;
    View viewConfigAll = null;
    ViewNavigator viewNavigatorTypes = null;
    ViewNavigator viewNavigatorConfig = null;
    ViewNavigator viewNavigatorCategories = null;

    try {
      viewTypesAll = db.getView("TypesAll");
      viewTypesAll.setAutoUpdate(false);
      viewNavigatorTypes = viewTypesAll.createViewNav();
      ViewEntry tmpEntry;
      ViewEntry entry = viewNavigatorTypes.getFirst();
      while (entry != null) {
        if (entry.isCategory() == false) {
          entry.setPreferJavaDates(true);
          List<Object> columnValues = entry.getColumnValues();

          List<String> moderators = new Vector<String>();
          Document doc = entry.getDocument();
          Item moderatorsItem = doc.getFirstItem("TModerators");
          if (moderatorsItem != null) moderators = (Vector<String>)moderatorsItem.getValues();
          Type type = new Type((String)columnValues.get(2),
              (String)columnValues.get(3),
              moderators,
              (String)columnValues.get(4),
              (String)columnValues.get(0),
              (String)columnValues.get(5));
          _types.add(type);
        }

        tmpEntry = viewNavigatorTypes.getNext();
        entry.recycle();
        entry = tmpEntry;
      }

      viewCategoriesAll = db.getView("CategoriesAll");
      viewCategoriesAll.setAutoUpdate(false);
      viewNavigatorCategories = viewCategoriesAll.createViewNav();
      entry = viewNavigatorCategories.getFirst();
      while (entry != null) {
        if (entry.isCategory() == false) {
          entry.setPreferJavaDates(true);
          List<Object> columnValues = entry.getColumnValues();

          Category category = new Category((String)columnValues.get(1),
              (String)columnValues.get(2),
              (String)columnValues.get(3));
          _categories.add(category);
        }

        tmpEntry = viewNavigatorCategories.getNext();
        entry.recycle();
        entry = tmpEntry;
      }

      viewConfigAll = db.getView("ConfigAll");
      viewConfigAll.setAutoUpdate(false);
      viewNavigatorConfig = viewConfigAll.createViewNav();
      entry = viewNavigatorConfig.getFirst();
      if (entry != null) {
        Document doc = entry.getDocument();
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  private List<String> getUserRoles(String user) {
    List<String> roles = null;
    Database db = ExtLibUtil.getCurrentDatabase();
    try {
      ACL acl = db.getACL();
      if (acl != null) {
        ACLEntry entry = acl.getEntry(user);
        if (entry != null) {
          roles = (List<String>)entry.getRoles();
          entry.recycle();
View Full Code Here

                // Domino classes.
                session = NotesFactory.createSession();
            }
     
            // Getting the specified Notes database.
            Database database = session.getDatabase( "", stringDatabase );
           
            // Getting a collection of all documents from the database.
            DocumentCollection documentCollection = database.getAllDocuments();
     
            // Getting the first document from the database
            Document document = documentCollection.getFirstDocument();
     
            // Start to write to cells at this row.
View Full Code Here

        // Creating a Notes session for only local calls to the Domino classes.
        session = NotesFactory.createSession();
      }
     
      // Getting the specified Notes database.
      Database database = session.getDatabase( "", stringDatabase );
     
      // Getting a collection of all documents from the database.
      DocumentCollection documentcollection = database.getAllDocuments();
     
      // Getting the first document from the database
      Document document = documentcollection.getFirstDocument();
     
      // Start to write to cells at this row.
View Full Code Here

   *
   * @return
   * @throws NotesException
   */
  protected OpenntfDominoDocument createDocument() throws NotesException {
    Database db = openDatabase();
    String server = com.ibm.xsp.model.domino.DominoUtils.getCurrentDatabase().getServer();

    if (!(StringUtil.isEmpty(server))) {
      String currentUser = com.ibm.xsp.model.domino.DominoUtils.getCurrentSession().getEffectiveUserName();
      int i = db.queryAccessPrivileges(currentUser);
      if (((i & Database.DBACL_CREATE_DOCS) == 0) && ((i & Database.DBACL_WRITE_PUBLIC_DOCS) == 0)) {
        throw new NoAccessSignal("User " + currentUser + " is has not enough privileges to create documents in "
            + getDatabaseName());
      }
    }
View Full Code Here

   * @return
   * @throws NotesException
   */
  protected OpenntfDominoDocument openDocument(final String noteId) throws NotesException {

    Database db = openDatabase();
    boolean allowDelted = isAllowDeletedDocs();
    Document backendDoc = com.ibm.xsp.model.domino.DominoUtils.getDocumentById(db, noteId, allowDelted);

    if (backendDoc != null) {
      BackendBridge.setNoRecycle(backendDoc.getParentDatabase().getParent(), backendDoc, true);
View Full Code Here

     *
     * @see org.openntf.domino.xsp.helpers.OpenntfViewValuePickerData.EntryMetaData#openView()
     */
    @Override
    protected View openView() throws NotesException {
      Database db = DominoUtils.openDatabaseByName(getDatabaseName());
      View view = db.getView(getViewName());
      String labelName = getLabelColumn();
      if (StringUtil.isNotEmpty(labelName)) {
        try {
          view.resortView(labelName, true);
        } catch (NotesException ex) {
View Full Code Here

    if (session != null) { // Unit tests
      ArrayList<NABDb> nabs = new ArrayList<NABDb>();
      Vector<?> vc = session.getAddressBooks();
      if (vc != null) {
        for (int i = 0; i < vc.size(); i++) {
          Database db = (Database) vc.get(i);
          try {
            db.open();
            try {
              NABDb nab = new NABDb(db);
              nabs.add(nab);
            } finally {
              db.recycle();
            }
          } catch (NotesException ex) {
            // Opening the database can fail if the user doesn't sufficient
            // rights. In this vase, we simply ignore this NAB and continue
            // with the next one.
View Full Code Here

TOP

Related Classes of lotus.domino.Database

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.