[Checkins] SVN: Sandbox/ulif/grok-adminui/ Sandbox-experiment: grok with adminui and martians.

Uli Fouquet uli at gnufix.de
Mon Jun 25 23:27:57 EDT 2007


Log message for revision 77089:
  Sandbox-experiment: grok with adminui and martians.

Changed:
  U   Sandbox/ulif/grok-adminui/buildout.cfg
  U   Sandbox/ulif/grok-adminui/src/grok/admin/README.txt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.py
  A   Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.txt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Develop_btn.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Eval_btn.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Fire.gif
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/GROK_Logo.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/GROK_Ornament.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Highlight_Bkgrnd.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Learn_btn.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Bottom.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Middle.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Top.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax.jpg
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax.png
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax4.png
  A   Sandbox/ulif/grok-adminui/src/grok/admin/static/grok.css
  U   Sandbox/ulif/grok-adminui/src/grok/admin/view.py
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/appsindex.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokclassview.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokinterfaceview.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokmoduleview.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokpackageview.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokview.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/gaiaview.pt
  U   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/index.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/macros.pt
  A   Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/z3index.pt

-=-
Modified: Sandbox/ulif/grok-adminui/buildout.cfg
===================================================================
--- Sandbox/ulif/grok-adminui/buildout.cfg	2007-06-26 03:01:27 UTC (rev 77088)
+++ Sandbox/ulif/grok-adminui/buildout.cfg	2007-06-26 03:27:56 UTC (rev 77089)
@@ -3,9 +3,8 @@
 parts = data instance testdata testinstance test
 
 [zope3]
-#recipe = zc.recipe.zope3checkout
-#url = svn://svn.zope.org/repos/main/Zope3/branches/3.3
-location = /home/faassen/buildout/z331-lp
+recipe = zc.recipe.zope3checkout
+url = svn://svn.zope.org/repos/main/Zope3/branches/3.3
 
 [data]
 recipe = zc.recipe.filestorage
@@ -31,12 +30,18 @@
        zope.traversing.browser
        zope.app    
        zope.app-meta
+       zope.app.apidoc
+       zope.app.apidoc-meta
+       zope.app.preference
+       zope.app.preference-meta
        zope.app.securitypolicy
        zope.app.securitypolicy-meta
        zope.app.authentication
        zope.app.catalog
        zope.app.intid
        zope.app.keyreference
+       zope.app.renderer
+       zope.app.renderer-meta
        grok
        grok-meta
 

Modified: Sandbox/ulif/grok-adminui/src/grok/admin/README.txt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/README.txt	2007-06-26 03:01:27 UTC (rev 77088)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/README.txt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -1,6 +1,9 @@
 A basic grok admin UI
-====================
+=====================
 
+The internal name of the admin UI is:
+Grok Application Interface Application or, for short gaia.
+
 Overview
 --------
 
@@ -11,3 +14,29 @@
 
 * "Delete application" form: checkboxes displayed with listed installed
   applications. Selected items may be deleted.
+
+
+To Do
+-----
+
+* Better application handling
+
+  - Configure apps.
+
+* Maintenance tools
+
+  - Start/stop/restart Zope3.
+
+* Debugging tools
+
+  - Show error logs.
+
+* Introspection tool
+
+  - Give information concerning installed apps, their containers
+    and contained objects.
+
+* Nicer layout
+
+* AJAXification using some framework (MojiKit or KSS most probably)
+

