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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))