コード例 #1
0
ファイル: statusmapper.py プロジェクト: a25kk/stv2
def initializeStatusCategories(event):
    """
    Initializes the category sets and categories of a category mapper
    to be used to track "active" workflow states for a membrane type.
    Triggered when a new membrane type is registered.  Defaults to all
    workflow states being active.
    """
    cat_map = ICategoryMapper(event.tool)
    cat_set = generateCategorySetIdForType(event.portal_type)
    cat_map.addCategorySet(cat_set)
    cat_map.addCategory(cat_set, ACTIVE_STATUS_CATEGORY)

    states = getAllWFStatesForType(event.tool, event.portal_type)
    for state in states:
        cat_map.addToCategory(cat_set, ACTIVE_STATUS_CATEGORY,
                              state)
コード例 #2
0
ファイル: status_map.py プロジェクト: a25kk/stv2
 def allStatesForType(self, portal_type):
     return getAllWFStatesForType(self.context, portal_type)