def _createDocument(self): document = ZBlogDocument() document.setTitle(u"RAVEN_TEMPLATE_FETCH_TITLE") #$NON-NLS-1$ document.setCreationTime(ZSchemaDateTime()) document.setLastModifiedTime(ZSchemaDateTime()) xhtmlDoc = loadXhtmlDocumentFromString(u"<p id='_raven_template_body'>RAVEN_TEMPLATE_FETCH_BODY</p>") #$NON-NLS-1$ content = ZXhtmlContent() content.setMode(u"xml") #$NON-NLS-1$ content.setType(u"application/xhtml+xml") #$NON-NLS-1$ content.setXhtmlDocument(xhtmlDoc) document.setContent(content) return document
def createBlogDocument(self): u"""createBlogDocument( -> IZBlogDocument""" #$NON-NLS-1$ xhtmlDoc = self.createXhtmlDocument() doc = ZBlogDocument() title = getNoneString(self.izBlogThisInformation.getTitle()) if not title: title = getSafeString(xhtmlDoc.getTitle()) doc.setTitle(title) content = ZXhtmlContent() content.setMode(u"xml") #$NON-NLS-1$ content.setType(u"application/xhtml+xml") #$NON-NLS-1$ content.setXhtmlDocument(xhtmlDoc) doc.setContent(content) return doc
def createBlogDocument(self): u"""createBlogDocument( -> IZBlogDocument""" #$NON-NLS-1$ xhtmlDoc = self.createXhtmlDocument() doc = ZBlogDocument() title = getNoneString( self.izBlogThisInformation.getTitle() ) if not title: title = getSafeString( xhtmlDoc.getTitle() ) doc.setTitle( title ) content = ZXhtmlContent() content.setMode(u"xml") #$NON-NLS-1$ content.setType(u"application/xhtml+xml") #$NON-NLS-1$ content.setXhtmlDocument(xhtmlDoc) doc.setContent(content) return doc
def _createDocument(self): document = ZBlogDocument() document.setTitle(u"RAVEN_TEMPLATE_FETCH_TITLE") #$NON-NLS-1$ document.setCreationTime(ZSchemaDateTime()) document.setLastModifiedTime(ZSchemaDateTime()) xhtmlDoc = loadXhtmlDocumentFromString( u"<p id='_raven_template_body'>RAVEN_TEMPLATE_FETCH_BODY</p>" ) #$NON-NLS-1$ content = ZXhtmlContent() content.setMode(u"xml") #$NON-NLS-1$ content.setType(u"application/xhtml+xml") #$NON-NLS-1$ content.setXhtmlDocument(xhtmlDoc) document.setContent(content) return document
def _createRavenDocument(self, zblog, serverEntry): # Create and return IZDocument # main document struct. zdoc = ZBlogDocument() # FIXME (PJ) server api needs separate dt fields for creation-time vs published time vs updated-time. schemaDt = ZSchemaDateTime( serverEntry.getUtcDateTime() ) zdoc.setCreationTime( schemaDt ) zdoc.setLastModifiedTime( schemaDt ) # FIXME (PJ) Test test for entries with out a title (else autogen titles) zdoc.setTitle( serverEntry.getTitle() ) # tagwords, if any. self._createRavenTagwords(zdoc, serverEntry) # blog info (including pubinfo object) zbloginfo = self._createRavenBlogInfo(zblog, serverEntry) # add blog info to doc zdoc.addBlogInfo(zbloginfo) # server side content content = serverEntry.getContent() # convert to Raven IZDocumentContent xhtml model zdocContent = self._createRavenContent(content) # add content to doc zdoc.setContent(zdocContent) # TODO: zdoc.setTagwords() and zdoc.add/setTrackback return zdoc
def _createRavenDocument(self, zblog, serverEntry): # Create and return IZDocument # main document struct. zdoc = ZBlogDocument() # FIXME (PJ) server api needs separate dt fields for creation-time vs published time vs updated-time. schemaDt = ZSchemaDateTime(serverEntry.getUtcDateTime()) zdoc.setCreationTime(schemaDt) zdoc.setLastModifiedTime(schemaDt) # FIXME (PJ) Test test for entries with out a title (else autogen titles) zdoc.setTitle(serverEntry.getTitle()) # tagwords, if any. self._createRavenTagwords(zdoc, serverEntry) # blog info (including pubinfo object) zbloginfo = self._createRavenBlogInfo(zblog, serverEntry) # add blog info to doc zdoc.addBlogInfo(zbloginfo) # server side content content = serverEntry.getContent() # convert to Raven IZDocumentContent xhtml model zdocContent = self._createRavenContent(content) # add content to doc zdoc.setContent(zdocContent) # TODO: zdoc.setTagwords() and zdoc.add/setTrackback return zdoc