A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
The present invention relates to systems, methods and computer readable media for serving data content Java servers. The present invention relates more particularly to rendering hierarchical data structures through a Java server.
Since its inception in 1995, the Java programming language has become increasingly popular. Java, which is an interpreted language, enabled the creation of applications which could be run on a wide variety of platforms. This ability to function across a variety of different client platforms and Java's relatively easy implementation of network applications has resulted in its use in endeavors as basic as personal web pages to endeavors as complex as large business-to-business enterprise systems.
Most Java interactions are based around a server product which provides application support and controls access to resources. One such server product is WebLogic Server by BEA Systems of San Jose, Calif.
It is often useful for servers to represent hierarchical data structures such as portals, file systems, and databases through a web interface generated by the server. However, doing so in a manner that is efficient and intuitive has proven difficult. Most solutions have been very narrow in their applications and have faced performance limitations. What is needed is a flexible, intuitive, and powerful mechanism for representing hierarchical data structures generated by a server on a client.
The present invention relates to the creation of trees for representing hierarchical data structures. Trees are created on a server, with the tree having nodes that are associated with paths on a server. Each node is associated with a resource locator indicating data that can be accessed through the tree. A tree manager module generates a state of a tree which is then rendered on a client browser for access by a user.
Embodiments of the present invention generate a rendering module which is transmitted to a client for use. The rendering module receives tree information from the server, from which it generates javascript that renders the tree on a client web browser. The present invention is advantageous as it allows customizable client-based rendering of tree structures while utilizing well known mechanisms for creating trees.
Although this diagram depicts objects/processes as logically separate, such depiction is merely for illustrative purposes. It will be apparent to those skilled in the art that the objects/processes portrayed in this figure can be arbitrarily combined or divided into separate software, firmware and/or hardware components. Furthermore, it will also be apparent to those skilled in the art that such objects/processes, regardless of how they are combined or divided, can execute on the same computing device or can be distributed among different computing devices connected by one or more networks or other suitable communication means.
In one embodiment and by way of a non-limiting example, the system can include a client 100, one or more web/application servers 102, and one or more databases 104, connected by one or more networks 106 or other suitable communication means. A network can include but is not limited to: public and/or private networks, wireless networks, optical networks, and satellite based communication links. Other suitable communication means can include but are not limited to: random access memory, file system(s), distributed objects, persistent storage, and inter-processor communication networks. The WebLogic® Server, available from BEA Systems, Inc., is a suitable web/application server in one embodiment. The one or more databases can include but is not limited to: relational databases, object-oriented databases, file systems, or any other kind of persistent storage.
The client 100 preferably includes a web browser capable of processing Java Script and reading HyperText Markup Language(HTML). The server 102 is a conventional Java Server. The databases 104 preferably include one or more hierarchical data structures that are suitable for rendering as tree structures. The server 102 serves pages to the client 100 that render hierarchical data structures.
The server 102 maintains a group of classes that are used to generate and operate tree structures and enable their display on the client 100. These classes include Tree.Java classes 210, Tree Popup.Java classes 220, Treenode.java classes 215 and TreeStateManager 225 classes.
The Tree.Java class enables a developer to create a create a tree on the server 102 which can be viewed through the client 100. A tree can be created through the execution of the following code:
The parameters include a “name” parameter, which is the name of the tree.
In the present embodiment, tree object creation and tree state management are performed by the server 102, and the tree is rendered by JavaScript on the client. The tree.java module creates a treescript.js module according to the capabilities of the client system and transfers it to the client. In some embodiments, the configuration of the treescript.js file is set according to the type of client used. The treescript.js module can be created dynamically or stored in advance and transferred to the client upon initiation of a session.
The server generates tree state information into Java code which is then consumed by the treescript.js module which creates a visual representation of the tree on the client. The treescript.js file can contain a conversion program that receives tree information as java objects from the tree.java classes on the server and converts the tree state information into javascript code for rendering the tree on the client browser.
The tree.java class, in managing the tree state on the server, additionally includes the following associated methods. These methods are used to set properties for the tree, including node characteristics. For each method, the parentheses indicate a location where parameters are submitted. For those methods in which parameters are listed with a variable name, the “parameters section” describes the data to be submitted with the parameter.
getHighlightNodePath
public java.lang. String getHighlightNodePath( )
This method returns a highlighted node path for a tree. If this parameter is not set, upon rendering the tree will try to find a highlighted node in the TreeStateManager if it exists, and then use it instead.
Returns:
This method sets a highlighted node path for a tree. If this parameter is not set, upon rendering the tree will try to find a highlighted node in the TreeStateManager if it exists, and then use it instead.
Parameters:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Parameters:
Returns:
Parameters:
The server 102 also maintains a treenode.java class. The treenode.java class enables the manipulation of individual nodes on the tree. In some embodiments, there is a separate treenode object for each node on a tree. Each node, when created is associated with a URL that is associated with the node and is loaded when the node is accessed. The class can be used to create a tree node through the following command: public TreeNode(java.lang.String name)
The “name” variable indicates a name for the new tree node. The treenode class additionally includes the following associated methods. These methods are used to set properties for the tree nodes. For each method, the parentheses indicate a location where parameters are submitted. For those methods in which parameters are listed with a variable name, the “parameters section” describes the data to be submitted with the parameter.
addChild
public TreeNode
addChild(java.lang. String namejava.lang. String actionjava.lang. String icon)
Add a child node to the current node.
Parameters:
Returns:
Return whether or not a node has children or not
setHasChildren
public void setHasChildren(boolean hasChildren)
Set whether or not a node has children or not.
Parameters:
Reference to the parent object of the tree node
Returns:The identity of the parent of the node.
is Expanded
public boolean is Expandedo
Returns:
If true, sets the state of the node to be expanded when displayed in the tree
Parameters:
Return the path associated with the node. This is essentially the path separated by the node delimeter.
Returns:
Sets the displayed name of the TreeNode.
Parameters:
Sets the form to be submitted when this node is clicked. Each node can either have a URL or a form name associated with it.
getSubmitFormName
public java.lang.String getSubmitFormName( )
Returns:
Returns:
Returns:
Sets the url associated with the node.
Parameters:
Returns:
Parameters:
Return a list of all the children TreeNode objects of this tree node.
Returns:
Returns:
Parameters:
Returns:
Parameters:
The treepopup classes 220 control the behavior of popup menus associated with each node in the tree. These classes include methods for enabling and disabling popup menus for each node.
The TreeStateManager 225 class is used to store and maintain a current state of the tree. For each tree, a TreeStateManager instance is generated. The TreeStateManager includes the following associated methods. These methods are used to obtain information about a state of the tree. For each method, the parentheses indicate a location where parameters are submitted. For those methods in which parameters are listed with a variable name, the “parameters section” describes the data to be submitted with the parameter.
getInstance
public static TreeStateManager getInstance(javax.servlet.http.HttpSession session, java.lang.String name)
Return an instance of the TreeStateManager for the tree with the given name.
Parameters:
Returns:
Returns:
Parameters:
Parameters:
Returns:
Parameters:
Process the state of the tree after a user has performed either of the following actions in the tree—expanded a node, collapsed a node, zoomed in or out, paged through a window or selected a node.
Parameters:
Return whether or not the given node path is paginated or not.
Parameters:
Returns:
Force a particular node path to be paginated, if it is not already paginated.
Parameters:
Remove the given node as being paginated.
setExpandNodesFromPath
public void setExpandNodesFromPath(java.lang.String nodePath)
Marks all nodes below the given path to be expanded.
Parameters:
Add a particular node, identified by its path as expanded in the tree.
Parameters:
Indicate whether or not the given node, identified by its path is expanded or not
Parameters:
Returns: A Boolean value indicating whether a node is expanded.
In some embodiments, the system closely mimics the APIs between corresponding java objects and javascript objects so as to allow for easy data transfer between the two mediums. For example, the treejava object has a similar API to the JSTree object in treescript.js. and the treenode.java object has a similar API to the JSTreeNode object in treescript.js. This interoperability allows for easy conversion to current embodiments from previous designs.
TreeStatemanager treestatemanager=TreeStatemanager.getinstance(session, “localTree”).
In step 310, the treestatemanager object determines a state of a tree. The state of the tree can include a current node arrangement of the tree as well. In the present embodiment, the tree state can be processed in response to a user selecting a node on a tree, but in alternate embodiments the step can be performed automatically or in response to another action. Step 310 can be implemented when the following code is executed:
Treestatemanager.processState(request). The server can also return information for a particular node on a tree. This information can include the URL associated with the node as well as supplementary information associated with the node.
In step 315, the server transmits a renderer such as the treescript.js module. The treescript.js module receives information from the server, which is used to generate javascript code for rendering the tree on the client.
In step 320, the server transmits tree information to the client. This information can be transmitted in a variety of formats. In some embodiments, the tree information can be transmitted as a text file. In alternate embodiments, formats such as extensible Markup Language documents or other formats can be used. This information is used by the treescript.js module on the client to generate javascript code for presenting the tree to a user.
In step 405, a root node is created for the new tree. The root node is the core element of the tree and all child nodes are associated with it. The instructions for creating a root node titled “local tree root” can be represented as: TreeNode root=new TreeNode (“Local Tree Root”). These instructions can be generated by the treescript.js module when it receives tree state information from the server.
In step 410 a child node is added to the root node. The child is associated with a root node and includes a name “firstChild”, an action that is performed when the node is selected(form submission) and an icon(folder.gif) to represent the node in a graphical interface. This action can be implemented by the following code, which is also generated by the treescript.js module when it receives tree state information from the server: addChild(“firstChild”, submitform, folder.gif)
In step 415 a tree object is created that references the root node created in step 405. The tree object can be implemented through the following code: Tree localTree=new Tree (“localTree”, root, true”).
In step 420, the tree is rendered and presented to a user when the javascript is executed by client web browser.
The tree nodes can be expanded to display subnodes by selecting the nodes with a pointer or other interface tool. Additionally, the trees, when expanded can display paginated hierarchies. Thus, if a node, once expanded, displays more elements that can be displayed on a single page, the tree can optionally load only those nodes that would be displayed on the first page, rather than all of the nodes, and load the new nodes as necessary.
It should be noted that while the embodiments used herein use Java and Javascript, in alternate embodiments other languages can be used to produce the tree data on the server. Additionally, other scripting languages can be used to render the tree on the client. Java and Javascript are merely used for illustrative purposes in the present application.
Other features, aspects and objects of the invention can be obtained from a review of the figures and the claims. It is to be understood that other embodiments of the invention can be developed and fall within the spirit and scope of the invention and claims.
The foregoing description of preferred embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to the practitioner skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalence.
In addition to an embodiment consisting of specifically designed integrated circuits or other electronics, the present invention may be conveniently implemented using a conventional general purpose or a specialized digital computer or microprocessor programmed according to the teachings of the present disclosure, as will be apparent to those skilled in the computer art.
Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art. The invention may also be implemented by the preparation of application specific integrated circuits or by interconnecting an appropriate network of conventional component circuits, as will be readily apparent to those skilled in the art.
The present invention includes a computer program product which is a storage medium (media) having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the present invention. The storage medium can include, but is not limited to, any type of disk including floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
Stored on any one of the computer readable medium (media), the present invention includes software for controlling both the hardware of the general purpose/specialized computer or microprocessor, and for enabling the computer or microprocessor to interact with a human user or other mechanism utilizing the results of the present invention. Such software may include, but is not limited to, device drivers, operating systems, and user applications.
Included in the programming (software) of the general/specialized computer or microprocessor are software modules for implementing the teachings of the present invention.
The present application relates to the following application, the contents of which are hereby incorporated by reference in their entirety. SYSTEM AND METHODS FOR AN IMPROVED INTERFACE FOR PORTAL AND WEBSERVER ADMINISTRATION, Application No. 60/571,068, filed on May 14, 2004, Inventor: Christopher E. Bales (Attorney Docket No.: BEAS-01635US0 SRM/BTW).
Number | Date | Country | |
---|---|---|---|
60571068 | May 2004 | US |