try: from Products.CMFCore import CMFCorePermissions as permissions except ImportError: from Products.CMFCore import permissions from Products.CMFCore.utils import getToolByName from Products.Archetypes.atapi import Schema, registerType from Products.Archetypes.atapi import IntegerField, StringField from Products.Archetypes.atapi import StringWidget, SelectionWidget, IntegerWidget from Products.ATContentTypes.content.file import ATFile, ATFileSchema from Products.PromoEngine.content.basead import BaseAd, BaseAdSchema from Products.PromoEngine.config import PROJECTNAME, SCALE_LIST from Products.PromoEngine.swfHeaderData import analyseContent FlashAdSchema = BaseAdSchema.copy() + ATFileSchema.copy() schema = FlashAdSchema + Schema(( IntegerField( 'scale', required = True, default = 100, validators = ('isInt'), vocabulary = SCALE_LIST, widget=SelectionWidget( label = 'Scale', description = 'Scale of the flash movie.', ), ), StringField(
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """ A simple ad for use with the Ad Manager """ from Products.CMFCore import CMFCorePermissions from Products.CMFCore.utils import getToolByName from Products.Archetypes import atapi from Products.ATFlashMovie.ATFlashMovie import ATFlashMovie from Products.ATFlashMovie.ATFlashMovie import schema as ATFlashMovieSchema from Products.PromoEngine.content.basead import BaseAd, BaseAdSchema from Products.PromoEngine.config import PROJECTNAME FlashAdSchema = BaseAdSchema.copy() + ATFlashMovieSchema.copy() class FlashAd(ATFlashMovie, BaseAd): """Create a flash based ad """ schema = FlashAdSchema global_allow = 0 content_icon = 'ad_icon.gif' archetype_name = 'Flash Ad' meta_type = portal_type = 'FlashAd' atapi.registerType(FlashAd, PROJECTNAME)
# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """ A simple ad for use with the Ad Manager """ from Products.CMFCore.utils import getToolByName from Products.Archetypes.atapi import registerType from Products.ATContentTypes.content.document import ATDocument, \ ATDocumentSchema from Products.PromoEngine.content.basead import BaseAd, BaseAdSchema from Products.PromoEngine.config import PROJECTNAME AdSchema = BaseAdSchema.copy() + ATDocumentSchema.copy() class Ad(ATDocument, BaseAd): """Create an ad """ schema = AdSchema registerType(Ad, PROJECTNAME)