Added: Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.py
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.py	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.py	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,464 @@
+"""The Grok's Friendly Doctor.
+
+Ask DocGrok and he will try his best, to keep you well informed about
+everything hanging around in your Zope3 and your Grok Application.
+"""
+
+import zope.component
+from zope.app.folder.interfaces import IRootFolder
+from zope.dottedname.resolve import resolve
+from zope.interface.interface import InterfaceClass
+from zope.security.proxy import isinstance
+from zope.proxy import removeAllProxies
+
+import os
+import types
+import grok
+import inspect
+import grok.interfaces
+from martian.scan import is_package, ModuleInfo
+from martian import InstanceGrokker, ModuleGrokker
+
+from zope.app.i18n import ZopeMessageFactory as _
+
+from zope.app.apidoc.codemodule.module import Module
+from zope.app.apidoc.codemodule.class_ import Class
+
+grok.context(IRootFolder)
+grok.define_permission('grok.ManageApplications')
+
+
+
+def handle_module( dotted_path, ob=None ):
+    if ob is None:
+        ob = resolve( dotted_path )
+    if not hasattr(ob, '__file__'):
+        return None
+    if not is_package(os.path.dirname(ob.__file__)):
+        return None
+    if os.path.basename(ob.__file__) in ['__init__.py',
+                                         '__init__.pyc',
+                                         '__init__.pyo']:
+        return None
+    return DocGrokModule(dotted_path)
+
+def handle_package( dotted_path, ob=None):
+    if ob is None:
+        ob = resolve( dotted_path )
+    if not hasattr(ob, '__file__'):
+        return None
+    if not is_package(os.path.dirname(ob.__file__)):
+        return None
+    if os.path.basename(ob.__file__) not in ['__init__.py',
+                                             '__init__.pyc',
+                                             '__init__.pyo']:
+        return None
+    return DocGrokPackage(dotted_path)
+
+def handle_interface(dotted_path, ob=None):
+    if ob is None:
+        ob = resolve(dotted_path)
+    if not isinstance(
+        removeAllProxies(ob), InterfaceClass):
+        return None
+    return DocGrokInterface(dotted_path)
+
+def handle_class(dotted_path, ob=None):
+    if ob is None:
+        ob = resolve(dotted_path)
+    if not isinstance(ob, (types.ClassType, type)):
+        return None
+    return DocGrokClass(dotted_path)
+
+# The docgroks registry.
+#
+# We register 'manually', because the handlers
+# are defined in the same module.
+docgrok_handlers = [
+    { 'name' : 'module',
+      'handler' : handle_module },
+    { 'name' : 'package',
+      'handler' : handle_package },
+    { 'name' : 'interface',
+      'handler' : handle_interface },
+    { 'name' : 'class',
+      'handler' : handle_class } ]
+
+
+def handle(dotted_path):
+    """Find a doctor specialized for certain things.
+    """
+    try:
+        ob = resolve( dotted_path )
+    except ImportError:
+        # There is no package of that name. Give back 404.
+        # XXX Do something more intelligent, offer a search.
+        return None
+    except:
+        return None
+
+    for handler in docgrok_handlers:
+        spec_handler = handler['handler']
+        doc_grok = spec_handler( dotted_path, ob )
+        if doc_grok is None:
+            continue
+        return doc_grok
+    return DocGrok(dotted_path)
+
+class DocGrokGrokker(InstanceGrokker):
+    """A grokker that groks DocGroks.
+
+    This grokker can help to 'plugin' different docgroks in an easy
+    way. You can register docgroks for your special classes, modules,
+    things. All required, is a function, that determines the correct
+    kind of thing, you like to offer a docgrok for and returns a
+    specialized docgrok or None (in case the thing examined is not the
+    kind of thing your docgrok is a specialist for).
+
+    Unfortunately, order counts here. If one docgrok handler is able
+    to deliver a specialized docgrok object, no further invesitgation
+    will be done.
+
+    In principle, the following should work. First we import the
+    docgrok module, because it contains a more specific grokker: the
+    InstanceGrokker 'docgrok_grokker' ::
+
+      >>> from grok.admin import docgrok
+
+    Then we get create an (empty) 'ModuleGrokker'. 'ModuleGrokkers'
+    can grok whole modules. ::
+      
+      >>> from martian import ModuleGrokker
+      >>> module_grokker = ModuleGrokker()
+
+    Then we register the 'docgrok_grokker', which should contain some
+    base handlers for modules, classes, etc. by default::
+      
+      >>> module_grokker.register(docgrok.docgrok_grokker)
+
+    The 'docgrok_grokker' is an instance of 'DocGrokGrokker'::
+
+      >>> from grok.admin.docgrok import DocGrokGrokker
+      >>> isinstance(docgrok.docgrok_grokker, DocGrokGrokker)
+      True
+
+    Now imagine, you have your own DocGroks for special things, for
+    example for a class 'Mammoth'. You might have derived this class
+    from DocGrok (or a subclass thereof), but this is not a
+    requirement. Note however, that other programmers might expect
+    your DocGroks to be compatible in a certain manner, so it surely
+    is a good idea to derive your GrokDocs from the original one.
+
+    Let's assume, your DocGrokMammoth is defined in a module called
+    'mammoth'::
+
+      >>> from grok.admin.docgrok import DocGrok
+      >>> class mammoth(FakeModule):
+      ...   class Mammoth(object):
+      ...     pass
+      ...
+      ...   class MammothDocGrok(DocGrok):
+      ...     def isMammoth(self):
+      ...       return True
+      ...
+      ...   def handle_mammoths(dotted_path,ob=None):
+      ...     if not isinstance(ob, Mammoth):
+      ...       return None
+      ...     return MammothDocGrok(dotted_path)
+
+    This is a simple DocGrok ('MammothDocGrok') accompanied by a
+    thing, it is representing (class 'Mammoth') and a handler
+    function, which decides, whether a given dotted path denotes a
+    Mammoth or not. The FakeModule class is a workaround to emulate
+    modules in doctests. Just think of watching a module, when you see
+    a FakeModule class.
+
+    Now we want to register this new DocGrok with the 'global
+    machinery'. Easy::
+    
+      >>> module_grokker.grok( 'mammoth_grokker', mammoth )
+      True
+      
+    Now the 'handle_mammoths' function is considered to deliver a
+    valid DocGrok, whenever it is asked. Every time, someone asks the
+    docgroks 'handle()' function for a suitable docgrok for things
+    that happen to be Mammoths, a DocGrokMammoth will be served.
+
+    Even the default docgrok viewer that comes with the grok package
+    in the admin interface, now will deliver your special views for
+    mammoths (if you defined one; otherwise the default 'DocGrok'
+    template will be used to show mammoth information).
+
+    XXX TODO: Show how to make a docgrok view.
+
+    That's it.
+    
+    """
+    component_class = types.FunctionType
+
+    def grok(self, name, obj, **kw):        
+        if not name.startswith('handle_'):
+            return False
+        if name in [x['name'] for x in docgrok_handlers]:
+            return False
+        #docgrok_handlers[name] = obj
+        docgrok_handlers.insert( 0, {'name':name,
+                                     'handler':obj})
+        return True
+
+
+## XXX deprecated...
+def getThingsType( dotted_path ):
+    """Determine type of thing described by a dotted path.
+
+    None for: thing does not exist/is not accessible by resolve().
+
+    'package' for: python package.
+    
+    'unknown' for: exists, but no special doctor for this desease.
+    """
+    try:
+        ob = resolve( dotted_path )
+    except ImportError:
+        # There is no package of that name. Give back 404.
+        # XXX Do something more intelligent, offer a search.
+        return None
+    except:
+        return None
+
+    if hasattr( ob, "__file__" ) and is_package(os.path.dirname(ob.__file__)):
+        if os.path.basename(ob.__file__) in ['__init__.py',
+                                             '__init__.pyc']:
+            return "package"
+        return "module"
+    elif isinstance(removeAllProxies(ob), InterfaceClass):
+        return "interface"
+    elif inspect.isclass(ob):
+        return "class"
+    return "unknown"
+
+
+def getDocGrokForDottedPath_obsolete( dotted_path ):
+    """Find a doctor, which is a specialist for the dotted path element.
+    """
+    return handle(dotted_path)
+    newtype = getThingsType( dotted_path )
+    if newtype is None:
+        # There is nothing of that name. Give back 404.
+        # XXX Do something more intelligent, offer a search.
+        return None
+    elif newtype == "package":
+        # We found a package. Let a DocGrokPackage handle further
+        # things.
+        doctor = DocGrokPackage( dotted_path )
+    elif newtype == "module":
+        doctor = DocGrokModule(dotted_path)
+    elif newtype == "interface":
+        doctor = DocGrokInterface(dotted_path)
+    elif newtype == "class":
+        doctor = DocGrokClass(dotted_path)
+    else:
+        doctor = DocGrok( dotted_path ) # Default
+    return doctor
+    
+    
+class DocGrok(grok.Model):
+    """DocGrok helps us finding out things about ourselves.
+
+    There are DocGroks for packages, modules, interfaces, etc., each
+    one a specialist for a certain type of element. 'Pure' DocGroks
+    build the root of this specialist hierarchy and care for objects,
+    which can not be handled by other, more specialized DocGroks.
+
+    DocGrok offers a minimum of information but can easily be extended in
+    derived classes.
+    """
+    msg = "I am Dr. Grok. How can I help you?"
+    path = None
+    _traversal_root = None
+    #_children = {}
+
+    def __init__(self, dotted_path ):
+        #super( DocGrok, self ).__init__()
+        self.path = dotted_path
+
+    def getPath(self):
+        return self.path
+
+    def getMsg(self):
+        return self.msg
+
+    def getFilePath( self ):
+        ob = resolve( self.path )
+        return hasattr(ob, __file__) and os.path.dirname(ob.__file__) or None
+
+    def traverse(self,patient):
+        """ Do special traversing inside the surgery.
+
+        Inside the docgrok-'namespace' we only accept DocGroks and
+        colleagues. Each DocGrok cares for a patient represented by a
+        path. This path might denote an object in the ZODB or in the
+        python path.
+
+        """
+        if patient == "index.html":
+            return self
+        if self.path is None:
+            newpath = patient
+        else:
+            newpath = '.'.join([self.path, patient])
+
+        #doctor = getDocGrokForDottedPath( newpath )
+        doctor = handle( newpath )
+
+        if doctor is None:
+            # There is nothing of that name. Give back 404.
+            # XXX Do something more intelligent, offer a search.
+            return None
+        #doctor.msg = "Do more grokking!"
+        doctor.__parent__ = self
+        doctor.__name__ = patient
+        doctor._traversal_root = self._traversal_root
+        doctor.path = newpath
+        return doctor
+    pass
+
+class DocGrokTraverser(grok.Traverser):
+    """If first URL element is 'docgrok', handle over to DocGrok.
+
+    This traverser binds to the RootFolder, which means, it is only
+    asked, when the publisher looks for elements in the Zope root (or
+    another IRootFolder). The further traversing is done by the Docs'
+    own traverser in it's model. See method `traverse()` in DocGrok.
+    """
+    grok.context(IRootFolder)
+
+    def traverse(self,path):
+        if path == "docgrok":
+            doctor = DocGrok(None)
+            # Giving a __parent__ and a __name__, we make things
+            # locatable in sense of ILocatable.
+            doctor.__parent__ = self.context
+            doctor.__name__ = 'docgrok'
+            doctor._traversal_root = doctor
+            return doctor
+        return None
+
+
+class DocGrokPackage(DocGrok):
+    """This doctor cares for python packages.
+    """
+    msg = "I am a Package of the Doc"
+    path=None
+    apidoc = None
+    _traversal_root = None
+
+    def __init__(self,dotted_path):
+        self.path = dotted_path
+        self._module = resolve(self.path)
+        # In apidoc packages are handled like modules...
+        self.apidoc = Module( None, None, self._module, True)
+
+    def getDocString( self ):
+        return self.apidoc.getDocString()
+
+    def getFilePath( self ):
+        ob = resolve( self.path )
+        return os.path.dirname( ob.__file__ ) + '/'
+
+    def _getModuleInfos( self, filter_func=lambda x:x ):
+        """Get modules and packages of a package.
+
+        The filter function will be applied to a list of modules and
+        packages of type grok.scan.ModuleInfo.
+        """
+        ob = resolve( self.path )
+        filename = ob.__file__
+        module_info = ModuleInfo( filename, self.path )
+        infos = module_info.getSubModuleInfos()
+        if filter_func is not None:
+            infos = filter( filter_func, infos)
+        #infos = [x for x in infos if not x.isPackage()]
+        result = []
+        for info in infos:
+            subresult = {}
+            # Build a url string from dotted path...
+            mod_path = "docgrok"
+            for path_part in info.dotted_name.split('.'):
+                mod_path = os.path.join( mod_path, path_part )
+            subresult = {
+                'url' : mod_path,
+                'name' : info.name,
+                'dotted_name' : info.dotted_name
+                }
+            result.append( subresult )
+        return result
+        
+
+    def getModuleInfos( self ):
+        """Get the modules inside a package.
+        """
+        filter_func = lambda x: not x.isPackage()
+        return self._getModuleInfos( filter_func )
+
+    def getSubPackageInfos( self ):
+        """Get the subpackages inside a package.
+        """
+        filter_func = lambda x: x.isPackage()
+        return self._getModuleInfos( filter_func )
+
+    def getChildren( self ):
+        result = self.apidoc.items()
+        result.sort( lambda x,y:cmp(x[0], y[0]) )
+        return result
+
+
+class DocGrokModule(DocGrokPackage):
+    """This doctor cares for python modules.
+    """
+
+    def getFilePath( self ):
+        ob = resolve( self.path )
+        filename = ob.__file__
+        if filename.endswith('o') or filename.endswith('c'):
+            filename = filename[:-1]
+        return filename
+
+       
+class DocGrokClass(DocGrokPackage):
+    """This doctor cares for classes.
+    """
+    def __init__(self,dotted_path):
+        self.path = dotted_path
+        self.klass = resolve(self.path)
+        self.module_path, self.name = dotted_path.rsplit('.',1)
+        self.module = resolve( self.module_path )
+        mod_apidoc = Module( None, None, self.module, False)
+        self.apidoc = Class( mod_apidoc, self.name, self.klass)
+
+    def getFilePath( self ):
+        if not hasattr( self.module, "__file__" ):
+            return None
+        filename = self.module.__file__
+        if filename.endswith('o') or filename.endswith('c'):
+            filename = filename[:-1]
+        return filename
+
+class DocGrokInterface(DocGrokClass):
+    """This doctor cares for interfaces.
+    """
+    def __init__(self,dotted_path):
+        self.path = dotted_path
+        self.klass = resolve(self.path)
+        self.module_path, self.name = dotted_path.rsplit('.',1)
+        self.module = resolve( self.module_path )
+        mod_apidoc = Module( None, None, self.module, False)
+        self.apidoc = Class( mod_apidoc, self.name, self.klass)
+
+    def getFilePath( self ):
+        if not hasattr( self.module, "__file__" ):
+            return None
+        filename = self.module.__file__
+        if filename.endswith('o') or filename.endswith('c'):
+            filename = filename[:-1]
+        return filename

