use of org.irods.jargon.extensions.dataprofiler.DataProfile in project metalnx-web by irods-contrib.
the class CollectionServiceImpl method getCollectionDataProfile.
@SuppressWarnings("unchecked")
@Override
public DataProfile<IRODSDomainObject> getCollectionDataProfile(String path) throws DataGridException {
IRODSAccount irodsAccount = irodsServices.getUserAO().getIRODSAccount();
logger.info("*****************path **************" + path);
logger.debug("got irodsAccount:{}", irodsAccount);
DataProfilerService dataProfilerService = dataProfilerFactory.instanceDataProfilerService(irodsAccount);
logger.debug("got the dataProfilerService");
// TODO: allow clone()
try {
@SuppressWarnings("rawtypes") DataProfile dataProfile = dataProfilerService.retrieveDataProfile(path);
logger.info("------CollectionInfoController getTestCollectionInfo() ends !!");
logger.info("data profile retrieved:{}", dataProfile);
/*
* TODO: after this do an if test and send to right view with the DataProfile in
* the model
*/
return dataProfile;
} catch (JargonException e) {
logger.error("Could not retrieve collection/dataobject from path: {}", path, e);
throw new DataGridException(e.getMessage());
}
}
use of org.irods.jargon.extensions.dataprofiler.DataProfile in project metalnx-web by irods-contrib.
the class BrowseController method getSummary.
@RequestMapping(value = "/summary", method = RequestMethod.POST)
public String getSummary(final Model model, @RequestParam("path") final String path) throws DataGridException, UnsupportedEncodingException {
logger.info("BrowseController getSummary() starts :: " + path);
IconObject icon = null;
String mimeType = "";
@SuppressWarnings("rawtypes") DataProfile dataProfile = cs.getCollectionDataProfile(URLDecoder.decode(path, "UTF-8"));
logger.info("DataProfiler is :: " + dataProfile);
if (dataProfile != null && dataProfile.isFile()) {
mimeType = dataProfile.getDataType().getMimeType();
}
icon = cs.getIcon(mimeType);
model.addAttribute("icon", icon);
model.addAttribute("dataProfile", dataProfile);
logger.info("getSummary() ends !!");
return "collections/summarySidenav :: SummarySidenavView";
}
use of org.irods.jargon.extensions.dataprofiler.DataProfile in project metalnx-web by irods-contrib.
the class CollectionInfoController method index.
@RequestMapping(method = RequestMethod.GET)
public String index(final Model model, HttpServletRequest request, @RequestParam("path") final String path) throws DataGridException, DataGridConnectionRefusedException, JargonException {
logger.info("index()");
if (path == null || path.isEmpty()) {
throw new IllegalArgumentException("null or empty path");
}
logger.info("path:{}", path);
String myPath = URLDecoder.decode(path);
logger.info("decoded myPath:{}", myPath);
IconObject icon = null;
String mimeType = "";
String template = "";
@SuppressWarnings("rawtypes") DataProfile dataProfile = collectionService.getCollectionDataProfile(myPath);
if (dataProfile != null && dataProfile.isFile()) {
mimeType = dataProfile.getDataType().getMimeType();
}
icon = collectionService.getIcon(mimeType);
model.addAttribute("icon", icon);
model.addAttribute("dataProfile", dataProfile);
model.addAttribute("breadcrumb", new DataGridBreadcrumb(dataProfile.getAbsolutePath()));
if (!dataProfile.isFile())
template = "collections/collectionInfo";
if (dataProfile.isFile())
template = "collections/fileInfo";
return template;
}
use of org.irods.jargon.extensions.dataprofiler.DataProfile in project metalnx-web by irods-contrib.
the class CollectionInfoController method getCollectionFileInfo.
@RequestMapping(value = "/collectionFileInfo/", method = RequestMethod.POST)
public String getCollectionFileInfo(final Model model, @RequestParam("path") final String path) throws DataGridException {
logger.info("CollectionInfoController getCollectionFileInfo() starts :: " + path);
IconObject icon = null;
String mimeType = "";
@SuppressWarnings("rawtypes") String myPath = URLDecoder.decode(path);
DataProfile dataProfile = collectionService.getCollectionDataProfile(myPath);
if (dataProfile != null && dataProfile.isFile()) {
mimeType = dataProfile.getDataType().getMimeType();
}
icon = collectionService.getIcon(mimeType);
model.addAttribute("icon", icon);
model.addAttribute("dataProfile", dataProfile);
logger.info("getCollectionFileInfo() ends !!");
return "collections/details :: detailsView";
}
Aggregations