Exemplo n.º 1
0
from collective.fsproxy.interfaces import IProxyFolder
from collective.fsproxy.config import PROJECTNAME
from collective.fsproxy import fsproxyMessageFactory as _
from AccessControl import ClassSecurityInfo
from plone.i18n.normalizer import idnormalizer

pathseparator = os.path.normcase('/')

ProxyFolderSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    
    atapi.StringField(
        name='fsposition',
        required=1,
        validators = ( "isValidFilesystemPath", ),
        widget=atapi.StringWidget(
            label=_(u"label_file_fs_position", default=u"Filesystem position for file to proxy"),
            description=_(u"help_file_position", default=u"Please enter the filesystem position where the file is."),
            i18n_domain="collective.fsproxy",
        ),
    ),

    atapi.BooleanField('recursive',
        required=0,
        widget=atapi.BooleanWidget(
            label=_(u"label_recursive", default=u"Recursive Search"),
            description=_(u"description_recursive", default=u"Include files in subfolders recursively."),
            i18n_domain="collective.fsproxy",
        ),
    ),

    atapi.LinesField('blacklist',
Exemplo n.º 2
0
from collective.fsproxy import fsproxyMessageFactory as _
from Products.CMFCore.permissions import View
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from plone.app.blob.subtypes.file import ExtensionBlobField

pathseparator = os.path.normcase("/")

ProxyFileSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(
    (
        atapi.StringField(
            name="fsposition",
            required=1,
            validators=("isValidFilesystemFile",),
            widget=atapi.StringWidget(
                label=_(u"label_file_fs_position", default=u"Filesystem position for file to proxy"),
                description=_(
                    u"help_file_position", default=u"Please enter the filesystem position where the file is."
                ),
                i18n_domain="collective.fsproxy",
            ),
        ),
    )
)

ProxyFileSchema["title"].storage = atapi.AnnotationStorage()
ProxyFileSchema["title"].required = False
ProxyFileSchema["description"].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(ProxyFileSchema, moveDiscussion=False)