Added: Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.txt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.txt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/docgrok.txt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,100 @@
+=======
+DocGrok
+=======
+
+The Grok's personal doctor.
+
+What is it?
+-----------
+
+DocGrok is meant as a friendly extension of the Zope 3 'builtin'
+apidoc feature. It should be easy to handle and informative in
+content. Main target are developers new to Grok.
+
+DocGrok is there to generate documentation for nearly everything
+living in a running Zope 3 instance.
+
+How to Use it
+-------------
+
+DocGrok documentation can be accessed through the web, calling special
+URL paths in your Zope 3 instance or (surprise!) directly via Python.
+
+
+Calling DocGrok through the web
++++++++++++++++++++++++++++++++
+
+To get documentation about a special element, call docgrok simply with
+`docgrok` as first part of the URL path.
+
+For example documentation about the grok package can be reached using
+
+    http://localhost:8080/docgrok/grok
+
+The admin package, which is located in the grok package can be
+accessed directly such:
+
+    http://localhost:8080/docgrok/grok/admin
+
+
+Calling the doctor directly
++++++++++++++++++++++++++++
+
+The doctor can also be reached via Python, naturally.
+
+   >>> from grok.admin import docgrok
+   >>> doctor = docgrok.DocGrok('grok.admin.docgrok')
+
+This doctor has immediatly a patient, which is denoted by the dotted
+path `grok.admin.docgrok`. The dotted path might reference any thing
+which lives in the Python environment: a package, a module, a class, a
+function or even a file or some interface attribute.
+
+   >>> doctor.getPath()
+   'grok.docgrok'
+
+We can also get a filepath, using the `getFilePath()` method. Objects,
+which have no filepath always return `None`.
+
+There is not much more information to get from Doc Grok. This is,
+because a `DocGrok` only knows very little about the objects. The base
+doc is not a specialist, but cares for all objects and elements, which
+can not be handled by other specialists.
+
+If we like to get more detailed information, we have to call a
+specialist. For example a package doctor, who happens to be called
+`DocGrokPackage`: 
+
+    >>> doctor = DocGrokPackage('grok.admin')
+
+
+    >>> doctor.path = 'grok.admin'
+    >>> doctor.getPath()
+    'grok.admin'
+
+Fine. Obviously DocGrokPackages know as much as DocGroks. That's
+little. But a package knows about package-things too:
+
+    >>> info = doctor.getSubPackageInfo()
+
+will generate infos concerning subpackages in the package formerly
+set.
+
+
+Getting a specialist directly
++++++++++++++++++++++++++++++
+
+Often we don't want to visit the base doctor, but a specialist
+directly. But how can we tell, what specialist we need? Easy. We use
+the function getDocGrokForDottedPath which delivers us a doctor, who
+can tell us more:
+
+    >>> from grok.admin.docgrok import getDocGrokForDottedPath
+    >>> thedoc = getDocGrokForDottedPath( 'grok.admin.docgrok' )
+    >>> type( thedoc )
+    <class 'grok.admin.docgrok.DocGrokModule'>
+
+This is correct. `docgrok` is a python module, so the best specialist
+we can get is a `DocGrokModule`. The mentioned function therefore is
+some kind of factory, which always gives us a doctor most appropriate
+for the kind of thing specified by a dotted path.

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Develop_btn.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Develop_btn.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Eval_btn.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Eval_btn.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Fire.gif
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Fire.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/GROK_Logo.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/GROK_Logo.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/GROK_Ornament.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/GROK_Ornament.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Highlight_Bkgrnd.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Highlight_Bkgrnd.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Learn_btn.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Learn_btn.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Bottom.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Bottom.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Middle.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Middle.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Top.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/Sidebar_Top.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax.jpg
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax.png
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax4.png
===================================================================
(Binary files differ)


