Examples: IsDesignLockingEnabled property

  1. This agent displays whether design locking is enabled for the current database.
    import lotus.domino.*;
    
    public class JavaAgent extends AgentBase {
    
      public void NotesMain() {
    
        try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();
    
          // (Your code goes here) 
          Database db = agentContext.getCurrentDatabase();
    
          if (db.isDesignLockingEnabled())
            System.out.println("Design locking is enabled");
          else
            System.out.println("Design locking is not enabled");
    
        } catch(Exception e) {
          e.printStackTrace();
        }
      }
    }
  2. This agent toggles design locking for the current database.
    import lotus.domino.*;
    
    public class JavaAgent extends AgentBase {
    
      public void NotesMain() {
    
        try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();
    
          // (Your code goes here) 
          Database db = agentContext.getCurrentDatabase();
    
          db.setDesignLockingEnabled(!db.isDesignLockingEnabled());
    
        } catch(Exception e) {
          e.printStackTrace();
        }
      }
    }