views:

51

answers:

1

I know nothing about microsoft office development, but I would like to build a prototype of a plugin will allow a user to Save and Open documents from a remote repository. Perhaps later build in a version control system on the server - but the server side piece is about the easiest portion of it (in my case). Perhaps I should focus on getting this to work for one office application at a time - say MS WOrd (unless folks think excel is easier to work with). And lets target Office 2007 (as that is what I have installed).

Saving

The repository will store the document Tagged (by many tags, of many types). Saving the document the AddIn will need to first Show a dialogue and allow the tagging. The AddIn needs to submit an array of Tags along with the document (Base 64 encoded?) over a SOAP or REST api to our servers. Few questions

  1. Is this possible? if so suggestions as to how it could be accomplished? Is there a mechanism for gaining access to the binary data (stream?) of the document you are viewing?
  2. Is it possible to piggy back this off of the File-SaveAs dialogue? OR will i need to create my own menu-item? Obviuos the former is probably more familiar with users...
  3. Is there already a mechanism for remote document persistance I can piggy back off of?

Opening

Once a number of documents have been saved, we will need a method of retrieving the documents / opening them. So I would think I would need a dialogue that allows browsing docucents Tag Type -> Tag Values (there may be more levels to the tree, but want to start there). ONce the document is opened I think the API would need to

  1. Make the RPC call (SOAP / REST) to retrieve the document - decode the content (actual document) and open that stream inside of Word (for example)
  2. I would also like to keep my tags in memory

XML Design

In order to best visualize the data being exchanged between Word and the server lets imagine an XML Structure like:

<document name="recapOfTheGame.doc">
   <tags>
      <tag type="team">New York Yankees</tag>
      <tag type="team">Boston Redsox</tag>
      <tag type="city">New York</tag>
      <tag type="city">Boston</tag>
      <tag type="type">recap</tag>
   </tags>
   <content encoding="base64">AKJSGHKASHGFKSJDHGFKSJDHGFSKDJFHGSKJDGSKDJGSKDJFHGSDKJFH</content>
</document>

the repository explorer should show this document in multiple places in the tree; Here is an example of a repository showing this document in five places (based on the tags):

repository
    + untagged <not shown in XML>
    - team  
        + Tampa Bay Rays <not shown in XML>
        - Boston Resox
               recapOfTheGame.doc
        - New York Yankeeys
               recapOfTheGame.doc
    - city
        + Tampa Bay <not shown in XML> 
        - new york 
               recapOfTheGame.doc
        - boston
               recapOfTheGame.doc
    - type
        + box scores <not shown in XML> 
        - recaps
               recapOfTheGame.doc

Other Thoughts

I only provided the XML design to make the concept more tangible, and I am open to other methods of storing the tag (within the document if that is possible). Basically any direction I can be given on this endeavor would be greatly appreciated.

I asked this question differently to check if the responses would differ, http://stackoverflow.com/questions/3737728/open-word-document-from-database-or-webservice

I am accepting the webDav answere - below as it is common between the two and is what alfresco does.

Thank you

+1  A: 

Look at using WebDAV to open/save the documents; Office has support for that, though ymmv. If you can't use the built-in Office support, use WebDrive/NetDrive etc, or build your own.

Another alternative is SharePoint protocol, if your repository supports it. Alfresco for example, has cloned parts of this. This also has the advantage of a built-in client in Word.

CMIS is more modern than WebDAV, you'd have to build your own client though (look at Apache Chemistry). Still, this might be the go if your repository supports it;

You could also use SOAP or REST, as you mention, via VSTO, but these also fall into the build your own client category.

Regarding the tags: you could pass these as WebDAV properties. It may also be worth putting them inside the docx as a CustomXML part (or just document properties - which has the advantage that they're visible in the Word UI), so the document has them even if moved or whatever.

plutext
The intent is to install this AddIn on client PCs outside of our trusted domain, and everything needs to run over Port 80; What do you mean build your own client? Are you referring to an AddIn as a client - I don't think I will get the repository exploring that I need without having to build a lot of my own client and server...
akaphenom
I'm assuming you'll build a VSTO addin. By "build your own client", I mean building the component responsible for browsing the repository; this is just a part of the overall addin. You don't necessarily have to build the repository browsing piece, as per my post.
plutext