Property changes on: Sandbox/ulif/grok-adminui/src/grok/admin/static/grok-relax4.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: Sandbox/ulif/grok-adminui/src/grok/admin/static/grok.css
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/static/grok.css	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/static/grok.css	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,443 @@
+/* @override http://www.urbantalk.se/DEVELOPER/grok_2/grok.css */
+
+body { 
+        bac/kground: #ffe;
+        background: #eee;
+        background: #fff;
+        ba/ckground: #bbb;
+        margin: 0px;
+        padding-top: -10px;
+	font-size: 13px;
+	font-family: verdana;
+	line-height: 20px;
+	color: #555555;
+
+}
+
+h1 {
+	font-size: 15px;
+	font-family: verdana;
+	line-height: 20px;
+        text-align: left;
+	color: #CC9900;
+	width: 100%;
+	margin: 23px auto 8px auto;
+	border-bottom: 1px solid #CC9900;
+}
+h2 {
+	font-size: 13px;
+	font-family: verdana;
+	line-height: 20px;
+	color: #CC9900;
+	width: 100%;
+	margin: 16px auto 8px auto;
+	border-bottom: 1px dotted #cccccc;
+}
+h3 {
+	font-size: 12px;
+	font-family: verdana;
+	line-height: 12px;
+	color: #555555;
+	width: 100%;
+	margin: 16px auto -4px auto;
+}
+p {
+	font-size: 13px;
+	font-family: verdana;
+	line-height: 20px;
+	color: #555555;
+	wi/dth: 540px;
+	margin: 8px auto;
+}
+p.download {
+	font-size: 10px;
+	font-weight: normal;
+	font-family: verdana;
+	line-height: 18px;
+	color: #555555;
+	margin: 4px 12px;
+	width: 176px;
+	
+}
+#menu {
+	font-size: 11px;
+	font-family: verdana;
+	line-height: 20px;
+	color: #A90101;
+}
+pre {
+	font-size: 11px;
+	font-family: courier;
+	line-height: 18px;
+	color: #A90101;
+	wi/dth: 540px;
+	margin: 8px auto;
+	padding: 16px 8px;
+	border-top: 1px solid #cccccc;
+	border-bottom: 1px solid #dddddd;
+	background: #eeeeee;
+}
+ul {
+	font-size: 11px;
+	font-family: verdana;
+	line-height: 20px;
+	color: #555555;
+	wi/dth: 540px;
+	margin: 16px auto;
+	list-style-type: none;
+}
+li {
+	margin: 0 50px 0 0;
+	left: 0;
+	padding: 0;
+}
+
+legend {
+	font-size: 12px;
+	font-family: verdana;
+        font-weight: bold;
+	line-height: 12px;
+	color: #555555;
+	color: #CC9900;
+	wi/dth: 100%;
+	margin: 16px auto -4px auto;
+}
+
+fieldset { 
+        background: url("Highlight_Bkgrnd.jpg");
+        border: 1px solid #c90;
+        wi/dth: 550px;
+}
+
+a > img { 
+        border: 0px;
+}
+
+
+a:link {
+	color: #555555;
+	text-decoration: none;
+	border-bottom-style: dotted;
+	border-bottom-width: 1px;
+}
+
+
+a:hover {
+	color: #CC9900;
+	border-bottom-style: dotted;
+	background-color: #ffffff;
+	border-width: 1px;
+}
+
+a:visited {
+	color: #555555;
+	text-decoration: none;
+	border-bottom-style: dotted;
+	border-bottom-width: 1px;
+}
+
+a:hover>img { 
+        background-color: #CC9900;
+        border: 0px;
+        border-bottom: 0px;
+}
+
+#logo { 
+        background-color: none;
+        border: 0px;
+        border-bottom: 0px;
+}
+
+div#tag_cloud {
+	margin:  16px 0px;
+}
+
+.tag_cloud>p {
+	font-family: verdana;
+	font-size: 13px;
+	line-height: 22px;
+	color: #555555;
+	width: 100%;
+	margin: 0 8px 8px 8px;
+}
+
+.tag_cloud>a:link {
+	color: #F7DA4A;
+}
+
+.tag_cloud>h3 {
+	font-family: verdana;
+	font-size: 10px;
+	font-weight: normal;
+	line-height: 20px;
+	color: #cccccc;
+	width: 100%;
+	margin: 0 8px -4px 8px;
+}
+
+div.track {
+	margin:  0;
+	padding:  0;
+	w/idth:  257px;
+	
+}
+
+.track>h2 {
+	padding: 0 8px;
+	font-size: 13px;
+	font-family: verdana;
+	line-height: 0px;
+	wi/dth: 253px;
+	border: none;
+}
+.track>a>p {
+	font-size: 13px;
+	font-family: verdana;
+	line-height: 20px;
+	color: #777777;
+	wi/dth: 249px;
+	margin: 0 2px;
+	padding: 3px 5px;
+}
+div.track>a>p:hover {
+	background-color: #ffffff;
+	color: #cc9900;
+}
+.track>p>a {
+	color:  #555555;
+}
+.track>p>a:link {
+	border-style: none;
+}
+.track>p>a:hover {
+	background-color: #dddddd;
+	border-style: none;
+}
+
+.menu_img {
+	margin: 0;
+	border-width: 0;
+}
+.menu_link {
+	margin: 0;
+	border-width: 0;
+	border-style: none;
+}
+.menu_link:hover {
+	margin: 0;
+	border-width: 0;
+	border-style: none;
+}
+
+div#version_info {
+	margin:  32px 0px;
+}
+
+.version_info>p {
+	font-family: verdana;
+	font-size: 13px;
+	line-height: 22px;
+	color: #CC9900;
+	width: 100%;
+	margin: 0 8px 8px 8px;
+}
+
+.version_info>h3 {
+	font-family: verdana;
+	font-size: 10px;
+	font-weight: normal;
+	line-height: 20px;
+	color: #cccccc;
+	width: 100%;
+	margin: 0 8px;
+}
+div.feature {
+	w/idth: 538px;  
+	min-height: 64px;
+	bac/kground: url('Highlight_Bkgrnd.jpg'); 
+	border-left: 1px solid #F7DA4A; 
+	border-left: 1px solid #ddd; 
+	bord/er-right: 1px solid #F7DA4A
+	border-right: 5px solid #ddd; 
+}
+
+div.feature > p {
+	wi/dth: 522px;
+	min-height: 64px;
+	padding: 8px 8px 0 8px;
+	color: #888888;
+	margin: 0;
+}
+
+div.feature > p:hover {
+	bac/kground-color: #ffffff;
+	background: url('Highlight_Bkgrnd.jpg'); 
+	color: #cc9900;
+}
+
+div.feature_top {
+	width: 540px;
+	height: 7px; 
+	background: url('Highlight_T.jpg') repeat-x
+}
+div.feature_bottom {
+	width: 540px;
+	height: 7px; 
+	background: url('Highlight_B.jpg') repeat-x
+}
+
+img.track_button {
+	float: left;
+	border-width: 0;
+	margin-left: 6px;
+	margin-right: 16px;
+}
+
+div#sidebar > h1 {
+	padding: 5px auto 0 auto;
+	text-align: center;
+	color: #777;
+	font-family: verdana;
+	font-size: 12px; 
+	font-weight: bold;
+	width: 264px; height: 27px; 
+	background: url("Sidebar_Top.jpg") no-repeat;
+	border: none;
+	margin:  0;
+}
+
+img.sidebar_divider {
+	padding: 0 0 3px 0;
+}
+
+img.people {
+	float: left;
+	border: 0px solid #F7DA4A;	
+}
+
+div#Breadcrumbs { 
+        padding-left: 5px;
+	font-size: 15px;
+	font-family: verdana;
+	color: #CC9900;
+        f/ont-style: verdana;
+        to/p: 59px;
+        background: url("Highlight_Bkgrnd.jpg");
+        ba/ckground: url("GROK_Ornament_small.jpg");
+        border-top: 1px solid #CC9900;
+}
+
+div#Content {
+        text-align: left;
+        po/sition: absolute;
+        le/ft: 290px;
+        t/op: 91px;
+        m/in-width: 400px;
+        m/ax-width: 540px;
+              max-width: 80%;
+        marg/in-left: 30%;
+        marg/in-right: 30%;
+        min-width: 50%;
+        max-width: 90%;
+}
+
+div#Fireplace { 
+        position: absolute; 
+        right: 0px; 
+        top: 10px; 
+        width: 205px; 
+        height: 105px;
+}
+div#Banner {
+        height: 81px;
+        background: #eeeeee url("GROK_Ornament.jpg") repeat-x;
+}
+
+#Footer-marker { 
+       text-align: center;
+       font-size: 10px;
+       color: #CC9900;
+       margin-top: 20px
+}
+#Footer-copyright {
+       text-align: center; 
+       font-size: 9px
+}
+#Sidebar { 
+       position: absolute;
+       left: 10px;
+       top: 112px;
+       width: 264px;
+       background: #dddddd url("Sidebar_Middle.jpg") repeat-y;
+}
+#SearchBox { 
+       padding: 5px 8px;
+}
+
+input,select { 
+       border: 1px solid #CC9900;
+       padding-left: 2px;
+}
+
+.button { 
+       background-color: #ccc;
+       font-size: 12px;
+       padding: 0px;
+       border: groove #CC9900 2px;
+}
+
+a.button { 
+       color: #000;
+       padding: 2px;
+       padding-top: 0px;
+       border-bottom: groove #CC9900 2px;
+}
+
+a:hover.button { 
+       background-color: #ccc;
+       color: #000;
+       padding: 2px;
+       padding-top: 0px;
+       border: groove #CC9900 2px;
+       border-bottom: groove #CC9900 2px;
+}
+
+.checkbox { 
+       border: groove #CC9900 2px;
+}
+.huge { 
+       text-align: center;
+       font-size: 16px;
+}
+.emph { 
+       font-weight: bold;
+}
+.rightalign { 
+       text-align: right;
+}
+
+
+/* docgrok related... */
+
+.docgrok-entry { 
+       margin-bottom: 5px;
+}
+.docgrok-description1 { 
+       font-weight: bold;
+}
+.docgrok-pathvalue { 
+       font-family: courier;
+}
+.docgrok-annotation1 { 
+       margin-left: 2ex;
+}
+.docgrok-annotation2 { 
+       margin-left: 5ex;
+}
+.docgrok-pycode1 { 
+       font-family: courier;
+       color: #00f;
+}
+.docgrok-elemname1 { /* Element names in headings */
+       color: #555555;
+}
\ No newline at end of file

Modified: Sandbox/ulif/grok-adminui/src/grok/admin/view.py
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view.py	2007-06-26 03:01:27 UTC (rev 77088)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view.py	2007-06-26 03:27:56 UTC (rev 77089)
@@ -1,24 +1,44 @@
+import grok
+from grok.admin.docgrok import DocGrok, DocGrokPackage, DocGrokModule, getThingsType
+from grok.admin.docgrok import DocGrokClass, DocGrokInterface
+
 import zope.component
-import grok.interfaces
 from zope.app.folder.interfaces import IRootFolder
 
+from zope.app import zapi
+from zope.app.applicationcontrol.interfaces import IServerControl
+from zope.app.applicationcontrol.applicationcontrol import applicationController
+from zope.app.applicationcontrol.runtimeinfo import RuntimeInfo
+from zope.app.applicationcontrol.browser.runtimeinfo import RuntimeInfoView
+
+from zope.interface.interface import InterfaceClass
+from zope.app.apidoc import utilities, codemodule
+from zope.app.apidoc.utilities import getPythonPath, renderText, columnize
+from zope.app.apidoc.codemodule.module import Module
+from zope.app.apidoc.codemodule.class_ import Class
+from zope.app.apidoc.codemodule.function import Function
+from zope.app.apidoc.codemodule.text import TextFile
+from zope.app.apidoc.codemodule.zcml import ZCMLFile
+
+from zope.proxy import removeAllProxies
+
 grok.context(IRootFolder)
 grok.define_permission('grok.ManageApplications')
 
