Beispiel #1
0
    def get_repository_title(self):
        # TODO: use disposition itself instead of the first dossier
        parent = self.dossiers[0].obj
        while not IRepositoryRoot.providedBy(parent):
            parent = aq_parent(aq_inner(parent))

        return ITranslatedTitle(parent).translated_title()
 def test_adding(self, browser):
     self.login(self.manager, browser)
     browser.open(view='++add++opengever.repository.repositoryroot')
     browser.fill({'Title': u'Foob\xe4r'}).save()
     statusmessages.assert_no_error_messages()
     self.assertTrue(IRepositoryRoot.providedBy(browser.context))
     self.assertEqual('foobar', browser.context.getId())
 def test_adding(self, browser):
     self.login(SITE_OWNER_NAME, browser)
     browser.open(view='++add++opengever.repository.repositoryroot')
     browser.fill({'Title': u'Foob\xe4r'}).save()
     statusmessages.assert_no_error_messages()
     self.assertTrue(IRepositoryRoot.providedBy(browser.context))
     self.assertEqual('foobar', browser.context.getId())
Beispiel #4
0
    def get_repository_title(self):
        # TODO: use disposition itself instead of the first dossier
        parent = self.dossiers[0].obj
        while not IRepositoryRoot.providedBy(parent):
            parent = aq_parent(aq_inner(parent))

        return ITranslatedTitle(parent).translated_title()
Beispiel #5
0
 def _has_default_role_assignments(self, obj):
     return any([
         IRepositoryRoot.providedBy(obj),
         IInbox.providedBy(obj),
         IInboxContainer.providedBy(obj),
         ITemplateFolder.providedBy(obj),
         IContactFolder.providedBy(obj),
     ])
Beispiel #6
0
 def _has_default_role_assignments(self, obj):
     return any([
         IRepositoryRoot.providedBy(obj),
         IInbox.providedBy(obj),
         IInboxContainer.providedBy(obj),
         ITemplateFolder.providedBy(obj),
         IContactFolder.providedBy(obj),
     ])
Beispiel #7
0
 def parents(self):
     obj = self.obj
     parents = [self]
     while True:
         obj = aq_parent(obj)
         parents.insert(0, obj)
         if obj is None or IRepositoryRoot.providedBy(obj):
             break
     return parents
Beispiel #8
0
 def parents(self):
     obj = self.obj
     parents = [self]
     while True:
         obj = aq_parent(obj)
         parents.insert(0, obj)
         if obj is None or IRepositoryRoot.providedBy(obj):
             break
     return parents
    def get_new_mapping(self, key, obj):
        parent = aq_parent(aq_inner(obj))
        ann = IAnnotations(parent)

        if IDossierMarker.providedBy(obj):
            mapping_base = ann.get(DOSSIER_KEY)
        elif IRepositoryFolder.providedBy(obj) or IRepositoryRoot.providedBy(obj):
            mapping_base = ann.get(REPOSITORY_FOLDER_KEY)
        else:
            raise Exception("Unknown object type!")

        if not mapping_base:
            return None

        mapping = mapping_base.get(key)
        return mapping
Beispiel #10
0
def get_repository_root(context):
    while not IRepositoryRoot.providedBy(context) and not IPloneSiteRoot.providedBy(context):
        context = aq_parent(aq_inner(context))
    return context
Beispiel #11
0
    def get_repository_version(self):
        obj = self.context
        while not IRepositoryRoot.providedBy(obj):
            obj = aq_parent(aq_inner(obj))

        return obj.version or ''
    def get_repository_version(self):
        obj = self.context
        while not IRepositoryRoot.providedBy(obj):
            obj = aq_parent(aq_inner(obj))

        return obj.version or ''
Beispiel #13
0
 def is_part_of_repo(self, obj):
     return IRepositoryRoot.providedBy(obj) or \
         IRepositoryFolder.providedBy(obj)
Beispiel #14
0
 def test_adding(self):
     self.grant('Reviewer', 'Manager')
     self.portal.invokeFactory('opengever.repository.repositoryroot',
                               'repository1')
     r1 = self.portal['repository1']
     self.failUnless(IRepositoryRoot.providedBy(r1))
Beispiel #15
0
 def is_part_of_repo(self, obj):
     return IRepositoryRoot.providedBy(obj) or \
         IRepositoryFolder.providedBy(obj)
Beispiel #16
0
def get_repository_root(context):
    while not IRepositoryRoot.providedBy(context) \
            and not IPloneSiteRoot.providedBy(context):
        context = aq_parent(aq_inner(context))
    return context
 def test_factory(self):
     fti = queryUtility(IDexterityFTI, name='opengever.repository.repositoryroot')
     factory = fti.factory
     new_object = createObject(factory)
     self.failUnless(IRepositoryRoot.providedBy(new_object))
 def test_adding(self):
     self.grant('Reviewer', 'Manager')
     self.portal.invokeFactory('opengever.repository.repositoryroot', 'repository1')
     r1 = self.portal['repository1']
     self.failUnless(IRepositoryRoot.providedBy(r1))
    def should_be_skipped(self, obj):
        if IRepositoryRoot.providedBy(obj):
            return True

        return False
Beispiel #20
0
 def test_factory(self):
     fti = queryUtility(IDexterityFTI,
                        name='opengever.repository.repositoryroot')
     factory = fti.factory
     new_object = createObject(factory)
     self.failUnless(IRepositoryRoot.providedBy(new_object))