return new ResourceComposite(new Resource(from.getAttributeAsInt("id")), AvailabilityType.DOWN);
}
@Override
public ListGridRecord copyValues(ResourceComposite from) {
Resource res = from.getResource();
ListGridRecord record = new ListGridRecord();
record.setAttribute("resourceComposite", from);
record.setAttribute("resource", res);
record.setAttribute("id", res.getId());
record.setAttribute(NAME.propertyName(), res.getName());
record.setAttribute(KEY.propertyName(), res.getResourceKey());
record.setAttribute(DESCRIPTION.propertyName(), res.getDescription());
record.setAttribute(LOCATION.propertyName(), res.getLocation());
record.setAttribute(TYPE.propertyName(), res.getResourceType().getId());
record.setAttribute(PLUGIN.propertyName(), res.getResourceType().getPlugin());
record.setAttribute(VERSION.propertyName(), res.getVersion());
record.setAttribute(CATEGORY.propertyName(), res.getResourceType().getCategory().name());
record.setAttribute("icon", ImageManager.getResourceIcon(res.getResourceType().getCategory(), res
.getCurrentAvailability().getAvailabilityType()));
record.setAttribute(AVAILABILITY.propertyName(),
ImageManager.getAvailabilityIconFromAvailType(res.getCurrentAvailability().getAvailabilityType()));
record.setAttribute(CTIME.propertyName(), res.getCtime());
record.setAttribute(ITIME.propertyName(), res.getItime());
record.setAttribute(MTIME.propertyName(), res.getMtime());
record.setAttribute(MODIFIER.propertyName(), res.getModifiedBy());
record.setAttribute(INVENTORY_STATUS.propertyName(), res.getInventoryStatus());
record.setAttribute("resourcePermission", from.getResourcePermission());
// for ancestry handling
record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, res.getAncestry());
record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, res.getResourceType().getId());
return record;
}