Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
plone.app.kss.demo.site_creation_view.SiteCreationView Class Reference
Inheritance diagram for plone.app.kss.demo.site_creation_view.SiteCreationView:
Inheritance graph
[legend]
Collaboration diagram for plone.app.kss.demo.site_creation_view.SiteCreationView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def addUsers
def createSite
def createNodes
def run

Static Public Attributes

list objects_tree
list users

Detailed Description

Definition at line 19 of file site_creation_view.py.


Member Function Documentation

Definition at line 78 of file site_creation_view.py.

00078 
00079     def addUsers(self, portal):
00080         for user in self.users:
00081             portal.acl_users._doAddUser(user['username'], user['password'], user['roles'], [])
 

Here is the caller graph for this function:

def plone.app.kss.demo.site_creation_view.SiteCreationView.createNodes (   self,
  node,
  objs_tree,
  portal 
)
Recursive method that create the tree structure of content types used for kss tests.

Definition at line 91 of file site_creation_view.py.

00091 
00092     def createNodes(self, node, objs_tree, portal):
00093         """Recursive method that create the tree structure of content types used for kss tests."""
00094         for item in objs_tree:
00095             obj_id = item.get('id')
00096             obj_pt = item.get('portal_type')
00097             obj_attrs = item.get('attrs')
00098             obj_children = item.get('children')
00099             obj_transitions = item.get('transitions', ())
00100             if hasattr(node, obj_id):
00101                 # if the object exists, we'll delete it
00102                 node.manage_delObjects([obj_id])
00103             node.invokeFactory(obj_pt, obj_id)
00104             new_obj = getattr(node, obj_id, None)
00105             # writing object attributes
00106             new_obj.update(**obj_attrs)
00107             # applying the transitions in order
00108             for transition in obj_transitions:
00109                 portal.portal_workflow.doActionFor(new_obj, transition)
00110           
00111             # recursive call for creating other nodes
00112             self.createNodes(new_obj, obj_children, portal)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 82 of file site_creation_view.py.

00082 
00083     def createSite(self, root):
00084         site_id = 'ksstestportal'
00085         if hasattr(root, site_id):
00086             logger.info('Deleting previous site "%s".' % (site_id, ))
00087             root.manage_delObjects([site_id])
00088         logger.info('Adding new site "%s".' % (site_id, ))
00089         addPloneSite(dispatcher=root, id=site_id, extension_ids=())
00090         return root[site_id]

Here is the call graph for this function:

Here is the caller graph for this function:

This method invokes the recursive method createNodes which creates the tree structure of
objects used by.

Definition at line 113 of file site_creation_view.py.

00113 
00114     def run(self, zoperoot):
00115         """This method invokes the recursive method createNodes which creates the tree structure of
00116         objects used by.
00117         """
00118         site = self.createSite(zoperoot)
00119         
00120         self.addUsers(site)
00121         
00122         self.createNodes(site, self.objects_tree, site)
00123 
00124         status_message='Selenium Test Site has been created'
00125         logger.info(status_message)
00126 
00127         # The method must return a tag with id "ok", containing the text "OK".
00128         # to signal success to the testsuite. 
00129         return '<html><body><div id="OK">OK</div><div>Site creation succesful.</div></body></html>'

Here is the call graph for this function:


Member Data Documentation

Initial value:
[{'id':'kssfolder', 
                 'portal_type':'Folder',
                 'attrs':{
                          'title':'KssFolder',
                          'description':'Folder for KSS contents',
                         },
                 'transitions': ('publish',),
                 'children': [{'id':'documentitem',
                              'portal_type':'Document',
                              'children':[],
                              'transitions': ('publish',),
                              'attrs':{
                                       'title':'KssDocument',
                                       'text':"""       KSS is a javascript framework that aims to allow Ajax development        without javascript. It uses stylesheets with CSS-compliant syntax        to setup behaviours in the client and a set of well-defined commands        that are marshalled back from the server to manipulate the DOM.       We'll also add an external link also (<a href="http://www.plone.org">       [bug #6343] click here to test if the external link works!</a>).       """,
                                       'description':"""              KSS is a javascript framework that aims to allow Ajax development               without javascript.              """,
                                      }
                             },
                             {'id':'newsitem',
                              'portal_type':'News Item',
                              'children':[],
                              'attrs':{
                                       'title':'KssNews',
                                       'text':"""       An early spring sprint at a beautiful location on the Italian coast.        The sprint will focus on topics of interest for Plone 4.0. Potential        topics include custom membership, extending Plone's use of AJAX,        content export-import, and much more.       """,
                                       'description':"""          a    Sorrento sprint              """,
                                      }
                             },
                            ],
                }]

Definition at line 23 of file site_creation_view.py.

Initial value:
[ { 'username': 'testuser',
                'password': 'secret',
                'roles': [ 'Member' ]
              },
              { 'username': 'testmanager',
                'password': 'secret',
                'roles': [ 'Manager', 'Member' ]
              } ]

Definition at line 69 of file site_creation_view.py.


The documentation for this class was generated from the following file: