Advanced: Smart Document Templates, Word, XML, MVC pattern

G

Gossi

Hi all,

I want to develop an document composer application which integrates Word in
the UI. The document is created and updated by the application but the user
shall be able to edit the document in parallel.

The basic requirements are:
- An administrator can "design" a template which is stored as XML (e.g.
WordML).
- MVC pattern: the template is later instanciated as document (the view,
represented by Word) which is continuously synchronized with the application
data model (data is updated in placeholders within the document) by a
controller (the application itself).
- The controller provides independent from the template a list of possible
placeholders (maybe specific fields) to Word. The admin can insert the
placeholders into the template as needed.
- Specific placeholders have to be made read-only by the controller when the
template is instantiated as document for editing by a user (i.e. the user
mustn't edit the contents of the placeholder, but perhaps may delete the
whole placeholder).

I already thought about using InfoPath as an alternative to Word, but as the
kind of documents is more like continuous text than a form, I thought that
Word should be the better choice.

Now to my questions ;-)

1. I don't know exactly how smart documents work. But I know that a smart
document needs its code compiled into an assembly DLL file. Is it possible to
allow the admin to create a template independently from the smart part of the
later document and afterwards (dynamically at runtime, not at compile time!)
attach the DLL to this template?

2. How can the controller provide a list of possible placeholders (maybe
fields) to Word for insertion into the a template?

3. Is it possible to make certain placeholders read-only for the user? And
if this works is it possible nevertheless to allow the user to delete the
whole placeholder?

It would be a great help if somebody could give me some hints about the
problems described above. Please also put an answer if it only deals with
parts of the questions!

Many thanks in advance and best regards,
Thomas

- - - - -
Do It. Do It Right. Do It Right Now.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?R29zc2k=?=,

1. This probably isn't the best group to pursue this question, as it mostly
caters to end-users. There are some office.development groups where you might
get a better discussion going ("might" because they aren't too frequented).
There's also a vsnet.vstools.office group that might be relevant, if the VSTO
suggestion below interests you.

You don't mention which version of Word comes in question for this? May we
assume 2003?

Given your requirements, I might take a close look at VSTO (2005), rather than
the SmartDocument tools. VSTO 2005 lets you use not only ActiveX controls, but
also Windows Forms controls, including ones you design. What's more, the file
need not be XML, and you wouldn't need to link it to a schema, or go through all
the hassle of a manifest.

Word 2003 provides a type of protection in the text layer that should work for
your purposes, although you might have to provide the "delete" part through an
automation interface (part of the custom task pane you can define in a VSTO 2005
project).
I want to develop an document composer application which integrates Word in
the UI. The document is created and updated by the application but the user
shall be able to edit the document in parallel.

The basic requirements are:
- An administrator can "design" a template which is stored as XML (e.g.
WordML).
- MVC pattern: the template is later instanciated as document (the view,
represented by Word) which is continuously synchronized with the application
data model (data is updated in placeholders within the document) by a
controller (the application itself).
- The controller provides independent from the template a list of possible
placeholders (maybe specific fields) to Word. The admin can insert the
placeholders into the template as needed.
- Specific placeholders have to be made read-only by the controller when the
template is instantiated as document for editing by a user (i.e. the user
mustn't edit the contents of the placeholder, but perhaps may delete the
whole placeholder).

I already thought about using InfoPath as an alternative to Word, but as the
kind of documents is more like continuous text than a form, I thought that
Word should be the better choice.

Now to my questions ;-)

1. I don't know exactly how smart documents work. But I know that a smart
document needs its code compiled into an assembly DLL file. Is it possible to
allow the admin to create a template independently from the smart part of the
later document and afterwards (dynamically at runtime, not at compile time!)
attach the DLL to this template?

2. How can the controller provide a list of possible placeholders (maybe
fields) to Word for insertion into the a template?

3. Is it possible to make certain placeholders read-only for the user? And
if this works is it possible nevertheless to allow the user to delete the
whole placeholder?

It would be a great help if somebody could give me some hints about the
problems described above. Please also put an answer if it only deals with
parts of the questions!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top