def activate(self, context): storage = context["Services"].getStorage() storedObj = storage.getObject(context["metadata"].getFirst("storage_id")) request = context["request"] version = request.getParameter("version") if version is not None: self.item = JsonSimple(File(storedObj.getPath() + "/version_" + version)) self.version = preview.formatDate(version, "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss") else: self.version = None self.item = preview.loadPackage(storedObj) self.Services = context["Services"] self.oid = storedObj.getId() self.getAttachments()
def __activate__(self, context): storage = context["Services"].getStorage() storedObj = storage.getObject( context["metadata"].getFirst("storage_id")) request = context["request"] version = request.getParameter("version") if version is not None: self.item = JsonSimple( File(storedObj.getPath() + "/version_" + version)) self.version = preview.formatDate(version, "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss") else: self.version = None self.item = preview.loadPackage(storedObj) self.Services = context["Services"] self.oid = storedObj.getId() self.getAttachments()
def __activate__(self, context): self.page = context["page"] self.metadata = context["metadata"] self.Services = context["Services"] self.formData = context["formData"] self.log = context["log"] storage = context["Services"].getStorage() storedObj = storage.getObject(context["metadata"].getFirst("storage_id")) request = context["request"] version = request.getParameter("version") versionTfPackage = request.getParameter("versionParked") if version is not None: self.item = JsonSimple(File(storedObj.getPath() + "/version_tfpackage_" + version)) self.version = preview.formatDate(version, "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss") self.versionStr = "This version was created on " + self.version else: self.version = None self.versionStr = "" self.item = preview.loadPackage(storedObj)
def __activate__(self, context): self.page = context["page"] self.metadata = context["metadata"] self.Services = context["Services"] self.formData = context["formData"] self.log = context["log"] storage = context["Services"].getStorage() storedObj = storage.getObject( context["metadata"].getFirst("storage_id")) request = context["request"] version = request.getParameter("version") versionTfPackage = request.getParameter("versionParked") if version is not None: self.item = JsonSimple( storedObj.getPayload("version_tfpackage_" + version).open()) self.version = preview.formatDate(version, "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss") self.versionStr = "This version was created on " + self.version else: self.version = None self.versionStr = "" self.item = preview.loadPackage(storedObj)