InfoPath instance documents tied published location

F

foomonkey

I am attempting to build a workflow application using Sharepoint 2003
and Infopath. Here's what I've got:

1. Site collection - main site with 5 sub sites
2. Each site, including the top level, has a Forms Library based on the
same InfoPath template. I actually published the InfoPath form to each
library. (Better way to do this?)
3. Custom event handler on each forms library
4. Windows service to route documents

Here is the process:
1. The event handler on the main site handles Insert events on the
Forms Library. When a new document is inserted, certain data elements
are evaluated and the document should be routed to one of the sub sites
based on this data.
2. The event handler creates a "routing instruction" document (xml
file) on the local drive of the server outside of Sharepoint.
3. The Windows service picks up the routing instructions and copies the
Infopath instance document from it's original location to the
appropriate sub site.
4. The Windows service deletes the original Infopath instance document
from the main site.

So far so good. This all works. Here's where the trouble begins.

If I open the Infopath instance document from it's new location, when I
try to save the document, there is confusion somewhere. I suspect it is
because of 1) the location of the instance document is encoded within
the XML of the document and/or 2) the template on which the document
was based is located on another Sharepoint site which is encoded into
the template as well.

Is it possible to move InfoPath documents around like this and they
will still "work"? I mean, can I edit them, save them, and they go to
the right place?

Thanks!
Andrew
 
B

Bart

hi andrew

how did u add an event handler to the forms library in sharepoint???. I
thought it was only for the Document Library.

well as u have added it, the trick would be to open the form read the xml
and change the <?mso-infoPathSolution/> tag to the destination form library
Template
<?mso-infoPathSolution/> tag.

could u please descirbe how u added the event handler to a form library.

cheers
Bart
 
F

foomonkey

Forms libraries are just document libraries based on an Infopath
template. So, you add it in the exact same way you add an event handler
for a document library.

Modify Columns and Settings -> Change advanced settings. Fill out the
Assembly Name and Class Name.

So, your solution would be to actually hack the XML, correct? Is this a
Microsoft-recommended approach?

Thanks.
 
F

foomonkey

Oh yeah. I thought I knew XML but, after looking at the InfoPath flavor
of XML, I have a question. The <?xml... ?> prolog is common but, what
the heck are the <?mso... ?> things? They are not regular elements. How
would one go about parsing those with .NET's XML framework?

Thanks.
Andrew
 
B

Bart

They are called as Processing instructions, telling the parser to render the
xml content using Infopath and the contents of the xml is based on the
template (href.....).

the following link is a commandline toll to change the processing
instructions of an infopath file(Microsoft).


http://msdn.microsoft.com/library/d...html/ipsdkUsingThePIUpdateTool_HV01081782.asp


and regarding the processing instruction there is a seperate class for it

"XmlProcessingInstruction class"

cheers
Bart
 

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