#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
##################################################
## MODULE CONSTANTS
try:
True, False
except NameError:
True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0rc8'
__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 8)
__CHEETAH_genTime__ = 1189741976.3337901
__CHEETAH_genTimestamp__ = 'Thu Sep 13 23:52:56 2007'
__CHEETAH_src__ = 'OWLHierarchyView.tmpl'
__CHEETAH_srcLastModified__ = 'Mon Sep 10 15:13:23 2007'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
raise AssertionError(
'This template was compiled with Cheetah version'
' %s. Templates compiled before version %s must be recompiled.'%(
__CHEETAH_version__, RequiredCheetahVersion))
##################################################
## CLASSES
class OWLHierarchyView(Template):
##################################################
## CHEETAH GENERATED METHODS
def __init__(self, *args, **KWs):
Template.__init__(self, *args, **KWs)
if not self._CHEETAH__instanceInitialized:
cheetahKWArgs = {}
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
for k,v in KWs.items():
if k in allowedKWs: cheetahKWArgs[k] = v
self._initCheetahInstance(**cheetahKWArgs)
def respond(self, trans=None):
## CHEETAH: main method generated for this template
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
<html>\r
\r
<head>\r
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>\r
\r
<link rel="stylesheet" type="text/css" href="/static/default.css" media="screen"/>\r
\r
<link rel="stylesheet" type="text/css" href="/static/tree.css" media="screen"/>\r
<style type="text/css">\r
#expandcontractdiv, #expandcontractdiv:hover {padding-left: 12px;}\r
#expandcontractdiv a { text-decoration: none; color: #554;}\r
#expandcontractdiv a:hover { text-decoration: none; color: #F60;}\r
.navigation {overflow: auto; }\r
#treediv { padding-top: 3px; }\r
\r
.icon-ppt, .icon-dmg, .icon-prv, .icon-gen, .icon-doc, .icon-jar, .icon-zip, .pnode, \r
.icon-ppt:hover, .icon-dmg:hover, .icon-prv:hover, .icon-gen:hover, .icon-doc:hover, \r
.icon-jar:hover, .icon-zip:hover, .pnode:hover \r
{ text-decoration: none; padding-left: 20px; }\r
\r
.pnode, .pnode:hover { background: transparent url(/https/sourceforge.net/static/favicon.ico) 0 0px no-repeat; }\r
.icon-ppt, .icon-ppt:hover { background: transparent url(/https/sourceforge.net/static/tree-icons.png) 0 0px no-repeat; }\r
.icon-dmg, .icon-dmg:hover { background: transparent url(/https/sourceforge.net/static/tree-icons.png) 0 -36px no-repeat; }\r
.icon-prv, .icon-prv:hover { background: transparent url(/https/sourceforge.net/static/tree-icons.png) 0 -72px no-repeat; }\r
.icon-gen, .icon-gen:hover { background: transparent url(/https/sourceforge.net/static/tree-icons.png) 0 -108px no-repeat; }\r
.icon-doc, .icon-doc:hover { background: transparent url(/https/sourceforge.net/static/tree-icons.png) 0 -144px no-repeat; }\r
.icon-jar, .icon-jar:hover { background: transparent url(/https/sourceforge.net/static/tree-icons.png) 0 -180px no-repeat; }\r
.icon-zip, .icon-zip:hover { background: transparent url(/https/sourceforge.net/static/tree-icons.png) 0 -216px no-repeat; }\r
\r
.icon-ppt, .icon-dmg, .icon-prv, .icon-gen, .icon-doc, .icon-jar, .icon-zip, .pnode { color: #554;}\r
.icon-ppt:hover, .icon-dmg:hover, .icon-prv:hover, .icon-gen:hover, .icon-doc:hover, \r
.icon-jar:hover, .icon-zip:hover, .pnode:hover { color: #F60;}\r
</style>\r
\r
<script type="text/javascript" src="/static/yahoo-min.js" ></script>\r
<script type="text/javascript" src="/static/event-min.js"></script>\r
<script type="text/javascript" src="/static/treeview-min.js" ></script>\r
<script type="text/javascript" src="/static/connection-min.js" ></script>\r
\r
<script>\r
\r
var tree;\r
\r
function nodeHref(nodeId) \r
{\r
var callback = { \r
success: function(o) \r
{\r
document.getElementById(\'contentdiv\').innerHTML = o.responseText;\r
// alert("Success! response text is: " + o.responseText);\r
}, \r
failure: function(o) {alert("Failure! response status is: " + o.status);}, \r
timeout: 5000, \r
argument: ["node details", "contentdiv", nodeId] // not used for now\r
}; \r
YAHOO.util.Connect.asyncRequest(\'GET\', \'/topengine/getClassDetails?key=\'+nodeId, callback, null); \r
}\r
\r
\r
function initializeTree() \r
{\r
//create the TreeView instance:\r
tree = new YAHOO.widget.TreeView("treediv");\r
\r
//get a reusable reference to the root node:\r
var root = tree.getRoot();\r
var dict;\r
\r
''')
stack = [('root', VFN(VFFSL(SL,"top_model",True),"get_owl_thing_class",False)()), ('root', VFN(VFFSL(SL,"top_model",True),"get_owl_nothing_class",False)())]
while len(VFFSL(SL,"stack",True)) > 0: # generated from line 73, col 9
parent_node, top_class = VFN(VFFSL(SL,"stack",True),"pop",False)(0)
key = VFN(VFN(VFFSL(SL,"top_class",True),"get_index",False)(),"get_key",False)()
node = 'p'+str(VFFSL(SL,"key",True))+'_'+str(VFFSL(SL,"parent_node",True))
write(''' \t\r
\tdict = {label:"''')
_v = VFN(VFN(VFFSL(SL,"top_class",True),"get_index",False)(),"get_name",False)() # '$top_class.get_index().get_name()' on line 78, col 25
if _v is not None: write(_filter(_v, rawExpr='$top_class.get_index().get_name()')) # from line 78, col 25.
write('''", id:"''')
_v = VFFSL(SL,"key",True) # '$key' on line 78, col 65
if _v is not None: write(_filter(_v, rawExpr='$key')) # from line 78, col 65.
write('''", href:"javascript:void nodeHref(\'''')
_v = VFFSL(SL,"key",True) # '$key' on line 78, col 104
if _v is not None: write(_filter(_v, rawExpr='$key')) # from line 78, col 104.
write('''\')"};\r
\tvar ''')
_v = VFFSL(SL,"node",True) # '$node' on line 79, col 14
if _v is not None: write(_filter(_v, rawExpr='$node')) # from line 79, col 14.
write(''' = new YAHOO.widget.TextNode(dict, ''')
_v = VFFSL(SL,"parent_node",True) # '$parent_node' on line 79, col 54
if _v is not None: write(_filter(_v, rawExpr='$parent_node')) # from line 79, col 54.
write(''', true);\r
\t''')
_v = VFFSL(SL,"node",True) # '$node' on line 80, col 10
if _v is not None: write(_filter(_v, rawExpr='$node')) # from line 80, col 10.
write(''' .labelStyle = "pnode";\r
\r
''')
if VFFSL(SL,"htype",True) == 'asserted': # generated from line 82, col 4
for sub_class in VFN(VFFSL(SL,"top_class",True),"get_asserted_direct_sub_classes",False)(): # generated from line 83, col 11
if VFN(VFFSL(SL,"sub_class",True),"has_class_identifier",False)(): # generated from line 84, col 21
write('''\t ''')
_v = VFN(VFFSL(SL,"stack",True),"append",False)((VFFSL(SL,"node",True), VFFSL(SL,"sub_class",True))) # '$stack.append(($node, $sub_class))' on line 85, col 22
if _v is not None: write(_filter(_v, rawExpr='$stack.append(($node, $sub_class))')) # from line 85, col 22.
write(''' ''')
else: # generated from line 88, col 7
cdic = {}
for sub_class in VFN(VFFSL(SL,"top_class",True),"get_inferred_direct_sub_classes",False)(): # generated from line 90, col 11
if VFN(VFFSL(SL,"sub_class",True),"has_class_identifier",False)(): # generated from line 91, col 21
cdic[sub_class.get_index().get_name()] = VFFSL(SL,"sub_class",True)
keys = VFN(VFFSL(SL,"cdic",True),"keys",False)()
write(''' ''')
_v = VFN(VFFSL(SL,"keys",True),"sort",False)() # '$keys.sort()' on line 96, col 17
if _v is not None: write(_filter(_v, rawExpr='$keys.sort()')) # from line 96, col 17.
write(''' ''')
for kdic in keys: # generated from line 97, col 17
write(''' ''')
_v = VFN(VFFSL(SL,"stack",True),"append",False)((VFFSL(SL,"node",True), VFFSL(SL,"cdic",True)[VFFSL(SL,"kdic",True)])) # '$stack.append(($node, $cdic[$kdic]))' on line 98, col 21
if _v is not None: write(_filter(_v, rawExpr='$stack.append(($node, $cdic[$kdic]))')) # from line 98, col 21.
write(''' ''')
write('''\r
tree.draw();\r
}\r
\r
</script>\r
\r
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />\r
<title>''')
_v = VFFSL(SL,"htype_name",True) # '$htype_name' on line 109, col 8
if _v is not None: write(_filter(_v, rawExpr='$htype_name')) # from line 109, col 8.
write(''' Model Hierarchy</title>\r
</head>\r
\r
<body onload="initializeTree()">\r
\r
<div class="outer-container">\r
\r
<div class="inner-container">\r
<div class="header">
<div class="title">
<span class="sitename"><a href="/topengine/">Top Engine</a></span>
<div class="slogan">Semantic Web Engine for the Enterprise</div>
</div>
</div>
\t<div class="path">\r
\t\t\t\r
\t\t\t<a href="/topengine/">Home</a> > <a href="/topengine/viewModelHierarchy?htype=''')
_v = VFFSL(SL,"htype",True) # '$htype' on line 120, col 85
if _v is not None: write(_filter(_v, rawExpr='$htype')) # from line 120, col 85.
write('''">View/Browse ''')
_v = VFFSL(SL,"htype_name",True) # '$htype_name' on line 120, col 105
if _v is not None: write(_filter(_v, rawExpr='$htype_name')) # from line 120, col 105.
write(''' Model</a>\r
\r
\t</div>\r
\r
\t<div class="main">\t\t\r
\t\t\r
<div class="content" id="contentdiv">\r
\r
<h1>Model Details</h1>\r
<blockquote><p>The devil is in the details!</p></blockquote>\r
<p>\r
Use the tree on the left to navigate to the concept of interest \r
using the +/- to expand/collapse the nodes and then click on the label\r
to see the detail here.\r
</p>\r
\r
</div>\r
\r
\t\t<div class="navigation">\r
\r
\t\t\t<h2>''')
_v = VFFSL(SL,"htype_name",True) # '$htype_name' on line 140, col 8
if _v is not None: write(_filter(_v, rawExpr='$htype_name')) # from line 140, col 8.
write(''' Hierarchy</h2>\r
<div id="expandcontractdiv">\r
<a href="javascript:tree.expandAll()">[Expand all]</a> \r
<a href="javascript:tree.collapseAll()">[Collapse all]</a>\r
</div>\r
\r
<div id="treediv"></div>\r
\r
\t\t</div>\r
\r
\t\t<div class="clearer"> </div>\r
\r
\t</div>\r
\r
<div class="footer">
<span class="left">
© 2007 <a href="http://www.dufresneconsulting.com">Dufresne Consulting LLC</a>. Valid <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> & <a href="http://validator.w3.org/check?uri=referer">XHTML</a>
</span>
<span class="right">
<a href="http://templates.arcsin.se">Website template</a> by <a href="http://arcsin.se">Arcsin</a>
</span>
<div class="clearer"></div>
</div>
\r
</div>\r
\r
</div>\r
\r
</body>\r
\r
</html>\r
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
##################################################
## CHEETAH GENERATED ATTRIBUTES
_CHEETAH__instanceInitialized = False
_CHEETAH_version = __CHEETAH_version__
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
_CHEETAH_genTime = __CHEETAH_genTime__
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
_CHEETAH_src = __CHEETAH_src__
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
_mainCheetahMethod_for_OWLHierarchyView= 'respond'
## END CLASS DEFINITION
if not hasattr(OWLHierarchyView, '_initCheetahAttributes'):
templateAPIClass = getattr(OWLHierarchyView, '_CHEETAH_templateClass', Template)
templateAPIClass._addCheetahPlumbingCodeToClass(OWLHierarchyView)
# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/
##################################################
## if run from command line:
if __name__ == '__main__':
from Cheetah.TemplateCmdLineIface import CmdLineIface
CmdLineIface(templateObj=OWLHierarchyView()).run()