OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

office-collab message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: ODF Character Test document & Representation in JSON Operations


Dear SC,

as Peter was asked to sent some test document with operations from his Android branch from Calligra and Jos (or his WebODF contact) should sent as well some test documents with their operations.

I thought I could start with an example from my experiences in the past year.
 
Attached you may find two files:
  1. a simple character style properties test document (character-properties_MSO15.odt) and
  2. its equivalent representation as change operations in the JSON text format (character-properties_MSO15.txt).
These are result from my work for Open-XChange (OX) from the past.
The sources are open source and available online: https://code.open-xchange.com/git/office (Unfortunately they do not provide their build system..).

Their business scenario is a web office in a browser in HTML5 and _javascript_.
The basic design is to map an ODF file to a sequence of operations on the server and sent them as a JSON file (as attached) to the browser office, which creates the document based on the operations.
Every user action in the browser office will result into operations being sent back to the server (as JSON) and merged back into the existing document.
The advantage of the merge approach - over the common desktop office filter approach, which neglects unknown objects - is that even unknown features can be kept in the original document.
There is no feature regression, when the ODF application is scaling up with features.

An interesting point from the abstraction view I would like to point out: For the browser the operations created from the file being loaded, could be as well the operations from another user typing them into another office.

Technical Note: The counting starts with 0 instead of 1 and the naming of the operations is a proprietary OX dialect.

Would be nice, if we could compare some operation dialects from different vendors and exchange some ideas..

Best regards,
Svante

