Package lotus.domino

Examples of lotus.domino.View


  protected ImportSource getSource(String type, String srcName) throws Exception {
    return loadSource(type,srcName);
  }
 
  protected ImportSource loadSource(String type, String srcName) throws Exception {
    View v = db.getView("AllImportSourcesByType");
    try {
      Vector<Object> keys = new Vector<Object>();
      keys.add(type);
      keys.add(srcName);
      Document doc = v.getDocumentByKey(keys);
      try {
        if(doc!=null) {
          return loadSource(doc);
        }
        return null;
      } finally {
        doc.recycle();
      }
    } finally {
      v.recycle();
    }
  }
View Full Code Here


      FacesContextEx.getCurrentInstance().addMessage(null, m);
   
  }

  protected void deleteAssets(ImportSource source, AsyncAction action) throws Exception {
    View v = db.getView("AllSnippetsByImportSource");
    try {
      Vector key = new Vector();
      key.add(getAssetForm());
      key.add(source.getName());
      v.getAllEntriesByKey(key).removeAll(true);
    } finally {
      v.recycle();
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  private synchronized void init() {
    _persons = new HashMap<String, Person>();

    Database db = ExtLibUtil.getCurrentDatabase();
    View viewPersonsAll = null;
    ViewNavigator viewNavigator = null;

    try {
      viewPersonsAll = db.getView("PersonsAll");
      viewPersonsAll.setAutoUpdate(false);
      viewNavigator = viewPersonsAll.createViewNav();
      ViewEntry tmpEntry;
      ViewEntry entry = viewNavigator.getFirst();
      while (entry != null) {
        entry.setPreferJavaDates(true);
        List<Object> columnValues = entry.getColumnValues();

        Person person = new Person(
            (String)columnValues.get(5),
            (String)columnValues.get(0),
            (String)columnValues.get(1),
            (String)columnValues.get(2),
            (String)columnValues.get(3),
            (String)columnValues.get(4),
            entry.getUniversalID());
        _persons.put((String)columnValues.get(5), person);

        tmpEntry = viewNavigator.getNext();
        entry.recycle();
        entry = tmpEntry;
      }
    } catch (Exception e) {
      e.printStackTrace();
    } catch (Throwable t) {
      t.printStackTrace();   
    } finally {
      try {
        if (viewNavigator != null) {
          viewNavigator.recycle();
        }
        if (viewPersonsAll != null) {
          viewPersonsAll.recycle();
        }
      } catch (NotesException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

    Messages.clear();

    try {

      Database database = (Database) resolveVariable("database");
      View settingsView = database.getView("applicationSettings");
      Document settings = settingsView.getFirstDocument();

      if (null == settings) {

        settingsView.recycle();
        XSPContext context = (XSPContext) resolveVariable("context");

        UIViewRootEx2 view = (UIViewRootEx2) resolveVariable("view");
        if (!view.getPageName().equals("/admin.xsp")) {
          System.out.println("mypic: invalid configuration - " + view.getPageName());
          validConfig = false;
          context.redirectToPage("/admin.xsp");
        }

      } else {

        SaveUrlInNab = settings.getItemValueString("saveMypicURLToNab");
        EnableProfiles = settings.getItemValueString("enableProfiles");
        StoreProfilesInNab = settings.getItemValueString("saveProfileToNab");
        NabServer = settings.getItemValueString("nabServer");
        NabFilePath = settings.getItemValueString("nabFilePath");
        ShowApiInNav = settings.getItemValueString("enableAPIPage");
        DefaultFormat = settings.getItemValueString("defaultFormat");
        DefaultSize = settings.getItemValueString("defaultSize");
       
        if (DefaultSize.trim().compareTo("") == 0) {
          DefaultSize = "50";
        }
       
        if (DefaultFormat.trim().compareTo("") == 0) {
          DefaultFormat = "png";
        }

        if ((SaveUrlInNab.equals("Yes") || StoreProfilesInNab.equals("Yes")) && (NabServer.isEmpty() || NabFilePath.isEmpty())) {
          Messages.clear();
          Messages.add("To save mypic URLs or Profile information to a Names and address book, "
              + "the NAB Server and File Path must be specified.");

          UIViewRootEx2 view = (UIViewRootEx2) resolveVariable("view");
          if (!view.getPageName().equals("/admin.xsp")) {
            XSPContext context = (XSPContext) resolveVariable("context");
            validConfig = false;
            context.redirectToPage("/admin.xsp");
          }

        }

        settings.recycle();
        settingsView.recycle();
      }
      validConfig = true;
    } catch (NotesException e) {
      e.printStackTrace();
    }
View Full Code Here

  public boolean saveSettings() {

    try {
      Database database = (Database) resolveVariable("database");
      Document settings = null;
      View settingsView = database.getView("applicationSettings");
      settings = settingsView.getFirstDocument();
      if (settings == null) {
        settings = database.createDocument();
        settings.replaceItemValue("form", "applicationSettings");
      }
View Full Code Here

        Session session = (Session) resolveVariable("sessionAsSigner");
        Database nab = session.getDatabase(this.NabServer, this.NabFilePath);
       
        if (null != nab) {
          String userAbbrev = session.createName(profile.getItemValueString("User")).getAbbreviated();
          View VIMPeople = nab.getView("($VIMPeople)");
         
          Document nabEntry = VIMPeople.getDocumentByKey(userAbbrev, true);
          if (null != nabEntry) {
            XSPContext context = (XSPContext) resolveVariable("context");

            profile.replaceItemValue("PhotoURL",
                context.getUrl().getScheme() + "://" + context.getUrl().getHost() + '/' + database.getFilePath() +
View Full Code Here

  // ===================================================================

  private static final boolean UNIQUE_USERS = true;

  void createUsers(Database db) throws NotesException, IOException {
    View w = db.getView("AllContacts");
    w.getAllEntries().removeAll(true);

    String[] firstNames = SampleDataUtil.readFirstNames();
    String[] lastNames = SampleDataUtil.readLastNames();
    String[] cities = SampleDataUtil.readCities();
View Full Code Here

  // ===================================================================
  // US States
  // ===================================================================

  void createStates(Database db) throws NotesException, IOException {
    View w = db.getView("AllStates");
    w.getAllEntries().removeAll(true);

    String[] states = SampleDataUtil.readStates();

    for (int i = 0; i < states.length; i++) {
      String[] s = StringUtil.splitString(states[i], ',');
View Full Code Here

    // Construct a list of authors
    // As we want the tag cloud to render differences between the authors, we give
    // as different weight to each author by adding it a random # of times in the list
    // We read the author names from the database
    ArrayList<String> users = new ArrayList<String>();
    View authorView = db.getView("AllContacts");
    authorView.refresh();
    try {
      int maxAuthors = 15;
      int nAuthor = 0;
      ViewEntryCollection authorCol = authorView.getAllEntries();
      for (ViewEntry e = authorCol.getFirstEntry(); e != null && nAuthor < maxAuthors; e = authorCol
          .getNextEntry()) {
        Vector<?> values = e.getColumnValues();
        String name = (String) values.get(7);
        // Add it a random number of times to the list
        int n = ((int) (Math.random() * maxAuthors)) + 1;
        for (int jj = 0; jj < n; jj++) {
          users.add(name);
        }
        nAuthor++;
      }
    } finally {
      authorView.recycle();
    }
    if (users.size() == 0) {
      // Just in case they were not created...
      users.add("John Doe");
    }

    View w = db.getView("AllThreads");
    w.getAllEntries().removeAll(true);
    createDiscussionDocument(db, null, users, new int[] { 0 }, disc_rootDocs);
  }
View Full Code Here

  // ===================================================================
  // All Types
  // ===================================================================

  void createAllTypes(Database db) throws NotesException, IOException {
    View w = db.getView("AllTypes");
    w.getAllEntries().removeAll(true);

    for (int i = 1; i < 25; i++) {
      createAllType(db, i);
    }
  }
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.