def afterSetUp(self):
     from Products.Naaya.NyFolder import addNyFolder
     from Products.NaayaPhotoArchive.NyPhotoGallery import addNyPhotoGallery
     from Products.NaayaPhotoArchive.NyPhotoFolder import addNyPhotoFolder
     from Products.NaayaPhotoArchive.NyPhoto import addNyPhoto
     addNyFolder(self.portal,
                 'myfolder',
                 contributor='contributor',
                 submitted=1)
     addNyPhotoGallery(self.portal.myfolder,
                       id='g',
                       title='My gallery',
                       submitted=1,
                       contributor='admin')
     addNyPhotoFolder(self.portal.myfolder.g,
                      id='f',
                      title='My folder',
                      submitted=1,
                      contributor='admin')
     addNyPhoto(self.portal.myfolder.g.f,
                id='myphoto',
                title='My photo',
                submitted=1,
                contributor='contributor')
     import transaction
     transaction.commit()
 def afterSetUp(self):
     from Products.Naaya.NyFolder import addNyFolder
     addNyFolder(self.portal, 'myfolder', contributor='contributor', submitted=1)
     addNyPhotoGallery(self.portal.myfolder, id='mygallery', title='My photo gallery', submitted=1, contributor='contributor')
     addNyPhotoFolder(self.portal.myfolder.mygallery, id='myalbum', title='My photo album')
     addNyPhoto(self.portal.myfolder.mygallery.myalbum, id="myphoto1", title="My photo 1")
     addNyPhoto(self.portal.myfolder.mygallery.myalbum, id="myphoto2", title="My photo 2")
     self.portal.myfolder.approveThis()
     import transaction; transaction.commit()
Example #3
0
 def afterSetUp(self):
     from Products.Naaya.NyFolder import addNyFolder
     from Products.NaayaPhotoArchive.NyPhotoGallery import manage_addNyPhotoGallery
     from Products.NaayaPhotoArchive.NyPhotoFolder import manage_addNyPhotoFolder
     from Products.NaayaPhotoArchive.NyPhoto import addNyPhoto
     addNyFolder(self.portal, 'myfolder', contributor='contributor', submitted=1)
     manage_addNyPhotoGallery(self.portal.myfolder, id='g', title='My gallery', submitted=1, contributor='admin')
     manage_addNyPhotoFolder(self.portal.myfolder.g, id='f', title='My folder', submitted=1, contributor='admin')
     addNyPhoto(self.portal.myfolder.g.f, id='myphoto', title='My photo', submitted=1, contributor='contributor')
     import transaction; transaction.commit()
    def afterSetUp(self):
        from Products.Naaya.NyFolder import addNyFolder
        from Products.NaayaPhotoArchive.NyPhotoGallery import addNyPhotoGallery
        from Products.NaayaPhotoArchive.NyPhotoFolder import addNyPhotoFolder
        from Products.NaayaPhotoArchive.NyPhoto import addNyPhoto

        addNyFolder(self.portal, "myfolder", contributor="contributor", submitted=1)
        addNyPhotoGallery(self.portal.myfolder, id="g", title="My gallery", submitted=1, contributor="admin")
        addNyPhotoFolder(self.portal.myfolder.g, id="f", title="My folder", submitted=1, contributor="admin")
        addNyPhoto(self.portal.myfolder.g.f, id="myphoto", title="My photo", submitted=1, contributor="contributor")
        import transaction

        transaction.commit()
 def _update_photo(self, doc, folder):
     if not getattr(doc, 'data', ''):
         return
     # Update default lang
     lang = doc.gl_get_selected_language()
     title, author, source = self._get_photo_local_properties(doc, lang)
     photo_id = addNyPhoto(folder, doc.getId(), title, '', doc.coverage,
                     doc.keywords, doc.sortorder, doc.releasedate, lang,
                     author, source, '', doc.open_for_comments(), doc.data)
     # Update languages
     for language in doc.get_languages_mapping():
         lang = language['code']
         title, author, source = self._get_photo_local_properties(doc, lang)
         if title:
             doc._setLocalPropValue('title', lang, title)
         if author:
             doc._setLocalPropValue('author', lang, author)
         if source:
             doc._setLocalPropValue('source', lang, source)
         if title or author or source:
             doc.recatalogNyObject(doc)
     return photo_id