Exemplo n.º 1
0
    def test(self):
        """
        test method
        """
        dummy = _(u'a dummy string')

        return {'dummy': dummy}
Exemplo n.º 2
0
    def test(self):
        """
        test method
        """
        dummy = _(u'a dummy string')

        return {'dummy': dummy}
Exemplo n.º 3
0
                         default_method='getDefaultRefDraft',
                         widget=ReferenceBrowserWidget(visible={
                             'edit': 'invisible',
                             'view': 'visible'
                         })),
    atapi.TextField(
        'text',
        required=False,
        searchable=True,
        primary=True,
        storage=atapi.AnnotationStorage(),
        validators=('isTidyHtmlWithCleanup', ),
        default_output_type='text/x-html-safe',
        widget=atapi.RichWidget(
            description='',
            label=_(u'label_body_text', default=u'Body Text'),
            rows=25,
            allow_file_upload=True,
        ),
    ),
))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.
CommentSchema['title'].storage = atapi.AnnotationStorage()
CommentSchema['description'].storage = atapi.AnnotationStorage()
CommentSchema['description'].widget.visible = {
    'edit': 'invisible',
    'view': 'invisible'
}
schemata.finalizeATCTSchema(CommentSchema, moveDiscussion=False)
Exemplo n.º 4
0
        ),        
        default_method="getDefaultEditors"    
    ),

    atapi.ReferenceField(
        name='refEditors',
        relationship = 'refEditors',
        required = False,
        multiValued = True,
        searchable=1,
        allowed_types=('gcPerson',),
        storage=atapi.AnnotationStorage(),
        
        widget = ReferenceBrowserWidget(
            condition="here/condition_refEditors",
            label=_("Editorial Board"),            
            description=_("Pick the users who compose the EB and are able to manage this journal/conf/RT."),            
            allow_browse=0,
            allow_search=1,
            show_results_without_query=1, 
#            startup_directory_method="_get_gcommons_users_tool",
        ),            
    ),
    

    atapi.FileField(
        name='configuration',
        required = False,
        searchable = False,
        languageIndependent = True,
        storage = atapi.AnnotationStorage(),
Exemplo n.º 5
0
#
#
#
gcRelatorsSchema_base = atapi.Schema ((

    atapi.StringField(
        name='primaryAuthor',
        searchable=True,
        index='FieldIndex',
        default_method ='_compute_author',
        vocabulary = 'vocabAuthor',
        storage = atapi.AnnotationStorage(),
        widget = atapi.ComputedWidget(
            name = 'Primary Author',
            description = _('Principal creator or responsible of the paper.'),
            visible = {'edit' : 'visible', 'view' : 'visible' },
        ),
    ),

    # testing this

    # This field is used
    #    if gcommons.Users not installed, hidden
    #    if user registration enforced: to hold them after registered
#    DataGridField(
#        name='refRegisteredRelators',
#        widget=DataGridWidget(
#            label=_("Other Authors (Already Registered)"),
#            description = _('If applicable, other authors of the paper or persons responsible for this piece, besides the principal author.'),
#            columns={
Exemplo n.º 6
0
            "refDraft",
            relationship="refDraft",
            multiValued=False,
            default_method="getDefaultRefDraft",
            widget=ReferenceBrowserWidget(visible={"edit": "invisible", "view": "visible"}),
        ),
        atapi.TextField(
            "text",
            required=False,
            searchable=True,
            primary=True,
            storage=atapi.AnnotationStorage(),
            validators=("isTidyHtmlWithCleanup",),
            default_output_type="text/x-html-safe",
            widget=atapi.RichWidget(
                description="", label=_(u"label_body_text", default=u"Body Text"), rows=25, allow_file_upload=True
            ),
        ),
    )
)

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.
CommentSchema["title"].storage = atapi.AnnotationStorage()
CommentSchema["description"].storage = atapi.AnnotationStorage()
CommentSchema["description"].widget.visible = {"edit": "invisible", "view": "invisible"}
schemata.finalizeATCTSchema(CommentSchema, moveDiscussion=False)


class Comment(base.ATCTContent):
    """Object containing comments for an article"""
Exemplo n.º 7
0
from gcommons.Core.config import PROJECTNAME
import gcommons.Core.permissions as permissions

logger = logging.getLogger("gcommons.Core.content.draft")


#
# Schema
#
DraftSchema = ATFile.schema.copy() + atapi.Schema(
    (
        atapi.ComputedField("title", searchable=False, expression="context._compute_title()", accessor="Title"),
        atapi.StringField(
            name="subtype",
            widget=atapi.SelectionWidget(
                label=_("Type"),
                description="Choose the description that best fits the type of draft you are uploading",
                label_msgid="gcommons_draft_subtype",
                description_msgid="gcommons_help_draft_subtype",
            ),
            required=True,
            default="first",
            storage=atapi.AnnotationStorage(),
            vocabulary="getDraftTypesVocabulary",
            searchable=False,
        ),
    )
)


