Skip to content

Commit

Permalink
#27 icon load
Browse files Browse the repository at this point in the history
  • Loading branch information
Hetal Patel committed Jan 19, 2018
1 parent 4c841cb commit 31bfa59
Showing 1 changed file with 15 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public String getTestCollectionInfo(final Model model, HttpServletRequest reques
DataProfile dataProfile = getCollectionDataProfile(path);

String iconToDisplay = "";



if(dataProfile!= null && dataProfile.isFile())
iconToDisplay = iconService.getIconToDisplayFile(dataProfile.getDataType().getMimeType());
if(dataProfile!= null && !dataProfile.isFile())
Expand All @@ -83,25 +82,10 @@ public String getTestCollectionInfo(final Model model, HttpServletRequest reques
model.addAttribute("iconToDisplay", iconToDisplay);
model.addAttribute("dataProfile", dataProfile);

return "collections/info"; //:: mainPage(page='collections/collectionInfo', fragment='collectionInfo')";
return "collections/info";

//:: mainPage(page='collections/collectionInfo', fragment='collectionInfo')";
//"main :: mainPage(page='some-page', fragment='somePage')";
//return "collections/collectionInfo";


/*
* DataGridCollectionAndDataObject dgColObj = null;
*
* try { dgColObj = collectionService.findByName(path);
* permissionsService.resolveMostPermissiveAccessForUser(dgColObj,
* loggedUserUtils.getLoggedDataGridUser()); } catch (DataGridException e) {
* logger.error("Could not retrieve collection/dataobject from path: {}", path);
* } model.addAttribute("currentPath", path);
* model.addAttribute("collectionAndDataObject", dgColObj); if (dgColObj !=
* null) model.addAttribute("flag", true); else { model.addAttribute("flag",
* false); }
*/

}

@SuppressWarnings("unchecked")
Expand All @@ -123,7 +107,6 @@ public DataProfile<IRODSDomainObject> getCollectionDataProfile(String path) thro
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
Expand All @@ -143,15 +126,23 @@ public DataProfile<IRODSDomainObject> getCollectionDataProfile(String path) thro
public String getCollectionFileInfo(final Model model, @RequestParam("path")
final String path) throws DataGridException {

logger.
info("------CollectionInfoController getCollectionFileInfo() starts :: "
+path);
logger.info("CollectionInfoController getCollectionFileInfo() starts :: " +path);

@SuppressWarnings("rawtypes")
DataProfile dataProfile = getCollectionDataProfile(path);


String iconToDisplay = "";

if(dataProfile!= null && dataProfile.isFile())
iconToDisplay = iconService.getIconToDisplayFile(dataProfile.getDataType().getMimeType());
if(dataProfile!= null && !dataProfile.isFile())
iconToDisplay = iconService.getIconToDisplayCollection();

model.addAttribute("iconToDisplay", iconToDisplay);
model.addAttribute("dataProfile", dataProfile);

logger.info("CollectionInfoController getCollectionFileInfo() ends !!");

return "collections/collectionInfo";
}

Expand Down

0 comments on commit 31bfa59

Please sign in to comment.