*/
public ObjectTemplateSO translateTo(ObjectTemplate obj) {
logger.debug("translate to: " + obj);
ObjectTemplateSO so = new ObjectTemplateSO();
so.setId(obj.getId());
so.setCampaignId(obj.getCampaign().getId());
so.setName(obj.getName());
so.setDescription(obj.getDescription());
so.setType(obj.getType());
so.setImage(obj.getImage());
so.setLabelProperty(obj.getLabelProperty());
if(obj.getParent() != null) {
so.setObjectTemplateId(obj.getParent().getId());
}
Set<String> properties = new HashSet<String>();
for(ObjectProperty op : obj.getProperties()) {
logger.trace("op: " + op);
properties.add(op.getId());
}
so.setProperties(properties);
return so;
}