Package lotus.domino

Examples of lotus.domino.Document


        Vector v = new Vector();
        v.add(FORM);
        v.add(id);
        ViewEntry e = database.getView("AllSnippetsById").getEntryByKey(v);
        if(e!=null) {
          Document doc = e.getDocument();
          Properties p = new Properties();
          String props = doc.getItemValueString("Properties");
          if(StringUtil.isNotEmpty(props)) {
            p.load(new StringReader(props));
          }
          String endpoint = p.getProperty("endpoint");
          if(StringUtil.isNotEmpty(endpoint)) {
            o.put("endpoint", FBSString.get(endpoint));
          }
          String baseDocUrl = doc.getItemValueString("basedocurl");
          if(StringUtil.isNotEmpty(baseDocUrl)) {
            o.put("doc_url", FBSString.get(baseDocUrl));
          }
          String json = doc.getItemValueString("Json");
          if(StringUtil.isNotEmpty(json)) {
            FBSValue value = (FBSValue)JsonParser.fromJson(new JsonJavaScriptFactory(jsContext), json);
            o.put("items", value);
          }
          fixAPIObject(o,baseDocUrl,unid);
View Full Code Here


      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())) {
                env.setNotesUrl(d.getNotesURL());
                environments.put(env.getName(), env);
                if(TRACE) {
                  System.out.println("Loading environment: "+env.getName());
                }
                allEnvs.add(env.getName());
              }
            } finally {
              d.recycle();
            }
          }
        }
      }
     
View Full Code Here

  }
 
 
 
  public void duplicateEnvironment(String id) throws NotesException, IOException {
    Document d = ExtLibUtil.getCurrentDatabase().getDocumentByID(id);
    Document newDoc = ExtLibUtil.getCurrentDatabase().createDocument();
    d.replaceItemValue("name", StringUtil.format("Copy of {0}", d.getItemValueString("Name")));
    d.copyAllItems(newDoc, true);
    newDoc.save();
  }
View Full Code Here

  }
  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

    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 false;
  }

  public String changeParent(String noteID, String newParentID) throws Exception {
    Database db = ExtLibUtil.getCurrentDatabase();
    Document doc = db.getDocumentByID(noteID);
    Document newParent = db.getDocumentByID(newParentID);
    doc.makeResponse(newParent);
    return null;
  }
View Full Code Here

  public void importDocuments(Database database) throws IOException {
    source.startImport();
    try {
      Session session = database.getParent();
      for( Entry e=source.next(); e!=null; e=source.next() ) {
        Document doc = database.createDocument();
        try {
          doc.setUniversalID(e.getUnid());
          importDocument(session,doc,e.getJsonObject());
          if(getDocumentFilter()==null || getDocumentFilter().accept(doc)) {
            doc.save();
          }
        } finally {
          doc.recycle();
        }
      }
    } catch(NotesException ex) {
      throw new IOException(ex);
    } finally {
View Full Code Here

    target.startExport();
    try {
      ViewEntryCollection entries = keys!=null ? view.getAllEntriesByKey(keys) : view.getAllEntries();
      try {
        for(ViewEntry entry=entries.getFirstEntry(); entry!=null; entry=entries.getNextEntry(entry)) {
          Document doc = entry.getDocument();
          try {
            exportDocument(doc);
          } finally {
            doc.recycle();
          }
        }
      } finally {
        entries.recycle();
      }
View Full Code Here

 
  //
  // Load Options
  //
  public void loadOptions() {
    Document doc = loadOptionsDocument();
    try {
      this.javaScriptSnippetsEnabled = getEnvironmentBoolean(doc,"JavaScriptSnippets");
      String jsAgg = getEnvironmentString(doc,"JavaScriptAggregator");
      if(StringUtil.equals(jsAgg, "sdk")) {
        this.javaScriptAggregator = JS_AGG_SDK;
      } else if(StringUtil.equals(jsAgg, "xpages")) {
        this.javaScriptAggregator = JS_AGG_XPAGES;
      } else {
        this.javaScriptAggregator = JS_AGG_NONE;
      }
      this.javaSnippetsEnabled = getEnvironmentBoolean(doc,"JavaSnippets");
      this.xpagesSnippetsEnabled = getEnvironmentBoolean(doc,"XPagesSnippets");
      this.gadgetSnippetsEnabled = getEnvironmentBoolean(doc,"GadgetSnippets");
      this.explorerEnabled = getEnvironmentBoolean(doc,"APIExplorer");
      this.apacheLicense = getEnvironmentBoolean(doc,"ApacheLicense");
      this.dwLookFeel = getEnvironmentBoolean(doc,"DwLookFeel");
      this.environments = getEnvironmentString(doc,"Environments");
     
      this.apiDocumentationEnabled = getEnvironmentBoolean(doc,"APIDocumentation");
 
      this.banner = getEnvironmentString(doc,"Banner");
      this.applicationTitle = getEnvironmentString(doc,"AppTitle","Social Business Toolkit");
      this.applicationLogo = getEnvironmentString(doc,"AppLogo");

      this.gaTrackingId = getEnvironmentString(doc,"GATrackingId");
      this.gaDomain = getEnvironmentString(doc,"GADomain");
    } finally {
      try {
        if(doc!=null) {
          doc.recycle();
        }
      } catch(NotesException ex) {}
    }
  }
View Full Code Here

      } catch(NotesException ex) {}
    }
  }
  public String getOptionsDocumentId() {
    try {
      Document doc = loadOptionsDocument();
      if(doc!=null) {
        return doc.getUniversalID();
      }
    } catch(NotesException ex) {
      Platform.getInstance().log(ex);
    }
    return null;
View Full Code Here

TOP

Related Classes of lotus.domino.Document

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.