Exemplo n.º 1
0
def hideToolsFromNavigation(context):
    """Hide auto-installed tool instances from navigation
    """
    if isNotECAssignmentBoxProfile(context):
        return

    # this tools will be uncataloged
    tool_id = "ecab_utils"

    site = context.getSite()
    portal = getToolByName(site, "portal_url").getPortalObject()

    portalProperties = getToolByName(site, "portal_properties")
    navtreeProperties = getattr(portalProperties, "navtree_properties")

    if navtreeProperties.hasProperty("idsNotToList"):
        # get IDs of all unlisted items
        current = list(navtreeProperties.getProperty("idsNotToList") or [])

        # add our tools to list of unlisted items
        if tool_id not in current:
            current.append(tool_id)
            kwargs = {"idsNotToList": current}
            navtreeProperties.manage_changeProperties(**kwargs)

        # unindex our tools
        try:
            portal[tool_id].unindexObject()
        except:
            LOG.warn("Could not unindex object: %s" % tool_id)
Exemplo n.º 2
0
def hideToolsFromNavigation(context):
    """Hide auto-installed tool instances from navigation
    """
    if isNotECAssignmentBoxProfile(context): return

    # this tools will be uncataloged
    tool_id = 'ecab_utils'

    site = context.getSite()
    portal = getToolByName(site, 'portal_url').getPortalObject()

    portalProperties = getToolByName(site, 'portal_properties')
    navtreeProperties = getattr(portalProperties, 'navtree_properties')

    if navtreeProperties.hasProperty('idsNotToList'):
        # get IDs of all unlisted items
        current = list(navtreeProperties.getProperty('idsNotToList') or [])

        # add our tools to list of unlisted items
        if tool_id not in current:
            current.append(tool_id)
            kwargs = {'idsNotToList': current}
            navtreeProperties.manage_changeProperties(**kwargs)

        # unindex our tools
        try:
            portal[tool_id].unindexObject()
        except:
            LOG.warn('Could not unindex object: %s' % tool_id)
Exemplo n.º 3
0
 def getWfStates(self):
     """
     @deprecated use getWfStates in ecab_utils directly
     """
     ecab_utils = getToolByName(self, 'ecab_utils', None)
     
     if (ecab_utils != None):
         return ecab_utils.getWfStates(config.ECA_WORKFLOW_ID)
     else:
         LOG.warn("Could not get tool by name: '%s'" % 'ecab_utils')
         return ()
Exemplo n.º 4
0
    def getWfStates(self):
        """
        @deprecated use getWfStates in ecab_utils directly
        """
        ecab_utils = getToolByName(self, 'ecab_utils', None)

        if (ecab_utils != None):
            return ecab_utils.getWfStates(config.ECA_WORKFLOW_ID)
        else:
            LOG.warn("Could not get tool by name: '%s'" % 'ecab_utils')
            return ()