-class Index(grok.View):
-    grok.name('index.html') # the root folder isn't a grok.Model
-    grok.require('grok.ManageApplications')
 
-    def update(self):
-        apps = zope.component.getAllUtilitiesRegisteredFor(
-            grok.interfaces.IApplication)
-        self.applications = ("%s.%s" % (x.__module__, x.__name__)
-                             for x in apps)
 
 class Add(grok.View):
     grok.require('grok.ManageApplications')
 
-    def render(self, application, name):
+    def update(self, inspectapp=None, application=None):
+        if inspectapp is not None:
+            self.redirect( self.url("docgrok") + "/%s/index"%(application.replace('.','/'),))
+        return 
+
+    def render(self, application, name, inspectapp=None):
+        if name is None or name == "":
+            self.redirect(self.url(self.context))
+            return
         app = zope.component.getUtility(grok.interfaces.IApplication,
                                         name=application)
         self.context[name] = app()
@@ -27,10 +47,229 @@
 class Delete(grok.View):
     grok.require('grok.ManageApplications')
 
-    def render(self, items):
+    def render(self, items=None):
+        if items is None:
+            self.redirect(self.url(self.context))
+            return
         if not isinstance(items, list):
             items = [items]
         for name in items:
             del self.context[name]
         self.redirect(self.url(self.context))
 
