Hi Jakob, Are you trying to insert from the boilerplate tab, from a search hit, or both?
To test boilerplate: save a document as XML from Word. (just as XML, not 2003 XML), save this to the database, and reference it in the config file found at Author/config/boilerplate.xml. Documents saved as XML are saved in what Microsoft calls OPC format. See http://community.marklogic.com/blog/smallchanges/2009-01-08 for more details. Then restart Word, place your cursor somewhere in the document, goto the boilerplate tab in the application, and click the button for the boilerplate you just added. You'll see that the code for boilerplate insert fetches the document from the Server and passes it to insertWordOpenXML() which inserts it at the current cursor location. If this works, we're on the right track. The insert function from the button on a search hit, takes a component found in a search ( a component being anything previously enriched from the enrich tab in the Authoring application and saved to MarkLogic ), and uses the XQuery API to format it as OPC, before inserting into the doc using the insertWordOpenXML() function. Are you starting with existing docs? Or docs from SharePoint? These may have XML elements we haven't seen yet that aren't accounted for in the XQuery API and so may cause an issue. You may want to start by Authoring new docs to test the functionality, then hammer it with your existing docs to break it. :) Hope this helps, Pete -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jakob Fix Sent: Thursday, February 23, 2012 8:39 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Word add-in and Word 2010 After having installed the Author sample application which is really rather cool, the insertion into the current document still doesn't work. While trying to understand, I noticed that the insert functionality expects the URI lexicon to be enabled which wasn't mentioned in the documentation but enabling that got me one step further. Now it seems that the items found cannot not be inserted anywhere in the current document. By the way, I stuck with the defaults right now (i.e. Policies, Sections, Recommendations). That's the error message: ERROR error: XML markup cannot be inserted in the specified location. which I was able to track down to this function in MarkLogicWordAddin: line 1368 MLA.insertWordOpenXML = function(opc_xml) and more particularly that line: line 1381 window.external.insertWordOpenXML(v_docx); Glad for any ideas cheers, Jakob. On Wed, Feb 22, 2012 at 17:59, Jakob Fix <[email protected]> wrote: > Thanks Pete, > > That's extra quick! :) > I got the zip. and am updating the msi as we speak. > > cheers, > Jakob. > > > > On Wed, Feb 22, 2012 at 17:45, Pete Aven <[email protected]> wrote: >> Hi Jakob, >> >>>>1) this add-in is supported for Word 2010 >> >> Though the Addin will install with Office 2010; the XQuery API with the >> Toolkit that is currently available on the Community site is only compatible >> with the 2007 flavor of WordprocessingML. >> >> The TK has been updated for 2010 support and is currently sitting in a >> repository where I'm told it will be released onto the unsuspecting, Office >> 2010-hungry masses at some point in the future. Until then, I've sent you a >> snapshot of the latest TK to your gmail. >> >>>>2) if so how can one debug this Javascript code (is there a Firebug-like >>>>tool for this?). >> >> Unfortunately, not really. Develop for the Addin application everything you >> can outside of the context of the Addin (In IE). You can use IE8 which has >> developer tools which are similar to firebug. Once the application is in >> the Addin however and calling the MLA functions, your only real option is to >> use alert()s (or write logs to the filesystem, which you can do with >> JavaScript in IE). >> >>>> MLA.insertBlockContent(response.responseXML); >> >> This function really should be deprecated. Instead of the simple >> Sample, I'd suggest using the Sample Authoring App to enrich/insert >> content, and taking a look at the function MLA.insertWordOpenXML(). >> Once you grok this function, you will keep Word in a headlock and >> pretty much have your way with it. :) >> >> Hope this helps, >> Pete >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of Jakob >> Fix >> Sent: Wednesday, February 22, 2012 11:24 AM >> To: General Mark Logic Developer Discussion >> Subject: [MarkLogic Dev General] Word add-in and Word 2010 >> >> Hello again, >> >> I've installed successfully the Word add-in and am able to search using the >> sample provided in the download. >> >> However, the double-click on a found paragraph does not insert it >> into the currently open word document. Probably, things have changed >> from >> 2007 to 2010. Looking at the Javascript code in Samples/search/search.js I >> find this line: >> >> MLA.insertBlockContent(response.responseXML); >> >> which seems to be responsible for the insertion of the paragraph. >> >> So, I guess my question is whether 1) this add-in is supported for Word 2010 >> and 2) if so how can one debug this Javascript code (is there a Firebug-like >> tool for this?). >> >> cheers, >> Jakob. >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
