Exemplo n.º 1
0
def addLink(self, id, title='', remote_url='', description=''):
    """
    Add a Link
    """
    o = Link(id, title, remote_url, description)
    self._setObject(id, o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 2
0
def addEvent(self
             , id
             , title=''
             , description=''
             , effective_date = DateTime() 
             , expiration_date = DateTime() 
             , location=''
             , contact_name=''
             , contact_email=''
             , contact_phone=''
             , event_url=''
             , REQUEST=None):
    """
    Create an empty event.
    """
    event = Event(id
                  , title
                  , description
                  , effective_date
                  , expiration_date
                  , location
                  , contact_name
                  , contact_email
                  , contact_phone
                  , event_url
                 )
    self._setObject(id, event)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 3
0
def addDocument(self, id, title='', description='', text_format='', text=''):
    """
        Add a Document
    """
    o = Document(id, title, description, text_format, text)
    self._setObject(id, o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 4
0
def addNewsItem(self, id, title='', text='', description=''):
    """
        Add a NewsItem
    """
    o = NewsItem(id, title, text, description)
    self._setObject(id, o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 5
0
def addDocument(self, id, title='', description='', text_format='',
                text=''):
    """
        Add a Document
    """
    o=Document(id, title, description, text_format, text)
    self._setObject(id,o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 6
0
def addFavorite(self, id, title='', remote_url='', description=''):
    """
    Add a Favorite
    """
    portal_url = getToolByName(self, 'portal_url')
    relUrl = portal_url.getRelativeUrl(self.restrictedTraverse(remote_url))
    o = Favorite(id, title, relUrl, description)
    self._setObject(id, o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 7
0
def addFavorite(self, id, title='', remote_url='', description=''):
    """
    Add a Favorite
    """
    portal_url = getToolByName(self, 'portal_url')
    relUrl = portal_url.getRelativeUrl(self.restrictedTraverse(
        remote_url))
    o=Favorite( id, title, relUrl, description )
    self._setObject(id,o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 8
0
Arquivo: Link.py Projeto: goschtl/zope
def addLink( self
           , id
           , title=''
           , remote_url=''
           , description=''
           ):
    """
    Add a Link
    """
    o=Link( id, title, remote_url, description )
    self._setObject(id,o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 9
0
def addNewsItem( self
               , id
               , title=''
               , text=''
               , description=''
               ):
    """
        Add a NewsItem
    """
    o=NewsItem( id, title, text, description )
    self._setObject(id, o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 10
0
def addNewsItem(self,
                id,
                title='',
                description='',
                text='',
                text_format='html'):
    """
        Add a NewsItem
    """
    o = NewsItem(id=id,
                 title=title,
                 description=description,
                 text=text,
                 text_format=text_format)
    self._setObject(id, o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 11
0
def addNewsItem( self
               , id
               , title=''
               , description=''
               , text=''
               , text_format='html'
               ):
    """
        Add a NewsItem
    """
    o=NewsItem( id=id
              , title=title
              , description=description
              , text=text
              , text_format=text_format
              )
    self._setObject(id, o)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 12
0
def addEvent(self,
             id,
             title='',
             description='',
             effective_date=DateTime(),
             expiration_date=DateTime(),
             location='',
             contact_name='',
             contact_email='',
             contact_phone='',
             event_url='',
             REQUEST=None):
    """
    Create an empty event.
    """
    event = Event(id, title, description, effective_date, expiration_date,
                  location, contact_name, contact_email, contact_phone,
                  event_url)
    self._setObject(id, event)
    afterCreate(self.this()._getOb(id))
Exemplo n.º 13
0
Arquivo: File.py Projeto: goschtl/zope
def addFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a File
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()

    # Instantiate the object and set its description.
    fobj = File( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because the object is now in the ZODB and
    # can span ZODB objects.
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))
Exemplo n.º 14
0
def addFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a File
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()

    # Instantiate the object and set its description.
    fobj = File( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because the object is now in the ZODB and
    # can span ZODB objects.
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))