+class GAIAView(grok.View):
+    """A grok.View with a special application_url.
+
+    We have to compute the application_url different from common
+    grok.Views, because we have no root application object in the
+    adminUI. To avoid mismatch, we also call it 'root_url'.
+    """
+    def root_url(self, name=None):
+        obj = self.context
+        result = ""
+        while obj is not None:
+            if __grok_context__.providedBy(obj):
+                return self.url(obj, name)
+            obj = obj.__parent__
+        raise ValueError("No application nor root element found.")
+
+
+class Index(GAIAView):
+    """A redirector to the real frontpage.
+    """
+    grok.name('index.html') # the root folder isn't a grok.Model
+    grok.require('grok.ManageApplications')
+
+    def update(self):
+        apps = zope.component.getAllUtilitiesRegisteredFor(
+            grok.interfaces.IApplication)
+        self.applications = ("%s.%s" % (x.__module__, x.__name__)
+                             for x in apps)
+        # Go to the first page immediatly...
+        self.redirect(self.url('appsindex'))
+
+
+class AppsIndex(GAIAView):
+    """View for application management."""
+    grok.name('appsindex')
+    grok.require('grok.ManageApplications')
+
+    def update(self):
+        apps = zope.component.getAllUtilitiesRegisteredFor(
+            grok.interfaces.IApplication)
+        self.applications = ("%s.%s" % (x.__module__, x.__name__)
+                             for x in apps)
+
+class Z3Index(GAIAView):
+    """Zope3 management screen."""
+    grok.name('z3index')
+    grok.require('grok.ManageApplications')
+
+    riv = RuntimeInfoView()
+
+    def serverControl(self):
+        return zapi.getUtility(IServerControl)
+
+    def runtimeInfo(self):
+        self.riv.context = applicationController
+        return self.riv.runtimeInfo()
+
+    def update(self, time=None, restart=None, shutdown=None):
+        self.ri = self.runtimeInfo()
+
+        if time is None:
+            return
+        try:
+            time = int(time)
+        except:
+            return
+        control = self.serverControl()
+        if restart is not None:
+            control.restart(time)
+        elif shutdown is not None:
+            control.shutdown(time)
+        self.redirect(self.url())
+
+
+
+class Macros(GAIAView):
+    """Only to contain the standard macros."""
+    grok.context(IRootFolder)
+    pass
+
+class ApidocMacros(GAIAView):
+    """Macros for apidoc documentation."""
+    grok.context(IRootFolder)
+    pass
+
+
+
+class DocGrokView(GAIAView):
+    """The doctor is in.
+    """
+    grok.context(DocGrok)
+    grok.name( 'index' )
+
+    def getDoc(self, text=None, heading_only=False):
+        """Get the doc string of the module STX formatted.
+        """
+        if text is None:
+            return None
+            if hasattr( self.context, "apidoc") and hasattr(
+                self.context.apidoc, "getDocString" ):
+                text = self.context.apidoc.getDocString()
+            else:
+                return None
+        lines = text.strip().split('\n')
+        if len(lines) and heading_only:
+            # Find first empty line to separate heading from trailing text.
+            headlines = []
+            for line in lines:
+                if line.strip() == "":
+                    break
+                headlines.append(line)
+            lines = headlines
+        # Get rid of possible CVS id.
+        lines = [line for line in lines if not line.startswith('$Id')]
+        return renderText('\n'.join(lines), self.context.getPath())
+        
+
+    def getDocHeading( self, text=None):
+        return self.getDoc( text, True)
+
+    def getPathParts(self, path=None):
+        """Get parts of a dotted name as url and name parts.
+        """
+        if path is None:
+            path = self.context.path
+        result = []
+        part_path = ""
+        for part in path.split( '.' ):
+            name = part
+            if part_path != "":
+                name = "." + part
+            part_path += part
+            result.append( {
+                'name':name,
+                'url':"/docgrok/%s" % (part_path,)
+                })
+            part_path += "/"
+        return result
+
+    def getEntries( self, columns=True ):
+        """Return info objects for all modules and classes in the
+        associated apidoc container.
+        """
+        if not hasattr(self.context, "apidoc") or not hasattr(self.context.apidoc, "items"):
+            return None
+        entries = [{'name': name,
+                    'obj' : obj,
+                    'doc' : (
+                         hasattr(obj,"getDocString") and self.getDocHeading(obj.getDocString())) or  (
+                         hasattr(obj, "getDoc") and isinstance(
+                         removeAllProxies(obj), InterfaceClass) and self.getDocHeading(obj.getDoc())) or  None,
+                    # only for interfaces; should be done differently somewhen
+                    'path': getPythonPath(removeAllProxies(obj)),
+                    'url': ("%s.%s" % (self.context.path, name)).replace('.','/'),
+                    'ispackage': getThingsType(
+                         "%s.%s" % (self.context.path,name) ) == "package",
+                    'ismodule': getThingsType(
+                         "%s.%s" % (self.context.path,name) ) == "module",
+                    'isinterface': isinstance(
+                         removeAllProxies(obj), InterfaceClass),
+                    'isclass': isinstance(obj, Class),
+                    'isfunction': isinstance(obj, Function),
+                    'signature' : isinstance(obj, Function) and obj.getSignature() or None,
+                    'istextfile': isinstance(obj, TextFile),
+                    'iszcmlfile': isinstance(obj, ZCMLFile)}
+                   for name, obj in self.context.apidoc.items()]
+        entries.sort(lambda x, y: cmp(x['name'], y['name']))
+        #if columns:
+        #    entries = columnize(entries)
+        return entries
+
+
+    def update(self):
+        self.docgrok_root = self.context._traversal_root
+        self.app_root = self.docgrok_root.__parent__
+        pass
+
+
+class DocGrokPackageView(DocGrokView):
+    grok.context(DocGrokPackage)
+    grok.name( 'index' )
+
+class DocGrokModuleView(DocGrokView):
+    grok.context(DocGrokModule)
+    grok.name( 'index' )
+
+class DocGrokClassView(DocGrokView):
+    grok.context(DocGrokClass)
+    grok.name( 'index' )
+
+    def getBases(self):
+        return self._listClasses(self.context.apidoc.getBases())
+
+    def getInterfaces(self):
+        return self._listClasses([iface for iface in self.context.apidoc.getInterfaces()])
+
+    def _listClasses(self, classes):
+        info = []
+        for cls in classes:
+            unwrapped_cls = removeAllProxies(cls)
+            fullpath = getPythonPath(unwrapped_cls)
+            if not fullpath:
+                continue
+            path, name = fullpath.rsplit('.', 1)
+            info.append( {
+                'path': path or None,
+                'path_parts' : self.getPathParts( path ) or None,
+                'name': name,
+                'url': fullpath and fullpath.replace('.','/') or None,
+                'doc': self.getDocHeading( cls.__doc__ ) or None
+                })
+        return info
+
+class DocGrokInterfaceView(DocGrokClassView):
+    grok.context(DocGrokInterface)
+    grok.name( 'index' )

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/appsindex.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/appsindex.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/appsindex.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,64 @@
+<html metal:use-macro="context/@@macros/gaia-page">
+  <div metal:fill-slot="content">
+
+<!--
+    <h1>Grok Applications:</h1>
+-->
+
+    <form tal:define="apps context/values"
+	  tal:attributes="action string:${context/@@absolute_url}/delete"
+	  tal:condition="apps|nothing">
+      <fieldset>
+	<legend>Installed applications</legend>
+	<div tal:repeat="app apps">
+	  <input type="checkbox" 
+		 class="checkbox" 
+		 tal:attributes="value app/__name__;
+				 name string:items" />
+	  <a tal:attributes="href string:${context/@@absolute_url}/${app/__name__}">
+	    <span tal:replace="app/__name__"/>
+	    (<span tal:replace="app/__class__/__name__"/>)
+	  </a>
+	  &nbsp;&nbsp;
+<!--
+	  <a href="" class="button"
+	     tal:attributes="href string:${context/@@absolute_url}/inspect?app=${app/__name__}">
+	    Inspect...
+	  </a>
+-->
+	</div>
+
+	<p>
+	  <input class="button" type="submit" value="Delete Selected"/></p>
+      </fieldset>
+    </form>
+    <form action="" tal:attributes="action string:${context/@@absolute_url}/add">
+      <fieldset>
+	<legend>Add application</legend>
+	<div>
+	  <span>
+	    <label for="application">Application: 
+	    <select height="1" name="application"> 
+	      <option tal:repeat="app view/applications" 
+		      tal:attributes="value app" 
+		      tal:content="app"
+		      />
+	    </select> 
+	    </label>
+	    <input type="submit" name="inspectapp" value="more..." />
+<!--
+	    <a href=""
+	       tal:attributes="href string:${context/@@absolute_url}/inspect?app=${app/__name__}">more...</a>
+-->
+	  </span>
+	</div>
+
+	<p><label>Name your new app: <input type="text" name="name"/></label></p>
+	  
+	<p><input class="button" type="submit" value="Add"/></p>
+
+      </fieldset>
+    </form>
+  </div>
+
+</html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokclassview.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokclassview.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokclassview.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,206 @@
+<html metal:use-macro="view/app_root/@@macros/gaia-page">
+  <head>
+    <title>DocGrok page title</title>
+  </head>
+  <body>
+    <div metal:fill-slot="content">
+
+      <h1>
+	Class
+	<span class="docgrok-pathvalue">
+	  <span class="docgrok-elemname1">
+	    <span tal:replace="context/name">ClassName</span>
+	  </span>
+	</span> in <span class="docgrok-pathvalue">
+	  <span tal:repeat="part python: view.getPathParts()[:-1]"><a href=""
+	       tal:attributes="href string:${view/root_url}${part/url}"
+	       tal:content="part/name">part</a></span></span> (Python Class)
+      </h1>
+      <div class="docgrok-entry" 
+	   tal:content="structure python: view.getDoc(context.getDocString())">
+	Documentation string.
+      </div>
+      <div>
+	<h2>Paths</h2>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Python path:</span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/path">path.in.python</span>
+	  <div class="docgrok-annotation2">
+	    Use <span class="docgrok-pycode1">from <span tal:replace="context/module_path">path</span> 
+	    import <span tal:replace="context/name">path</span></span>
+	    to use the functionality of this module in your application or component.
+	  </div>
+	</div>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Absolute file path: </span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/getFilePath">/absolute/file/path</span>
+	  <div class="docgrok-annotation2">
+	    This is the file, wherein this class is defined.
+	  </div>
+	</div>
+
+      </div>
+      <div>
+
+	<h2>Base Classes</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getBases">
+	  class
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+	       tal:content="item/name">
+	      ClassName
+	    </a>
+	  </span>
+	  in
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:repeat="part item/path_parts"
+	       tal:attributes="href string:${view/root_url}${part/url}">
+
+	      <span tal:replace="part/name" />
+	    </a>
+	  </span>
+	  <div class="docgrok-annotation2"
+	       tal:condition="item/doc"
+	       tal:content="structure item/doc">
+	  </div>
+	  <div class="docgrok-annotation2"
+	       tal:condition="not: item/doc">
+	    Use <span class="docgrok-pycode1">from <span
+	    tal:replace="item/path">x</span> import <span
+	    tal:replace="item/name">y</span></span> to make the
+	    functionality of this class available in your application
+	    or component.
+	  </div>
+	</div>
+
+	<h2>Interfaces</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getInterfaces">
+	  interface
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+	       tal:content="item/name">
+	      ClassName
+	    </a>
+	  </span>
+	  in
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:repeat="part item/path_parts"
+	       tal:attributes="href string:${view/root_url}${part/url}">
+
+	      <span tal:replace="part/name" />
+	    </a>
+	  </span>
+	  <div class="docgrok-annotation2"
+	       tal:condition="item/doc"
+	       tal:content="structure item/doc">
+	  </div>
+	  <div class="docgrok-annotation2"
+	       tal:condition="not: item/doc">
+	    Use <span class="docgrok-pycode1">from <span
+	    tal:replace="item/path">x</span> import <span
+	    tal:replace="item/name">y</span></span> to make the
+	    functionality of this class available in your application
+	    or component.
+	  </div>
+	</div>
+
+	<div tal:repeat="iface view/getInterfaces">
+	  <div tal:content="python: str(iface)">asd</div>
+	</div>
+<!--
+	<h2>Functions:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isfunction">
+	    <div class="docgrok-pathvalue">
+	      function
+	      <a href=""
+		 tal:attributes="href 
+				 string:${view/root_url}/docgrok/${item/url}" >
+		<span tal:content="item/name">function_name</span><span tal:content="item/signature">(signature)</span>
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make the
+	      functionality of this class available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+
+	<h2>Interfaces:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isinterface">
+	    <div class="docgrok-pathvalue">
+	      interface
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="item/name">
+		InterfaceName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make this
+	      interface definition available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+
+	<h2>Classes:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isclass">
+	    <div class="docgrok-pathvalue">
+	      class
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="item/name">
+		ClassName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make the
+	      functionality of this class available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+-->
+      </div>
+
+    </div>
+  </body>
+</html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokinterfaceview.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokinterfaceview.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokinterfaceview.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,206 @@
+<html metal:use-macro="view/app_root/@@macros/gaia-page">
+  <head>
+    <title>DocGrok page title</title>
+  </head>
+  <body>
+    <div metal:fill-slot="content">
+
+      <h1>
+	Interface
+	<span class="docgrok-pathvalue">
+	  <span class="docgrok-elemname1">
+	    <span tal:replace="context/name">ClassName</span>
+	  </span>
+	</span> in <span class="docgrok-pathvalue">
+	  <span tal:repeat="part python: view.getPathParts()[:-1]"><a href=""
+	       tal:attributes="href string:${view/root_url}${part/url}"
+	       tal:content="part/name">part</a></span></span> (Python Class)
+      </h1>
+      <div class="docgrok-entry" 
+	   tal:content="structure python: view.getDoc(context.getDocString())">
+	Documentation string.
+      </div>
+      <div>
+	<h2>Paths</h2>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Python path:</span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/path">path.in.python</span>
+	  <div class="docgrok-annotation2">
+	    Use <span class="docgrok-pycode1">from <span tal:replace="context/module_path">path</span> 
+	    import <span tal:replace="context/name">path</span></span>
+	    to use the functionality of this module in your application or component.
+	  </div>
+	</div>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Absolute file path: </span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/getFilePath">/absolute/file/path</span>
+	  <div class="docgrok-annotation2">
+	    This is the file, wherein this class is defined.
+	  </div>
+	</div>
+
+      </div>
+      <div>
+
+	<h2>Base Classes</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getBases">
+	  class
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+	       tal:content="item/name">
+	      ClassName
+	    </a>
+	  </span>
+	  in
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:repeat="part item/path_parts"
+	       tal:attributes="href string:${view/root_url}${part/url}">
+
+	      <span tal:replace="part/name" />
+	    </a>
+	  </span>
+	  <div class="docgrok-annotation2"
+	       tal:condition="item/doc"
+	       tal:content="structure item/doc">
+	  </div>
+	  <div class="docgrok-annotation2"
+	       tal:condition="not: item/doc">
+	    Use <span class="docgrok-pycode1">from <span
+	    tal:replace="item/path">x</span> import <span
+	    tal:replace="item/name">y</span></span> to make the
+	    functionality of this class available in your application
+	    or component.
+	  </div>
+	</div>
+
+	<h2>Interfaces</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getInterfaces">
+	  interface
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+	       tal:content="item/name">
+	      ClassName
+	    </a>
+	  </span>
+	  in
+	  <span class="docgrok-pathvalue">
+	    <a href=""
+	       tal:repeat="part item/path_parts"
+	       tal:attributes="href string:${view/root_url}${part/url}">
+
+	      <span tal:replace="part/name" />
+	    </a>
+	  </span>
+	  <div class="docgrok-annotation2"
+	       tal:condition="item/doc"
+	       tal:content="structure item/doc">
+	  </div>
+	  <div class="docgrok-annotation2"
+	       tal:condition="not: item/doc">
+	    Use <span class="docgrok-pycode1">from <span
+	    tal:replace="item/path">x</span> import <span
+	    tal:replace="item/name">y</span></span> to make the
+	    functionality of this class available in your application
+	    or component.
+	  </div>
+	</div>
+
+	<div tal:repeat="iface view/getInterfaces">
+	  <div tal:content="python: str(iface)">asd</div>
+	</div>
+<!--
+	<h2>Functions:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isfunction">
+	    <div class="docgrok-pathvalue">
+	      function
+	      <a href=""
+		 tal:attributes="href 
+				 string:${view/root_url}/docgrok/${item/url}" >
+		<span tal:content="item/name">function_name</span><span tal:content="item/signature">(signature)</span>
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make the
+	      functionality of this class available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+
+	<h2>Interfaces:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isinterface">
+	    <div class="docgrok-pathvalue">
+	      interface
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="item/name">
+		InterfaceName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make this
+	      interface definition available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+
+	<h2>Classes:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isclass">
+	    <div class="docgrok-pathvalue">
+	      class
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="item/name">
+		ClassName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make the
+	      functionality of this class available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+-->
+      </div>
+
+    </div>
+  </body>
+</html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokmoduleview.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokmoduleview.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokmoduleview.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,129 @@
+<html metal:use-macro="view/app_root/@@macros/gaia-page">
+  <head>
+    <title>DocGrok page title</title>
+  </head>
+  <body>
+    <div metal:fill-slot="content">
+
+      <h1>
+	<span class="docgrok-pathvalue">
+	  <span tal:repeat="part view/getPathParts"><a href=""
+	       tal:attributes="href string:${view/root_url}${part/url}"
+	       tal:content="part/name">part</a></span></span> (Python Module)
+      </h1>
+      <div class="docgrok-entry" 
+	   tal:content="structure python: view.getDoc(context.getDocString())">
+	Documentation string.
+      </div>
+      <div>
+	<h2>Paths</h2>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Python path:</span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/path">path.in.python</span>
+	  <div class="docgrok-annotation2">
+	    Use <span class="docgrok-pycode1">import 
+	    <span tal:replace="context/path">path</span></span>
+	    to use the functionality of this module in your application or component.
+	  </div>
+	</div>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Absolute file path: </span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/getFilePath">/absolute/file/path</span>
+	  <div class="docgrok-annotation2">
+	    This is the file, where this module is located in file system.
+	  </div>
+	</div>
+
+      </div>
+      <div>
+
+	<h2>Functions:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isfunction">
+	    <div class="docgrok-pathvalue">
+	      function
+	      <a href=""
+		 tal:attributes="href 
+				 string:${view/root_url}/docgrok/${item/url}" >
+		<span tal:content="item/name">function_name</span><span tal:content="item/signature">(signature)</span>
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make the
+	      functionality of this class available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+
+	<h2>Interfaces:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isinterface">
+	    <div class="docgrok-pathvalue">
+	      interface
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="item/name">
+		InterfaceName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make this
+	      interface definition available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+
+	<h2>Classes:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/isclass">
+	    <div class="docgrok-pathvalue">
+	      class
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="item/name">
+		ClassName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      Use <span class="docgrok-pycode1">from <span
+	      tal:replace="context/path">x</span> import <span
+	      tal:replace="item/name">y</span></span> to make the
+	      functionality of this class available in your application
+	      or component.
+	    </div>
+	  </div>
+	</div>
+
+      </div>
+
+    </div>
+  </body>
+</html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokpackageview.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokpackageview.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokpackageview.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,101 @@
+<html metal:use-macro="view/app_root/@@macros/gaia-page">
+  <head>
+    <title>DocGrokPackage page title</title>
+  </head>
+  <body>
+    <div metal:fill-slot="content">
+
+      <h1>
+	<span class="docgrok-pathvalue">
+	  <span tal:repeat="part view/getPathParts"><a href=""
+						       tal:attributes="href string:${view/root_url}${part/url}"
+						       tal:content="part/name">part</a></span>
+	</span> 
+	(Python Package)
+      </h1>
+      <div>
+
+	<h2>Paths</h2>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Python path:</span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/path">path.in.python</span>
+	  <div class="docgrok-annotation2">
+	    Use <span class="docgrok-pycode1">import 
+	    <span tal:replace="context/path">path</span></span>
+	    to use the functionality of this package in your application or component.
+	  </div>
+	</div>
+
+	<div class="docgrok-entry">
+	  <span class="docgrok-description1">Absolute file path: </span>
+	  <span class="docgrok-pathvalue" 
+		tal:content="context/getFilePath">absolute/file/path</span>
+	  <div class="docgrok-annotation2">
+	    This is, where this package is located in file system.
+	  </div>
+	</div>
+
+	<h2>Subpackages:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/ispackage">
+	    <div class="docgrok-pathvalue">
+	      package
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="string: ${context/path}.${item/name}">
+		moduleName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      You can use <span class="docgrok-pycode1">import <span
+	      tal:replace="string: ${context/path}.${item/name}">a.b</span>
+	    </span>
+	    to make the elements of this package available in your 
+	    application or component.
+	    </div>
+	  </div>
+	</div>
+
+	<h2>Modules:</h2>
+
+	<div class="docgrok-entry" tal:repeat="item view/getEntries">
+	  <div tal:condition="item/ismodule">
+	    <div class="docgrok-pathvalue">
+	      module
+	      <a href=""
+		 tal:attributes="href string:${view/root_url}/docgrok/${item/url}" 
+		 tal:content="string: ${context/path}.${item/name}">
+		moduleName
+	      </a>
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="item/doc"
+		 tal:content="structure item/doc">
+	    </div>
+	    <div class="docgrok-annotation2"
+		 tal:condition="not: item/doc">
+	      You can use <span class="docgrok-pycode1">import <span
+	      tal:replace="string: ${context/path}.${item/name}">a.b</span>
+	    </span>
+	    to make the elements of this module available in your 
+	    application or component.
+	    </div>
+	  </div>
+	</div>
+
+<!--
+	<div tal:content="context/msg" />
+-->
+
+      </div>
+    </div>
+  </body>
+</html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokview.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokview.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/docgrokview.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,27 @@
+<html metal:use-macro="view/app_root/@@macros/gaia-page">
+  <head>
+    <title>DocGrok page title</title>
+  </head>
+  <body>
+    <div metal:fill-slot="content">
+      <div tal:content="context" />
+      <h1>DocGrok Documentation for
+	<span class="docgrok-pathvalue">
+	  <span tal:repeat="part view/getPathParts"><a href=""
+						       tal:attributes="href string:${view/root_url}${part/url}"
+						       tal:content="part/name">part</a></span>
+	</span> 
+      </h1>
+      <div class="Content">
+	<h2>Path</h2>
+	<div tal:content="context/path">
+	  path.to.some.element
+	</div>
+	<div class="description1">
+	  The python path of this element.
+	</div>
+      </div>
+    </div>
+    <div metal:fill-slot="footer">asda</div>
+  </body>
+</html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/gaiaview.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/gaiaview.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/gaiaview.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1 @@
+<!-- Just a placeholder -->

