Beispiel #1
0
class InternalVideoATTypeExtender(object):
    adapts(IRTInternalVideo)
    implements(ISchemaExtender)

    fields = [
        ExtensionBlobField('file',
            widget=atapi.FileWidget(
                label=RTInternalVideoSchema['file'].widget.label,
                description=RTInternalVideoSchema['file'].widget.description,
            ),
            required=True,
            primary=True,
            validators=('isNonEmptyFile'),
        ),

    ]

    def __init__(self, context):
        self.context = context

    def getFields(self):
        return self.fields
Beispiel #2
0
#            startup_directory_method="_get_gcommons_users_tool",
        ),            
    ),
    

    atapi.FileField(
        name='configuration',
        required = False,
        searchable = False,
        languageIndependent = True,
        storage = atapi.AnnotationStorage(),
        validators = (('isNonEmptyFile', V_REQUIRED), 
                      ('checkFileMaxSize', V_REQUIRED), # This comes from ATContentType.file
                      ('isValidXML', V_REQUIRED)),  
        widget = atapi.FileWidget (
                description='Configuration XML, please leave empty if you dont know what this means',
                label= 'Configuration XML'
        ),                 
        default_method = 'getDefaultConfiguration',
    ),
))


def finalizeContainerSchema(schema):
    # nothing now
    return schema


def gcommons_aq_container(context):
    """ Returns topmost gcContainer from context
    """
    if not IgcContainer.providedBy(context):
Beispiel #3
0
VideoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

    atapi.FileField('webm_video.webm',
                required = False,
                languageIndependent = False,
                allowable_content_types=('video/webm',),
                default_content_type='video/webm',
                validators = (
                    ('isNonEmptyFile', V_REQUIRED),
                ),
                widget = atapi.FileWidget(
                     description = _(u"The video in the WebM format"),
                     label= _(u"WebM File"),
                     show_content_type = False,
                ),
                storage=atapi.AttributeStorage(),
    ),

    atapi.FileField('h264_video.mp4',
                required = False,
                languageIndependent = False,
                allowable_content_types=('video/mp4',),
                default_content_type='video/mp4',
                validators = (
                    ('isNonEmptyFile', V_REQUIRED),
                ),
                widget = atapi.FileWidget(
                     description = _(u"The video in the H.264 format"),
Beispiel #4
0
from rendereasy.origineclub import origineclubMessageFactory as _

from rendereasy.origineclub.interfaces import IAlbum
from rendereasy.origineclub.config import PROJECTNAME

from DateTime.DateTime import *
from Products.CMFPlone.utils import getToolByName
from string import join

AlbumSchema = folder.ATFolderSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.FileField(
        'trilha',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(label=_(u"Trilha"), ),
        required=True,
        validators=('isNonEmptyFile'),
    ), ))

# Set storage on fields copied from ATFolderSchema, making sure
# they work well with the python bridge properties.

