• Anonymous
  • Login
  • Register
OpenLog - Feature Request: Jaca OpenLogItem: new constructor for compatibility with Bob Balabans' Two-Headed Beast


Dear Julian,

I was trying to integrate OpenLog into a small Java I was writing in Eclipse. I use the "Two-Headed beast" method because the DDE Editors just bug me, and the debugging is yummy in native Eclipse. I couldn't get OpenLog to work correctly because this line in useDefaultLogDb was failing - currentDatabase was null.

            logDb = session.getDatabase(currentDatabase.getServer(), logDbName);

There might be a better way to to this, but I created a new constructor for the OpenLogItem object

public OpenLogItem (Session s, Database callingdb, String agentName) {
        try {
            thisDatabase = callingdb.getFilePath();
            this.currentDatabase = callingdb;
            thisAgent = agentName;
            session = NotesFactory.createSession();
            thisServer = session.getServerName();
            if (thisServer == null)
                thisServer = "";
           
            userName = session.getUserName();
            clientVersion = new Vector();
            String cver = session.getNotesVersion();
            if (cver != null) {
                if (cver.indexOf("|") > 0) {
                    clientVersion.addElement(cver.substring(0, cver.indexOf("|")));
                    clientVersion.addElement(cver.substring(cver.indexOf("|") + 1));
                } else {
                    clientVersion.addElement(cver);
                }
            }
           
            startTime = session.createDateTime("Today");
            startTime.setNow();
           
            resetFields();
        } catch(Exception e) {
            debugPrint(e);
        }
    }

and modified the calling agent thus:

public void NotesMain() {
        Session s;
        Database db;
        AgentContext ac;
        OpenLogItem oli;

        // do we get Session from debug member var,
        // or from agent context?
        try {
            if (this.m_Session != null) {
                s = this.m_Session;
                ac = this.m_Ctx;
                oli = new OpenLogItem(s, ac.getCurrentDatabase(), "Clean up Roaming Training Users");
            } else {
                s = this.getSession();
                ac = s.getAgentContext();
                oli = new OpenLogItem(s);
            }
        } catch (Exception e) {
            e.printStackTrace();

            return;
        }

        // from this point on, agent code is common to
        // both debug and "real agent" environments
       
        try {

Hope you see this as a helpful "Open Source Contribution" - and it might also simply be that I have missed something really obvious, in which case I will bribe you with beer to get this feature request deleted.

All the best
Andrew



Taken Actions by Owners

No actions have been taken yet.


In this field you can enter the actual request.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.
In this field owners can describe what they have done or want to do.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.