Exemplo n.º 1
0
    def edit(self, node, old_field, new_field, old_xform, new_xform, activity_log_detail):
        bind_node = old_xform.bind_node(node)

        if bind_node is not None and new_field.constraint_message != old_field.constraint_message:
            if new_field.constraint_message:
                add_attrib(bind_node, 'constraintMsg', new_field.constraint_message)
            else:
                remove_attrib(bind_node, 'constraintMsg')
            activity_log_detail["constraint_message_changed"] = [old_field.label] if activity_log_detail.get("constraint_message_changed") is None \
                else activity_log_detail.get("constraint_message_changed") + [old_field.label]
Exemplo n.º 2
0
    def edit(self, node, old_field, new_field, old_xform, new_xform, activity_log_detail):
        bind_node = old_xform.bind_node(node)

        if bind_node is not None and new_field.relevant != old_field.relevant:
            if new_field.relevant:
                relevant = replace_node_name_with_xpath(new_field.relevant, old_xform)
                add_attrib(bind_node, 'relevant', relevant)
            else:
                remove_attrib(bind_node, 'relevant')
            activity_log_detail["relevant_changed"] = [old_field.label] if activity_log_detail.get("relevant_changed") is None \
                else activity_log_detail.get("relevant_changed") + [old_field.label]
Exemplo n.º 3
0
    def edit(self, node, old_field, new_field, old_xform, new_xform, activity_log_detail):
        bind_node = old_xform.bind_node(node)

        if bind_node is not None:
            if new_field.is_required() and not old_field.is_required():
                add_attrib(bind_node, 'required', 'true()')
                activity_log_detail["required_changed"] = [old_field.label] if activity_log_detail.get("required_changed") is None \
                    else activity_log_detail.get("required_changed") + [old_field.label]
            elif not new_field.is_required() and old_field.is_required():
                remove_attrib(bind_node, 'required')
                activity_log_detail["required_changed"] = [old_field.label] if activity_log_detail.get("required_changed") is None \
                    else activity_log_detail.get("required_changed") + [old_field.label]
Exemplo n.º 4
0
    def edit(self, node, old_field, new_field, old_xform, new_xform,
             activity_log_detail):
        if bool(new_field.appearance
                ) and node.get("appearance") != new_field.appearance:
            add_attrib(node, "appearance", new_field.appearance)
            activity_log_detail["appearance_changed"] = [old_field.label] if activity_log_detail.get("appearance_changed") is None \
                else activity_log_detail.get("appearance_changed") + [old_field.label]

        if not bool(new_field.appearance) and bool(node.get("appearance")):
            remove_attrib(node, "appearance")
            activity_log_detail["appearance_changed"] = [old_field.label] if activity_log_detail.get("appearance_changed") is None \
                else activity_log_detail.get("appearance_changed") + [old_field.label]
Exemplo n.º 5
0
    def edit(self, node, old_field, new_field, old_xform, new_xform, activity_log_detail):
        bind_node = old_xform.bind_node(node)

        if bind_node is not None and new_field.xform_constraint != old_field.xform_constraint:
            xform_constraint = new_field.xform_constraint
            if xform_constraint:
                if "${" in xform_constraint:
                    xform_constraint = replace_node_name_with_xpath(xform_constraint, old_xform)
                add_attrib(bind_node, 'constraint', xform_constraint)
            else:
                remove_attrib(bind_node, 'constraint')
            activity_log_detail["constraint_changed"] = [old_field.label] if activity_log_detail.get("constraint_changed") is None \
                else activity_log_detail.get("constraint_changed") + [old_field.label]