AlbumSchema['title'].widget.label = _(u"Nome do Álbum")
AlbumSchema['title'].storage = atapi.AnnotationStorage()
AlbumSchema['description'].storage = atapi.AnnotationStorage()
AlbumSchema['description'].widget.visible = {
    "edit": "invisible",
    "view": "invisible"
}
AlbumSchema['location'].widget.visible = {
class SchemaExtender(object):
    """ Extend a file to get more publication related fields """
    implements(IOrderableSchemaExtender)

    _fields = [
        # Override relatedItems make it langauge independent and override
        # the accessor to return langage dependent references.
        ExtendedReferenceField(
            'relatedItems',
            relationship='relatesTo',
            multiValued=True,
            isMetadata=True,
            languageIndependent=True,
            accessor='getRelatedItems',
            mutator='setRelatedItems',
            index='KeywordIndex',
            write_permission=permissions.ModifyPortalContent,
            widget=ReferenceBrowserWidget(allow_search=True,
                                          allow_browse=True,
                                          show_indexes=False,
                                          force_close_on_insert=True,
                                          label=_(u"Related Items"),
                                          description='',
                                          visible={
                                              'edit': 'visible',
                                              'view': 'invisible'
                                          }),
        ),
        ExtendedImageField(
            'cover_image',
            schemata='publication',
            sizes={'cover': (70, 100)},
            languageIndependent=True,
            accessor='getCover_image',
            mutator='setCover_image',
            widget=atapi.ImageWidget(
                label=_(u'label_cover_image', default=u'Cover Image'),
                description=_(
                    u'description_cover_image',
                    default=
                    u'Upload a cover image. Leave empty to have the system autogenerate one for you.'
                ),
            ),
        ),
        ExtendedStringField(
            'author',
            schemata='publication',
            languageIndependent=True,
            accessor='getAuthor',
            mutator='setAuthor',
            widget=atapi.StringWidget(
                label=_(u'label_author', default=u'Author'),
                description=_(
                    u'description_author',
                    default=
                    u'Fill in the Name of the Author of this Publication.'),
            ),
        ),
        ExtendedStringField(
            'isbn',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_isbn', default=u'ISBN'),
                description=_(
                    u'description_isbn',
                    default=u'Fill in the ISBN Number of this Publication.'),
            ),
        ),
        ExtendedStringField(
            'order_id',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_order_id', default=u'Order ID'),
                description=_(
                    u'description_order_id',
                    default=u'Fill in the Order ID of this Publication.'),
            ),
        ),
        ExtendedBooleanField(
            'for_sale',
            schemata='publication',
            languageIndependent=True,
            accessor='getFor_sale',
            mutator='setFor_sale',
            widget=atapi.BooleanWidget(
                label=_(u'label_for_sale', default=u'For sale?'),
                description=_(u'description_for_sale',
                              default=u'Is this Publication for sale?'),
            ),
        ),
        ExtendedLinesField(
            'chapters',
            schemata='publication',
            languageIndependent=True,
            accessor='getChapters',
            mutator='setChapters',
            widget=atapi.LinesWidget(
                label=_(u'label_chapters', default=u'Chapters'),
                description=_(
                    u'description_chapters',
                    default=
                    u'Chapters of this Publication. Specify the Link targets defined in your pdf file, one per line.'
                ),
            ),
        ),
        ExtendedFileField(
            'metadata_upload',
            schemata='publication',
            languageIndependent=True,
            accessor='getMetadata_upload',
            mutator='setMetadata_upload',
            widget=atapi.FileWidget(
                label=_(u'label_metadata_upload',
                        default=u'Metadata INI upload'),
                description=_(u'description_metadata_upload',
                              default=u'Upload Metadata in INI style format.'),
            ),
        ),
        ExtendedStringField(
            'owner_password',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_owner_password', default=u'Owner Password'),
                description=_(
                    u'description_owner_password',
                    default=
                    u'If this publication is protected, speciy the pdf owner password if you want to parse the file.'
                ),
            ),
        ),
        ExtendedStringField(
            'user_password',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_user_password', default=u'User Password'),
                description=_(
                    u'description_user_password',
                    default=
                    u'If this publication is protected, speciy the pdf user password if you want to parse the file.'
                ),
            ),
        ),
    ]

    def __init__(self, context):
        """ init """
        self.context = context
        klass = context.__class__
        if HAVE_LINGUAPLONE and not getattr(
                klass, LANGUAGE_INDEPENDENT_INITIALIZED, False):
            fields = [
                field for field in self._fields if field.languageIndependent
            ]
            generateMethods(klass, fields)
            setattr(klass, LANGUAGE_INDEPENDENT_INITIALIZED, True)

    def getFields(self):
        """ get fields """
        return self._fields

    def getOrder(self, original):
        """ new order """
        publication = original.get('publication', [])

        publication.insert(0, 'author')
        publication.insert(1, 'isbn')
        publication.insert(2, 'order_id')
        publication.insert(3, 'for_sale')
        publication.insert(4, 'chapters')
        publication.insert(5, 'cover_image')
        publication.insert(6, 'metadata_upload')
        publication.insert(7, 'owner_password')
        publication.insert(8, 'user_password')

        original['publication'] = publication

        return original
