def onInit(self): osiris.IMainPage.onInit(self) self.pathway.add( self.getText( "extensions.4A7F130B4A5C42CC5D928D157641596A89543C65.index.title" ), "/developer_tools") if self.postBack == False: self.noCase.check = True blockInput = osiris.IdeBlock("Input") self.getArea(osiris.pageAreaContent).controls.add(blockInput) blockInput.body.controls.add(self.input) blockExpression = osiris.IdeBlock("Expression") self.getArea(osiris.pageAreaContent).controls.add(blockExpression) blockExpression.body.controls.add(self.expression) blockExpression.body.controls.add(self.noCase) blockFormat = osiris.IdeBlock("Format") self.getArea(osiris.pageAreaContent).controls.add(blockFormat) blockFormat.body.controls.add(self.format) self.getArea(osiris.pageAreaContent).controls.add(self.compute)
def onPreRender(self): osiris.IMainPage.onPreRender(self) if (self.getPostBack()): try: match = False out = "" match = osiris.RegexManager.instance().match( self.input.value, self.expression.value, self.noCase.check) out = osiris.RegexManager.instance().replace( self.input.value, self.expression.value, self.format.value, self.noCase.check) bbOut = "[center][size=\"2em\"]" if (match): bbOut += "Match!" else: bbOut += "Not match." bbOut += "[/size][/center]" if (out != ""): bbOut += "[code]" + out + "[/code]" bbOut = self.parseOml(bbOut) blockOutput = osiris.IdeBlock("Output") self.getArea(osiris.pageAreaContent).controls.add(blockOutput) blockOutput.body.controls.add(osiris.HtmlLiteral(bbOut)) except Exception as ex: self.showMessage(ex.message)
def onLoad(self): osiris.IPortalPage.onLoad(self) myBlock = osiris.IdeBlock(self.getText("portal.pages.changes.title")) myBlock.outerStyle = "clear:both"; query = osiris.SearchQuery() query.orderMode = osiris.searchOrderModeSubmitDate query.orderDirection = osiris.searchOrderDirectionDescendent #if(self.loggedUser.guestMode == False): query.fromInsertDateType = osiris.searchDateTimeReference query.groupMode = False query.showDeleted = True query.template = "blog" params = { } params["mode"] = "rss" query.rssUrl = self.portal.getLink("changes", params) self.ideQuery = osiris.IdeSearchQuery(query) self.ideQuery.setDirectRun(True) self.ideQuery.setShowParams(False) self.ideQuery.id = "query" myBlock.body.controls.add(self.ideQuery) self.getArea(osiris.pageAreaContent).controls.add(myBlock)
def onLoad(self): osiris.IPortalPage.onLoad(self) if (self.sessionAccount.isPortalGuest(self.database) == True): self.showMessage( self.getText("portals.errors.loggeduser_required")) return myBlock = osiris.IdeBlock( self.getText("portal.pages.latest_user_discussions.title")) query = osiris.SearchQuery() query.orderMode = osiris.searchOrderModeLastObject query.orderDirection = osiris.searchOrderDirectionDescendent query.groupMode = True query.showDeleted = False query.template = "table" query.byUser = "******" ideQuery = osiris.IdeSearchQuery(query) ideQuery.setDirectRun(True) ideQuery.setShowParams(False) ideQuery.id = "query" myBlock.body.controls.add(ideQuery) self.getArea(osiris.pageAreaContent).controls.add(myBlock)
def onPreRender(self): osiris.IMainPage.onPreRender(self) blockHtmlGenerated = osiris.IdeBlock("Direct HTML Output") self.getArea(osiris.pageAreaContent).controls.add(blockHtmlGenerated) output = osiris.HtmlDiv() output.id="output" output.controls.add(osiris.HtmlLiteral(self.editor.value)) blockHtmlGenerated.body.controls.add(output)
def onInit(self): osiris.IMainPage.onInit(self) self.pathway.add(self.getText("extensions.4A7F130B4A5C42CC5D928D157641596A89543C65.index.title"),"/developer_tools") blockEditor = osiris.IdeBlock("Editor") self.getArea(osiris.pageAreaContent).controls.add(blockEditor) blockEditor.body.controls.add(self.editor)
def onLoad(self): osiris.IPortalPage.onLoad(self) myBlock = osiris.IdeBlock(self.getText("portal.pages.trash.title")) myBlock.specialPage = True myBlock.outerStyle = "clear:both" self.query = osiris.IdeTableQuery() sql = "select id, author, submit_date, insert_date, rank, accept_msg from os_entries te where rank=-1" self.query.setSql(sql) self.query.setColumnType(0, osiris.IdeTableQuery.ctObjectID) self.query.setColumnType(1, osiris.IdeTableQuery.ctUserID) self.query.setColumnType(2, osiris.IdeTableQuery.ctShortDateTime) self.query.setColumnType(3, osiris.IdeTableQuery.ctShortDateTime) myBlock.body.controls.add(self.query) self.getArea(osiris.pageAreaContent).controls.add(myBlock)
def onInit(self): osiris.IMainPage.onInit(self) block = osiris.IdeBlock("Python Documentation Generator") self.getArea(osiris.pageAreaContent).controls.add(block)