use of com.emc.metalnx.core.domain.entity.IconObject in project metalnx-web by irods-contrib.
the class IconServiceImpl method createMap.
private static Map<String, IconObject> createMap() {
Map<String, IconObject> myMap = new HashMap<String, IconObject>();
myMap.put("image/jpg", new IconObject("File", "fa fa-file-image-o"));
myMap.put("image/jpeg", new IconObject("File", "fa fa-file-image-o"));
myMap.put("image/png", new IconObject("File", "fa fa-file-image-o"));
myMap.put("image/gif", new IconObject("File", "fa fa-file-image-o"));
myMap.put("application/pdf", new IconObject("File", "fa fa-file-pdf-o"));
myMap.put("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", new IconObject("File", "fa fa-file-excel-o"));
myMap.put("application/vnd.openxmlformats-officedocument.spreadsheetml.template", new IconObject("File", "fa fa-file-excel-o"));
myMap.put("application/vnd.openxmlformats-officedocument.wordprocessingml.document", new IconObject("File", "fa fa-file-word-o"));
myMap.put("text/csv", new IconObject("File", "fa fa-file-excel-o"));
myMap.put("text/plain", new IconObject("File", "fa fa-file-text-o"));
return myMap;
}
use of com.emc.metalnx.core.domain.entity.IconObject 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 com.emc.metalnx.core.domain.entity.IconObject 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 com.emc.metalnx.core.domain.entity.IconObject 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