Beispiel #6
0
from zope.interface import implements

from Products.Archetypes import atapi
from Products.ATContentTypes.content import schemata
from Products.ATContentTypes.content.base import ATCTFileContent, ATContentTypeSchema

from observatorio.conteudo import MessageFactory as _
from observatorio.conteudo.config import PROJECTNAME
from observatorio.conteudo.interfaces import IPublicacao

PublicacaoSchema = ATContentTypeSchema.copy() + atapi.Schema((
    BlobField(
        name='arquivo',
        widget=atapi.FileWidget(
            label=_(u'Arquivo'),
            description=_(u'Arquivo da publicacao.'),
        ),
        required=True,
        primary=True,
    ),
    ImageField(
        name='image',
        widget=atapi.ImageWidget(
            label=_(u'Imagem Capa'),
            description=_(u'Imagem da capa da publicacao.'),
        ),
        required=False,
    ),
))

schemata.finalizeATCTSchema(PublicacaoSchema)
Beispiel #7
0
    atapi.StringField(
        'url',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Url ou se trouve le document"),
            description=_(u""),
            size=500,
            maxlength=500,
        ),
        validators=('isURL'),
    ),
    atapi.FileField(
        'fichier',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            label=_(u"Fichier a attacher"),
            description=_(u""),
        ),
    ),
))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

DocLegisSchema['title'].storage = atapi.AnnotationStorage()
DocLegisSchema['description'].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(DocLegisSchema, moveDiscussion=False)


class DocLegis(base.ATCTContent):
    """Un document legislatif"""
Beispiel #8
0
            label=_(u"Probmap View"),
            #description=_(u"A SimMap view visualzing the Probmap."),
            startup_directory='/luc/drivers',
        ),
        required=False,
        relationship='probmap_probview',
        allowed_types=('SimMap'),
        multiValued=False,
    ),
    
    FileField(
        'probfile',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            visible={'view': 'hidden', 'edit': 'visible'},
            label=_(u"Probmap File"),
            #description=_(u"Precomputed version of the probability map."),
        ),
        required=False,
    ),

))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

ProbmapSchema['title'].storage = atapi.AnnotationStorage()
ProbmapSchema['description'].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(ProbmapSchema, moveDiscussion=False)
Beispiel #9
0
        columns=("titulo", "texto", "texto_off"),        
        widget=DataGridWidget(
            label='Tela',
            columns={
                'titulo' : Column("Título"),
                'texto' : TextAreaColumn("Texto Letreiro/Fonte"),
                'texto_off' : TextAreaColumn("Texto do Off"),
            }            
        ),
        required=True,
    ),

    atapi.FileField(
        name='arquivo',
        widget=atapi.FileWidget(
            label='Arquivo do Off',
        ),
    ),

    atapi.DateTimeField(
       name='entrega',
       default_method='getDataMinima',       
       widget=atapi.CalendarWidget(
           label="Entrega",
           description="Data e hora limite para entrega",
       ),
       required=True,
       validators=('isValidDate', ExpressionValidator('python: DateTime(value) > DateTime()+0.084', 'A hora de entega deve ser, no mínimo, duas horas maior que a hora atual.'), ),

    ),
Beispiel #10
0
        storage=atapi.AnnotationStorage(),
        widget=atapi.TextAreaWidget(
            label=_(u"Transcrição"),
            rows=10,
        ),
        default_output_type = "text/html",
        default_content_type = "text/plain",
        allowable_content_types = ("text/plain",
                                   "text/html")
    ),

    atapi.FileField(
        'audio.mp3',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            label=_(u"Arquivo de áudio com qualidade baixa"),
        ),
        required=True,
        validators=('isNonEmptyFile'),
        mutator='setAudio',
        acessor='getAudio',
        primary = 1,
    ),

    atapi.FileField(
        'alta',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            label=_(u"Arquivo de áudio com qualidade alta"),
        ),
        validators=('isNonEmptyFile'),
