Ejemplo n.º 1
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "comment_reference")
        e2.text = self.commentReference

        e3 = XMLSubelement(e1, "comment_text")
        e3.text = self.commentText

        return e1
Ejemplo n.º 2
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "transition")
        e2.text = self.transition

        e3 = XMLSubelement(e1, "new_workflow_status")
        e3.text = self.newWorkflowStatusReference

        return e1
Ejemplo n.º 3
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "version")
        e2.text = self.reference

        e3 = XMLSubelement(e1, "file_name")
        e3.text = self.fileName

        return e1
Ejemplo n.º 4
0
    def toXML(self):
        e1 = XMLElement("question")
        e1.set("id", self.id)
        e1.set("version", str(self.version))
        
        e10 = XMLSubelement(e1, "upload_date")
        e10.text = self.uploadDate.strftime(DATETIME_FORMAT) if self.uploadDate != None else ""

        e11 = XMLSubelement(e1, "last_modification_date")
        e11.text = self.lastModificationDate.strftime(DATETIME_FORMAT) if self.lastModificationDate != None else ""

        e1.append(self.attribution.toXML())

        e3 = XMLSubelement(e1, "developers")

        for developer in self.developers:
            e3.append(developer.toXML())

        e1.append(self.language.toXML())

        e4 = XMLSubelement(e1, "dialects")

        for dialect in self.dialects:
            e4.append(dialect.toXML())

        e5 = XMLSubelement(e1, "calendars")

        for calendar in self.calendars:
            e5.append(calendar.toXML())

        e6 = XMLSubelement(e1, "currencies")

        for currency in self.currencies:
            e6.append(currency.toXML())

        e7 = XMLSubelement(e1, "unit_systems")

        for unitSystem in self.unitSystems:
            e7.append(unitSystem.toXML())

        e2 = XMLSubelement(e1, "title")
        e2.text = self.title

        e8 = XMLSubelement(e1, "parameters")

        for parameterSet in self.parameters:
            e8.append(parameterSet.toXML())

        e9 = XMLSubelement(e1, "parts")

        for part in self.parts:
            e9.append(part.toXML())

        return e1 
Ejemplo n.º 5
0
    def toXML(self):
        e1 = XMLElement("developer")
        e1.set("role", self.role)

        e2 = XMLSubelement(e1, "name")
        e2.text = self.name 

        e3 = XMLSubelement(e1, "email_address")
        e3.text = self.emailAddress 

        return e1
Ejemplo n.º 6
0
    def toXML(self):
        e1 = XMLElement("part")

        e1.set("type", self.type)
        e1.set("reference", self.reference)

        e2 = XMLSubelement(e1, "layout")

        e3 = XMLSubelement(e1, "response_formats")

        for responseFormat in self.responseFormats:
            e3.append(responseFormat.toXML())

        return e1
Ejemplo n.º 7
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "watcher")
        e2.text = self.watcher

        return e1
Ejemplo n.º 8
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "label")
        e2.text = self.label

        return e1
Ejemplo n.º 9
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "new_priority")
        e2.text = self.newPriority

        return e1
Ejemplo n.º 10
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "new_assignee")
        e2.text = self.newAssignee

        return e1
Ejemplo n.º 11
0
    def toXML(self):
        e1 = super().toXML()

        e2 = XMLSubelement(e1, "new_workflow")
        e2.text = self.newWorkflowReference

        return e1
Ejemplo n.º 12
0
    def toXML(self):
        e1 = XMLElement("response_format")
        e1.set("type", "choices")

        e2 = XMLSubelement(e1, "choices")

        for choice in self.choices:
            e2.append(choice.toXML())

        return e1
Ejemplo n.º 13
0
    def toXML(self):
        e1 = XMLElement("history")
        e1.set("for_entity", "{}/{}".format(self.contentEntityType,
                                            self.contentEntityId))

        e1.append(self.state.toXML())

        e2 = XMLSubelement(e1, "actions")

        for action in self.actions:
            e2.append(action.toXML())

        return e1
Ejemplo n.º 14
0
    def toXML(self):
        e1 = XMLElement("state")

        e2 = XMLSubelement(e1, "workflow")
        e2.text = self.workflowReference

        e3 = XMLSubelement(e1, "workflow_status")
        e3.text = self.workflowStatusReference

        e4 = XMLSubelement(e1, "developers")

        for developer in self.developers:
            e4.append(developer.toXML())

        e5 = XMLSubelement(e1, "assignee")
        e5.text = self.assignee

        e6 = XMLSubelement(e1, "priority")
        e6.text = self.priority

        e7 = XMLSubelement(e1, "labels")

        for label in self.labels:
            e8 = XMLSubelement(e7, "label")
            e8.text = label

        e9 = XMLSubelement(e1, "watchers")

        for watcher in self.watchers:
            e10 = XMLSubelement(e9, "watcher")
            e10.text = watcher

        e11 = XMLSubelement(e1, "versions")

        for version in self.versions:
            e11.append(version.toXML())

        return e1