Updating Document Groups

Updating Document Groups
 1ot = impact.gui.output_toolbox
 2db = impact.active_database
 3
 4ot.clear()
 5
 6docs = db.documents
 7
 8if docs is None:
 9    ot.add("No document support in the database")
10else:
11    ot.add("Document support is enabled in this database")
12
13    settings = db.settings.document_settings
14
15    # find a document group and update its properties
16    group_name = "GroupA"
17    group = settings.groups.item(group_name)
18
19    if not group.isNone():
20
21        # set some IDocumentGroup properties
22        group.name = "Images"
23        group.default_extensions = "jpg;jpeg;png;bmp;"
24        group.allow_all_extensions = False
25
26        # call DoUpdate to apply the changes permanently
27        if group.do_update():
28            ot.add("Successfully updated document group " + str(group_name))
29
30        else:
31            ot.add("Failed to update document group " + str(group_name))
32
33    else:
34        ot.add("Unable to find document group " + str(group_name))
35
36
37