marcel gnoth, nteam gmbh smarte und verbundene dokumente mit office 2003 und.net entwickeln...
TRANSCRIPT
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smarte und verbundene Dokumente mit
Office 2003 und .NET entwickeln
Geschäftsdaten intelligent mit Dokumenten verbinden
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Zur Person
• Dipl. Inf. Marcel Gnoth, MCSD– www.gnoth.net
• NTeam GmbH, Berlin– www.nteam.de– Leiter Softwareentwicklung– MS Gold Partner Busines Intelligence, Information Worker,
Advanced Infrastructur
• Autor dotnetpro und dotnet-magazin• Trainer (u.a. SPC Berlin, www.spc.de )• Themen
– VB6, COM– Datenbanken, Yukon– Verteilte Informationssysteme mit .Net– Office System 2003 Integration
– Reisen in ferne Länder: www.gnoth.net/reise.htm
Marcel Gnoth, NTeam GmbH www.gnoth.net
Agenda
• Einleitung • VBA und das Web Services Toolkit 2.01• Research Services• XML-Schemata und Office Dokumente• Smart Documents (ISmartDocument)• VSTO 2003• VSTO 2005 Beta• Smart Tags• Information Bridge Framework (IBF)• Fazit
Marcel Gnoth, NTeam GmbH www.gnoth.net
Einleitung
Office in den Unternehmen
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Office als Client
• Mehr als 400 Mio Officeinstallationen• Für sehr viele Menschen ist Office das
Hauptwerkzeug im Büro• Wie kann Ihnen das Arbeiten leichter gemacht
werden?• Wenige neuen Features,• Bessere Integration in die Unternehmens IT
Marcel Gnoth, NTeam GmbH www.gnoth.net
Probleme im Büroalltag für Anwender...
• Anwender muss Informationen in verschiedenen Systemen zusammensuchen– Outlook, SharePoint– CRM, in HR, in SAP, in ... – Anwender muss in der Lage sein, diese Systeme zu
bedienen, auch wenn er/sie nur selten damit arbeitet
• Keine Unterstützung bei der Dateneingabe– Viel manuelle Tipparbeit
• Austausch zwischen den verschiedenen Systemen könnte für den Anwender leichter sein.– Nur Copy & Paste– Oder abtippen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Probleme im Büroalltag für IT ...
• Office Dokumente sind Freitext– Nutzer kann fehlerhafte, unstrukturierte Eingaben machen– schlechte Datenqualität– Parsen nach Informationen aufwendig
• Dokumentformat properitär– Elektronische Verarbeitung (auf Servern) aufwendig– Austausch mit anderen heterogenen Systemen schwierig
Marcel Gnoth, NTeam GmbH www.gnoth.net
Unterstützung durch Office 2003
• Dokumente können als XML gespeichert werden– Austausch mit anderen Systemen– Verarbeitung auf dem Server ohne Office
• Verknüpfen eines Office Dokumentes mit einem XML-Schema– Prüfen von Nutzereingaben auf Fehler– Daten können einfach elektronisch weiterverarbeitet und
ausgetauscht werden
Marcel Gnoth, NTeam GmbH www.gnoth.net
Unterstützung durch Office 2003
• Kontextbezogene Informationen bereitstellen– Aggregation von Informationen aus verschiedenen
Systemen– Recherchieren von Informationen– Einfügen von Daten in ein Office Dokument
• Vermeidet Fehleingaben• Erhöht Datenqualität
Marcel Gnoth, NTeam GmbH www.gnoth.net
Viele Wege führen nach Friedrichshagen ...
• Microsoft hat viel Energie unter die Oberfläche von Office gesteckt
• Die Anwender verwenden eh nur 10% der Möglichkeiten
• Deshalb viel Energie auf – Smart Clients und– Unterstützung von Information Workern
• Leute die schnell, einfach auf viele Infos zugreifen müssen
• Das (stärkste) Argument für Office 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Werkzeuge
• Viele Ansätze • Taskpane / Aufgabenbereich
– Formulare zur Dateneingabe– Nachschlageergebnisse– Informationen / Aktionen
• XML-Schemata – Kein Freitext mehr– Kontextbezogener Zugriff auf TaskPane
• Smart Tags– Kontextbezogener Zugriff auf TaskPane– Aktionen und Infos zu einem ausgewählten Wort
• Webservice Zugriff– Nachschlagewerke, Datenaustausch
Marcel Gnoth, NTeam GmbH www.gnoth.net
Umsetzungen
• Und ich dachte immer Officeprogrammierung ist langweilig – Office VBA
• VS.Net, Toolkits und Werkzeuge ohne Ende ... – XML, Research Service, Smart Tags, Smart Document,
ISmartDocument, IBF, VSTO 2003 und 2005, WS für VBA, MOSTL, RSDE, RSCL, RSTV, MOSTL, SharePoint, ...........
Marcel Gnoth, NTeam GmbH www.gnoth.net
Technologieübersicht
• TaskPane– Research Services– IBF– ISmartDocument– VSTO 2003+2005
• Im Dokument– SmartTags– XML– VSTO 2005
• Kontextbezogene Hilfe
Marcel Gnoth, NTeam GmbH www.gnoth.net
VBA und Webservices
Zugriffe auf die schöne, bunte Web Service Welt von VBA aus
Webservice Toolkit 2.01
Marcel Gnoth, NTeam GmbH www.gnoth.net
Office 2003 Webservice Toolkit 2.01
• Separater Download
• Tools -> Add Webreferenz
• Erzeugt VBA-Proxyklassen
• Dynamische Listen über WS Zugriff– Amazon, eBay, ...
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
VBA und Webservices
Webservice Toolkit 2.01
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fazit
• Sehr leichte Einbindung von WS in VBA
Marcel Gnoth, NTeam GmbH www.gnoth.net
Research Services
Nachschlagewerke für das eigene UnternehmenWebservices und die TaskPane
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Research Services (RS) – Überblick
• Recherche von Informationen über Webservices– Word, Excel, PPT, Outlook, Publisher, OneNote, Visio, IE
• Anzeige der Informationen in der TaskPane• Übernahme von Daten in das Dokument
• Office eigene Dienste• Kommerzielle Anbieter• Eigenentwicklung
– WS mit beliebiger Sprache implementieren– WS kann auf beliebiger Plattform laufen– WS muss zwei XSD – Schemata unterstützen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Verfügbare Research Services
• Lokal auf dem Computer– Thesaurus und Übersetzung
• Office 2003 Research Services– Wörterbuch, Enzyklopädie, Web Suche, Aktienkurse
• Kommerzielle Anbieter– Factiva, eLibrary, Gale, WorldLingo– Weitere werden kommen
• SharePoint Portal server
Marcel Gnoth, NTeam GmbH www.gnoth.net
Research Beispiele
Marcel Gnoth, NTeam GmbH www.gnoth.net
Eigene Research Services entwickeln
• Beliebige Sprache, beliebige Plattform• Ein Webservice mit zwei Methoden
– Register (oder Registry-Keys direkt schreiben)– Query– SOAP Response muß Schemata entsprechen
• MS Werkzeuge– RS - SDK– RS - Development Extras
• RS mit Smart Tags erweitern– Daten in das Dokument einfügen– Andere Aktionen starten ...– Dll auf dem Client benötigt!
Marcel Gnoth, NTeam GmbH www.gnoth.net
RS – Schemata
Marcel Gnoth, NTeam GmbH www.gnoth.net
RS SDK – Schemata
• WS Registration– Request– Response
• WS Query– Request– Response
• Beispiele, Doku, Schemata
• Codieren der Werbservice Antworten ist „fummlig“– (zu) viel Handarbeit– Nicht wirklich schön
.WriteStartElement("Content", ns:="urn:Microsoft.Search.Response.Content")
.WriteElementString("P", "Folgende Pokemon wurden gefunden:")
.WriteStartElement("Image source=""" + pathHTTP + "Pokemon/Gengar.gif"" ")
.WriteEndElement()
.WriteElementString("P", "Name: " + m_Pokemons.Name)
.WriteStartElement("Tabular")
.WriteStartElement("Record")
.WriteElementString("Name", "Type")
Marcel Gnoth, NTeam GmbH www.gnoth.net
RS – Smart Tags
• Verwenden von Smart Tag Actions• Definiert durch Query Response• Simple Smart Tags
– Insert, Copy, NewQuery, Hyperlink
• Smart Tag API– Dll– Sehr flexibel
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
RS Hallo WeltSmartTag
Northwind RS
Research Services
Marcel Gnoth, NTeam GmbH www.gnoth.net
RS – Development Extras (RSDE)
• Separater Download• Research Services Class Library (RSCL)
– OO-Wrapper für SDK Schemata– Macht das Leben leichter– Mit Quellcode
• RSCL Wizard – Neuer Projekttyp– Mit Quellcode
• Viele Samples• Research Services
Tracing and Validation Tool (RSTV)
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
RSCL Wizard und RSTV
RSDE
Marcel Gnoth, NTeam GmbH www.gnoth.net
Deployment / Registry
• Installation durch Anwender– Eingabe der URL
• Installation durch Admin– Verwenden einer .reg - Datei
• HKEY_CURRENT_USER\Software\Microsoft\...…Office\11.0\Common\Research
• HKEY_LOCAL_MACHINE\Software\Microsoft\...…Office\11.0\Common\Research
• Ausnahme: eigene Smart – Tags – Dll auf dem Client– Später mehr
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fazit
• Einfache Recherche aus Office Applikationen heraus
• Kombinieren mit Volltextsuche des SQL Servers
• Dynamisches Update
• WS können auf jedem System gehostet werden!
SELECT ProductName, QuantityPerUnitFROM ProductsWHERE CONTAINS(ProductName, ' FORMSOF (INFLECTIONAL, dry) ')
Marcel Gnoth, NTeam GmbH www.gnoth.net
XML – Schemata und Office Dokumente
Schluss mit dem Freitext
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Überblick
• Office Dokumente (Freitext) mit einem XML-Schema verknüpfen
• Daten können als XML gespeichert (und weiterverarbeitet) werden
• Trennung der Daten von der Präsentation
Marcel Gnoth, NTeam GmbH www.gnoth.net
XML in Office
• Offenes XML-Dateiformat
• Verknüpfen der Dokumente mit einem XML-Schema
• GUI-Integration über Aufgabenbereich(auch Outlook ein bisschen)
Marcel Gnoth, NTeam GmbH www.gnoth.net
Freitext
Marcel Gnoth, NTeam GmbH www.gnoth.net
Freitext
Marcel Gnoth, NTeam GmbH www.gnoth.net
Inhalt als XML
<ConferenceReport> <Date>3/24/2004</Date> <Summary> <Keyword>XML Conference (Europe)</Keyword> <Abstract>Role of XML on the Desktop</Abstract> </Summary> <Attendees> <Attendee Name="John" Doe”> <Department>Health Agency</Department> <Potential> <Sales>100</Sales> <Growth>25%</Growth> <Remarks>The team comprises great innovators</Remarks> <ToDo>Contact their IT Manager</ToDo> </Potential> </Attendee> <Attendee Name="Judith" Jones”> <Department>Finance Agency</Department> </Attendee> </Attendees> <Conclusion>Organize another European tour </Conclusion></ConferenceReport>
Marcel Gnoth, NTeam GmbH www.gnoth.net
Formatierungen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Formatierung als XML
• WordML• Eigenes Schema• HTML ähnlich• Keine verschachtelten
Tags
<w:p> <w:r> <w:rPr> <w:b /> </w:rPr> <w:t>John Doe</w:t> </w:r> <w:r> <w:rPr> <w:i /> </w:rPr> <w:t>Health Agency</w:t> </w:r></w:p>
Marcel Gnoth, NTeam GmbH www.gnoth.net
Dokumente und XML-Schemata
• Selbstdefinierte (Geschäfts-) Schemata– Datenorientiert
• Kunde, Auftrag, Mitarbeiter, ...
– Erlauben Zerlegung des Dokumentes in Datenelemente
• MS-Referenz-Schemata– Präsentationsorientiert
• Fett, Kursiv, Tabelle, Zelle, ...
– WordprocessingML, SpreadsheetML, FormTemplate, DataDiagramingML
– Offen und Lizenzgebührenfrei– Erzeugen und verändern von Officedokumenten
auf dem Server ohne Office– Austausch in heterogenen Systemen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Hello Word in WordML
<?mso-application progid="Word.Document"?><w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Title>Hello World</o:Title><o:Author>John Peltonen</o:Author><o:LastAuthor>John Peltonen</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>0</o:TotalTime><o:Created>2004-02-18T04:15:00Z</o:Created><o:LastSaved>2004-02-18T04:15:00Z</o:LastSaved><o:Pages>1</o:Pages><o:Words>1</o:Words><o:Characters>12</o:Characters><o:Company>3SHARP</o:Company><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>12</o:CharactersWithSpaces><o:Version>11.5604</o:Version></o:DocumentProperties><w:fonts><w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/></w:fonts><w:styles><w:versionOfBuiltInStylenames w:val="4"/><w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/><w:style w:type="paragraph" w:default="on" w:styleId="Normal"><w:name w:val="Normal"/><w:rPr><wx:font wx:val="Times New Roman"/><w:sz w:val="24"/><w:sz-cs w:val="24"/><w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/></w:rPr></w:style><w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:semiHidden/></w:style><w:style w:type="table" w:default="on" w:styleId="TableNormal"><w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/><w:semiHidden/><w:rPr><wx:font wx:val="Times New Roman"/></w:rPr><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="list" w:default="on" w:styleId="NoList"><w:name w:val="No List"/><w:semiHidden/></w:style></w:styles><w:docPr><w:view w:val="print"/><w:zoom w:percent="100"/><w:displayBackgroundShape/><w:doNotEmbedSystemFonts/><w:proofState w:grammar="clean"/><w:attachedTemplate w:val=""/><w:defaultTabStop w:val="720"/><w:punctuationKerning/><w:characterSpacingControl w:val="DontCompress"/><w:optimizeForBrowser/><w:validateAgainstSchema/><w:saveInvalidXML w:val="off"/><w:ignoreMixedContent w:val="off"/><w:alwaysShowPlaceholderText w:val="off"/><w:compat><w:breakWrappedTables/><w:snapToGridInCell/><w:wrapTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr><w:body><wx:sect><w:p><w:r><w:t>Hello WordML!</w:t></w:r></w:p><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="720" w:footer="720" w:gutter="0"/><w:cols w:space="720"/><w:docGrid w:line-pitch="360"/></w:sectPr></wx:sect></w:body></w:wordDocument>
Marcel Gnoth, NTeam GmbH www.gnoth.net
Hello World-etwas schöner
<?mso-application progid="Word.Document"?><w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-
microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Title>Hello World</o:Title><o:Author>John Peltonen</o:Author><o:LastAuthor>John Peltonen</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>0</o:TotalTime><o:Created>2004-02-18T04:15:00Z</o:Created><o:LastSaved>2004-02-18T04:15:00Z</o:LastSaved><o:Pages>1</o:Pages><o:Words>1</o:Words><o:Characters>12</o:Characters><o:Company>3SHARP</o:Company><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>12</o:CharactersWithSpaces><o:Version>11.5604</o:Version></o:DocumentProperties><w:fonts><w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/></w:fonts><w:styles><w:versionOfBuiltInStylenames w:val="4"/><w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/><w:style w:type="paragraph" w:default="on" w:styleId="Normal"><w:name w:val="Normal"/><w:rPr><wx:font wx:val="Times New Roman"/><w:sz w:val="24"/><w:sz-cs w:val="24"/><w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/></w:rPr></w:style><w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:semiHidden/></w:style><w:style w:type="table" w:default="on" w:styleId="TableNormal"><w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/><w:semiHidden/><w:rPr><wx:font wx:val="Times New Roman"/></w:rPr><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="list" w:default="on" w:styleId="NoList"><w:name w:val="No List"/><w:semiHidden/></w:style></w:styles><w:docPr><w:view w:val="print"/><w:zoom w:percent="100"/><w:displayBackgroundShape/><w:doNotEmbedSystemFonts/><w:proofState w:grammar="clean"/><w:attachedTemplate w:val=""/><w:defaultTabStop w:val="720"/><w:punctuationKerning/><w:characterSpacingControl w:val="DontCompress"/><w:optimizeForBrowser/><w:validateAgainstSchema/><w:saveInvalidXML w:val="off"/><w:ignoreMixedContent w:val="off"/><w:alwaysShowPlaceholderText w:val="off"/><w:compat><w:breakWrappedTables/><w:snapToGridInCell/><w:wrapTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr>
<w:body><wx:sect><w:p><w:r><w:t>Hello World!</w:t></w:r></w:p><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440"
w:left="1800" w:header="720" w:footer="720" w:gutter="0"/><w:cols w:space="720"/><w:docGrid w:line-pitch="360"/></w:sectPr></wx:sect>
</w:body></w:wordDocument> Section PropertiesSection Properties
Namespace DeclarationsNamespace Declarations
Document PropertiesDocument Properties
Marcel Gnoth, NTeam GmbH www.gnoth.net
WordML – im Detail
• XML erlaubt keine überlappenden Tags wie HTML:<p><b>This is some <i>bolded</b> and Italicized text</i></p>
• WordML:<p>
<r><rPr> <b/> </rPr><t>This is some</t></r><r><rPr> <b/> <i/> </rPr>
<t>bolded</t></r>
... etc ...</p>
Marcel Gnoth, NTeam GmbH www.gnoth.net
XML und Word
Plain XML vs Word XML:
Your XML
WordMLMicrosoft Corp.
2/21/2003
Strong Buy
Word
Microsoft Corp.
2/21/2003
Strong Buy
Microsoft Corp.
2/21/2003
Strong Buy
Save ‘Data Only’ or Transform
Transform
Open/Save
Database
WYSIWYG Web Page
Microsoft Corp.
2/21/2003
Strong Buy
Transform
Marcel Gnoth, NTeam GmbH www.gnoth.net
XML in Word-Formularen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Word – XML – Excel
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
XML - Schema Validierung
• Bei der Eingabe
• Platzhalter bei der Eingabe• Dokumente schützen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Schemalvalidierung und Platzhalter
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fazit
• XML-Format eröffnet viele neue Wege– Verarbeiten von Dokumenten ohne Office– Schemavalidierung– Datenaustausch
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smart Documents
ISmartDocumentCOM Schnittstelle
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smarte Dokumente
• Programmieren der Taskpane• Dokument mit benutzerdefinierten
Schema verknüpft• Code wird Elementen des
Schemas zugeordnet• Code
– Lokal auf Client oder – auf Server – Wird auf dem Client ausgeführt
• Erhöhte Sicherheit• Einfaches Deployment
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smart Document - Komponenten
• Dokument mit XML Schema
• Solution URL verweißt auf XML-Manifest
• Manifest beschreibt Dateien des XML-Expansion Pack‘s– Code (Dll), Bilder, Daten
• Komponenten können von Webserver geladen werden
• Jetzt ist das Doc Smart
XML SchemaXML Schema
DocumentDocument
XML ManifestXML Manifest
namename
addressaddress
dlldll imageimage schemaschema configconfig
Solution URLSolution URL
Marcel Gnoth, NTeam GmbH www.gnoth.net
Wo zu finden ..?
• Word 2003 und Excel 2003
• Word: Tools -> Templates and Add-ins
• Excel: Data -> XML -> XML Expansion Packs
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smart Dokument Installation
• Manifest muß signiert sein
• Manifest mußvon einemvertrautenServer stammen
• .net CAS
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
SmartDoc verwenden
Smart Documents
Marcel Gnoth, NTeam GmbH www.gnoth.net
Das Manifest<manifest xmlns="http://schemas.microsoft.com/office/xmlexpansionpacks/2003"> <version>1.0</version> <uri>NorthwindSmartDocDemo</uri> <solution> <solutionID>Smart Doc Files</solutionID> <type>smartDocument</type> <alias lcid="1033">Northwind Smart Document Demo</alias> <file> <type>solutionActionHandler</type> <managed /> <version>1.1</version> <filePath>NorthwindSmartDoc.dll</filePath> <CLSNAME>NorthwindSmartDoc.DocActions</CLSNAME> </file> <file> <type>other</type> <version>1.2</version> <filePath>Interop.SmartTagLib.dll</filePath> </file> </solution> <solution> <solutionID>Schema Files</solutionID> <type>schema</type> <alias lcid="1033">Northwind Work Absence Form Schema</alias> <file> <runFromServer /> <type>schema</type> <version>1.0</version> <filePath>workabsence.xsd</filePath> </file> </solution></manifest>
Marcel Gnoth, NTeam GmbH www.gnoth.net
ISmartDocument
• COM – Schnittstelle – VB6 oder .Net oder VC++ oder Delphi – Office Setup
• PIA‘s für Word/Excel und Smart Tag Support mitinstallieren !!!
– 17 Methoden• Populate• OnChange
– 8 Eigenschaften
Marcel Gnoth, NTeam GmbH www.gnoth.net
Namespace
• XML-Schema
• ISmartDocument-Porperties– SmartDocXmlTypeCaption– SmartDocXmlTypeCount– SmartDocXmlTypeName
(Zuordnung zwischen Schema-Elementen und dem Code)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:www.gnoth.net.PokemonSD"> <xsd:element name="Name" type="xsd:string" /> <xsd:element name="Skill" type="xsd:string" /> <xsd:element name="Type" type="xsd:string" /></xsd:schema>
Public Const BASEURI As String = "urn:www.gnoth.net.PokemonSD"Public Const Poke_NAME As String = BASEURI & "#Name"Public Const Poke_SKILL As String = BASEURI & "#Skill"Public Const Poke_TYPE As String = BASEURI & "#Type"Public Const TYPESCOUNT As Integer = 3
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fröhliches Late Binding mit Zahlen
http://msdn.streetmarket.com/hr#VacationRequest
101
102
103
104
105
ControlCount = 5ControlIndex + 100
Marcel Gnoth, NTeam GmbH www.gnoth.net
Ablauf
Specify control behaviour, as required (0..n)
Populate each control, as required (0..n)
Define each element’s TaskPane controls
Define all elements
start
SmartDocInitialize
SmartDocXMLTypeCount
ControlCount
ControlID
ControlNameFromID
ControlCaptionFromID
ControlTypeFromID
PopulateActiveXProps
PopulateCheckbox
PopulateDocumentFragment
PopulateHelpContent
PopulateImage
PopulateListOrComboContent
PopulateOther
PopulateRadioGroup
PopulateTextboxContent
ImageClick
InvokeControl
OnCheckboxChange
OnListOrComboSelectChange
OnPaneUpdateComplete
OnRadioGroupSelectChange
OnTextboxContentChange
end
For each Type...
SmartDocXMLTypeName
SmartDocXMLTypeCaption
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Smart Doc implementieren
Smart Documents
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smart Doc Security
• Manifest Security Check– Tool verwenden um Manifest und Code zu signieren– xmlsign.exe, SmartDoc SDK– Kann auf Entwicklerrechnern deaktiviert werden
• Kleine Regdatei
– Quellserver muß zu Trusted Sites gehören• Localhost = Intranet, trusted• 127.0.0.1 = nicht vertraut
[HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Common\Smart Tag]"DisableManifestSecurityCheck"=dword:00000001
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smart Document Security - CAS
• .Net – Code Access Security (CAS)– Für Dateien, die auf den Client runtergeladen und
ausgeführt werden sollen– CAS kann zentral von Admins ausgerollt werden– Detaillierte Einstellungen
Caspol.exe -ag All_Code -url "file://C:/Smart Doc Files/*" FullTrust -n NorthwindSmartDocDemo
Marcel Gnoth, NTeam GmbH www.gnoth.net
Vertigo Wraper
• Kostenlos, mit Quellcode nicht supported– http://vertigosoftware.com/wrapper– Gute FAQ!
• Neue Projekttypen in VS.Net
• Kapselt das ISmartDocument Interface– Objektorientiert – Programmierung einfacher– Weniger Flexibilität
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fazit
• Sicherheit und Deployment• Endanwender erhält kontextsensitive Hilfe
• Entwicklung ist nicht so elegant • COM – basierte Schnittstelle (PIA)
• Wird mit VSTO 2005 obsolet
Marcel Gnoth, NTeam GmbH www.gnoth.net
VSTO 2003
Visual Studio Tools für Office V1.0
Word und Excel mit VS.Net programmieren
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Überblick
• Strategisches Tool für die Office programmierung– VSTO 2003 nur für Word und Excel– VSTO 2003 ist eine V1.0,
der nächste Sprung kommt mit VSTO 2005– Office Applikationen haben COM-API
• VSTO soll Interop erleichtern
• VSTO bietet:– Vorlagen für VS.Net– Aktualisiert lokale Entwicklereinstellungen (CAS)– Code Behind – Modell, aber keine Office Designer
• Gedacht für professionelle Entwickler– VS.Net– .Net Framework– Wird nicht VBA ersetzen (Für Enduser)
Marcel Gnoth, NTeam GmbH www.gnoth.net
VSTO – Entwicklert programmiert
RuntimeRuntime
Design timeDesign time
DeveloperDeveloper
Visual StudioVisual Studio
Marcel Gnoth, NTeam GmbH www.gnoth.net
RuntimeRuntime
Design timeDesign time
Business LogicBusiness Logic
DeveloperDeveloper
Code will typically be stored on a share or server for easy deployment and maintenance
.NET Assembly
.NET Assembly
Visual StudioVisual Studio
VSTO – Deployment
Marcel Gnoth, NTeam GmbH www.gnoth.net
RuntimeRuntime
Design timeDesign time
Business LogicBusiness Logic
ExcelExcel
Assembly is downloaded from share or server and code runs, subject to restricted security policy
.NET Assembly
.NET Assembly
.NETSecurityPolicy
VSTO – Anwender
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Erzeugen einer VSTO Lösung
VSTO 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Sicherheit VBA
• Code in Dokumenten wird geblockt– Low, Medium, & High security modes
• AuthentiCode signatures for code authenticity• Codeausführung: Alles oder nichts• Anwender treffen „mutige“ Entscheidungen
– „Dumm, aber glücklich!“
Marcel Gnoth, NTeam GmbH www.gnoth.net
Überblick - Sicherheit
• VSTO erzeugt normale .Net Assemblies• Code Access Security (CAS) muß auf dem Client
konfiguriert sein• Keine Entscheidung des Anwenders
– Kein „Makro aktivieren J/N“
• Auf Entwicklerrechner wird die CAS bei Projekterstellung durch VSTO aktualisiert
Marcel Gnoth, NTeam GmbH www.gnoth.net
Verknüpfung Dokument – Assembly
• Document Property wo Assembly liegt• CAS• Wenn Web offline, dann lädt Word
vom Assembly Cache
Marcel Gnoth, NTeam GmbH www.gnoth.net
Überblick Deployment
• Click Once Depolyment
• Komponenten einer VSTO Solution:– Quellcode (im Source Safe )– Kompiliertes Assembly auf einem Server– Office Dokument
• Enthält Link zum Assembly auf dem Server
• Zentrales Update auf dem Server
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Security & Deployment
VSTO 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fazit
• Ziemlich wenig bis jetzt• Hilft bei einigen Details bis jetzt
• Fast das Gleiche kann auch ohne VSTO mit normalem COM Interop erreicht werden
• Der große Wurf wird erst mit der nächsten Version kommen– Aufgaben Bereich / Task pane– Offline Daten / Data Island– u.a.
Marcel Gnoth, NTeam GmbH www.gnoth.net
VSTO 2005 Beta 1
Jetzt gehts erst richtig los
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
VSTO Roadmap
Office Professional Edition 2003Office Professional Edition 2003
Visual Studio Visual Studio projects for Word projects for Word and Exceland ExcelDocument-centric Document-centric customizationscustomizations
Version 2003Word and Excel Word and Excel hosted in VS IDE hosted in VS IDE View controlsView controlsActionsPaneActionsPaneSchema-based Schema-based programming programming modelmodelServer-accessible Server-accessible data islanddata island
Version 2005
Visual Studio .NET 2003Visual Studio .NET 2003 Visual Studio 2005Visual Studio 2005
Marcel Gnoth, NTeam GmbH www.gnoth.net
Neue Designer1. Drag+Drop onto Designer
2. Designer-generated
managed classes
3. First-class
managed citizens
Marcel Gnoth, NTeam GmbH www.gnoth.net
Programmierbare TaskPane1. Design a UserControl
2. Add control behaviour
3. Add the control to the ActionsPane
Marcel Gnoth, NTeam GmbH www.gnoth.net
So schauts dann aus...
Marcel Gnoth, NTeam GmbH www.gnoth.net
XML Knoten und die TaskPane
1. Design multiple
UserControls
2. Map XML schema
3. Code UserControl behaviour
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Die TaskPane
Marcel Gnoth, NTeam GmbH www.gnoth.net
Dateninseln im Dokument1. Attribute the DataSet as Cached
2. The DataSet
is Cached as XML in
the doc
• Vorteile– Office Dokumente auf dem Server verarbeiten– Offline Modus
Marcel Gnoth, NTeam GmbH www.gnoth.net
Data Islands auf dem Server
• Keine Officeinstallation auf dem Server
ServerDocument doc = new ServerDocument("expenses.xls");CachedDataItem cdi = _ doc.CachedDataManifest.Views["Sheet1"].CachedData["Expenses"];cdi.Xml = "new xml string";
Marcel Gnoth, NTeam GmbH www.gnoth.net
VS Tools für Office 2005
Windows Client
Microsoft Office Professional 2003
.NET Framework
Schemas
Data Island
VSTO Runtime
Web Web ServicesServices
Client
VSTO Assembly
Deployment Server
LoB Data
Marcel Gnoth, NTeam GmbH www.gnoth.net
VSTO 2005
• Data Island Zugriff auf dem Server
Windows Server
.NET Framework
Data CacheData Island
Server-side
Assembly
Server
VSTO ServerDocument Assembly
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smart Tags
Kontextbezogene Hilfe
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Was sind SmartTags?
• Verknüpfen Text in Dokumenten mit Geschäftsprozessen
Smart Tag Action Button
Lila gepunktete Linie: Smart Tag Kennzeichnung
Marcel Gnoth, NTeam GmbH www.gnoth.net
Entwicklung von Smart Tags
• Microsoft Office Smart Tag List (MOSTL)– Für “einfache” Smart Tags– Leichte Entwicklung und Deployment– Können automatisch aktualisiert werden
• Smart Tag API– Alle Möglichkeiten des .Net Frameworks– Programmierung (COM-Interface)
• C#, VB.NET, C++ oder VB6• .Net Applikationen verwenden COM Interop oder VSTO Loader
– Benötigen Setup (Einträge in die Registry)
Marcel Gnoth, NTeam GmbH www.gnoth.net
MOSTL
• Erzeugen einer XML DateiC:\Programme\Gemeinsame Dateien\Microsoft Shared\Smart Tag\LISTS\1031
<FL:smarttaglist xmlns:FL="urn:schemas-microsoft-com:smarttags:list"> <FL:smarttag type="urn:lamborghini-com:cars#car"> <FL:caption>Lamborghini Cars</FL:caption> <FL:terms> <FL:termlist>350, 400, Countach, Diablo, Espada, Gallardo, Islero, Jalpa, Jarama, LM002, Miura, Murcielago, Silhouette, Urraco</FL:termlist> </FL:terms> <FL:actions> <FL:action id="Information"> <FL:caption>&View Information</FL:caption> <FL:url>http://www.lamborghini.com</FL:url> </FL:action> </FL:actions> </FL:smarttag></FL:smarttaglist>
Marcel Gnoth, NTeam GmbH www.gnoth.net
COM – API - SmartTagLib
• Dll – Projekt (Klassenbibliothek)• Verweis auf Microsoft Smart Tags 2.0 Type Library
COM Bibliothek• recognizer Klasse implementieren
– ISmartTagRecognizer(2)– ProgID und GUID Attribute
• action Klasse implementieren– ISmartTagAction(2)– ProgID und GUID Attribute
[ProgId("MlbSmartTag.Recognizer"),GuidAttribute("90D62E8D-79E3-4197-907F-BF3EC133698D"), ComVisible(true)]public class Recognizer : ISmartTagRecognizer2, ISmartTagRecognizer{ }
Marcel Gnoth, NTeam GmbH www.gnoth.net
COM – API - SmartTagLib
• Assembly Version konfigurieren– Default ändern von 1.0.* auf einen Wert
• Zum Debuggen die Start Action auf Word oder Excel setzen– Project Properties | Configuration Properties | Debugging |
Start Action | …… Start Application (C#)… Start external program (Visual Basic .NET)
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Smart Tag ProgrammierungResearch Services
Smart Tags
Marcel Gnoth, NTeam GmbH www.gnoth.net
Smart Tag Installation
• Setup Program installiert Dll• Muss registriert werden
– Als COM Komponente– Als Smart Recognizer und Action
• Selbstregistrierende DLL (ComRegisterFunctionAttribute)• Schlüssel bei der Installation erzeugen
HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Smart Tag\RecognizersHKEY_CURRENT_USER\Software\Microsoft\Office\Common\Smart Tag\Actions
• Wenn der VSTO Loader verwendet wird, dann CAS!
Marcel Gnoth, NTeam GmbH www.gnoth.net
Download Smart Tag Developer Tools
• Smart Tag Explorer – Zeigt an, welche Smart Tags auf einem Rechner aktiv sind
• Recognize Tester– Ermöglicht das Testen, ob ein Smart Tag bestimmte Tokens
erkennt
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Smart Tag Developer Tools
Smart Tags
Marcel Gnoth, NTeam GmbH www.gnoth.net
Information Bridge Framework
Office Dokumente mit verschiedenen LOB – Daten verknüpfen
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
Warum IBF ?
Find Customer Account Rep
Find Orders
MS Word Task Pane
Option1Option1
Child
ChildChildChild
Label
LabelMary : Ford order is late. Please investigate.
Unproduktiv und Fehleranfällig!
Copy & Paste
• Emails und Dokumente beziehen sich auf Geschäfts-Entitäten– Kunde, Bestellung, ...
• Oft befinden sich die Daten in verschiedenen Systemen
• Es gibt keinen einfachen Weg diese Daten in Beziehung zu setzen
• Einarbeitung in die Systeme• Copy & Paste ist einzige
Integration
Marcel Gnoth, NTeam GmbH www.gnoth.net
Warum IBF
• Verknüpft Office Documente mit Daten• Zugriff auf Daten über Webservices• Informationen werden komfortabel in der TaskPane
angezeigt
• Wenig Programmieren, deklarativer Ansatz
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Was kann IBF
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
IBF-Überblick-Grafik
• Web Service-basierende Architektur (SOA)• Zentraler Metadaten / GUI Server• Runtime für Smart Tag /
XML Ereignis Initiierung• Windows Forms und
Taskpane Unterstützung MetadataMetadata
FinanceFinance
ERPERP
CRMCRM
Smart ClientsSmart Clients
Web Web ServicesServices
Web Web ServicesServices
Marcel Gnoth, NTeam GmbH www.gnoth.net
IBF-Architektur
Windows 2003 Server Services
.NET Framework
IBF Metadata Store
SQL Server 2000
IBF (Metadata Service)
Windows Client
XML
Microsoft Office Professional Edition
Web Services.NET Framework
Information Bridge Framework
Client Server
CRM
ERP Other Data
Metadata Service
In
form
ati
on B
ridg
e E
ngin
e1User selects “Show
Details” from Smart
Tag
2
CAS Interprets “Context” using Metadata
3Call Web Service to retrieve data
Smart TagDisplays data in Taskpane
5
4 Returns data
Marcel Gnoth, NTeam GmbH www.gnoth.net
IBF-Architekur
Legacy Legacy AppApp
Workflow Workflow EngineEngine
SiebelSiebelSAPSAPMS-CRMMS-CRM
Information BridgeInformation Bridge
Back-end ServicesBack-end Services
ClientClient
Office Office ApplicationApplication
Smart TagSmart Tag
Smart DocSmart Doc
Task Pane Task Pane ManagerManager
Host Host RendererRenderer
IBF - UIIBF - UI
IBF IBF EngineEngine
Metadata Metadata CacheCache
Metadata Metadata DesignerDesigner
Metadata Metadata Web ServiceWeb Service
MetadataMetadata
Compliant Compliant Service Service AdapterAdapter
Compliant Compliant Service Service AdapterAdapter
Compliant Compliant Service Service (Native)(Native)
BizTalk BizTalk EAIEAI
Existing Existing Web Web
ServiceService
XML Instance XML Instance DataData
MetadataMetadata
Marcel Gnoth, NTeam GmbH www.gnoth.net
IBF-Entwicklung
Let‘s walking through the dark forrest …
Inspiriert durch Vijay Desai. (Sep, 2004)http://www.persistent.co.in/knowledgecenter/InformationBridgeFramework.pdf
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
Überblick einer einfachen IBF-Entwicklung
1. Sorgfältige Planung (Use Cases)2. Definieren von:
– Entities (Geschäftsobjekten)– Beziehungen der Entities untereinander– Views (Darstellung der Geschäftsobjekte)– Operations (Welche Aktionen)
3. Erzeugen eines /mehrerer Webservice– Nach Möglichkeit IBF-konform (nicht zwingend)
4. XML Strukturen von Entities erzeugen– WsdlToMetadata.exe
5. Metadaten mit VS.Net-Metadata-Explorer erzeugen6. SmartTag entwickeln7. GUI entwickeln (UserControl), nicht zwingend
Marcel Gnoth, NTeam GmbH www.gnoth.net
Planung - Anwendungsfälle
• Applikation: GreetingService• Anwender öffnet Word• Tippt Namen von Freunden ein• SmartTag-Recognizer erkennt Namen• Anwender ruft SmartTag->Show Detail auf• SmartTag-Action ruft IBF auf, übergibt erkannten
Anwendernamen• IBF ruft Webservices auf und erhält Ergebnis• Ergebnis wird in der TaskPane in einem
selbstentwickelten UserControl angezeigt
Marcel Gnoth, NTeam GmbH www.gnoth.net
Entities, Views, Operations
• Entity: Friend
• Schema
<Entity Name="Friend" DefaultReferenceSchemaName="FriendSchema">
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Friend"> <xs:complexType> <xs:attribute name="Name" type="xs:string" use="required"></xs:attribute> </xs:complexType> </xs:element></xs:schema>
Marcel Gnoth, NTeam GmbH www.gnoth.net
Entities, Views, Operations
• View: getGreetingMessage
• Schema
<GreetingMessage> <Salutation>Hello</Salutation> <Name>William</Name></GreetingMessage>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Salutation" type="xs:string"></xs:element> <xs:element name="GreetingMessage"> <xs:complexType> <xs:sequence> <xs:element ref="Salutation"></xs:element> <xs:element ref="Name"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Name" type="xs:string"></xs:element></xs:schema>
Marcel Gnoth, NTeam GmbH www.gnoth.net
Entities, Views, Operations
• Operation: GetGreetingMessage
<Operation Name="GetGreetingMessage" EntityName="Friend"> <InputSchemas> <SchemaInstance SchemaName="FriendSchema" Index="1" /> </InputSchemas> <OutputSchemas> <SchemaInstance SchemaName="GreetingMessageSchema" Index="1" /> </OutputSchemas></Operation>
Marcel Gnoth, NTeam GmbH www.gnoth.net
Der Webservice
• Neues Projekt: FriendService• Neuer WS: SayHello• Zwei neue Klassen für
– Friend-Entity– Enthält XML-Attribute
– GreetingMessage–View• ...
[XmlRoot("Friend", Namespace="urn-GreetingService-Data")] public class Friend { private string name; [XmlAttribute("Name")] public string Name { get { return this.name; } set { this.name = value; } } }
Marcel Gnoth, NTeam GmbH www.gnoth.net
3. Der Webservice
• Ein ganz normaler Webservice
• Testmethode einfügen (siehe Code)
[WebService(Name="Greeting Service", Description="A Service to send out greeting messages", Namespace="http://InformationBridge/SayHello")] public class SayHello : System.Web.Services.WebService { private GreetingMessage greetingMessage;
[WebMethod(Description="A method to greet a friend")] public GreetingMessage GetGreetingMessage(Friend aFriend) { greetingMessage = new GreetingMessage(); greetingMessage.Name = aFriend.Name; if (aFriend.Name=="Marcel") { greetingMessage.Salutation = "Hello "; } else { greetingMessage.Salutation = "Guten Tach "; } return greetingMessage; } }
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Webservice Projekt und Test
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
Metadaten anlegen
• Zwei Gruppen von Metadaten• Daten und Logik
– Webservice Zugriffe– Operations, Entities
• Darstellung– Views– GUI-Elemente in der TaskPane
• Neuer Projekttyp in VS.Net
Marcel Gnoth, NTeam GmbH www.gnoth.net
Metadaten-Typen
• Metadata = Ein Projekt der IBF Lösung• Entity = Geschäftsobjekt• View = eine Ansicht eines Geschäftsobjektes• Ports = Quelle für XML, Daten, Schemata, …• Schema = XML-Schema • Transformation = wandelt XML in anderes XML
Marcel Gnoth, NTeam GmbH www.gnoth.net
Entities und Views
• Eine Entity kann auf verschiedene Art Dargestellt werden
• Informationen können aus unterschiedlichen Quellen (WebServices) stammen
• Kunde– Finanzen– Bestellungen– Privates
Entity Entity (Author)(Author)Entity Entity
(Author)(Author)
View View (AuthorSummary)(AuthorSummary)
View View (AuthorSummary)(AuthorSummary)
View View (AuthorRoyaltyData)(AuthorRoyaltyData)
View View (AuthorRoyaltyData)(AuthorRoyaltyData)
Marcel Gnoth, NTeam GmbH www.gnoth.net
Überblick Metadaten
• In IBF gibt es eine ganze Reihe von Metadaten
Relationship View 2
Entity
Scope
Entity
(Output) Schema
Entity 2
(Input) Schema
Reference
Service Operatio
nInstance
View Locator
View 1
Entity 1
Service Operatio
nInstance
View Locator
Port
Marcel Gnoth, NTeam GmbH www.gnoth.net
Relationships
• Ein Autor hat viele Bücher geschrieben• Die Entitäten stehen in Beziehung zu einander• So kann der Anwender später ein Drill Down machen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Relationships von verschiedenen LOB Systemen
Office 2003Office 2003
IBF EngineIBF EngineMetadata
CacheMetadata
Cache
Information WorkerInformation Worker
Client sideClient side
Server sideServer side
Pubs databaseFulfillment
System
Web Service Web Service
Relationship in Metadata
• Informationen können aus mehreren LOB’s zusammengesammelt werden
Marcel Gnoth, NTeam GmbH www.gnoth.net
Metadaten – Geschäftsdaten
• Metadata Scope SayHello• Entity Friend • View GreetingMessage• Friend.DefaultViewName = GreetingMessage
• Port XML und Schema für Friend-Schema• Port XML und Schema für GreetingMessage-Schema
• Zuweisen der Schemata zuEntity und GreetingMessage
Marcel Gnoth, NTeam GmbH www.gnoth.net
Metadaten – Der Webservice
• Port SOAP für den Webservice anlegen– Hier wird die Webreferenz verlinkt
• Operation für GetGreetingMessage anlegen– Port SOAP zuordnen– Entity Friend zuordnen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Metadata
• Aktueller Stand der Metadaten
Metadata ScopeSayHello
EntityFriend
ViewGreetingMessage
DefaultViewName
Port FileXMLFriend Schema
Port File XMLGreetingMessage
Schema
Schema XSDFriendSchema
Schema XSDGreetingMessage
DefaultReferenzSchemaName
SchemaName
Port SOAPGreetingService
OperationSoapRequestGetGreetingMessage
Ports
Schemata
Operation
Port zum Webservice
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Metadata-Explorer und XML-Datei
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
Publishing Metadata
Marcel Gnoth, NTeam GmbH www.gnoth.net
Metadata Explorer: The Publish Metadata Dialog Box
Marcel Gnoth, NTeam GmbH www.gnoth.net
The Publishing Process
Metadata ServicesMetadata Services
VS .NETVS .NET
Metadata DesignerMetadata Designer
SQL ServerSQL Server
Client sideClient side
Server sideServer side
Office 2003Office 2003
IBF EngineIBF EngineMetadata
CacheMetadata
Cache
Information WorkerInformation Worker Solution DeveloperSolution Developer
ReadRead WriteWrite
XML File
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Publishing
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
Die GUI
Marcel Gnoth, NTeam GmbH www.gnoth.net
Die GUI
Title Bar
Region Caption
Region
Marcel Gnoth, NTeam GmbH www.gnoth.net
Die GUI – Eine Überschrift (Title bar)
• View GreetingMessage• Verfügt über MenuItemDefinition – Properties
– Menüaussehen wird über XML definiert– XML kommt aus einer Operation– MenuType = 1 (Anzeigen)– MenuDefinitionOp…Instance
hinzufügen– Operation hinzufügen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Die Operation
• Name des erkannten Freundes anzeigen• Input ist ein Schema vom Typ Friend das auch den
Namen (Attribut Name) enthält• Menüs müssen ein bestimmtes IBF Schema erfüllen• Output der Operation muß ein Schema vom Typ
MenuDefinitionSchema
• Deshalb Operation vom Typ:OperationTransformationAggregation
<xs:element name="ViewProperties" type="ViewPropertiesType" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="ViewPropertiesType" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:sequence> <xs:any namespace="##any" processContents="lax" minOccurs="0" /> </xs:sequence> <xs:attribute name="Caption" type="xs:string" use="optional" default="" /> <xs:attribute name="Description" type="xs:string" use="optional" default="" /> </xs:complexType></xs:element>
Marcel Gnoth, NTeam GmbH www.gnoth.net
Die Operation – Wir zeigen eine Überschrift an …
MenuItemDefinition
OperationTransformationAggregation
DefineMenuItemName
Port FileXMLFriend Schema
Port File XMLMenuDefinitionPort
Schema XSDFriendSchema
Schema XSDMenuDefinitionSchema
Port File XMLMenuDefinitionProvider
XSL
Transformation XSLMenuCaptionCreation
ViewGreetingMessage
Ports für XML-Text
Schemata
Operation wandelt Friend Input inMenuDefinition Output um
Marcel Gnoth, NTeam GmbH www.gnoth.net
Überschirft Metadaten
Anzeige der Knoten
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
Aktionen
• Aktionen bestehen aus Instanzen mehrerer Operationen
Marcel Gnoth, NTeam GmbH www.gnoth.net
Aktions Designer: Instanzen von Operationen erzeugen
Metadata Explorer
Action Canvas
Toolbox
Marcel Gnoth, NTeam GmbH www.gnoth.net
Aktions Designer – Parameter
• Die Operationen können sequentiell ausgeführt werden
• Über Transformationsinstanzen können Ein- und Ausgabeparameter zwischen den Operationsinstanzen zugewiesen werden
Marcel Gnoth, NTeam GmbH www.gnoth.net
Aktionen testen
Build & Execute Action Button
Build & Execute Action Context Menu Item
Marcel Gnoth, NTeam GmbH www.gnoth.net
Demo
Aktion aus VS heraus testen
Information Bridge Framework
Marcel Gnoth, NTeam GmbH www.gnoth.net
IBF
• Client– Microsoft Office System (InfoPath, Word, Excel, Visio, Outlook)– Visual Studio Tools for Office (VSTO)
• Actions Pane• Deep document centric integration with Word and Excel
– Information Bridge Framework (IBF)• Context & Action Services Engine (CAS)• Smart Tag driven• Windows Forms• Can use either use .NET Assemblies or Web Services
• Server– Microsoft Windows Server 2003
• IBF uses IIS6 for the reading/writing web services that access the metadata server.
– SQL Server 2000• Used as the Metadata Server store
– IBF• Metadata Server based on SQL Server 2000• Metadata store is relatively small (~5MB) as it only stores metadata and not data
directly.
Marcel Gnoth, NTeam GmbH www.gnoth.net
Server Konfig
All services reside on a single machine
Web services are hosted on one or more separate serversSQL Server 2000
MDS Read / WriteWeb Service
AuthorizationManager
MDS Read / WriteWeb Service
AuthorizationManager
SQL Server 2000Web Server
Marcel Gnoth, NTeam GmbH www.gnoth.net
Client Konfig
IIS & SQL Server 2000
MDS Read / WriteWeb Service
AuthorizationManager
Windows XP
Metadata Designer
Visual Studio .NET
Office 2003
IBF Client
IIS & SQL Server 2000
MDS Read / WriteWeb Service
AuthorizationManager
Metadata Designer
Visual Studio .NET
IBF Client
Office 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fazit
• Hohe Lernkurve– Sehr gute XML, XSL, XSD, … Kenntnisse !
• Entwicklung wird noch nicht genug unterstützt– Version 1.5 für QI 2005 geplant !– Unterstützung für Entwickler stark verbessert
• Zugriff auf beliebige Webservices möglich– Metadaten werden einfacher, wenn die Webservices sich
„wohlverhalten“ – Get und Put für Entitäten, Beziehungen zwischen Entitäten
• VSTO 2005 bietet ähnliche Funktionalität– Leichter für Entwickler mit .net Erfahrung
• Auf dem Client muss IBF Runtime sein
Marcel Gnoth, NTeam GmbH www.gnoth.net
Fazit
Und was nun ...?
Microsoft Office System 2003
Marcel Gnoth, NTeam GmbH www.gnoth.net
Ergebnisse
• VBA bleibt• VSTO 2005 wird ein großer Schritt nach vorn• IBF steckt noch in den Kinderschuhen, hat aber
großes Potential• Research Services: gutes Aufwand Nutzen Verhältnis• Formulare in Word oder InfoPath
– Je nach Schwerpunkt
• ISmartDocument ist aufwendig zu programmieren– Wird mit VSTO 2005 obsolet
• VSTO 2003 bringt nicht wirklich Punkte• Office Dokumente gewinnen viel durch XML
Unterstützung• Verbessertes Deployment und Security
Marcel Gnoth, NTeam GmbH www.gnoth.net
InfoPath 2003 Toolkit für VS.Net
Info Path mit Assemblies verknüpfen
Marcel Gnoth, NTeam GmbH www.gnoth.net
InfoPath Entwicklung
• Java Script oder VB Script• Mit dem Toolkit kann auch in .Net entwickelt werden
– Neues Projekttemplate in VS.Net
• Info Path- oder Wordformulare?– InfoPath muss auf den Clients installiert– Der Schwerpunkt bei Infopath liegt auf den Formularen und
dem Zugriff auf Datenquellen oder WS– Der Schwerpunkt bei Word liegt auf Dokumenten
Marcel Gnoth, NTeam GmbH www.gnoth.net
Tipps
• Zuerst VS.Net und dann Office 2003 installieren– GAC muss vorhanden sein, wenn Office die PIA’s installiert
• Dann Office 2003 Professional or Professional Enterprise Edition installieren– Andere Versionen unterstützen keine Smart Doc
Entwicklung
• Primary Interop Assemblies bei Office installieren– Nicht standardmäßig ausgewählt– “Run From My Computer” Option verwenden
Marcel Gnoth, NTeam GmbH www.gnoth.net
Alles wird gut
Uff...Uff...