Question

Preamble: the last time I had an issue with something from the extension libraries, I immediately posted a bug report on openNTF.org. It then turned out that I had missed a property setting that made everything work perfectly. To prevent this issue from happening again, I decided to post the question here first, can anyone reproduce the error that I am having, or am I missing a property on the xe:DynamicViewPanel control?

tested ExtLib versions tested:

  1. 901v00_06.20140424-0600
  2. 901v00_02.20131212-1115

Domino/Notes version used Domino 9.0.1

Steps to reproduce

  1. Create a dashboard XPage application. - data is stored in a different database.

  2. Using a dynamicViewPanel control, access a database that lies ON THE SAME SERVER and show information from that database in the view.

  3. Click on a document link in the dynamic view panel and look at the URL in the browser. When the dynamicViewPanel is pointing to a view in a different database hosted on the same server as the dashboard, the url looks like this :
    http://path/Portal.nsf/%24%24OpenDominoDocument.xsp?databaseName=CN=Maestro/O=hol-dev/C=DE!!path/Portal.nsf&documentId=A6727D8AF7D2FE19C1257C9E0034A14C&action=editDocument

  4. The appropriate Xpage defined by the form name of the document being clicked on will open and the data saved in that document will even be loaded.

  5. Click on a button that performs any action with the defined document datasource. It can be as simple as printing a string to the server when notesXspDoc.isNewNote(). You will get an error message saying that (in the case above) NotesXSPDocument.isNewNote() null. This means that the variable IS NOT null, but for some reason you are getting a null error response.

This error will only happen when the dashboard and the data database are on the same domino server. As soon as one of them are moved, it will work perfectly AND the URL will be correctly written; the server name of the databaseName parameter will be written in the abbreviated way.

In an attempt to understand/fix this issue, I took a closer look at the code in the Extension Library class com.ibm.xsp.extlib.component.dynamicview.UIDynamicViewPanel. There, I found the call to super(XspViewPanel).getDocumentUrl(). My guess is that the error lies in that function, but that is not a class that is defined by the ExtLibs. At the very least I would be interested to know what is written there.

educated guesswork
I am pretty certain of the following: The page when first open loads because key information is saved in the requestScope. This information is not not passed on to the java DominoDocument object which is created by the NotesXspDocument javascript 'class'. When (in the background) the DomDoc.restoreDocument() function is called, it tries to locate the database CN (as returned by the param.get("databaseName") function) and fails. Thus, no further function can be called on the object since an exception would always be thrown. (This is all an educated guess on my part)

My Questions clearly stated

  1. Is this a known bug and I am just not finding it in my google searches?
  2. Am I just not seeing a property of the ViewPanel that would fix this error?
  3. Is there a better work around other than setting the "ignoreUrlParams" property of the document data source and calculating the server/documentID?

Thank you very much for all assistance given!

EDIT
Changing the "ignoreRequestParams" property to true and calculating the databaseName and the documentID does not make a difference at all. I am really confused as to why it does not work, I would think that calculating the source information and not paying any attention to the request parameters would solve it, but i am having the same issues. Any further assistance would be greatly appreciated!

Was it helpful?

Solution

After a great deal of testing, deleting functions and re-adding them, I think I have the answer I sought. I cannot really say why this is, and I find it a crappy design if my thoughts are correct.

I found that when I commented out a certain javascript line which opened the database in a background java class to find out the user's current roles, it worked again. Upon further investigation, when I took out the java lines that recycled the source database, the dashboard worked again. This means, however, that the background c++ object is still existing in the background somewhere. In this project, it seems to only be an issue when the source DB and dashboard DB are hosted on the same server.

I am going to answer my question with "No, this is not a bug in the dynamicViewPanel", but rather a questionable design from IBM itself. Either we should be recycling our Notes objects, or we should not be recycling our Notes objects, or we should be given a very detailed description of when and when not to recycle. Maybe I am just not used doing my own GC. Here is the code that was giving me a hard time (some variable names have changed to protect the anonymity of the customer):

public String getDatabaseRoles(){
        Session session = null;
        Database db = null;

        Vector<String> roles = null;

        try {
            session = SessionHelper.getCurrentSession();
            db = DatabaseController.getApplicationInstance().getDbFile().getDatabase();
            roles = db.queryAccessRoles(session.getEffectiveUserName());
        } catch (NullDatabaseException e) {
            // already logged
        } catch (NotesException e) {
            ErrorWriter.getSessionInstance().writeError(new Date(), ErrorLevel.ERROR, "EprDatabaseController.getDatabaseRoles()", 
                    e);
        } catch (NullSessionException e) {
            // already logged
        } finally {
            //if(db != null) try {db.recycle();} catch(NotesException e) {}  //commented out due to issues when portal is on same server as data.
            //if(session != null) try {session.recycle();} catch(NotesException e) {}

        }
        StringBuilder roleStr = new StringBuilder();
        if(roles != null){
            for(String role : roles){
                if(!StringHelper.isNullOrEmpty(role)){
                    roleStr.append(role);
                    roleStr.append(":");
                }
            }
        }
        ErrorWriter.getSessionInstance().writeError(new Date(), ErrorLevel.TRACE, "DatabaseController.getEPRDatabaseRoles()", 
                "Database Roles: " + roleStr.toString());
        return roleStr.toString();
    }

Again, just so workarounds are already answered for future readers,

  1. have the source database on a different server.
  2. set the ignoreUrlParams property of the document datasource and calculate the the documentID and databaseName correctly inserting the server name as abbreviated.

This not being the true answer of my question, I am just putting this here for future user ease.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top