Exemplo n.º 1
0
 def clearState( self, policy ):
     import incremental
     catalog = getToolByName( policy, 'portal_catalog' )
     pidx_id = incremental.getIncrementalIndexId( policy )
     for idx in catalog.index_objects():
         if idx.getId() == pidx_id:
             idx.clearState()
Exemplo n.º 2
0
    def beginPolicyRemoval( self, policy ):
        """
        remove any non contained instance objects associated with policy.
        ie. policy incremental index
        """

        import incremental
        catalog = getToolByName( policy, 'portal_catalog' )
        pidx_id = incremental.getIncrementalIndexId( policy )
        if pidx_id in catalog.indexes():
            catalog.manage_delIndex( ids=[ pidx_id ] )

        policy.setResetDate( True )
Exemplo n.º 3
0
    def finishPolicyConstruction( self, policy ):
        """
        add incremental policy index, deletion source, and dependency source
        """

        import incremental
        catalog = getToolByName( policy, 'portal_catalog' )
        pidx_id = incremental.getIncrementalIndexId( policy )

        if pidx_id not in catalog.indexes():
            catalog.manage_addIndex( pidx_id,
                                     incremental.PolicyIncrementalIndex.meta_type )

        import sources
        
        if DefaultConfiguration.DeletionSource not in policy.objectIds():
            sources.deletion.addDeletionSource( policy,
                                                DefaultConfiguration.DeletionSource )

        if DefaultConfiguration.DependencySource not in policy.objectIds():
            sources.dependency.addDependencySource( policy,
                                                    DefaultConfiguration.DependencySource )