SlideShare una empresa de Scribd logo
1 de 66
Leverage DXL to Overcome Web Browser Rich Text Limitations Lance Spellman Workflow Studios
What We’ll Cover … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Specific Problem to Be Addressed ,[object Object],[object Object],[object Object],Usage Scenarios: ,[object Object],[object Object],[object Object]
How Does Domino Deliver Rich Text to the Web? ,[object Object],[object Object],[object Object],[object Object],[object Object]
What Rich Text Elements Does Domino Have Trouble With? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What Rich Text Elements Does Domino Have Trouble  With? (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Demonstration: How Domino Handles Rich Text on the Web Domino default rendering of Rich Text to the Web
Rich Text Input with the Notes Client Image floats right of text 2 nd  row starts immediately Table borders of varying thickness Cell padding Picture caption
Rich Text Rendering by Domino to Browser Table rows are equally spaced Table borders are all visible and set to ridge style Picture caption? Paragraph wraps incorrectly Cell padding is NOT observed
What We’ll Cover … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exploring Workarounds ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Workaround 1 — Alter the Stored Rich Text, Attempt 1 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Setting HTML Properties to Fix Cell Padding ,[object Object],Firefox works, but exposes table border problem IE shows no change whatsoever
Workaround 1 — Alter the Stored Rich Text, Attempt 2 ,[object Object],[object Object]
Store Contents as HTML and MIME ,[object Object],[object Object],[object Object],Converts to HTML/MIME on document save. Results are MUCH WORSE!
Potential Workaround Methods ,[object Object],[object Object],[object Object]
Browser Rendering of Content Stored as HTML/MIME Attachment has moved out of the table Wrap properties for picture are completely lost Table size is no longer fixed width, but has been converted to page width
Browser Rendering Now Closely Matches Notes?!? ,[object Object],[object Object],[object Object],[object Object]
Demonstration: Saving Rich Text Content as MIME and Viewing It Saving RT content as MIME/HTML
Workaround 1 — Alter the Stored Rich Text, Attempt 3 ,[object Object],[object Object]
Issues with Fixing Stored HTML/MIME ,[object Object],[object Object],[object Object]
Workaround 2 — Fix the Rendering On-the-Fly  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],I am a highly paid (I wish) professional.  Please, do not try this at home!
Workaround 3 — Fix the Rendering After the Fact ,[object Object],[object Object],[object Object],[object Object],[object Object],Tedious, and more importantly,  performance would be awful Caution
Workaround 4 — Provide Alternate Content via DXL ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Secret Sauce is Domino Extensible Language (DXL) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rich Text Transformed to Correct HTML on Post Save Notes Document Output DXL Transform DXL to HTML Display to Web Display to Web Rich Text Block Post-Save Event HTML Block
What We’ll Cover … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Rich Text to DXL to HTML Process Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Understanding the DXL Output of Rich Text ,[object Object],[object Object],[object Object],[object Object]
Demonstration: DXL Process — Rich Text to DXL to HTML Overview of the process for RT to DXL to HTML
Inline Images in Rich Text and DXL ,[object Object],[object Object],[object Object],[object Object],[object Object]
Code That Produces DXL Output ,[object Object],[object Object],[object Object],[object Object],[object Object]
Code Example for DXL Export try { … DxlExporter dxl = session.createDxlExporter(); … // handle inline images in the Rich Text dxl.setConvertNotesBitmapsToGIF(true); // turn DOCTYPE output off because DOM processor  // can't find the DOCTYPE declaration file and errors dxl.setOutputDOCTYPE(false);  String docDxl = dxl.exportDxl(doc); Exports document as XML to a string Changes output of inline pictures from Notes bitmap to GIF
Reviewing DXL Export of Rich Text ,[object Object],[object Object],See doc_dxl.xml for complete sample DXL listing
Identifying the Rich Text Items in DXL Output <item name='MIME_Version'> <text>1.0</text> </item> <item name='body'><richtext> <pardef id='1' align='center' leftmargin='1in'/> <par def='1'><run> <font size='18pt' style='bold'/> Rich Text Is Totally WICKED! </run> </par>… Text Item vs. Rich Text Item
The PARDEF Tag: Style Definitions for Paragraphs ,[object Object],[object Object],[object Object],<pardef id='1' align='center' leftmargin='1in'/>
The PAR Tag: Paragraphs That Are Styled by DEF Attribute ,[object Object],[object Object],[object Object],<par def='1'> <run> <font size='18pt' style='bold'/> Rich Text Is Totally WICKED! </run> </par>
PAR and PARDEF Equivalencies in HTML/CSS PARDEF  =  CSS Selector PARDEF ID attribute =  CSS Class PAR = HTML <p> PAR DEF attribute  = HTML <p class=“”>
Sample PARDEF and PAR Equivalencies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DXL’s Representation of Inline Images ,[object Object],[object Object],[object Object],[object Object],[object Object]
DXL Output with setConvertNotesBitmapsToGIF( false ); <picture width='160px' height='135px' scaledheight='1.4063in' scaledwidth='1.6667in' align='right'> <notesbitmap> </notesbitmap> <caption>Mikkel Heisterberg</caption> </picture> lQAmAAAAAAAAAAAAAAABAAAAAAAAACsALwAIAAEACAABADAAAgCWAJUEAAAAAAAAAAAAAC8AgwTN AM8EAR3OAM0ABQQMDgwOwgzCD8IMww4DJyMWzQDNAAEExA7FDMQOBCcjGBbMAMUAAQvCJsMLyBXH FAIeDsIYAhkcywDFAAImFMMawhPJB8USAgUMwhgDAxkcygDFAAEmwhoCEwfCCAIVDcMIBRoNCAAI whPCB8IIAxUNCMISBQgSCAELxAkFBS0ZGA/CBgMPGRbHAMUAAgsTwwcBCMISAgcIwhIDCA0Iwg3E … Base64 encoded content
DXL Output with setConvertNotesBitmapsToGIF( true ); <picture width='160px' height='135px' scaledheight='1.4063in' scaledwidth='1.6667in' align='right'> <gif> </gif> <caption>Mikkel Heisterberg</caption> </picture> R0lGODlhoACHAOcAAPD4+P///xgYICAgKLjAwKiwuBAYGBAQGBggIOjw+BAQECgoMAgQEKCwsKiw sCAoKLC4wCAoMDA4QPDw+HB4gDhASCgwMCgwOLC4uOj4+AgIEBggKBgYGDA4OLjAyAgICEBIUGhw eDAwODhAQKCosEBISEhQWFhgaCAgIDg4QGBocFBYYCgoKDAoKEhQUDgwKHiAiCggIGh4gOjw8EBA SEhIUFBYWKi4uFhgYAAAADAoILDAwCgoIJB4aPDw8AAICDAwMKCwuDg4OHCAiBAYILDAyAAACKCo… Base64 encoded content of GIF that can be saved to a file
DXL’s Representation of Attachments ,[object Object],[object Object],[object Object],[object Object],[object Object]
DXL for File Attachments <attachmentref name='test.pdf‘ displayname='test.pdf'> <picture height='47px' width='43px'> <notesbitmap> lQAmAAAAAAAAAAAAAAABAAAAAAAAACsALwAIAAEACAABADAAAgCWAJUEAAAAAAAAAAAAAC8AgwTN AM8EAR3OAM0ABQQMDgwOwgzCD8IMww4DJyMWzQDNAAEExA7FDMQOBCcjGBbMAMUAAQvCJsMLyBXH FAIeDsIYAhkcywDFAAImFMMawhPJB8USAgUMwhgDAxkcygDFAAEmwhoCEwfCCAIVDcMIBRoNCAAI… </notesbitmap > </picture> </attachmentref> <picture height='47px' width='43px'> <notesbitmap> lQAmAAAAAAAAAAAAAAABAAAAAAAAACsALwAIAAEACAABADAAAgCWAJUEAAAAAAAAAAAAAC8AgwTN AM8EAR3OAM0ABQQMDgwOwgzCD8IMww4DJyMWzQDNAAEExA7FDMQOBCcjGBbMAMUAAQvCJsMLyBXH FAIeDsIYAhkcywDFAAImFMMawhPJB8USAgUMwhgDAxkcygDFAAEmwhoCEwfCCAIVDcMIBRoNCAAI… </notesbitmap > </picture> The attachment filename Picture element is just the icon used to display the file attachment. It is not the file attachment itself.
DXL for File Attachments (cont.) <item name='$FILE' summary='true' sign='true' seal='true'> <object> <file hosttype='msdos' compression='none' flags='storedindoc' encoding='none' name='test.pdf'> <created> <datetime>20051111T180304,3906</datetime> </created> <modified> <datetime>20051111T180304,39-06</datetime> </modified> <filedata> JVBERi0xLjQNCiXDpMO8w7bDnw0KMiAwIG9iag0KPDwgL0xlbmd0aCAzIDAgUg0KICAgL0ZpbHRl… The attachment filename Base64 encoded data of the attachment The file element
What We’ll Cover … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Produce a W3C DOM Object from Rich Text DXL ,[object Object],[object Object]
Create a DOM Object from DXL Text ,[object Object],[object Object],[object Object],[object Object]
Code for Obtaining a DOM Document from DXL String private org.w3c.dom.Document getDOMDoc(String dxl) { try { // Get Document Builder Factory DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); … // Obtain a document builder object DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new DefaultHandler()); // Parse the document and return it StringReader reader = new StringReader(dxl); InputSource source = new InputSource(reader); return builder.parse(source); … DocumentBuilder parses a String InputSource to create a DOM Document
Working with DXL Output of Rich Text Inline Image ,[object Object],[object Object],[object Object]
Base64 Libraries Allow Data to Be Decoded and Saved to File ,[object Object],//decode the base64 stream to a temp file Base64.decodeToFile(base64Stream, fullfilepath);
Isolating the Inline Images and Saving Them to Files Element element = domDoc.getDocumentElement(); // find all the inline images in the richtext fields get the picture nodes NodeList pictureNodes = element.getElementsByTagName(&quot;picture&quot;); int numOfPictures = pictureNodes.getLength(); … for (int k=0; k<numOfPictures; k++) { NodeList picChildren = pictureNodes.item(k).getChildNodes();  // gif tags int numOfNodes = picChildren.getLength(); for (int i=0; i<numOfNodes; i++) {  // loop through the <gif> tags Node binaryNode = numOfNodes.item(i).getFirstChild(); String base64Stream = binaryNode.getNodeValue(); … String fullfilepath = filename;  // filename set earlier in code Base64.decodeToFile(base64Stream, fullfilepath);  } } Collects all the picture elements Gets the Base64 data for the picture as a String Decodes and saves file to filesystem
What We’ll Cover … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Customizing HTML ,[object Object],[object Object],[object Object]
Applying XSL to the DXL DOM Object ,[object Object],[object Object],[object Object],[object Object],[object Object],See DXL2HTML.xsl for complete XSL listing
Selecting the Rich Text Items to Apply Template Rules <xsl:template match=&quot;d:document&quot;> <xsl:apply-templates select=&quot;d:item&quot;/> </xsl:template> <xsl:template match=&quot;d:item&quot;> <xsl:apply-templates select=&quot;d:richtext&quot;/> </xsl:template> <xsl:template match=&quot;d:richtext&quot;> <xsl:apply-templates/> </xsl:template> Starts with document, looks for items, selects only Rich Text items, then applies remaining templates to Rich Text items only
Sample Template for Handling Table Elements <xsl:template match=&quot;d:table&quot;> <table width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;> <xsl:attribute name=&quot;width&quot;> <xsl:if test=&quot;@widthtype='fitmargins'&quot;>100%</xsl:if> </xsl:attribute> <xsl:attribute name=&quot;style&quot;>border-collapse: collapse; <xsl:if test=&quot;string(d:border/@style)&quot;> border-style:  <xsl:choose> <xsl:when test=&quot;d:border/@style='dot'&quot;>dotted</xsl:when> <xsl:when test=&quot;d:border/@style='dash'&quot;>dashed</xsl:when> <xsl:otherwise><xsl:value-of select=&quot;d:border/@style&quot;/></xsl:otherwise> </xsl:choose>; </xsl:if> … </xsl:template> Template illustrates getting the style attribute from the DXL and converting that to CSS selectors
Implementing the XSL Transformation in Code XSLProcessor xp = new XSLProcessor(new XML4JLiaison4dom()); StringReader xmlSource2 = new StringReader(docDxl); StringReader xslSource2 =  new StringReader(xslProfile.getItemValueString(&quot;RTXSL&quot;)); StringWriter sw = new StringWriter(); XSLTInputSource xs = new XSLTInputSource(xmlSource2); XSLTInputSource xt = new XSLTInputSource(xslSource2); XSLTResultTarget tout = new XSLTResultTarget(sw); xp.process(xs, xt, tout); RichTextItem rt = doc.createRichTextItem(&quot;HTMLTransform&quot;); rt.appendText(sw.toString()); XSL is retrieved from a text field in a Notes document The DXL source DXL is transformed to HTML and saved to the document
Demonstration: Live Debug Session for DXL2HTML.xsl Visual Studio Debugger for  DXL2HTML.xsl
What We’ll Cover … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Extending the Idea … ,[object Object],[object Object],[object Object]
Acknowledgements ,[object Object],[object Object],[object Object]
Resources for Working with Base64 Encoded Data ,[object Object],[object Object],[object Object],See Script Libraries in dxl_sample.nsf for both Java and LotusScript libraries
Rich Text Handling for Free Resources ,[object Object],[object Object],[object Object],[object Object]
7 Key Points to Take Home ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Your Turn! How to Contact Me: Lance Spellman [email_address]

Más contenido relacionado

La actualidad más candente

Web design in 7 days by waqar
Web design in 7 days by waqarWeb design in 7 days by waqar
Web design in 7 days by waqar
Waqar Chodhry
 

La actualidad más candente (20)

Web page concept final ppt
Web page concept  final pptWeb page concept  final ppt
Web page concept final ppt
 
Dynamic html (#1)
Dynamic  html (#1)Dynamic  html (#1)
Dynamic html (#1)
 
Html Tutorial
Html Tutorial Html Tutorial
Html Tutorial
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
 
Wp unit 1 (1)
Wp  unit 1 (1)Wp  unit 1 (1)
Wp unit 1 (1)
 
Html 5
Html 5Html 5
Html 5
 
HTML Basics 1 workshop
HTML Basics 1 workshopHTML Basics 1 workshop
HTML Basics 1 workshop
 
Html viva questions
Html viva questionsHtml viva questions
Html viva questions
 
Practical file on web technology(html)
Practical file on web technology(html)Practical file on web technology(html)
Practical file on web technology(html)
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 
Origins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTMLOrigins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTML
 
Web I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML Introduction
 
Vskills certified html designer Notes
Vskills certified html designer NotesVskills certified html designer Notes
Vskills certified html designer Notes
 
Web design in 7 days by waqar
Web design in 7 days by waqarWeb design in 7 days by waqar
Web design in 7 days by waqar
 
Html
HtmlHtml
Html
 
Vskills certified html5 developer Notes
Vskills certified html5 developer NotesVskills certified html5 developer Notes
Vskills certified html5 developer Notes
 
Design Tools Html Xhtml
Design Tools Html XhtmlDesign Tools Html Xhtml
Design Tools Html Xhtml
 
Modular documentation in Structured FrameMaker
Modular documentation in Structured FrameMakerModular documentation in Structured FrameMaker
Modular documentation in Structured FrameMaker
 
Introduction to Html
Introduction to HtmlIntroduction to Html
Introduction to Html
 
Iwt module 1
Iwt  module 1Iwt  module 1
Iwt module 1
 

Destacado (9)

The Top 30 LotusScript Development Tips
The Top 30 LotusScript Development TipsThe Top 30 LotusScript Development Tips
The Top 30 LotusScript Development Tips
 
Learning to run
Learning to runLearning to run
Learning to run
 
Lotusphere 2007AD302 WHAT’S NEW IN THE IBM LOTUS DOMINO WEB SERVER
Lotusphere 2007AD302 WHAT’S NEW IN THE IBM LOTUS DOMINO WEB SERVERLotusphere 2007AD302 WHAT’S NEW IN THE IBM LOTUS DOMINO WEB SERVER
Lotusphere 2007AD302 WHAT’S NEW IN THE IBM LOTUS DOMINO WEB SERVER
 
Maximizing application performance
Maximizing application performanceMaximizing application performance
Maximizing application performance
 
real world web services
real world web servicesreal world web services
real world web services
 
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
Uklug2011.lotus.on.linux.report.technical.edition.v1.0Uklug2011.lotus.on.linux.report.technical.edition.v1.0
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
 
Lotusphere 2007 BP312: Trap and Manage Your Errors Easily, Efficiently and Re...
Lotusphere 2007 BP312: Trap and Manage Your Errors Easily, Efficiently and Re...Lotusphere 2007 BP312: Trap and Manage Your Errors Easily, Efficiently and Re...
Lotusphere 2007 BP312: Trap and Manage Your Errors Easily, Efficiently and Re...
 
Domino Vs Exchange App Dev
Domino Vs Exchange App DevDomino Vs Exchange App Dev
Domino Vs Exchange App Dev
 
JavaScript blast
JavaScript blastJavaScript blast
JavaScript blast
 

Similar a leverage dxl

COMPUTER-9-LESSON-2-Basic-HTML-Elements.pptx
COMPUTER-9-LESSON-2-Basic-HTML-Elements.pptxCOMPUTER-9-LESSON-2-Basic-HTML-Elements.pptx
COMPUTER-9-LESSON-2-Basic-HTML-Elements.pptx
joydesiar2
 
ITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docx
ITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docxITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docx
ITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docx
christiandean12115
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 

Similar a leverage dxl (20)

HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
 
Digital Marketing Company
Digital Marketing CompanyDigital Marketing Company
Digital Marketing Company
 
Webcomponents v2
Webcomponents v2Webcomponents v2
Webcomponents v2
 
WEB DEVELOPMENT
WEB DEVELOPMENTWEB DEVELOPMENT
WEB DEVELOPMENT
 
Webcomponents TLV October 2014
Webcomponents TLV October 2014Webcomponents TLV October 2014
Webcomponents TLV October 2014
 
Document object model
Document object modelDocument object model
Document object model
 
Web design in 7 days
Web design in 7 daysWeb design in 7 days
Web design in 7 days
 
ILUG 2007 - Notes and Office Integration
ILUG 2007 - Notes and Office IntegrationILUG 2007 - Notes and Office Integration
ILUG 2007 - Notes and Office Integration
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
 
Dhtml
DhtmlDhtml
Dhtml
 
How Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul IrishHow Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul Irish
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
 
Browsers. Magic is inside.
Browsers. Magic is inside.Browsers. Magic is inside.
Browsers. Magic is inside.
 
Presentation html
Presentation   htmlPresentation   html
Presentation html
 
COMPUTER-9-LESSON-2-Basic-HTML-Elements.pptx
COMPUTER-9-LESSON-2-Basic-HTML-Elements.pptxCOMPUTER-9-LESSON-2-Basic-HTML-Elements.pptx
COMPUTER-9-LESSON-2-Basic-HTML-Elements.pptx
 
ITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docx
ITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docxITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docx
ITECH2106-6106 Lab01-HTML CSS Intro and Needs Analysis.pdf.docx
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Html Concept
Html ConceptHtml Concept
Html Concept
 

Más de dominion

What is a itil and how does it relate to your collaborative environment uklug
What is a itil and how does it relate to your collaborative environment   uklugWhat is a itil and how does it relate to your collaborative environment   uklug
What is a itil and how does it relate to your collaborative environment uklug
dominion
 
iOS enterprise
iOS enterpriseiOS enterprise
iOS enterprise
dominion
 
cloud session uklug
cloud session uklugcloud session uklug
cloud session uklug
dominion
 
Uklug 2011 administrator development synergy
Uklug 2011 administrator development synergyUklug 2011 administrator development synergy
Uklug 2011 administrator development synergy
dominion
 
Uklug 2011 client management
Uklug 2011 client managementUklug 2011 client management
Uklug 2011 client management
dominion
 
Populating your domino directory or any domino database with tivoli directory...
Populating your domino directory or any domino database with tivoli directory...Populating your domino directory or any domino database with tivoli directory...
Populating your domino directory or any domino database with tivoli directory...
dominion
 
Uklug2011 Know your Notes
Uklug2011 Know your NotesUklug2011 Know your Notes
Uklug2011 Know your Notes
dominion
 
Taking themes to the next level
Taking themes to the next levelTaking themes to the next level
Taking themes to the next level
dominion
 
Supersize me
Supersize meSupersize me
Supersize me
dominion
 
Aussie outback
Aussie outbackAussie outback
Aussie outback
dominion
 
Implementing xpages extension library
Implementing xpages extension libraryImplementing xpages extension library
Implementing xpages extension library
dominion
 
Abb presentation uklug
Abb presentation uklugAbb presentation uklug
Abb presentation uklug
dominion
 
Domino testing presentation
Domino testing presentationDomino testing presentation
Domino testing presentation
dominion
 
Composite applications tutorial
Composite applications tutorialComposite applications tutorial
Composite applications tutorial
dominion
 
Error handling in XPages
Error handling in XPagesError handling in XPages
Error handling in XPages
dominion
 
wcm domino
wcm dominowcm domino
wcm domino
dominion
 
Ajax in domino web-anwendungen - der nächste schritt
Ajax in domino web-anwendungen - der nächste schrittAjax in domino web-anwendungen - der nächste schritt
Ajax in domino web-anwendungen - der nächste schritt
dominion
 
Inside notes
Inside notesInside notes
Inside notes
dominion
 

Más de dominion (20)

What is a itil and how does it relate to your collaborative environment uklug
What is a itil and how does it relate to your collaborative environment   uklugWhat is a itil and how does it relate to your collaborative environment   uklug
What is a itil and how does it relate to your collaborative environment uklug
 
iOS enterprise
iOS enterpriseiOS enterprise
iOS enterprise
 
cloud session uklug
cloud session uklugcloud session uklug
cloud session uklug
 
Uklug 2011 administrator development synergy
Uklug 2011 administrator development synergyUklug 2011 administrator development synergy
Uklug 2011 administrator development synergy
 
Uklug 2011 client management
Uklug 2011 client managementUklug 2011 client management
Uklug 2011 client management
 
Populating your domino directory or any domino database with tivoli directory...
Populating your domino directory or any domino database with tivoli directory...Populating your domino directory or any domino database with tivoli directory...
Populating your domino directory or any domino database with tivoli directory...
 
Uklug2011 Know your Notes
Uklug2011 Know your NotesUklug2011 Know your Notes
Uklug2011 Know your Notes
 
Quickr
QuickrQuickr
Quickr
 
Taking themes to the next level
Taking themes to the next levelTaking themes to the next level
Taking themes to the next level
 
Supersize me
Supersize meSupersize me
Supersize me
 
Aussie outback
Aussie outbackAussie outback
Aussie outback
 
Implementing xpages extension library
Implementing xpages extension libraryImplementing xpages extension library
Implementing xpages extension library
 
Abb presentation uklug
Abb presentation uklugAbb presentation uklug
Abb presentation uklug
 
Domino testing presentation
Domino testing presentationDomino testing presentation
Domino testing presentation
 
Composite applications tutorial
Composite applications tutorialComposite applications tutorial
Composite applications tutorial
 
Error handling in XPages
Error handling in XPagesError handling in XPages
Error handling in XPages
 
wcm domino
wcm dominowcm domino
wcm domino
 
Ajax in domino web-anwendungen - der nächste schritt
Ajax in domino web-anwendungen - der nächste schrittAjax in domino web-anwendungen - der nächste schritt
Ajax in domino web-anwendungen - der nächste schritt
 
lotus notes r851 -training
lotus notes r851 -traininglotus notes r851 -training
lotus notes r851 -training
 
Inside notes
Inside notesInside notes
Inside notes
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

leverage dxl

  • 1. Leverage DXL to Overcome Web Browser Rich Text Limitations Lance Spellman Workflow Studios
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Demonstration: How Domino Handles Rich Text on the Web Domino default rendering of Rich Text to the Web
  • 8. Rich Text Input with the Notes Client Image floats right of text 2 nd row starts immediately Table borders of varying thickness Cell padding Picture caption
  • 9. Rich Text Rendering by Domino to Browser Table rows are equally spaced Table borders are all visible and set to ridge style Picture caption? Paragraph wraps incorrectly Cell padding is NOT observed
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Browser Rendering of Content Stored as HTML/MIME Attachment has moved out of the table Wrap properties for picture are completely lost Table size is no longer fixed width, but has been converted to page width
  • 18.
  • 19. Demonstration: Saving Rich Text Content as MIME and Viewing It Saving RT content as MIME/HTML
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Rich Text Transformed to Correct HTML on Post Save Notes Document Output DXL Transform DXL to HTML Display to Web Display to Web Rich Text Block Post-Save Event HTML Block
  • 27.
  • 28.
  • 29.
  • 30. Demonstration: DXL Process — Rich Text to DXL to HTML Overview of the process for RT to DXL to HTML
  • 31.
  • 32.
  • 33. Code Example for DXL Export try { … DxlExporter dxl = session.createDxlExporter(); … // handle inline images in the Rich Text dxl.setConvertNotesBitmapsToGIF(true); // turn DOCTYPE output off because DOM processor // can't find the DOCTYPE declaration file and errors dxl.setOutputDOCTYPE(false); String docDxl = dxl.exportDxl(doc); Exports document as XML to a string Changes output of inline pictures from Notes bitmap to GIF
  • 34.
  • 35. Identifying the Rich Text Items in DXL Output <item name='MIME_Version'> <text>1.0</text> </item> <item name='body'><richtext> <pardef id='1' align='center' leftmargin='1in'/> <par def='1'><run> <font size='18pt' style='bold'/> Rich Text Is Totally WICKED! </run> </par>… Text Item vs. Rich Text Item
  • 36.
  • 37.
  • 38. PAR and PARDEF Equivalencies in HTML/CSS PARDEF = CSS Selector PARDEF ID attribute = CSS Class PAR = HTML <p> PAR DEF attribute = HTML <p class=“”>
  • 39.
  • 40.
  • 41. DXL Output with setConvertNotesBitmapsToGIF( false ); <picture width='160px' height='135px' scaledheight='1.4063in' scaledwidth='1.6667in' align='right'> <notesbitmap> </notesbitmap> <caption>Mikkel Heisterberg</caption> </picture> lQAmAAAAAAAAAAAAAAABAAAAAAAAACsALwAIAAEACAABADAAAgCWAJUEAAAAAAAAAAAAAC8AgwTN AM8EAR3OAM0ABQQMDgwOwgzCD8IMww4DJyMWzQDNAAEExA7FDMQOBCcjGBbMAMUAAQvCJsMLyBXH FAIeDsIYAhkcywDFAAImFMMawhPJB8USAgUMwhgDAxkcygDFAAEmwhoCEwfCCAIVDcMIBRoNCAAI whPCB8IIAxUNCMISBQgSCAELxAkFBS0ZGA/CBgMPGRbHAMUAAgsTwwcBCMISAgcIwhIDCA0Iwg3E … Base64 encoded content
  • 42. DXL Output with setConvertNotesBitmapsToGIF( true ); <picture width='160px' height='135px' scaledheight='1.4063in' scaledwidth='1.6667in' align='right'> <gif> </gif> <caption>Mikkel Heisterberg</caption> </picture> R0lGODlhoACHAOcAAPD4+P///xgYICAgKLjAwKiwuBAYGBAQGBggIOjw+BAQECgoMAgQEKCwsKiw sCAoKLC4wCAoMDA4QPDw+HB4gDhASCgwMCgwOLC4uOj4+AgIEBggKBgYGDA4OLjAyAgICEBIUGhw eDAwODhAQKCosEBISEhQWFhgaCAgIDg4QGBocFBYYCgoKDAoKEhQUDgwKHiAiCggIGh4gOjw8EBA SEhIUFBYWKi4uFhgYAAAADAoILDAwCgoIJB4aPDw8AAICDAwMKCwuDg4OHCAiBAYILDAyAAACKCo… Base64 encoded content of GIF that can be saved to a file
  • 43.
  • 44. DXL for File Attachments <attachmentref name='test.pdf‘ displayname='test.pdf'> <picture height='47px' width='43px'> <notesbitmap> lQAmAAAAAAAAAAAAAAABAAAAAAAAACsALwAIAAEACAABADAAAgCWAJUEAAAAAAAAAAAAAC8AgwTN AM8EAR3OAM0ABQQMDgwOwgzCD8IMww4DJyMWzQDNAAEExA7FDMQOBCcjGBbMAMUAAQvCJsMLyBXH FAIeDsIYAhkcywDFAAImFMMawhPJB8USAgUMwhgDAxkcygDFAAEmwhoCEwfCCAIVDcMIBRoNCAAI… </notesbitmap > </picture> </attachmentref> <picture height='47px' width='43px'> <notesbitmap> lQAmAAAAAAAAAAAAAAABAAAAAAAAACsALwAIAAEACAABADAAAgCWAJUEAAAAAAAAAAAAAC8AgwTN AM8EAR3OAM0ABQQMDgwOwgzCD8IMww4DJyMWzQDNAAEExA7FDMQOBCcjGBbMAMUAAQvCJsMLyBXH FAIeDsIYAhkcywDFAAImFMMawhPJB8USAgUMwhgDAxkcygDFAAEmwhoCEwfCCAIVDcMIBRoNCAAI… </notesbitmap > </picture> The attachment filename Picture element is just the icon used to display the file attachment. It is not the file attachment itself.
  • 45. DXL for File Attachments (cont.) <item name='$FILE' summary='true' sign='true' seal='true'> <object> <file hosttype='msdos' compression='none' flags='storedindoc' encoding='none' name='test.pdf'> <created> <datetime>20051111T180304,3906</datetime> </created> <modified> <datetime>20051111T180304,39-06</datetime> </modified> <filedata> JVBERi0xLjQNCiXDpMO8w7bDnw0KMiAwIG9iag0KPDwgL0xlbmd0aCAzIDAgUg0KICAgL0ZpbHRl… The attachment filename Base64 encoded data of the attachment The file element
  • 46.
  • 47.
  • 48.
  • 49. Code for Obtaining a DOM Document from DXL String private org.w3c.dom.Document getDOMDoc(String dxl) { try { // Get Document Builder Factory DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); … // Obtain a document builder object DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new DefaultHandler()); // Parse the document and return it StringReader reader = new StringReader(dxl); InputSource source = new InputSource(reader); return builder.parse(source); … DocumentBuilder parses a String InputSource to create a DOM Document
  • 50.
  • 51.
  • 52. Isolating the Inline Images and Saving Them to Files Element element = domDoc.getDocumentElement(); // find all the inline images in the richtext fields get the picture nodes NodeList pictureNodes = element.getElementsByTagName(&quot;picture&quot;); int numOfPictures = pictureNodes.getLength(); … for (int k=0; k<numOfPictures; k++) { NodeList picChildren = pictureNodes.item(k).getChildNodes(); // gif tags int numOfNodes = picChildren.getLength(); for (int i=0; i<numOfNodes; i++) { // loop through the <gif> tags Node binaryNode = numOfNodes.item(i).getFirstChild(); String base64Stream = binaryNode.getNodeValue(); … String fullfilepath = filename; // filename set earlier in code Base64.decodeToFile(base64Stream, fullfilepath); } } Collects all the picture elements Gets the Base64 data for the picture as a String Decodes and saves file to filesystem
  • 53.
  • 54.
  • 55.
  • 56. Selecting the Rich Text Items to Apply Template Rules <xsl:template match=&quot;d:document&quot;> <xsl:apply-templates select=&quot;d:item&quot;/> </xsl:template> <xsl:template match=&quot;d:item&quot;> <xsl:apply-templates select=&quot;d:richtext&quot;/> </xsl:template> <xsl:template match=&quot;d:richtext&quot;> <xsl:apply-templates/> </xsl:template> Starts with document, looks for items, selects only Rich Text items, then applies remaining templates to Rich Text items only
  • 57. Sample Template for Handling Table Elements <xsl:template match=&quot;d:table&quot;> <table width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;> <xsl:attribute name=&quot;width&quot;> <xsl:if test=&quot;@widthtype='fitmargins'&quot;>100%</xsl:if> </xsl:attribute> <xsl:attribute name=&quot;style&quot;>border-collapse: collapse; <xsl:if test=&quot;string(d:border/@style)&quot;> border-style: <xsl:choose> <xsl:when test=&quot;d:border/@style='dot'&quot;>dotted</xsl:when> <xsl:when test=&quot;d:border/@style='dash'&quot;>dashed</xsl:when> <xsl:otherwise><xsl:value-of select=&quot;d:border/@style&quot;/></xsl:otherwise> </xsl:choose>; </xsl:if> … </xsl:template> Template illustrates getting the style attribute from the DXL and converting that to CSS selectors
  • 58. Implementing the XSL Transformation in Code XSLProcessor xp = new XSLProcessor(new XML4JLiaison4dom()); StringReader xmlSource2 = new StringReader(docDxl); StringReader xslSource2 = new StringReader(xslProfile.getItemValueString(&quot;RTXSL&quot;)); StringWriter sw = new StringWriter(); XSLTInputSource xs = new XSLTInputSource(xmlSource2); XSLTInputSource xt = new XSLTInputSource(xslSource2); XSLTResultTarget tout = new XSLTResultTarget(sw); xp.process(xs, xt, tout); RichTextItem rt = doc.createRichTextItem(&quot;HTMLTransform&quot;); rt.appendText(sw.toString()); XSL is retrieved from a text field in a Notes document The DXL source DXL is transformed to HTML and saved to the document
  • 59. Demonstration: Live Debug Session for DXL2HTML.xsl Visual Studio Debugger for DXL2HTML.xsl
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66. Your Turn! How to Contact Me: Lance Spellman [email_address]