@SuppressWarnings("deprecation") public void addColumn(final LogicalColumn column, final Element tableNode, final String locale) { Element columnNode = tableNode.addElement("column"); // $NON-NLS-1$ if (column.getId() != null) { columnNode.addElement("column_id").setText(column.getId()); // $NON-NLS-1$ } if (column.getName(locale) != null) { columnNode.addElement("column_name").setText(column.getName(locale)); // $NON-NLS-1$ } if (column.getDescription(locale) != null) { columnNode .addElement("column_description") .setText(column.getDescription(locale)); // $NON-NLS-1$ } if (column.getFieldType() != null) { // TODO this should take a locale String desc = column.getFieldType().getDescription(); desc = org.pentaho.pms.messages.Messages.getString(desc); columnNode.addElement("column_field_type").setText(desc); // $NON-NLS-1$ } DataType dataType = column.getDataType(); if (dataType != null) { columnNode.addElement("column_type").setText(dataType.getName()); // $NON-NLS-1$ } if (column.getProperty("lookup") != null) { // $NON-NLS-1$ columnNode.addElement("column_lookup").setText("true"); // $NON-NLS-1$ //$NON-NLS-2$ } }
private void assertColumns(LogicalColumn lcolumn, Element column, String categoryId) { assertEquals(lcolumn.getId(), column.getId()); assertEquals(lcolumn.getName(DEFAULT_LOCALE), column.getName()); assertEquals(lcolumn.getDescription(DEFAULT_LOCALE), column.getDescription()); assertEquals(categoryId, column.getParentId()); assertEquals(lcolumn.getDataType().getName().toUpperCase(), column.getDataType()); assertEquals(lcolumn.getFieldType().name(), column.getElementType()); Assert.assertArrayEquals( new String[] {"SUM", "COUNT", "AVERAGE"}, column.getAvailableAggregations()); assertEquals(lcolumn.getAggregationType().name(), column.getDefaultAggregation()); assertEquals(lcolumn.getAggregationType().name(), column.getSelectedAggregation()); assertEquals("LEFT", column.getHorizontalAlignment()); assertEquals("test_mask", column.getFormatMask()); Assert.assertFalse(column.isHiddenForUser()); }