"Document has been modified or corrupted since signed! (data)" Message - lotus-notes

I'm running an agent which modifies view column title (using NotesViewColumn class). Everything is fine until I open the modified view, in the status bar below it says "document has been modified or corrupted since signed! (data)". Any suggestion on how to solve this. Thanks in advance.

I get the view as a NotesDocument object using NotesDatabase.getDocumentByUNID('unid of view') and used sign() and save() methods, it worked :) thanks again

Related

Tibco Spotfire webplayer, set a document property via the url

I am trying to do something simple in Tibco Spotfire, to try and set a document property in webplayer by specifying a property in the url. I cannot get this to work.
I have created a document property called 'test' which is simply a string
I have then created an input text control bound to that document property
I would expect that if I opened that report in webplayer with a url prepended with &configurationBlock=test%3D"helloworld" then the input text would be populated with the value helloworld. However, it is not.
This seems to be a reasonably simple thing to get working, I have tried what I think is every possible variant of encoding the data to no effect. Is there something I am doing wrong that could make this work.
you are going to hate this answer :)
you need to put a semicolon at the end of the parameter assignment. so you should have:
http://example.com/Spotfire/stuff?configurationBlock=test=helloworld;

Commenting System in XPages

I'm trying to implement a simple comment system in XPages. I have come across examples that create response documents from an existing document. The issue I'm having is when I open a new XPage and want to add a comment but I don't have an existing document because it hasn't been saved yet.
Is there a way I can create comments (response documents) on an unsaved document somehow? Or is there a different way to implement a comment system that doesn't use response documents?
Thanks for any tips.
If this is XPages then don't use a response document. Use a manual key of some sort. I prefer #Unique style keys - some people use UNIDS.
There's little to no value in using pure response document in XPages applications.
Patrick asks the key question. How can you have a "child" document if you don't first save the "parent" document.
Now of course you can save the parent and the child at the same time.
A response document need the unid of the main document for creation. If the main document is not saved you get the following exception.
Unable to create new document
NotesException: Invalid universal id
I don't know an other way to handle this problem.
Why don't you want to save the main document?
How can someone comment on something that does not exist?
I would need more details but you need to save the document. Perhaps you can move it into a different category like a draft view or something till it is ready for production?

Invalid UniversalID when document has been copied

I have a strange problem: I want to access documents in a different database (same server). My approach is very close to this one discussed here: http://www-10.lotus.com/ldd/nd85forum.nsf/DateAllFlatWeb/517ef6249d5b9fa6852575cc00503786?OpenDocument
I have only 3 docs in the source database. 2 are created directly, one is copied from another database (these are just test document). We have a generic view that lists thos entries from a view, calcs the links in a form like this:
http://localhost/database.nsf/xpMBK.xsp?action=openDocument&db=dominotest%2Ftest%2Fulcbs%21%21projects%2FFKIE%2FEinsMuB.nsf&view=AMBKEinsAll&documentId=781F14A98A699548C1257C3200316BAC
As you can see we are using an Xpage in the current database and place parameters that point the Xpage to open the document to the source database (notation is server!!database here), a view (this is the one to which I want to return) and finally the unid of the source document.
Now the strange one:
I cannot open the copied document, receiving the
NotesException: Invalid universal id
lotus.domino.local.Database.getDocumentByUNID(Unknown Source)
error.
Even better: if I copy a document that works within the same database (the current one) this document can also not opened anymore!
What's this and can you give me a hint to solve this?
Thanks in advance!
If, by "copied", you mean either manually copied and pasted into the target database or programmatically duplicated via copyToDatabase(), the new copy of the document will be assigned a new UNID; it is not guaranteed to have the same UNID as the original did (and, in my experience, it's rare that it preserves the original). If you're duplicating the document programmatically, be sure to check its new UNID afterward and use that ID in your URL calculation instead.
I've had a problem very similar to this in the past, and the answer turned out to be that I wasn't opening the NSF file that I thought I was opening. I was using NotesDatabase.OpenByReplicaID, and there were two replicas of the database on the server, with different sets of documents. In that situation, Notes gets to pick one of the two replicas -- you have no control over it. The replica that was actually opening contained some of documents corresponding the the UNIDs that I was trying to access, but some of them really were not there and therefore the getDocumentByUNID() method was correct in throwing the "Invalid universal id" error. This was really, really hard to debug.
After I figured it out and removed the second replica from my server, the first thing I did (after testing and confirming the problem went away) was to write an agent that scans a server for duplicate replica IDs.
The UNID:S in a Domino database when it's copied to the database thru copyToDatabase is done like this.
One part of the UNID comes from the database one part is document unique. So if you copy a document from one database to another the document could get the same unid each time. If the unique combination doesn't have a valid document with that combination in the database, the document will get the same UNID everytime. In other cases the document will get a new Id.
More information can be found here
UNID and copytodatabase
Thank you guys for your ideas!
But I was completely wrong #facepalm
The problem was: a colleague coded a bean to access the other database and I didn't noticed that the config document pointed to a replica on another server, so when I copied the document within my database on my local server it was fairly clear that the xpage could not find the copied one - as it resided on the other machine.
Thank you anyway :)

I Need to prevent saved conflict in xpage

Scenario :- I opened the same document in different browsers(users). One user modified and saved the document. another user also modifying the same document which creates saved conflicts. for this I googled and found the link and tried.
http://dontpanic82.blogspot.in/2010/01/xpages-custom-control-that-can-help.html
(Thanks to Mr Tommy).
I included this custom control in another custom control(Form) at the end of Cc.
I am getting currentDocument not found in before render response event. I have my data source name document which is defined for full page not for panel.
Document handle is not getting in Before render response event?
Please help to me to solve this. or is there any other way to prevent saved conflicts?
Have a look at the concurrencyMode property of the document datasource.
You can for instance set it to fail in order for the document save to stop (fail) if a save conflict occurs. If you have (or add) a message control to your xpage, a save conflict error message will then appear.
If you isn't building for XPinc you could use my Document locker project on openntf.org
Document Locker on openntf.org
It works like this, when a user opens a document a< lock is added to an application scope bean. And when the user exits the document this lock is removed. if another user tried to enter the document at the same time they will be redirected to readmode.
Also, check the section in Mastering XPages 2nd Edition about document locking. That gives thorough examples for enabling the in-built Domino document locking.

Get UniqueId of a list item from SPMetal code

Quick question. I want to generate code with SPMetal that includes the UniqueId field (the field that has the GUID for the list item), but somehow in Visual Studio I end up with either:
A list without that field
A list that in theory has that field (UniqueIdUniqueId.. why is it named that way?), but when I try to run it, throws me a NullException.
I'm using Sharepoint 2010, VS 2010.
Can you point me in the right direction? I'm stalled right now. I would paste you the XML file I've been using as parameters to SPMetal, but my servers are down right now. I'll post it ASAP, but if anyone has the answer on how to generate a class that includes that particular field, I'd be thankful.
Thanks!
The solution was: use the "GUID" hidden field. Duh.
I think is no way to include 'UniqueId', because is not a part of any content type.
If this realy need to get 'UniqueId', try write SQuery, which get item by ID with one viewField (to maximize performance).

Resources