Fair enough. Thank you!
Thank you. That’s a progress, but… this sample is incomplete. It implements just small part of what I asked for.
1. There is no CMISInputHandler, saving just annotations in the repository makes no sense. Documents should be retrieved from the repository as well. Filesystem cannot be used. Annotations should be related then with a Relation to the document: http://www.programcreek.com/java-api-examples/index.php?api=org.apache.chemistry.opencmis.client.api.Relationship
2. There is no user session implemented. Currently you assume that only one user will be connected to the repository. Sample URL should accept three parameters: objectId, userName and password and then instantianate the CMIS session per user. That means creating custom handler and connectors per HTTP session and you will notice issues related with that.
3. All other stuff is saved still as XML which will cause issues as we used load balanced servers, so every session may access a different server and thus XML file. Plus simultaneus access will case many issues as well. I expect that volatile data to be populated from the CMIS repository or rather created on the fly. We cannot use filesystem at all. Only the repository can be used which should not store volatile (e.g. session) data or duplicated info about users. User has already a unique name. Also since the connectors/custom input handler will be created per session and there might be 100 users accessing the same document and the same XML files you can imagine all the issues related with that.
4. Annotation still contains the sessionId and userId as integer. We cannot store those volatile parameters. CMIS Object already contains the user/creator name and that should be enough.
5. Replies should be saved with the annotation, as a single object (single XML in the repository) or at least as the same annotation object. Currently it makes no sense as replies are saved in XML and only annotation in the repository. From the ECM/CMIS and user perspective, reply is also an annotation, just related with a different one (related by objectId:string). So all annotations and replies should be saved as separate annotations, same style object.
So my question is whether there is any way to implement it as I described above? That’s the way it should and have to work with any ECM system, e.g. via CMIS.
I appreciate your help so far and I hope we can solve somehow the issues mentioned above.
Yes, you can implement it. Please note that we provided just a sample. With this sample you can find how to achieve all 5 steps you pointed:
- Please see the getSession method in the CMISAnnotationDao, using it you can easily retrieve any objects from the CMIS repository, except it the Alfresco implementation of the InputDataHandler we provided you earlier. As queries are enough to manipulate with annotations I'd not provided the relationship part. If you want you can add the aspect wich will keep document related annotations.
- This sample was aimed to show the connection to the CMIS repo, Session question is in progress we will reply to you with it in the appropriate thread.
- As I've mentioned this is just the sample not the high-end solution, so you can implement exact those things that your case need. You can easily replace the XML DAOs with such that store data in-memory.
- Feel free to remove any of those, as you can see from the commit history first there was binding through the annotationSessionId, now the annotations are bound to the document guid, so you can freely remove session and user ids in the storage but set them only in the DAO implementation to pass the correct entity value to the AnnotationHandler.
- You can easily extend the type definition and add there list of replies or "attach" them through the aspect.
I asked for the sample, as I’m not able to make that work. I spent a lot of time trying to do that but I get many different unexpected exception on every step. You claim it’s possible, but I cannot confirm that. Custom implementation of every connector besides the annotation causes many issues, thus I ask for a sample in-memory sample. The same sample, just please do that per user session with the three parameters I mentioned. You will see that this is not so simple. Try to get rid of the XML or database and the integer IDs and you will a bunch of exceptions of every step. I could report every single issue I get but it would takes us another 6 months and we don’t have so much time.
So please prepare some in-memory sample that I could work on. At this point I don’t see any way to do that.