Modified: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/index.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/index.pt	2007-06-26 03:01:27 UTC (rev 77088)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/index.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -1,50 +1,14 @@
-<html>
-  <head>
-    <title>grok administration interface</title>
-  </head>
-
-  <body tal:define="apps context/values">
-    <h1>Grok Applications</h1>
-
-    <form tal:attributes="action string:${context/@@absolute_url}/delete"
-          tal:condition="apps|nothing">
-      <fieldset>
-        <legend>Installed applications</legend>
-
-    <ul>
-      <li tal:repeat="app apps">
-        <input type="checkbox" tal:attributes="value app/__name__;
-                                               name string:items" />
-        <a tal:attributes="href string:${context/@@absolute_url}/${app/__name__}">
-          <span tal:replace="app/__name__"/>
-          (<span tal:replace="app/__class__/__name__"/>)
-        </a>
-      </li>
-    </ul>
-
-        <p><input type="submit" value="Delete Selected"/></p>
-        </fieldset>
-    </form>
-    <form tal:attributes="action string:${context/@@absolute_url}/add">
-      <fieldset>
-        <legend>Add application</legend>
-
-        <p>
-          <label>Application: 
-            <select height="1" name="application"> 
-              <option tal:repeat="app view/applications" 
-                tal:attributes="value app" 
-                tal:content="app"
-                />
-            </select> 
-          </label>
-        </p>
-
-        <p><label>Name: <input type="text" name="name"/></label></p>
-
-        <p><input type="submit" value="Add"/></p>
-
-      </fieldset>
-    </form>
-  </body>
+<html metal:use-macro="context/@@macros/gaia-page">
+  <div metal:fill-slot="content">
+    <h1></h1>
+    <div class="logo">
+      <a href="context/@@appsindex"
+	 tal:attributes="href string:${context/@@absolute_url}/appsindex">
+	<img alt="Image of Grok relaxing..."
+	     src="grok-relax.jpg"
+	     tal:attributes="src view/static/grok-relax.png" />
+      </a>
+    </div>
+  </div>
+  <div metal:fill-slot="footer">asda</div>
 </html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/macros.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/macros.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/macros.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,169 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+	metal:define-macro="gaia-page">
