), BooleanField( 'Composite', default=False, widget=BooleanWidget( label=_("Composite"), description= _("Check this box if the samples taken at this point are 'composite' " "and put together from more than one sub sample, e.g. several surface " "samples from a dam mixed together to be a representative sample for the dam. " "The default, unchecked, indicates 'grab' samples"), ), ), BlobFileField( 'AttachmentFile', widget=FileWidget(label=_("Attachment"), ), ), )) schema['description'].widget.visible = True schema['description'].schemata = 'default' class SamplePoint(BaseContent, HistoryAwareMixin): implements(IDeactivable) security = ClassSecurityInfo() displayContentsTab = False schema = schema _at_rename_after_creation = True
# Products imports from iw.fss.config import PROJECTNAME from iw.fss.FileSystemStorage import FileSystemStorage BaseItemShema = Schema(( FileField( 'file', required=False, primary=True, storage=FileSystemStorage(), widget=FileWidget( description= "Select the file to be added by clicking the 'Browse' button.", description_msgid="help_file", label="File", label_msgid="label_file", i18n_domain="plone", show_content_type=False, )), ImageField('image', required=False, sizes={ 'mini': (40, 40), 'thumb': (80, 80), }, storage=FileSystemStorage(), widget=ImageWidget()), TextField('text', required=False, storage=FileSystemStorage(),
), TextField( "Instructions", default_content_type="text/plain", allowed_content_types=("text/plain", ), default_output_type="text/plain", widget=TextAreaWidget( label=_("Instructions"), description=_("Technical description and instructions " "intended for analysts"), ), ), BlobFileField( "MethodDocument", # XXX Multiple Method documents please widget=FileWidget( label=_("Method Document"), description=_("Load documents describing the method here"), )), # The instruments linked to this method. Don't use this # method, use getInstrumentUIDs() or getInstruments() instead LinesField( "_Instruments", vocabulary="getInstrumentsDisplayList", widget=MultiSelectionWidget( modes=("edit"), label=_("Instruments"), description=_( "The selected instruments have support for this method. " "Use the Instrument edit view to assign " "the method to a specific instrument"), ),
from plone.app.blob.config import permissions from plone.app.blob.field import FileField from plone.app.blob.field import ImageField from plone.app.blob.tests.base import changeAllowedSizes from plone.app.blob.tests.base import ReplacementTestCase from plone.app.blob.tests.utils import getFile from Products.Archetypes.public import BaseContent from Products.Archetypes.public import BaseSchema from Products.Archetypes.public import FileWidget from Products.Archetypes.public import ImageWidget from Products.Archetypes.public import registerType from Products.Archetypes.public import Schema SampleSchema = BaseSchema.copy() + Schema(( FileField(name='foo', widget=FileWidget(label='File', description='a file')), ImageField(name='bar', widget=ImageWidget(label='Image', description='an image')), ImageField(name='hmm', sizes={'tiny': (42, 42)}, widget=ImageWidget(label='Image', description='an image')), )) class SampleType(BaseContent): portal_type = 'SampleType' schema = SampleSchema permissions['SampleType'] = packageName + ': SampleType'
from bika.lims.config import PROJECTNAME from bika.lims.content.bikaschema import BikaSchema from bika.lims.interfaces import IInvoice from plone.app.blob.field import FileField as BlobFileField from Products.Archetypes.public import BaseFolder from Products.Archetypes.public import FileWidget from Products.Archetypes.public import ReferenceField from Products.Archetypes.public import Schema from Products.Archetypes.public import registerType from Products.ATExtensions.ateapi import DateTimeField from Products.ATExtensions.ateapi import DateTimeWidget from Products.CMFPlone.utils import safe_unicode from zope.interface import implements schema = BikaSchema.copy() + Schema(( BlobFileField("InvoicePDF", widget=FileWidget(label=_("Invoice PDF"), )), ReferenceField( "Client", required=1, vocabulary_display_path_bound=sys.maxsize, allowed_types=("Client", ), relationship="ClientInvoice", ), ReferenceField( "AnalysisRequest", required=1, vocabulary_display_path_bound=sys.maxsize, allowed_types=("AnalysisRequest", ), relationship="AnalysisRequestInvoice", ), ReferenceField(
LinesField( 'xppm_artifact_tags', vocabulary="vocabulary_artifactTag", widget=InAndOutWidget( label=u'Tags', description="Please select the tags for this artifact", ), #schemata = 'Properties', schemata='Metadata', ), # attachment FileField( 'xppm_artifact_attachment', widget=FileWidget( label="Attachment", description="You may upload a file here:", ), storage=AttributeStorage(), schemata='Metadata', ), )) # finalize the schema. finalizeATCTSchema(PPMArtifactSchema) # set the description field invisible. PPMArtifactSchema['description'].widget.visible = False # the class. class PPMArtifact(XPPMBase, ATFolder, HistoryAwareMixin):
from iscorpio.plonepm.content.base import XPPMBase __author__ = 'Sean Chen' __email__ = '*****@*****.**' # define a PPMProject as a folder in plone site. PPMFuncSpecSchema = ATFolderSchema.copy() + Schema(( # the function specificaion docuemnt. FileField( 'xppm_fsd', required = True, searchable = True, storage = AnnotationStorage(migrate = True), widget = FileWidget( label = 'Document', description = 'The function specification docuement', ), ), ) ) finalizeATCTSchema(PPMFuncSpecSchema); # the corresponding class file. class PPMFuncSpec(XPPMBase, ATFolder, HistoryAwareMixin): """ defines a content type for function specification docuemtn. """ schema = PPMFuncSpecSchema # type, name
default_output_type='text/x-html-safe', widget=RichWidget( label=u'Email Body', description=u'Please edit your email message here!', rows=22, ), ), # the file attachement. FileField( 'xpcm_emessage_attachment', required=False, searchable=False, storage=AnnotationStorage(migrate=True), widget=FileWidget( label='Attachment', description='You may add one attachment into you email.', ), ), # the view only sending log. StringField( 'xpcm_emessage_sendinglog', widget=StringWidget( visible={'edit': 'invisible'}, label='Sending Log', description='Sending log for this message', ), ), ), ) # Plone 3 will re-organize all fields' shemata by using this method.