use of com.emc.metalnx.core.domain.entity.DataGridResource in project metalnx-web by irods-contrib.
the class ResourceController method findResourcesByName.
/**
* Lists all resources that match the parameter given
*
* @param model
* @return
* @throws DataGridConnectionRefusedException
*/
@RequestMapping(value = "/find/{resourceName}/")
public String findResourcesByName(Model model, @PathVariable String resourceName) throws DataGridConnectionRefusedException {
DataGridResource dataGridResource = resourceService.find(resourceName);
model.addAttribute("resources", dataGridResource);
model.addAttribute("resourceName", resourceName);
return "resources/resourceList :: resourceList";
}
use of com.emc.metalnx.core.domain.entity.DataGridResource in project metalnx-web by irods-contrib.
the class ResourceController method showModifyResourceForm.
/**
* Shows the modify resource form
*
* @param model
* @return the template that renders the add resource from
* @throws DataGridConnectionRefusedException
*/
@RequestMapping(value = "/modify/{resourceName}/")
public String showModifyResourceForm(Model model, @PathVariable String resourceName) throws DataGridConnectionRefusedException {
if (dataGridResources == null || dataGridResources.isEmpty()) {
dataGridResources = resourceService.findAll();
}
DataGridResource dataGridResourceToModify = resourceService.find(resourceName);
List<String> childrenList = resourceService.getImmediateChildren(resourceName);
List<DataGridResourceType> coordinatingResources = getCoordinatingResources(resourceService.listResourceTypes());
List<DataGridResourceType> storageResources = getStorageResources(resourceService.listResourceTypes());
for (DataGridResourceType dataGridResourceType : resourceService.listResourceTypes()) {
if (dataGridResourceType.getDataGridType().equals(DataGridResourceTypeEnum.IRODS_COORDINATING)) {
coordinatingResources.add(dataGridResourceType);
} else if (dataGridResourceType.getDataGridType().equals(DataGridResourceTypeEnum.IRODS_STORAGE)) {
storageResources.add(dataGridResourceType);
}
}
ResourceForm resourceForm = new ResourceForm(dataGridResourceToModify);
// prevent the same resource being modified from showing in the parent resource
// list
model.addAttribute("resourceForm", resourceForm);
model.addAttribute("requestMapping", URLMap.URL_MODIFY_RESOURCE_ACTION);
model.addAttribute("resources", dataGridResources);
model.addAttribute("childrenList", childrenList);
model.addAttribute("coordinatingResources", coordinatingResources);
model.addAttribute("storageResources", storageResources);
return "resources/resourceForm";
}
use of com.emc.metalnx.core.domain.entity.DataGridResource in project metalnx-web by irods-contrib.
the class ResourceController method addResourceForm.
private void addResourceForm(Model model) throws DataGridConnectionRefusedException {
List<DataGridResource> dataGridResources = resourceService.findAll();
List<DataGridResourceType> resourceTypes = resourceService.listResourceTypes();
List<DataGridResourceType> coordinatingResources = getCoordinatingResources(resourceTypes);
List<DataGridResourceType> storageResources = getStorageResources(resourceTypes);
model.addAttribute("resourceForm", new ResourceForm());
model.addAttribute("requestMapping", URLMap.URL_ADD_RESOURCE_ACTION);
model.addAttribute("resources", dataGridResources);
model.addAttribute("childrenList", new ArrayList<String>());
model.addAttribute("coordinatingResources", coordinatingResources);
model.addAttribute("storageResources", storageResources);
model.addAttribute("zones", zoneService.findAll());
}
use of com.emc.metalnx.core.domain.entity.DataGridResource in project metalnx-web by irods-contrib.
the class TestRuleService method testIlluminaMetadataRule.
@Test
public void testIlluminaMetadataRule() throws DataGridRuleException, DataGridConnectionRefusedException {
DataGridResource dgDestResc = resourceService.find(RESOURCE);
ruleService.execIlluminaMetadataRule(dgDestResc, "/zone/home/rods", "/zone/home/rods/test_SSU.tar");
// these two methods should never be called since there is no objects under the
// test path
verify(ruleService, atMost(2)).executeRule(anyString());
}
use of com.emc.metalnx.core.domain.entity.DataGridResource in project metalnx-web by irods-contrib.
the class DashboardController method getDetailsForResource.
@RequestMapping(value = "/resourceDetails/{resourceName}/", method = RequestMethod.GET)
public String getDetailsForResource(@PathVariable String resourceName, Model model) throws DataGridConnectionRefusedException {
logger.info("getDetailsForResource()");
DataGridResource resource = resourceService.find(resourceName);
if (resource != null) {
model.addAttribute("resource", resource);
} else {
model.addAttribute("resourceNotFound", resourceName);
}
return "dashboard/details/resourceInfo";
}
Aggregations