Esempio n. 1
0
    def submitColumnChoice(self, REQUEST):
        """
	    Test
	    """
        # Form's select_column contains the value of the column selected.
        catalog = getToolByName(self, "portal_catalog")
        items = catalog.searchResults({"portal_type": "Column"})
        self.columnChoice = REQUEST["select_column"]
        for item in items:
            if item.id == self.columnChoice:
                column = item.getObject()
        if column is None:
            return
        skin = self.portal_skins.newspaper_templates
        submitTemplate = skin.submit
        i = 0
        columnSize = self.getColumnSize()
        verbage = self.getVerbage()
        col = Columnar(verbage, columnSize)
        columns = col.getLines()
        lineCount = col.countLines()
        while i <= lineCount:
            lineid = str(i)
            if len(lineid) == 1:
                lineid = "0" + lineid
            portal_types = getToolByName(column, "portal_types")
            type_info = portal_types.getTypeInfo("Line")
            lineitem = type_info._constructInstance(column, lineid)
            lineitem.markCreationFlag()
            lineitem.setVerbage(columns[i])
            i += 1
        return submitTemplate()
    def returnLines(self):
	    """
	    Test
	    """
	    articles = self.getWordage()
	    output = []
            for article in articles:
	    	verbage = article.getWordage()
		just = Columnar(verbage,40)
		lines = just.getLines()
		totalLines = just.countLines()
		i = 1
		while i<=totalLines:
			theLine = just.returnLine(i)
			output.append(theLine)
			i += 1
	    return output