{"operations":[{"name":"insertFontDescription","attrs":{"family":"'Courier New'","familyGeneric":"modern","pitch":"fixed"},"fontName":"Courier New"},
{"name":"insertFontDescription","attrs":{"family":"'MS Gothic'","familyGeneric":"modern","pitch":"fixed"},"fontName":"MS Gothic"},
{"name":"insertFontDescription","attrs":{"family":"'MS Mincho'","familyGeneric":"modern","pitch":"fixed"},"fontName":"MS Mincho"},
{"name":"insertFontDescription","attrs":{"family":"Cambria","familyGeneric":"roman","pitch":"variable"},"fontName":"Cambria"},
{"name":"insertFontDescription","attrs":{"family":"'Times New Roman'","familyGeneric":"roman","pitch":"variable"},"fontName":"Times New Roman"},
{"name":"insertFontDescription","attrs":{"family":"Arial","familyGeneric":"swiss","pitch":"variable"},"fontName":"Arial"},
{"name":"insertFontDescription","attrs":{"family":"Calibri","familyGeneric":"swiss","pitch":"variable"},"fontName":"Calibri"},
{"name":"insertFontDescription","attrs":{"family":"'MS Mincho'","familyGeneric":"system","pitch":"variable"},"fontName":"MS Mincho1"},
{"name":"insertFontDescription","attrs":{"family":"Tahoma","familyGeneric":"system","pitch":"variable"},"fontName":"Tahoma"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"default_paragraph_style","attrs":{"character":{"bold":false,"boldAsian":false,"boldComplex":false,"color":{"type":"auto"},"fillColor":{"type":"auto"},"fontName":"Cambria","fontNameAsian":"MS Mincho","fontNameComplex":"Times New Roman","fontSize":12,"fontSizeAsian":12,"italic":false,"italicAsian":false,"italicComplex":false,"language":"en-US","letterSpacing":"normal","strike":"none","underline":false,"vertAlign":"baseline"},"paragraph":{"alignment":"left","borderBottom":{"space":0,"style":"none"},"borderLeft":{"space":0,"style":"none"},"borderRight":{"space":0,"style":"none"},"borderTop":{"space":0,"style":"none"},"document":{"defaultTabStop":1249},"fillColor":{"type":"auto"},"lineHeight":{"type":"percent","value":100},"paddingBottom":0,"paddingLeft":0,"paddingRight":0,"paddingTop":0}},"default":true,"hidden":true,"styleName":"Default Paragraph Style"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Normal","attrs":{},"parent":"default_paragraph_style"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Heading_20_1","attrs":{"character":{"bold":true,"boldAsian":true,"boldComplex":true,"color":{"type":"rgb","value":"345a8a"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","fontSize":16,"fontSizeAsian":16},"paragraph":{"marginBottom":0,"marginTop":847,"nextStyleId":"Normal","outlineLevel":0}},"parent":"Normal","styleName":"Heading 1"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Heading_20_2","attrs":{"character":{"bold":true,"boldAsian":true,"boldComplex":true,"color":{"type":"rgb","value":"4f81bd"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","fontSize":13,"fontSizeAsian":13},"paragraph":{"marginBottom":0,"marginTop":353,"nextStyleId":"Normal","outlineLevel":1}},"parent":"Normal","styleName":"Heading 2"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Standard","attrs":{},"parent":"default_paragraph_style"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Heading","attrs":{"character":{"fontName":"Arial","fontNameAsian":"MS Mincho1","fontNameComplex":"Tahoma","fontSize":14,"fontSizeAsian":14},"paragraph":{"marginBottom":212,"marginTop":423,"nextStyleId":"Text_20_body"}},"parent":"Standard"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Text_20_body","attrs":{"paragraph":{"marginBottom":212,"marginTop":0}},"parent":"Standard","styleName":"Text body"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Marginalia","attrs":{"character":{"strike":"double"},"paragraph":{"indentFirstLine":0,"indentLeft":4001,"indentRight":0,"marginLeft":4001,"marginRight":0}},"parent":"Text_20_body"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Subtitle","attrs":{"character":{"color":{"type":"rgb","value":"4f81bd"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","italic":true,"italicAsian":true,"italicComplex":true,"letterSpacing":26},"paragraph":{"nextStyleId":"Normal"}},"parent":"Normal"},
{"name":"insertStyleSheet","type":"paragraph","styleId":"Title","attrs":{"character":{"color":{"type":"rgb","value":"17365d"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","fontSize":26,"fontSizeAsian":26,"letterSpacing":9},"paragraph":{"borderBottom":{"color":{"type":"rgb","value":"4f81bd"},"space":141,"style":"single","width":35},"borderLeft":{"space":0,"style":"none"},"borderRight":{"space":0,"style":"none"},"borderTop":{"space":0,"style":"none"},"marginBottom":529,"marginTop":0,"nextStyleId":"Normal","paddingBottom":141,"paddingLeft":0,"paddingRight":0,"paddingTop":0}},"parent":"Normal"},
{"name":"insertStyleSheet","type":"character","styleId":"Default_20_Paragraph_20_Font","attrs":{},"parent":"default_character_style","styleName":"Default Paragraph Font"},
{"name":"insertStyleSheet","type":"character","styleId":"Heading_20_1_20_Char","attrs":{"character":{"bold":true,"boldAsian":true,"boldComplex":true,"color":{"type":"rgb","value":"345a8a"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","fontSize":16,"fontSizeAsian":16}},"parent":"Default_20_Paragraph_20_Font","styleName":"Heading 1 Char"},
{"name":"insertStyleSheet","type":"character","styleId":"Heading_20_2_20_Char","attrs":{"character":{"bold":true,"boldAsian":true,"boldComplex":true,"color":{"type":"rgb","value":"4f81bd"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","fontSize":13,"fontSizeAsian":13}},"parent":"Default_20_Paragraph_20_Font","styleName":"Heading 2 Char"},
{"name":"insertStyleSheet","type":"character","styleId":"Subtitle_20_Char","attrs":{"character":{"color":{"type":"rgb","value":"4f81bd"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","italic":true,"italicAsian":true,"italicComplex":true,"letterSpacing":26}},"parent":"Default_20_Paragraph_20_Font","styleName":"Subtitle Char"},
{"name":"insertStyleSheet","type":"character","styleId":"Title_20_Char","attrs":{"character":{"color":{"type":"rgb","value":"17365d"},"fontName":"Calibri","fontNameAsian":"MS Gothic","fontNameComplex":"Times New Roman","fontSize":26,"fontSizeAsian":26,"letterSpacing":9}},"parent":"Default_20_Paragraph_20_Font","styleName":"Title Char"},
{"name":"insertStyleSheet","type":"drawing","styleId":"default_drawing_style","attrs":{"character":{"bold":false,"boldAsian":false,"boldComplex":false,"color":{"type":"auto"},"fontSize":12,"fontSizeAsian":12,"italic":false,"italicAsian":false,"italicComplex":false,"language":"en-US","letterSpacing":"normal","strike":"none","underline":false,"vertAlign":"baseline"},"line":{"type":"solid","color":{"type":"rgb","value":"4a7ebb"},"style":"solid","width":26},"paragraph":{"alignment":"left","lineHeight":{"type":"percent","value":100}}},"default":true,"hidden":true,"styleName":"Default Graphic Style"},
{"name":"setDocumentAttributes","attrs":{"document":{"defaultTabStop":1249,"fileFormat":"odf"},"page":{"height":29700,"indentLeft":2000,"indentRight":2000,"marginBottom":2000,"marginLeft":2000,"marginRight":2000,"marginTop":2000,"numberFormat":"1","printOrientation":"portrait","width":21001}}},
{"name":"insertParagraph","start":[0],"attrs":{"styleId":"Title","paragraph":{"pageBreakBefore":true}}},
{"name":"insertText","start":[0,0],"text":"Character Attributes"},
{"name":"insertParagraph","start":[1],"attrs":{"styleId":"Subtitle"}},
{"name":"insertText","start":[1,0],"text":"Examples"},
{"name":"insertParagraph","start":[2],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[2,0],"text":"Bold"},
{"name":"insertParagraph","start":[3],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[3,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[3,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[3,0],"end":[3,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"bold":true,"boldAsian":true}}},
{"name":"insertParagraph","start":[4],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[4,0],"text":"Italic"},
{"name":"insertParagraph","start":[5],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[5,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[5,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[5,0],"end":[5,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"italic":true,"italicAsian":true}}},
{"name":"insertParagraph","start":[6],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[6,0],"text":"Underline"},
{"name":"insertParagraph","start":[7],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[7,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[7,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[7,0],"end":[7,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"underline":true}}},
{"name":"insertParagraph","start":[8],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[8,0],"text":"Bold+Italic+Underline"},
{"name":"insertParagraph","start":[9],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[9,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[9,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[9,0],"end":[9,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"bold":true,"boldAsian":true,"italic":true,"italicAsian":true,"underline":true}}},
{"name":"insertParagraph","start":[10],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[10,0],"text":"Text Color"},
{"name":"insertParagraph","start":[11],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[11,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[11,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[11,0],"end":[11,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"color":{"type":"rgb","value":"ff0000"}}}},
{"name":"insertParagraph","start":[12],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[12,0],"text":"Highlight Color"},
{"name":"insertParagraph","start":[13],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[13,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[13,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[13,0],"end":[13,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"fillColor":{"type":"rgb","value":"ffff00"}}}},
{"name":"insertParagraph","start":[14],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[14,0],"text":"Subscript + Superscript"},
{"name":"insertParagraph","start":[15],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[15,0],"text":"Lorem"},
{"name":"insertText","start":[15,5],"text":" "},
{"name":"insertText","start":[15,6],"text":"ipsum"},
{"name":"insertText","start":[15,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[15,0],"end":[15,4],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"vertAlign":"sub"}}},
{"name":"setAttributes","start":[15,6],"end":[15,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"vertAlign":"super"}}},
{"name":"insertParagraph","start":[16],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[16,0],"text":"Font Size"},
{"name":"insertParagraph","start":[17],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[17,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[17,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[17,0],"end":[17,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"fontSize":16,"fontSizeAsian":16}}},
{"name":"insertParagraph","start":[18],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[18,0],"text":"Font Name"},
{"name":"insertParagraph","start":[19],"attrs":{"styleId":"Normal"}},
{"name":"insertText","start":[19,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[19,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[19,0],"end":[19,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"fontName":"Courier New","fontNameComplex":"Courier New"}}},
{"name":"insertParagraph","start":[20],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[20,0],"text":"Strikethrough"},
{"name":"insertParagraph","start":[21],"attrs":{"styleId":"Marginalia"}},
{"name":"insertText","start":[21,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[21,11],"text":" do"},
{"name":"insertText","start":[21,14],"text":"lor sit "},
{"name":"insertText","start":[21,22],"text":"amet\u2026"},
{"name":"setAttributes","start":[21,0],"end":[21,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"strike":"single"}}},
{"name":"setAttributes","start":[21,14],"end":[21,21],"attrs":{"character":{"strike":"none"}}},
{"name":"insertParagraph","start":[22],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}},
{"name":"insertText","start":[22,0],"text":"Double Strikethrough"},
{"name":"insertParagraph","start":[23],"attrs":{"styleId":"Marginalia"}},
{"name":"insertText","start":[23,0],"text":"Lorem ipsum"},
{"name":"insertText","start":[23,11],"text":" dolor sit amet\u2026"},
{"name":"setAttributes","start":[23,0],"end":[23,10],"attrs":{"styleId":"Default_20_Paragraph_20_Font","character":{"strike":"double"}}},
{"name":"insertParagraph","start":[24],"attrs":{"styleId":"Heading_20_2","paragraph":{"outlineLevel":1}}}]}

Attachment: character-properties_MSO15.odt
Description: application/vnd.oasis.opendocument.text



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]