diff --git a/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionController.java b/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionController.java index a2ba1135f..4f1729ba5 100755 --- a/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionController.java +++ b/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionController.java @@ -473,7 +473,8 @@ public String getFileInfo(final Model model, final String path) dataGridObj.setNumberOfReplicas(cs.getTotalNumberOfReplsForDataObject(path)); dataGridObj.setReplicaNumber(String.valueOf(cs.getReplicationNumber(path))); permissionsService.resolveMostPermissiveAccessForUser(dataGridObj, - loggedUserUtils.getLoggedDataGridUser()); + loggedUserUtils.getLoggedDataGridUser()); + } diff --git a/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionInfoController.java b/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionInfoController.java index 73c9ccc37..47781b4ce 100644 --- a/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionInfoController.java +++ b/src/emc-metalnx-shared/src/main/java/com/emc/metalnx/controller/CollectionInfoController.java @@ -4,6 +4,7 @@ import org.irods.jargon.core.connection.IRODSAccount; import org.irods.jargon.core.exception.JargonException; +import org.irods.jargon.core.pub.domain.IRODSDomainObject; import org.irods.jargon.extensions.dataprofiler.DataProfile; import org.irods.jargon.extensions.dataprofiler.DataProfilerFactory; import org.irods.jargon.extensions.dataprofiler.DataProfilerService; @@ -17,6 +18,7 @@ import org.springframework.util.AntPathMatcher; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.HandlerMapping; @@ -58,11 +60,40 @@ public class CollectionInfoController { public String getTestCollectionInfo(final Model model, HttpServletRequest request) throws DataGridException, DataGridConnectionRefusedException { - logger.info("------CollectionInfoController getTestCollectionInfo() starts !!"); + logger.info("CollectionInfoController getTestCollectionInfo() starts !!"); final String path = "/" + extractFilePath(request); logger.info("path ::" + path); model.addAttribute("summary", "This is comming from the CollectionInfoController() - Test the main controller"); + @SuppressWarnings("rawtypes") + DataProfile dataProfile = getCollectionDataProfile(path); + + model.addAttribute("dataProfile", dataProfile); + 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") + public DataProfile getCollectionDataProfile(String path) throws DataGridException { + + IRODSAccount irodsAccount = irodsServices.getUserAO().getIRODSAccount(); logger.debug("got irodsAccount:{}", irodsAccount); @@ -77,49 +108,39 @@ public String getTestCollectionInfo(final Model model, HttpServletRequest reques 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 "collections/info"; + return dataProfile; + } catch (JargonException e) { logger.error("Could not retrieve collection/dataobject from path: {}", path, e); throw new DataGridException(e.getMessage()); } - /* - * 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); } - */ - } - - /* - * @RequestMapping(value = "/collectionFileInfo/", method = RequestMethod.POST) - * public String getCollectionFileInfo(final Model model, @RequestParam("path") - * final String path) throws DataGridConnectionRefusedException { - * - * logger. - * info("------CollectionInfoController getCollectionFileInfo() starts :: " - * +path); DataGridUser loggedUser = LoggedUserUtils.getLoggedDataGridUser(); - * - * - * logger.info("User First Name :: " +loggedUser.getUsername()); - * - * model.addAttribute("infoName", "This is Info !!"); return "collections/info"; - * - * } - */ + + + + @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); + + @SuppressWarnings("rawtypes") + DataProfile dataProfile = getCollectionDataProfile(path); + + + model.addAttribute("dataProfile", dataProfile); + return "collections/collectionInfo"; + } + /* * @RequestMapping(value = "/collectionMetadata/", method = RequestMethod.POST) diff --git a/src/emc-metalnx-shared/src/main/resources/static/js/collection.js b/src/emc-metalnx-shared/src/main/resources/static/js/collection.js index 9637b773a..7be9de1cb 100644 --- a/src/emc-metalnx-shared/src/main/resources/static/js/collection.js +++ b/src/emc-metalnx-shared/src/main/resources/static/js/collection.js @@ -7,10 +7,12 @@ function getCollectionSummary(path){ } function displayCollectionSummary(data){ - alert("displayTestDetails()"); + console.log("displayTestDetails()"); $("#summary").html(data); //alert([[${ currentPath }]]); - getInfoDetails(path); + //getInfoDetails(path); + displayInfoDetails(data); + //$("#info").html(data); } @@ -19,7 +21,8 @@ function getInfoDetails(path){ window.location.hash = "info"; console.log("Path :: " +path); //var url = "/emc-metalnx-web/collectionInfo/collectionFileInfo/"; - var url = "/emc-metalnx-web/collections/info/"; + //var url = "/emc-metalnx-web/collections/info/"; + var url = "/emc-metalnx-web/collectionInfo/collectionFileInfo/"; //getBreadcrumb(path); ajaxEncapsulation(url, "POST", {path: path}, displayInfoDetails, null, null, null); diff --git a/src/emc-metalnx-shared/src/main/resources/views/collections/collectionInfo.html b/src/emc-metalnx-shared/src/main/resources/views/collections/collectionInfo.html index 3223686a0..b40319447 100755 --- a/src/emc-metalnx-shared/src/main/resources/views/collections/collectionInfo.html +++ b/src/emc-metalnx-shared/src/main/resources/views/collections/collectionInfo.html @@ -17,59 +17,12 @@ - - + - - - - - -
-
- -
-
+ -
+

@@ -77,85 +30,40 @@

<

- - - - + + + + + + +
+ +
-
+
-
+
-
+ +
+ + diff --git a/src/emc-metalnx-shared/src/main/resources/views/collections/info.html b/src/emc-metalnx-shared/src/main/resources/views/collections/info.html index ea9fa3977..fd84ebd16 100644 --- a/src/emc-metalnx-shared/src/main/resources/views/collections/info.html +++ b/src/emc-metalnx-shared/src/main/resources/views/collections/info.html @@ -7,31 +7,34 @@
+
Summary ::
- + diff --git a/src/emc-metalnx-web/src/main/webapp/WEB-INF/applicationContext.xml b/src/emc-metalnx-web/src/main/webapp/WEB-INF/applicationContext.xml index e1d0344c1..4e9901a77 100755 --- a/src/emc-metalnx-web/src/main/webapp/WEB-INF/applicationContext.xml +++ b/src/emc-metalnx-web/src/main/webapp/WEB-INF/applicationContext.xml @@ -31,8 +31,8 @@ - file:/etc/irods-ext/metalnx.properties - + + file:///C:/Users/hetalben/opt/etc/irods-ext/metalnx.properties @@ -41,8 +41,8 @@ - - + +