I would like to compare the structure of 2 databases.
I found an API function : IDTableTime, which give me the Date/Time of a table which contains the structure data (forms, views, …). I used the API function NSFDbGetModifiedNoteTable to get this table and the function OSLockObject to get an ID of this table.
I have no problems to get the table and the ID table but problems to use the function IDTableTime. It must return a TimeDate but this datatype doesn’t exist, and I must create a type in declaration. But I can’t use this new type in the API function declaration of IDTableTime.
Can someone help me or give me another solution to compare the structure of 2 databases ?
Have a look at the NoteCollection class, especially the selectAllDesignElements() method. This will collect together all the design notes in the database.
Then have a look at the NotesDXLExporter class, especially the export( noteCollection ) method.
The result of the export is what is called DXL (Domino XML) which is just an XML file.
If you really want to all the work yourself you can use the NotesXMLProcessor class to read/process the resulting DXL.
I had a look to the Domino XML and it could be a solution, but how can I compare 2 DXL data (a NotesDatabase for example) expected with a third-part software ?
I will try to explain you clearly what I want to do.
we have a server where is located a template database (A), and others servers where we want this template be copied (B).
So, I would like to compare the database structure of the good template (A) and templates on the other servers (B). If the structure are differents, I recreate the template on the server concerned (B) with the good template (A).
IMO, a better approach would be to replace the template on B with replicas of the template on A.
You may have some initial cycles to update database designs on B which inherit from the template, but as long as B replicates with A you don’t have to do any custom checking on template differences.
We use Team Studio Delta, a tool designed to explicitly compare two Domino databases. It’s called “Delta” so one may compare two versions of the same database to see the differences, and it will even do “diff-like” output for their Configurator tool to make one look like the other, though I’ve never used that. But Delta will compare any two databases, which is also useful to, say check if one particular template of a multi-template application has in fact been applied correctly. Those pesky “Prohibit design refresh” boxes! (wink)- Is it perfect? No way. Is it useful? I don’t know how people develop for Notes without it!
We manage a large number of databases based on several dozen design templates that are constantly being updated by the development team. The overhead of managing all these designs across replicas on 10 or more servers is considerable. To help us deal with this problem we developed our own design compare system that checks to ensure that all replicas of production databases on all servers match their corresponding post-QA template on our development server. The system uses the NotesNoteCollection to perform the comparison. It checks that the design element list of a production database exactly matches its post-QA template and that the update dates of all the elements match. When discrepencies are found they are logged so that we can follow up on them and correct the problem (hopefully before the client notices). This system is entirely LotusScript based and does not use DXL or API functions because we do not need to perform line-by-line comparisons of design elements. If the last update date of a design element is different from the corresponding element in the post-QA template that is enough to tell us that they are different and someone needs to have a look at it and figure out what went wrong with the refresh cycle.
In order to make the system work you must have a chain of templates in place to ensure that design updates are released in a controlled way. Our chain consists of:
Development template where developers make new bugs and rearrange existing ones.
QA template where testing is performed.
Post-QA template that serves as the design reference standard for production databases.
Production databases.
Design elements are manually copied from one database in the chain to the next (except for the post-QA → Production step) to ensure that only the elements relevant to a specific task are moved up.
The main advantages of this system are:
a) It ensures that no untested code is ever released to a production database.
b) It provides us with a way of measuring design correctness of the production databases without having to manually inspect them, which would be impossible given our staffing levels and their attention span.
c) It gives us a proactive system to spot design management problems so that we can start ignoring them right away instead of waiting for the client to complain before we start ignoring them.
I hope this helps you with your problem. The process of figuring out if two database designs match is not that hard - just compare the NotesNoteCollections of the two databases and figure out where they differ. Your use of the API functions is perhaps another way to accomplish this same objective, but the NotesNoteCollection approach has the advantage of simplicity and the tools are much better documented than the API.