Rich text handling for a web application
First Claim
1. A method of representing and managing rich text for use by Web based applications and browsers as implemented in a machine, the method comprising the steps of:
- providing one or more classes for use by the applications to at least create and manage one or more rich text nodes in a memory structure representation representative of rich text;
representing the rich text in the memory structure representation; and
editing the rich text in a document using the memory structure representation to perform editing functions on the document having the rich text as managed and created by the one or more classes, wherein the memory structure representation comprises;
forming a table structure represented in memory as a set of special rich text node types including table node, table body node and table header node for defining table characteristics, wherein the table row node, heading cell node and row cell node correspond to types of hyper-text markup language (HTML) tags controlling table representation, whereineach type of node maintains a reference to the nodes it controls for a next level including the table row controlling a list of row cell nodes, and the table body node controlling a list of table row nodes,the header cell node and row cell node maintain lists of the rich text nodes, representing content of the rich text nodes and the rich text node contains an anchor point to another table node to start a new table at that point in the rich text thereby allowing for nested tables; and
further comprising;
providing a method to transform text from its memory format into string representations and vice versa, comprising;
storing one of the rich text as a string in a relational database, formatting the string by converting the rich text into a HTML string for storage, converting the rich text into Extensible Mark-up Language (XML) and using a compressed format where various attributes of each rich text node are captured, along with the text value for that node, wherein creating rich text memory structure from HTML, comprises one of;
parsing, by the rich text node, a well-formed segment of HTML and set its attributes accordingly, including creating other rich text nodes as needed as the HTML indicates a change in text attributes or presence of an image or link; and
as a function in a rich text list, taking the HTML that is not well formed, and preprocesses the HTML to make it recognizable by the rich text nodes, wherein the rich text list also handles creating the nodes for the table structures included within the HTML;
parsing the HTML by extracting tag information from a text attribute, then using the tag information to set other attributes in the rich text by calling a resolveTag method, wherein the resolveTag method comprises;
reading text up to a first tag and if this is not a null string, cloning a current rich text node and making the clone a preceding node, and assigning to it all text before the first tag, then removing the text and calling the resolveTag method again, wherein the HTML is well formed for the cloning to work recursively, and the well formed HTML ensures that encountered tags are in proper order so that the text sent to the clone will not miss any tags;
if the tag has a matching end tag, checking if there is any text beyond the end tag, and if there is, cloning the current rich text node, making the clone the following node, and assigning it the text after the end tag, then removing the text and calling the resolveTag method again;
if the tag is an image or link tag, cloning the current rich text node and making the clone the following node, and assigning the following node the text after the tag;
passing the tag information to resolve the tag and to set up tag attributes, wherein if there is an image or link tag, the attributes are stored in the text; and
if preceding or following nodes are not null, call resolveTag making the preceding or following node the current node, which recursively propagates more rich text nodes to fully represent the rich text.
3 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for representing and controlling documents including rich text for Web based applications and browsers is provided so that editing of rich text can be facilitated within the browsers. The rich text is represented in a memory structure so that various formats may be flexibly maintained. Text, images, tables, links and the like are represented in the memory structure, which may be maintained in databases for eventual editing. A controller class and subsidiary classes represent the rich text and provide methods to convert html to the memory structure and back, representing the rich text in a relational database, retrieving the rich text from a relational database, and presenting the rich text for editing. A spell checking facility for the rich text is included.
-
Citations
25 Claims
-
1. A method of representing and managing rich text for use by Web based applications and browsers as implemented in a machine, the method comprising the steps of:
-
providing one or more classes for use by the applications to at least create and manage one or more rich text nodes in a memory structure representation representative of rich text; representing the rich text in the memory structure representation; and editing the rich text in a document using the memory structure representation to perform editing functions on the document having the rich text as managed and created by the one or more classes, wherein the memory structure representation comprises; forming a table structure represented in memory as a set of special rich text node types including table node, table body node and table header node for defining table characteristics, wherein the table row node, heading cell node and row cell node correspond to types of hyper-text markup language (HTML) tags controlling table representation, wherein each type of node maintains a reference to the nodes it controls for a next level including the table row controlling a list of row cell nodes, and the table body node controlling a list of table row nodes, the header cell node and row cell node maintain lists of the rich text nodes, representing content of the rich text nodes and the rich text node contains an anchor point to another table node to start a new table at that point in the rich text thereby allowing for nested tables; and
further comprising;providing a method to transform text from its memory format into string representations and vice versa, comprising; storing one of the rich text as a string in a relational database, formatting the string by converting the rich text into a HTML string for storage, converting the rich text into Extensible Mark-up Language (XML) and using a compressed format where various attributes of each rich text node are captured, along with the text value for that node, wherein creating rich text memory structure from HTML, comprises one of; parsing, by the rich text node, a well-formed segment of HTML and set its attributes accordingly, including creating other rich text nodes as needed as the HTML indicates a change in text attributes or presence of an image or link; and as a function in a rich text list, taking the HTML that is not well formed, and preprocesses the HTML to make it recognizable by the rich text nodes, wherein the rich text list also handles creating the nodes for the table structures included within the HTML; parsing the HTML by extracting tag information from a text attribute, then using the tag information to set other attributes in the rich text by calling a resolveTag method, wherein the resolveTag method comprises; reading text up to a first tag and if this is not a null string, cloning a current rich text node and making the clone a preceding node, and assigning to it all text before the first tag, then removing the text and calling the resolveTag method again, wherein the HTML is well formed for the cloning to work recursively, and the well formed HTML ensures that encountered tags are in proper order so that the text sent to the clone will not miss any tags; if the tag has a matching end tag, checking if there is any text beyond the end tag, and if there is, cloning the current rich text node, making the clone the following node, and assigning it the text after the end tag, then removing the text and calling the resolveTag method again; if the tag is an image or link tag, cloning the current rich text node and making the clone the following node, and assigning the following node the text after the tag; passing the tag information to resolve the tag and to set up tag attributes, wherein if there is an image or link tag, the attributes are stored in the text; and if preceding or following nodes are not null, call resolveTag making the preceding or following node the current node, which recursively propagates more rich text nodes to fully represent the rich text. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A method of representing and managing rich text for use by applications as implemented in a machine, the method comprising the steps of:
-
providing one or more classes for use by the applications to at least create and manage one or more rich text nodes in a memory structure representation representative of rich text;
representing the rich text in the memory structure representation; andediting the rich text in a document using the memory structure representation to perform editing functions on the document having the rich text as managed and created by the one or more classes, further comprising the steps of; providing well-formed segments of text to a current rich text node of the one or more rich text nodes from a rich text list node; parsing the well-formed segments of text; assigning unparsed segments of text to the current rich text node'"'"'s text attribute; and resolving the current rich text node'"'"'s text attribute by extracting tag information and setting attributes in the current rich text node, the attributes including at least one of font face, font size, font color, italicized, underlined, and bold; wherein the resolving step comprises the steps of; a) reading the text attribute up to a first tag; b) if the reading step produces a non-null string, then cloning the current rich text node to make a preceding rich text node and assigning to it all text before the tag; c) checking whether the first tag has a matching end tag; d) if there is a matching end tag, cloning the current rich text node to make a following rich text node and assigning to it any text after the matching end tag, then removing the text after the matching end tag; e) resolving the information between the first tag and matching end tag to set up attributes in the current rich text node; and f) repeating steps a) through e) until a null string is produced in step b). - View Dependent Claims (18, 19)
-
-
20. A method of representing and managing documents having rich text for use in a machine, the method comprising the steps of:
-
representing rich text in a memory structure representation; providing one or more classes for use by the applications to create the memory structure representation, the one or more classes including a rich text list class to create a rich text list node and to manage one or more rich text nodes and a rich text class to create the one or more rich text nodes each representing a unit of the rich text; and providing well-formed segments of text to the one or more current rich text nodes from a rich text list node to initialize the current rich text nodes for representing rich text in a document, wherein the providing well-formed segments of text step further comprising the steps of; parsing the well-formed segments of text; assigning unparsed segments of text to the current rich text node'"'"'s text attribute; and resolving the current rich text node'"'"'s text attribute by extracting tag information and sets attributes in the current rich text node, the attributes including at least one of font face, font size, font color, italicized, underlined, and bold, wherein the resolving step comprises the steps of; a) reading the text attribute up to a first tag; b) if the reading step produces a non-null string, then cloning the current rich text node to make a preceding rich text node and assigning to it all text before the tag; c) checking whether the first tag has a matching end tag; d) if there is a matching end tag, cloning the current rich text node to make a following rich text node and assigning to it any text after the matching end tag, then removing the text after the matching end tag; e) resolving the information between the first tag and matching end tag to set up attributes in the current node; and f) repeating steps a) through e) until all a null string is produced in step b). - View Dependent Claims (21, 22)
-
-
23. A computer program product comprising a non-transitory computer readable storage medium having a computer readable program code embodied in the medium, the computer program product includes:
-
a first computer program code to provide one or more classes for use by Web based applications and browsers to at least create and manage one or more rich text nodes in a memory structure representation representative of rich text; a second computer program code to represent the rich text in the memory structure representation; a third computer program code to edit the rich text in a document using the memory structure representation to perform editing functions on the document having rich text as managed and created by the one or more classes; and at least one further computer program to parse hyper-text markup language (HTML) by extracting tag information from a text attribute, then using the tag information to set other attributes in the one or more rich text nodes by calling a resolveTag method, wherein the resolveTag method comprises; reading text up to a first tag and if this is not a null string, cloning a current rich text node and making the clone a preceding node, and assigning to it all text before the first tag, then removing the text and calling the resolvetag method again, wherein the HTML is well formed for the cloning to work recursively, and the well formed HTML ensures that encountered tags are in proper order so that the text sent to the clone will not miss any tags; if the tag has a matching end tag, checking if there is any text beyond the end tag, and if there is, cloning the current rich text node, making the clone the following node, and assigning it the text after the end tag, then removing the text and calling the resolveTag method again; if the tag is an image or link tag, cloning the current rich text node and making the clone the following node, and assigning the following node the text after the tag; passing the tag information to resolve the tag and to set up tag attributes, wherein if there is an image or link tag, the attributes are stored in the text; and if preceding or following nodes are not null, call resolveTag making the preceding or following node the current node, which recursively propagates more rich text nodes to fully represent the rich text. - View Dependent Claims (24, 25)
-
Specification