+  <head>
+    <title
+	metal:define-slot="title"
+	>grok administration interface</title>
+    <link metal:define-slot="header"
+	rel="stylesheet" type="text/css" href="static/grok.css"
+	  tal:attributes="href view/static/grok.css" />
+    <metal:block define-slot="extrahead">
+    </metal:block>
+  </head>
+
+  <body>
+    <div>
+    <div id="Banner">
+      <a href="/" id="logo">
+	<img alt="Grok" src="images/GROK_Logo.jpg"
+	     tal:attributes="src view/static/GROK_Logo.jpg" />
+      </a>
+    </div>
+    <div id="Breadcrumbs">
+      Grok Admin Interface
+    </div>
+    <div id="Fireplace">
+      <img alt="Fire" src="images/Fire.gif"
+	   tal:attributes="src view/static/grok-relax4.png" />
+    </div>
+    <p></p>
+    <center tal:define="currview python:view.url()">
+      <span class="menu_link_inactive"
+	    tal:define="target python:view.root_url('appsindex')">
+	<a href="appsindex"
+	   tal:condition="python: target != currview"
+	   tal:attributes="href target"
+	   >Applications</a>
+	<span class="emph"
+	      tal:condition="python: target == currview">
+	  Applications
+	</span>
+      </span>
+	  &nbsp;&nbsp;
+      <span class="menu_link_inactive"
+	    tal:define="target python:view.root_url('z3index')">
+	<a href="z3index"
+	   tal:condition="python: target != currview"
+	   tal:attributes="href target"
+	   >Zope3</a>
+	<span class="emph"
+	      tal:condition="python: target == currview">
+	  Zope3
+	</span>
+      </span>
+      &nbsp;&nbsp;
+      <a href=""
+	 tal:attributes="href view/root_url">Debug</a>
+      &nbsp;&nbsp;
+      <a href=""
+	 tal:attributes="href view/root_url">Documentation</a>
+    </center>
+
+    <center>
+    <div id="Content">
+      <div metal:define-slot="content">
+
+	<h1>Welcome to Grok!</h1>
+
+	<div>
+	  Your friendly and easy way to Zope 3.
+	</div>
+
+      </div>
+      <div>
+
+<!--
+	<p id="Footer-marker">
+	  &copy; Copyright 2007, The Grok Community
+	- <a href="http://grok.zope.org">GROK</a>|<a href="http://www.zope.org">ZOPE3</a> -</p>
+-->
+	<p id="Footer-copyright">&copy; Copyright 2007, The Grok Community<br />Design by Sebastian Ware</p>
+      </div>
+    </div>
+    </center>
+
+
+<!--
+    <div id="Sidebar" metal:define-slot="sidebar">
+
+
+      <h1>GROK Navigator</h1>
+      
+      <div id="SearchBox">
+	<input type="text" value="Full-text search..." />
+	<input type="submit" class="button" value="Go" />
+      </div>
+
+      <img alt="===" class="sidebar_divider" src="Sidebar_Bottom.jpg"
+	   tal:attributes="src view/static/Sidebar_Bottom.jpg" />
+
+      <a href="appsindex">
+	<div class="feature">
+	  <p>
+	    <img alt="Manage your Apps" src="Develop_btn.jpg"  
+		 class="track_button"
+		 tal:attributes="src view/static/Develop_btn.jpg" />
+	    <b>Manage Apps</b>: Manage your Grok applications and components.
+	  </p>
+	</div>
+      </a>
+
+      <a href="z3index">
+	<div class="feature">
+	  <p>
+	    <img alt="Manage Zope3" src="Develop_btn.jpg"  class="track_button"
+		 tal:attributes="src view/static/Develop_btn.jpg" />
+	    <b>Manage Zope3</b>: Manage your Zope3 Server
+	  </p>
+	</div>
+      </a>
+-->
+<!--
+      <img alt="===" class="sidebar_divider" src="Sidebar_Bottom.jpg"
+	   tal:attributes="src view/static/Sidebar_Bottom.jpg" />
+-->
+<!--
+      <a href="">
+	<div class="feature">
+	  <p>
+	    <img alt="Debug" src="Eval_btn.jpg"  class="track_button"
+		 tal:attributes="src view/static/Eval_btn.jpg" />
+	    <b>Debug</b> your Grok Applications.
+	  </p>
+	</div>
+      </a>
+-->
+<!--
+      <img alt="===" class="sidebar_divider" src="Sidebar_Bottom.jpg"
+	   tal:attributes="src view/static/Sidebar_Bottom.jpg" />
+-->
+<!--
+      <a href="">
+	<div class="feature">
+	  <p>
+	    <img alt="Documentation" src="Learn_btn.jpg"  class="track_button"
+		 tal:attributes="src view/static/Learn_btn.jpg" />
+	    <b>Documentation</b>: Learn all about Grok and friends.
+	  </p>
+	</div>
+      </a>
+
+      <img alt="===" class="sidebar_divider" src="Sidebar_Bottom.jpg"
+	   tal:attributes="src view/static/Sidebar_Bottom.jpg" />
+      <div class="version_info">
+	<h3>Current version:</h3>
+	<p>
+	  This is just developer stuff and by no means ready for
+	  production use.
+	</p>
+      </div>
+      <img src="images/Sidebar_Bottom.jpg"
+	   tal:attributes="src view/static/Sidebar_Bottom.jpg" />
+
+    </div>
+
+  </div>
+-->
+
+  </body>
+</html>

Added: Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/z3index.pt
===================================================================
--- Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/z3index.pt	                        (rev 0)
+++ Sandbox/ulif/grok-adminui/src/grok/admin/view_templates/z3index.pt	2007-06-26 03:27:56 UTC (rev 77089)
@@ -0,0 +1,60 @@
+<html metal:use-macro="context/@@macros/gaia-page">
+  <div metal:fill-slot="content">
+    <h1>Manage your Zope 3 instance:</h1>
+
+    <form method="POST" action=""
+	  tal:attributes="action string:${context/@@absolute_url}/z3index">
+      <fieldset>
+	<legend>Manage Server Process</legend>
+	<input type="submit" name="restart" class="button" value="Restart Zope 3" />
+	<input type="submit" name="shutdown" class="button" value="Stop Zope 3" />
+	after <input type="text" name="time" value="0" size="4" /> seconds
+       </fieldset>
+
+      <fieldset tal:define="ri view/ri">
+	<legend>Server Process Info</legend>
+	<div>
+	  <span class="emph">Uptime:</span>
+	  <span tal:content="ri/Uptime">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">System Platform:</span>
+	  <span tal:content="ri/SystemPlatform">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">Zope Version:</span>
+	  <span tal:content="ri/ZopeVersion">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">Python Version:</span>
+	  <span tal:content="ri/PythonVersion">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">Command Line:</span>
+	  <span tal:content="ri/CommandLine">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">Preferred Encoding:</span>
+	  <span tal:content="ri/PreferredEncoding">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">File System Encoding:</span>
+	  <span tal:content="ri/FileSystemEncoding">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">Process Id:</span>
+	  <span tal:content="ri/ProcessId">unknown</span> 
+	</div>
+	<div>
+	  <span class="emph">Python Path:</span>
+	  <div tal:repeat="path ri/PythonPath">
+	    <span tal:content="path">unknown</span> 
+	  </div>
+	</div>
+       </fieldset>
+
+    </form>
+
+  </div>
+
+</html>



More information about the Checkins mailing list