Pregunta

I'm currently building some applications that will connect to a WCF acting as a middleware between these external apps and a Document Management System. This means that I have doubts choosing the DMS (SharePoint, Alfresco, or custom made in a SQL Server Data Model). The DMS is intended to store large amounts of documents because there are at least 4 applications that will consume the WCF (one of the applications about 1TB of documents every 3 months)

One of the main constraints is that after calling the WCF and then SharePoint Web Services to insert documents, the Access to those documents has to be immediate (so I cannot use Search Service).

My idea here was to activate the Doc ID feature in the site collections, in some way the WCF would do some query by the Unique Doc ID (I don't know if this is possible) and then, the WCF would retrieve a JSON or something like that to the applications with the Document ID as one of the values of the JSON string (metadata, site collection name, etc as other values of the string)

Alfresco, for instance, has some web services that retrieve somethig like the NodeLeafID so you can store in the external Apps data models and don't need to call Search Services.

Does anybody know how can achieve something like this?

¿Fue útil?

Solución

You can create your own unique Id by combining (e.g. concatenating) the GUID of the sub-site, the GUID of the doc lib and the Id (int) of the item.

For exemple, you upload a document to http://WebApp/sites/site01/subsiteA/TheDocLib.
You can then get the Id of subsiteA, the Id of TheDocLib and last the Id of the file you've just uploaded:

  • Id of subsiteA: {EFA3433B-50FA-46CA-BD13-FFE89BE696BD}
  • Id of TheDocLib: {170F4DC4-695D-4D6C-8A66-29F7CEA054C}
  • Id of the file item: 13

This would give something like EFA3433B50FA46CABD13FFE89BE696BD170F4DC4695D4D6C8A6629F7CEA054C413. That's your unique Id for a given doc.
When that Id is presented later, you can easily access the document with the (server or client-side) object model. First you split it to get back all 3 Ids (32 chars, 32 chars, remaining digits compose the item Id integer), and (e.g. with CSOM), you can easily open the Web by its Id, open the list by its Id, and get the item #13.

Licenciado bajo: CC-BY-SA con atribución
scroll top