use of org.pentaho.platform.dataaccess.metadata.model.impl.Category in project data-access by pentaho.
the class MetadataServiceUtil method createThinModel.
/**
* Creates a lightweight, serializable model object from a logical model
*
* @param m
* @param domainId
* @return
*/
public Model createThinModel(LogicalModel m, String domainId) {
// create the model object
Model model = new Model();
model.setName(m.getName(getLocale()));
model.setId(m.getId());
model.setDomainId(domainId);
model.setDescription(m.getDescription(getLocale()));
// add the categories to the model
List<Category> categories = new ArrayList<Category>();
for (org.pentaho.metadata.model.Category cat : m.getCategories()) {
categories.add(createCategory(m, cat));
}
model.setCategories(categories.toArray(new Category[categories.size()]));
return model;
}
use of org.pentaho.platform.dataaccess.metadata.model.impl.Category in project data-access by pentaho.
the class MetadataServiceUtil method createCategory.
/**
* Creates a lightweight, serializable category objects from a logical model category
*
* @param m
* @param c
* @return
*/
private Category createCategory(LogicalModel m, org.pentaho.metadata.model.Category c) {
// create a thin category object
Category cat = new Category();
cat.setName(c.getName(getLocale()));
cat.setId(c.getId());
List<Column> columns = new ArrayList<Column>();
for (LogicalColumn col : c.getLogicalColumns()) {
columns.add(createColumn(m, col, c));
}
cat.setColumns(columns.toArray(new Column[columns.size()]));
return cat;
}
Aggregations