def finalizeDraftSchema(schema):
Exemplo n.º 8
0
from gcommons.Core import CoreMessageFactory as _
from gcommons.Core.interfaces import ICallForPapers
from gcommons.Core.config import PROJECTNAME

CallForPapersSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
    atapi.TextField(
        'body',
        searchable=1,
        required=1,
        allowable_content_types=(
            'text/plain',
            'text/structured',
            'text/html',
        ),
        default_output_type='text/x-html-safe',
        widget=atapi.RichWidget(label=_(u'Call text')),
    ),

    #
    # Dates
    atapi.DateTimeField(
        name='startDate',
        required=True,
        searchable=False,
        accessor='start',
        #TODO                  write_permission = ChangeEvents,
        default_method=DateTime,
        languageIndependent=True,
        widget=atapi.CalendarWidget(description='',
                                    label=_(u'label_call_start',
                                            default=u'Call Starts')),
Exemplo n.º 9
0
        default_method = 'getDefaultRefDraft',
        widget = ReferenceBrowserWidget(
            visible = {'edit' : 'invisible', 'view' : 'visible' }
        )
    ),

    atapi.TextField('text',              
        required=False,              
        searchable=True,              
        primary=True,              
        storage = atapi.AnnotationStorage(),
        validators = ('isTidyHtmlWithCleanup',),              
        default_output_type = 'text/x-html-safe',              
        widget = atapi.RichWidget(                        
                    description = '',                        
                    label = _(u'label_body_text', default=u'Body Text'),                        
                    rows = 25,
                    allow_file_upload = True,                        
        ),    
    ),
   

))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.
CommentSchema['title'].storage = atapi.AnnotationStorage()
CommentSchema['description'].storage = atapi.AnnotationStorage()
CommentSchema['description'].widget.visible = {'edit' : 'invisible', 'view' : 'invisible' }
schemata.finalizeATCTSchema(CommentSchema, moveDiscussion=False)
Exemplo n.º 10
0
logger = logging.getLogger("gcommons.Core.lib.creators")

#
#
#
gcRelatorsSchema_base = atapi.Schema((
    atapi.StringField(
        name='primaryAuthor',
        searchable=True,
        index='FieldIndex',
        default_method='_compute_author',
        vocabulary='vocabAuthor',
        storage=atapi.AnnotationStorage(),
        widget=atapi.ComputedWidget(
            name='Primary Author',
            description=_('Principal creator or responsible of the paper.'),
            visible={
                'edit': 'visible',
                'view': 'visible'
            },
        ),
    ),

    # testing this

    # This field is used
    #    if gcommons.Users not installed, hidden
    #    if user registration enforced: to hold them after registered
    #    DataGridField(
    #        name='refRegisteredRelators',
    #        widget=DataGridWidget(
Exemplo n.º 11
0

from gcommons.Core import CoreMessageFactory as _
from gcommons.Core.interfaces import ICallForPapers
from gcommons.Core.config import PROJECTNAME

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

  atapi.TextField('body',
            searchable = 1,
            required = 1,
            allowable_content_types = ('text/plain',
                                       'text/structured',
                                       'text/html',),
            default_output_type = 'text/x-html-safe',
            widget = atapi.RichWidget(label = _(u'Call text')),
           ),

    #
    # Dates
    atapi.DateTimeField(
        name='startDate',                  
        required=True,                  
        searchable=False,                  
        accessor='start',                  
#TODO                  write_permission = ChangeEvents,                  
        default_method=DateTime,                  
        languageIndependent=True,                  
        widget = atapi.CalendarWidget(                        
                  description= '',                        
                  label=_(u'label_call_start', 
Exemplo n.º 12
0

#
# Schema
#
DraftSchema = ATFile.schema.copy() + atapi.Schema((
    atapi.ComputedField('title',
        searchable=False,
        expression='context._compute_title()',
        accessor='Title'
    ),

    atapi.StringField(        
        name='subtype',        
        widget = atapi.SelectionWidget(            
            label=_("Type"),            
            description="Choose the description that best fits the type of draft you are uploading",
            label_msgid="gcommons_draft_subtype",            
            description_msgid="gcommons_help_draft_subtype",            
        ),
        required=True,
        storage = atapi.AnnotationStorage(),
        vocabulary="getDraftTypesVocabulary",        
        searchable=False   
    ),
                                                  
))

def finalizeDraftSchema(schema):
    schema['title'].storage = atapi.AnnotationStorage()
    schema['description'].storage = atapi.AnnotationStorage()