Beispiel #11
0
from rendereasy.cna.interfaces import IFoto
from rendereasy.cna.config import PROJECTNAME

from DateTime.DateTime import *
from Products.CMFPlone.utils import getToolByName
from string import join

FotoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

    atapi.FileField(
        'legenda',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            label=_(u"Arquivo"),
        ),
        required=True,
        validators=('isNonEmptyFile'),
    ),

    atapi.StringField(
        'legenda',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Legenda"),
        ),
    ),

))
Beispiel #12
0
from rendereasy.cna import cnaMessageFactory as _

from rendereasy.cna.interfaces import IVinheta
from rendereasy.cna.config import PROJECTNAME

from DateTime.DateTime import *
from Products.CMFPlone.utils import getToolByName
from string import join

VinhetaSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.FileField(
        'video',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(label=_(u"Video"), ),
        required=True,
        validators=('isNonEmptyFile'),
    ),
    atapi.StringField(
        'downloadlink',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(label=_(u"Download link"), ),
    ),
))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

VinhetaSchema['title'].storage = atapi.AnnotationStorage()
VinhetaSchema['description'].storage = atapi.AnnotationStorage()
Beispiel #13
0
     atapi.StringField(
         'email',
         searcheable=1,
         isMetadata=0,
         required=1,
         storage=atapi.AnnotationStorage(),
         validators=('isEmail', ),
         widget=atapi.StringWidget(
             label=_(u"Email"), maxlength=150, i18_domain="deu.contentypes")),
     atapi.FileField('cv',
                     searcheable=1,
                     isMetadata=0,
                     required=1,
                     storage=atapi.AnnotationStorage(),
                     widget=atapi.FileWidget(label=_(u"Curriculum Vitae"),
                                             maxlength=150,
                                             i18_domain="deu.contentypes"))))

#ocultamos los campos titulo y descripcion que trae plone por defecto
BancoDatosSchema['title'].widget.visible = {"edit": "invisible"}
BancoDatosSchema['description'].widget.visible = {"edit": "invisible"}

schemata.finalizeATCTSchema(BancoDatosSchema, moveDiscussion=False)


class Curriculum(base.ATCTContent):
    """Campos para arquetipo Banco datos"""
    implements(ICurriculum)
    meta_type = 'Curriculum'
    schema = BancoDatosSchema
Beispiel #14
0
    atapi.StringField(
        'subtitulo',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(label=_(u"Subtítulo"), ),
    ),
    atapi.DateTimeField(
        'data',
        storage=atapi.AnnotationStorage(),
        widget=atapi.CalendarWidget(label=_(u"Data"), ),
        required=True,
        validators=('isValidDate'),
    ),
    atapi.FileField(
        'foto',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(label=_(u"Foto"), ),
        required=True,
        validators=('isNonEmptyFile'),
    ),
    atapi.StringField(
        'downloadlink',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(label=_(u"Download link"), ),
    ),
))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

CardSchema['title'].storage = atapi.AnnotationStorage()
CardSchema['description'].storage = atapi.AnnotationStorage()
Beispiel #15
0
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-
from uwosh.hrjobposting import hrjobpostingMessageFactory as _

from uwosh.hrjobposting.interfaces import IClassifiedJob
from uwosh.hrjobposting.config import PROJECTNAME

ClassifiedJobSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.FileField(
        'positiondescription',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            label=_(u"Position Description"),
            description=_(u"Upload a position description PDF"),
        ),
        required=True,
        validators=('isNonEmptyFile'),
    ),
    atapi.TextField(
        'jobinfo',
        storage=atapi.AnnotationStorage(),
        widget=atapi.RichWidget(
            label=_(u"Job Information"),
            description=_(u""),
        ),
    ),
    atapi.TextField(
        'jobsummary',
        storage=atapi.AnnotationStorage(),
Beispiel #16
0
 BlobField('xmlfile',
           required=True,
           primary=True,
           searchable=False,
           accessor='getXMLFile',
           mutator='setXMLFile',
           index_method='getIndexValue',
           languageIndependent=True,
           storage=atapi.AnnotationStorage(migrate=True),
           default_content_type='application/octet-stream',
           validators=(('isNonEmptyFile', V_REQUIRED),
                       ('checkFileMaxSize', V_REQUIRED),
                       ('isXMLFile', V_REQUIRED)),
           widget=atapi.FileWidget(
               label=_(u'label_xmlfile', default=u'XML File'),
               description=_(u''),
               show_content_type=False,
           )),
 BlobField('xslfile',
           required=True,
           searchable=False,
           accessor='getXSLFile',
           mutator='setXSLFile',
           index_method='getIndexValue',
           languageIndependent=True,
           storage=atapi.AnnotationStorage(migrate=True),
           default_content_type='application/octet-stream',
           validators=(('isNonEmptyFile', V_REQUIRED),
                       ('checkFileMaxSize', V_REQUIRED)),
           widget=atapi.FileWidget(
               label=_(u'label_xslfile', default=u'XSL File'),
Beispiel #17
0
# -*- Message Factory Imported Here -*-
from uwosh.hrjobposting import hrjobpostingMessageFactory as _

from uwosh.hrjobposting.interfaces import ITransferJob
from uwosh.hrjobposting.config import PROJECTNAME

TransferJobSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

    atapi.FileField(
        'positiondescription',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            label=_(u"Position Description"),
            description=_(u"Field description"),
        ),
        required=True,
        validators=('isNonEmptyFile'),
    ),


    atapi.StringField(
        'postdate',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Posting Date"),
            description=_(u""),
        ),
        required=True,
    ),
Beispiel #18
0

    atapi.StringField(
        'creditopergunta',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Crédito - Pergunta"),
        ),
    ),


    atapi.FileField(
        'videopergunta',
        storage=atapi.AnnotationStorage(),
        widget=atapi.FileWidget(
            label=_(u"Vídeo - Pergunta"),
        ),
        validators=('isNonEmptyFile'),
    ),


    atapi.StringField(
        'nomeresposta',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Nome - Resposta"),
        ),
        required=True,
    ),

Beispiel #19
0
    WEB
        METADATA
            wms_enable_request "*"
        END
    END

