Package lotus.domino

Examples of lotus.domino.View


      cacheFilled = true;
      List<String> allEnvs = new ArrayList<String>();
      Database db = ExtLibUtil.getCurrentDatabase();
      if(db!=null) {
        View v = db.getView("AllEnvironments");
        if(v!=null) {
          ViewEntryCollection vc = v.getAllEntries();
          for(ViewEntry e=vc.getFirstEntry(); e!=null; e=vc.getNextEntry()) {
            Document d = e.getDocument();
            try {
              PlaygroundEnvironment env = readEnvironment(d);
              if(envs.length==0 || StringUtil.contains(envs, env.getName())) {
View Full Code Here


    d.replaceItemValue("name", StringUtil.format("Copy of {0}", d.getItemValueString("Name")));
    d.copyAllItems(newDoc, true);
    newDoc.save();
  }
  public void copyEnvironment(DominoDocument doc, String name) throws NotesException, IOException {
    View v = ExtLibUtil.getCurrentDatabase().getView("AllEnvironments");
    ViewEntry ve = v.getEntryByKey(name);
    if(ve!=null) {
      Document d = ve.getDocument();
      d.copyAllItems(doc.getDocument(), true);
      doc.setDocument(doc.getDocument());
    }
View Full Code Here

  public void moveDown(String noteID) throws Exception {
    swap(noteID,false);
  }
  private boolean swap(String noteID, boolean previous) throws Exception {
    // Is there a faster way?
    View view = ExtLibUtil.getCurrentDatabase().getView("AllDocumentation");
    //view.setAutoUpdate(false);
    ViewNavigator vn = view.createViewNav();   
    try {
      for(ViewEntry ve=vn.getFirst(); ve!=null; ve=vn.getNext(ve)) {
        if(ve.getNoteID().equals(noteID)) {
          int docIndent = ve.getIndentLevel();
          Document doc = ve.getDocument();
          ve = previous ? vn.getPrev(ve) : vn.getNext(ve);
          if(ve!=null) {
            Document other = ve.getDocument();
            if(ve.getIndentLevel()==docIndent) {
              Object ts = other.getItemValue("OrderTS");
              other.replaceItemValue("OrderTS",doc.getItemValue("OrderTS"));
              doc.replaceItemValue("OrderTS",ts);
              doc.save();
              other.save();
              view.refresh();
              return true;
            }
          }
          return false;
        }
View Full Code Here

    return null;
  }
  protected Document loadOptionsDocument() {
    try {
      Database db = ExtLibUtil.getCurrentDatabase();
      View v = db.getView("GlobalOptions");
      Document doc = v.getFirstDocument();
      return doc;
    } catch(Exception ex) {
      ex.printStackTrace();
    }
    return null;
View Full Code Here

        this.assetLoaderEnvironment.prepareEndpoints();
      }
     
      //PlaygroundEnvironment env = DataAccessBean.get().findCurrentEnvironment();
      Database db = ExtLibUtil.getCurrentDatabase();
      View v = db.getView("AllSnippetsFlat");
      try {
        RootNode root = new RootNode();
        String apisSearch = (String)ExtLibUtil.getViewScope().get("assetSearch");
        if(StringUtil.isNotEmpty(apisSearch)) {
          v.FTSearch(apisSearch);
          //ViewEntryCollection col = v.getAllEntriesByKey(getAssetForm());
          ViewEntryCollection col = v.getAllEntries();
          for(ViewEntry e=col.getFirstEntry(); e!=null; e=col.getNextEntry()) {
            Vector<?> values = e.getColumnValues();
            String notesUnid = e.getUniversalID();
            // 2 type
            String type = (String)values.get(0);
            if(!StringUtil.equals(type, getAssetForm())) {
              // Ignore if it is not of the right type
              continue;
            }
            String cat = (String)values.get(1);
            String name = (String)values.get(2);
            String jspUrl = (String)values.get(3);
            // 4 ImportSource
            // 5 CreateDate
            // 6 Description
            String filterRuntimes = (String)values.get(7);
            String filterLibraries = (String)values.get(8);
            if(acceptAsset(e, filterRuntimes, filterLibraries)) {
              CategoryNode c = findCategory(root, cat);
              AssetNode node = createAssetNode(notesUnid,c,name,cat,jspUrl);
              node.setTooltip((String)values.get(6));
              c.getChildren().add(node);
            }
          }
        } else {
          v.setAutoUpdate(false);
          ViewNavigator nav = v.createViewNavFromCategory(getAssetForm());
          nav.setBufferMaxEntries(500);
          for(ViewEntry e=nav.getFirst(); e!=null; e=nav.getNext()) {
            Vector<?> values = e.getColumnValues();
            String notesUnid = e.getUniversalID();
            // 2 type
            String cat = (String)values.get(1);
            String name = (String)values.get(2);
            String assetId = (String)values.get(3);
            // 4 ImportSource
            // 5 CreateDate
            // 6 Description
            String filterRuntimes = (String)values.get(7);
            String filterLibraries = (String)values.get(8);
            if(acceptAsset(e, filterRuntimes, filterLibraries)) {
              CategoryNode c = findCategory(root, cat);
              AssetNode node = createAssetNode(notesUnid,c,name,cat,findUniqueUrl(c,notesUnid,assetId));
              node.setTooltip((String)values.get(6));
              c.getChildren().add(node);
            }
          }
        }
        return root;
      } finally {
        v.recycle();
      }
    } finally {
      this.assetLoaderEnvironment = null;
    }
  }
View Full Code Here

  /**
   * Read the asset categories
   */
  public String[] getAllCategories() throws NotesException {
    Database db = ExtLibUtil.getCurrentDatabase();
    View v = db.getView("AllSnippets");
    ViewNavigator nav = v.createViewNavFromCategory(getAssetForm());
    try {
      nav.setMaxLevel(1);
      //nav.setCacheSize(128);
      List<String> categories = new ArrayList<String>();
      for(ViewEntry ve=nav.getFirst(); ve!=null; ve=nav.getNext(ve)) {
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public NotesView getView(String view) throws NotesConnectorExceptionImpl {
    try {
      View viewObj = getNotesObject().getView(view);
      if (viewObj == null) {
        return null;
      }
      return new NotesViewImpl(viewObj);
    } catch (NotesException e) {
View Full Code Here

  public static interface TreeModel {
    public boolean isLeaf(ViewEntry ve) throws NotesException;
  }

  public String generateAsStringHier(TreeModel tree, String viewName, boolean compact) throws NotesException, IOException {
    View view = ExtLibUtil.getCurrentDatabase().getView(viewName);
    return generateAsStringHier(tree, view, compact);
  }
View Full Code Here

        String viewName = "AllSnippetsById";
        if(StringUtil.equals(key,"alldocs")) {
          viewName = "AllDocs";
          key = null;
        }
        View view = DominoUtils.getCurrentDatabase().getView(viewName);
        try {
          exp.exportDocuments(view,key);
        } finally {
          view.recycle();
        }
      } finally {
        os.flush();
      }
    } catch(NotesException ex) {
View Full Code Here

                return;
              }
              JsonImport imp = new JsonImport(new JsonImport.ZipImportSource(lis));
             
              // Delete all the documents
              View view = DominoUtils.getCurrentDatabase().getView("AllSnippetsById");
              try {
                view.getAllEntriesByKey(key).removeAll(true);
              } finally {
                view.recycle();
              }
             
              // And import the new ones
              imp.importDocuments(DominoUtils.getCurrentDatabase());
             
View Full Code Here

TOP

Related Classes of lotus.domino.View

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.