@Override
protected List<ControlDescriptor> getControlDescriptors() {
List<ControlDescriptor> controlDescriptors = new ArrayList<ControlDescriptor>();
final Resource resource = getResourceModel().getObject();
//Category
controlDescriptors.add(new ControlDescriptor(new ResourceModel(MKEY_CATEGORY)) {
private static final long serialVersionUID = 1L;
@Override
public Component createComponent(String componentId) {
return new Label(componentId,
new ResourceModel(MKEY_RSUBTYPE_PREFIX + ResourceUtils.getShortSubtype(resource.getClass())));
}
});
//Description selector
/*
final Category category = resource.get;
if(category != null && !category.getLeafCategory()) {
controlDescriptors.add(new ControlDescriptor(new ResourceModel(MKEY_DESCRIPTION)) {
private static final long serialVersionUID = 1L;
@Override
public Component createComponent(String componentId) {
return new MultiLineLabel(componentId, resource.getDescription());
}
});
}*/
//Populate with category properties controls
//Init custom values map
if(resourceCustomValues == null) {
resourceCustomValues = new HashMap<Property, Value>();
Collection<PropertySpecification> propsSpecs = resource.getSpecification();
for(PropertySpecification spec: propsSpecs) {
resourceCustomValues.put(spec.getProperty(), spec.getValue());
}
}
/* Collection<Property> properties = categoryReader.getProperties(category);