"""

simmapSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.FileField(
        'simImage',
        storage=FileSystemStorage(),
        widget=atapi.FileWidget(
            label=_(u"GIS Layer"),
            description=_(u""),
        ),
        required=True,
        validators=('isNonEmptyFile'),
    ),
    atapi.FileField(
        'mapFile',
        storage=FileSystemStorage(),
        widget=atapi.FileWidget(
            label=_(u"Mapserver Map File"),
            description=_(u""),
        ),
        #validators=('isNonEmptyFile'),
    ),
    atapi.TextField(
        'details',
Beispiel #20
0
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import safe_unicode
from bika.lims import bikaMessageFactory as _
from bika.lims.browser.fields import UIDReferenceField
from bika.lims.browser.widgets import DateTimeWidget
from DateTime import DateTime
from bika.lims.config import PROJECTNAME
from bika.lims.content.bikaschema import BikaSchema
from plone.app.blob.field import FileField

schema = BikaSchema.copy() + Schema(
    (
        # It comes from blob
        FileField(
            'AttachmentFile',
            widget=atapi.FileWidget(label=_("Attachment"), ),
        ),
        UIDReferenceField(
            'AttachmentType',
            required=0,
            allowed_types=('AttachmentType', ),
            widget=ReferenceWidget(label=_("Attachment Type"), ),
        ),
        atapi.StringField(
            'AttachmentKeys',
            searchable=True,
            widget=atapi.StringWidget(label=_("Attachment Keys"), ),
        ),
        DateTimeField(
            'DateLoaded',
            required=1,
         u"Give a Description of the file that you upload; especially of it's featrures",
         i18n_domain="collective.TemplateUploadCenter",
         rows=6,
     ),
 ),
 atapi.FileField(
     'downloadableFile',
     primary=1,
     required=1,
     validators=(
         ('isNonEmptyFile', V_REQUIRED),
         ('isVirusFree', V_REQUIRED),
     ),
     widget=atapi.FileWidget(
         label=u"File",
         description="Click 'Browse' to upload a release file.",
         i18n_domain="collective.TemplateUploadCenter",
     ),
     storage=DynamicStorage(),
 ),
 atapi.StringField(
     name='license',
     required=1,
     vocabulary='getLicenseVocab',
     widget=atapi.SelectionWidget(
         format='radio',
         label=u"License",
         description=
         u"License of the file: Please examine carefully which license you choose for your contribution. You can't  change it after the release.",
         i18n_domain='collective.TemplateUploadCenter',
     ),
Beispiel #22
0
from Products.Archetypes import atapi
from Products.Archetypes.public import BaseContent
from bika.lims.interfaces import IMultifile
from bika.lims.content.bikaschema import BikaSchema
from bika.lims import bikaMessageFactory as _
from bika.lims import config

schema = BikaSchema.copy() + atapi.Schema((
    atapi.StringField('DocumentID',
                      required=1,
                      validators=('uniquefieldvalidator', ),
                      widget=atapi.StringWidget(label=_("Document ID"), )),
    atapi.FileField('File',
                    required=1,
                    widget=atapi.FileWidget(
                        label=_("Document"),
                        description=_("File upload "),
                    )),
    atapi.StringField('DocumentVersion',
                      widget=atapi.StringWidget(
                          label=_("Document Version"), )),
    atapi.StringField(
        'DocumentLocation',
        widget=atapi.StringWidget(
            label=_("Document Location"),
            description=_("Location where the document set is shelved"),
        )),
    atapi.StringField(
        'DocumentType',
        required=1,
        widget=atapi.StringWidget(
            label=_("Document Type"),
Beispiel #23
0
class DefaultBookLayoutExtender(object):
    """Schema extender, adding the layout-specific fields "release", "author"
    and "author_address" to the book when the default layout is selected.
    """

    adapts(IBook)
    implements(ISchemaExtender)

    fields = [
        StringField(name='release',
                    default='',
                    required=False,
                    widget=atapi.StringWidget(label=_(u'book_label_release',
                                                      default=u'Release'), )),
        StringField(name='author',
                    default='',
                    required=False,
                    widget=atapi.StringWidget(label=_(u'book_label_author',
                                                      default=u'Author'), )),
        TextField(name='author_address',
                  default='',
                  required=False,
                  default_content_type='text/plain',
                  allowable_content_types=('text/plain', ),
                  default_output_type='text/plain',
                  widget=atapi.TextAreaWidget(
                      label=_(u'book_label_author_address',
                              default=u'Author Address'), )),
        FileField(name='titlepage_logo',
                  required=False,
                  widget=atapi.FileWidget(
                      label=_(u'book_label_titlepage_logo',
                              default=u'Titlepage logo'),
                      description=_(u'book_help_titlepage_logo',
                                    default=u'Upload an image or a PDF, which '
                                    u'will be displayed on the titlepage'))),
        IntegerField(name='titlepage_logo_width',
                     default=0,
                     required=False,
                     size=3,
                     widget=atapi.IntegerWidget(
                         label=_(u'book_label_titlepage_logo_width',
                                 default=u'Titlepage logo width (%)'),
                         description=_(
                             u'book_help_titlepage_logo_width',
                             default=u'Width of the titlepage logo in '
                             u'percent of the content width.'),
                         size=3,
                         maxlength=3)),
    ]

    def __init__(self, context):
        self.context = context

    def getFields(self):
        # Checking whether the request provides the
        # IDefaultBookLayoutSelectionLayer interface does not work when
        # LinguaPlone is installed.
        # Looks like this method is called before
        # BookTraverse.publishTraverse() marks the request with the interface.

        if self.context.isTemporary():
            return []

        layout_layer_name = getattr(self.context, 'latex_layout', None)
        if layout_layer_name:
            layout_layer = resolve(layout_layer_name)
            if layout_layer == IDefaultBookLayoutSelectionLayer:
                return self.fields
        return []