Example #1
0
 def __init__(self,sessionuser, name,vcs = None, fs = None):
     PanObj.__init__(self,sessionuser)
     self.status = "draft" # need to define flag :{draft,published}
     """History, Date, Author and Permissions lie within PanObj
     # A pagelets initialisation is independent of views and fields       
     # pagelets can have fields that are not necessarily associated 
     with a view."""
     # self.fields = [(f, Null) for f in self.views.fields] #FieldData set
     # Reworking the ID
     self.id = "p"+str(self.getNextCounter())
     # Maintaining reference of all pagelets posted similar from this draft pagelet.
     # similars?
     self.views = vcs
     self.fields = fs
     self.sessionuser = sessionuser
     self.name = name
     self.leaves =[]
     self.view_id = []
     for i in vcs:
         self.view_id.append(i.getid())
     #for i in fs:
     #    self.fieldid.append(i.getid())
     self.flds = []
     for f in fs:
         self.flds.append(dict({f.getid():f.getvalue()}))
     pagelet = {"_id":self.id,
                "pagelet_name": self.name,
                "views": self.view_id, 
                "field_set": self.flds, 
                "status": self.status,
                "authors": self.authors}
                
     storedata.save_data_into_db(pagelet, self.__class__.__name__.lower())
Example #2
0
 def __init__(self, sessionuser, deco, label, val=None):
     PanObj.__init__(self, sessionuser)
     self.decoration = deco
     self.label = label
     self.value = val
     self.id = "f" + str(self.getNextCounter())
     self.data = {"label": label, "decoration": deco, "_id": self.id, "value": self.value}
     storedata.save_data_into_db(self.data, self.__class__.__name__.lower())
 def __init__(self,sessionuser,vcname,perm_id, perm, persona):
     PanObj.__init__(self,sessionuser)
     self.name = vcname
     self.permissions_id = perm_id
     self.permissions = perm
     self.workflowrole = persona # View is associated with a role
     self.id = "vc" + str(self.getNextCounter())
     self.data = {"_id":self.id,"name":self.name, "permissions": self.permissions_id}
     storedata.save_data_into_db(self.data, self.__class__.__name__.lower())
Example #4
0
 def __init__(self,sessionuser, vcs = None, fs = None):
     PanObj.__init__(self,sessionuser)
     self.status = "draft" # need to define flag :{draft,published}
     # History, Date, Author and Permissions lie within PanObj
     # A pagelets initialisation is independent of views and fields
     # self.views = vcs #views : ViewCategory set
     self.views = vcs
     # pagelets can have fields that are not necessarily associated 
     # with a view.
     # self.fields = [(f, Null) for f in self.views.fields] #FieldData set
     self.fields = fs
     # Reworking the ID
     self.id = "p"+str(self.id)
     # Maintaining reference of all pagelets posted similar from this draft pagelet.
     # similars?
     self.leaves =[]
 def __init__(self,sessionuser,vcname,perm,persona ):
     PanObj.__init__(self,sessionuser)
     self.name = vcname
     self.permissions = perm
     self.workflowrole = persona # View is associated with a role
     self.id = "vc" + str(self.id)
Example #6
0
 def __init__(self, sessionuser, deco, label, val = None):
     PanObj.__init__(self,sessionuser)
     self.decoration = deco
     self.label = label
     self.value = val
     self.id = "f" + str(self.id)