Package org.openntf.dominoTests

Source Code of org.openntf.dominoTests.NewDatabaseBean

package org.openntf.dominoTests;

import java.io.Serializable;

import org.openntf.domino.Database;
import org.openntf.domino.utils.Factory;

import com.ibm.xsp.extlib.util.ExtLibUtil;

/*
   Copyright 2014 OpenNTF Domino API Team Licensed under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with the
  License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
  or agreed to in writing, software distributed under the License is distributed
  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  express or implied. See the License for the specific language governing
  permissions and limitations under the License
 
*/

public class NewDatabaseBean implements Serializable {
  private static final long serialVersionUID = 1L;

  public NewDatabaseBean() {

  }

  public void getApiPath() {
    Database db = Factory.getSession().getCurrentDatabase();
    ExtLibUtil.getViewScope().put("javaTest", db.getApiPath());
  }

  public void getByApiPath() {
    Database db = Factory.getSession().getCurrentDatabase();
    String apiPath = db.getApiPath();
    Database currDb = Factory.getSession().getDatabase(apiPath);
    if (null != currDb) {
      ExtLibUtil.getViewScope().put("javaTest", "Database found at " + db.getApiPath());
    }
  }

  public void getMetaReplicaID() {
    Database db = Factory.getSession().getCurrentDatabase();
    ExtLibUtil.getViewScope().put("javaTest", db.getMetaReplicaID());
  }

  public void getByMetaReplicaID() {
    Database db = Factory.getSession().getCurrentDatabase();
    String metaReplicaID = db.getMetaReplicaID();
    Database currDb = Factory.getSession().getDatabase(metaReplicaID);
    if (null != currDb) {
      ExtLibUtil.getViewScope().put("javaTest", "Database found at " + db.getMetaReplicaID());
    }
  }
}
TOP

Related Classes of org.openntf.dominoTests.NewDatabaseBean

TOP
Copyright © 2018 www.massapi.com. 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.