summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app
diff options
context:
space:
mode:
Diffstat (limited to 'idrop-web/grails-app')
-rwxr-xr-xidrop-web/grails-app/conf/BuildConfig.groovy2
-rwxr-xr-xidrop-web/grails-app/conf/Config.groovy4
-rwxr-xr-xidrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy21
-rwxr-xr-xidrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy2
-rwxr-xr-xidrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy9
-rwxr-xr-xidrop-web/grails-app/controllers/org/irods/mydrop/controller/ShoppingCartController.groovy89
-rwxr-xr-xidrop-web/grails-app/i18n/messages.properties2
-rw-r--r--idrop-web/grails-app/services/org/irods/mydrop/service/ViewStateService.groovy21
-rwxr-xr-xidrop-web/grails-app/views/browse/_browseTabContent.gsp1
-rwxr-xr-xidrop-web/grails-app/views/browse/_collectionInfoToolbar.gsp2
-rwxr-xr-xidrop-web/grails-app/views/browse/_dataObjectInfoToolbar.gsp2
-rwxr-xr-xidrop-web/grails-app/views/browse/index.gsp13
-rwxr-xr-xidrop-web/grails-app/views/common/_topbar.gsp4
-rwxr-xr-xidrop-web/grails-app/views/layouts/mainNoSidebar.gsp2
-rwxr-xr-xidrop-web/grails-app/views/login/login.gsp2
15 files changed, 111 insertions, 65 deletions
diff --git a/idrop-web/grails-app/conf/BuildConfig.groovy b/idrop-web/grails-app/conf/BuildConfig.groovy
index 7a45764..68f1b3b 100755
--- a/idrop-web/grails-app/conf/BuildConfig.groovy
+++ b/idrop-web/grails-app/conf/BuildConfig.groovy
@@ -25,12 +25,10 @@ grails.project.dependency.resolution = {
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
- //test 'org.irods.jargon:jargon-test:3.1.3-SNAPSHOT'
test 'org.mockito:mockito-all:1.8.1'
compile 'commons-io:commons-io:2.1'
provided 'junit:junit:4.8.1'
compile ('org.irods.jargon:jargon-core:3.3.0-SNAPSHOT') { excludes ([group:'org.jglobus'])}
- //compile 'org.irods.jargon:jargon-security:3.2.0-SNAPSHOT'
compile ('org.irods.jargon:jargon-data-utils:3.3.0-SNAPSHOT') { excludes ([group:'org.jglobus'])}
compile ('org.irods.jargon:jargon-ticket:3.3.0-SNAPSHOT') { excludes ([group:'org.jglobus'])}
compile ('org.irods.jargon:jargon-user-profile:3.3.0-SNAPSHOT') { excludes ([group:'org.jglobus'])}
diff --git a/idrop-web/grails-app/conf/Config.groovy b/idrop-web/grails-app/conf/Config.groovy
index 71545df..1453a97 100755
--- a/idrop-web/grails-app/conf/Config.groovy
+++ b/idrop-web/grails-app/conf/Config.groovy
@@ -183,11 +183,11 @@ log4j = {
'net.sf.ehcache.hibernate'
//info 'org.irods.mydrop'
- info 'org.irods.jargon'
+ debug 'org.irods.jargon'
warn 'org.irods.jargon.spring.security'
warn 'org.springframework'
- debug 'grails.app'
+ warn 'grails.app'
warn 'org.mortbay.log',
'grails.app.controller',
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy
index 1c03ac4..3efb564 100755
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy
@@ -64,6 +64,12 @@ class BrowseController {
ViewState viewState = viewStateService.getViewStateFromSessionAndCreateIfNotThere()
log.info("viewState:${viewState}")
+
+
+ if (viewState) {
+ mode = "path"
+ absPath = viewState.rootPath
+ }
if (mode != null) {
if (mode == "path") {
@@ -185,11 +191,11 @@ class BrowseController {
* If I have a preserved view state, initialize to that
*/
- String rootPath = viewStateService.retrieveRootPath()
+ ViewState viewState = viewStateService.getViewStateFromSessionAndCreateIfNotThere()
- if (rootPath) {
+ if (viewState.rootPath) {
- parent = rootPath
+ parent = viewState.rootPath
icon = "folder"
state = "closed"
@@ -311,7 +317,7 @@ class BrowseController {
def splitMode = params['splitMode']
if (pagingOffset == null) {
- throw new JargonException("missing the partialStart")
+ pagingOffset = 0;
}
if (splitMode == null) {
@@ -353,8 +359,7 @@ class BrowseController {
throw new JargonException("no absolute path passed to the method")
}
- ViewState viewState = viewStateService.getViewStateFromSessionAndCreateIfNotThere()
- viewState.browseView = "browse"
+ ViewState viewState = viewStateService.saveViewModeAndSelectedPath("browse", absPath)
log.info "displayBrowseGridDetails for absPath: ${absPath}"
try {
@@ -406,7 +411,7 @@ class BrowseController {
throw new JargonException("no absolute path passed to the method")
}
- viewStateService.saveViewMode("info")
+ viewStateService.saveViewModeAndSelectedPath("info", absPath)
ViewNameAndModelValues mav = handleInfoLookup(absPath)
render(view:mav.view, model:mav.model)
@@ -583,6 +588,8 @@ class BrowseController {
if (absPath == null) {
throw new JargonException("no absolute path passed to the method")
}
+
+ viewStateService.saveViewModeAndSelectedPath("gallery", absPath)
try {
log.info "galleryView for absPath: ${absPath}"
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy
index 8a01a42..9926abd 100755
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy
@@ -192,7 +192,7 @@ class LoginController {
}
def logout = {
- session["SPRING_SECURITY_CONTEXT"] = null
+ session.invalidate()
redirect(action:"login")
}
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy
index 2bb2aef..39db3d9 100755
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy
@@ -101,8 +101,8 @@ class ProfileController {
userProfile = profileService.retrieveProfile(irodsAccount)
} catch (Exception e) {
log.error("error retrieving user profile", e)
- def message = message("message.cannot.create.profile")
- response.sendError(500, message)
+ flash.error = e.message
+ render(view:"index", model:[userProfile:profileCommand])
return
}
@@ -127,10 +127,11 @@ class ProfileController {
profileService.updateProfile(irodsAccount, userProfile)
} catch (Exception e) {
log.error("error updating user profile", e)
- def message = message("message.cannot.create.profile")
- response.sendError(500, message)
+ flash.error = e.message
+ render(view:"index", model:[userProfile:profileCommand])
return
}
+
log.info "updated"
flash.message = message(code:"message.update.successful")
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ShoppingCartController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ShoppingCartController.groovy
index 203e7d1..985a989 100755
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ShoppingCartController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ShoppingCartController.groovy
@@ -5,46 +5,46 @@ import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
import org.irods.mydrop.service.ShoppingCartSessionService;
/**
-* Controller for shopping cart functionality
-* @author Mike Conway - DICE (www.irods.org)
-*/
+ * Controller for shopping cart functionality
+ * @author Mike Conway - DICE (www.irods.org)
+ */
class ShoppingCartController {
-
- IRODSAccessObjectFactory irodsAccessObjectFactory
- IRODSAccount irodsAccount
- ShoppingCartSessionService shoppingCartSessionService
- def grailsApplication
-
- /**
- * Interceptor grabs IRODSAccount from the SecurityContextHolder
- */
- def beforeInterceptor = [action:this.&auth]
-
- def auth() {
- if(!session["SPRING_SECURITY_CONTEXT"]) {
- redirect(controller:"login", action:"login")
- return false
- }
- irodsAccount = session["SPRING_SECURITY_CONTEXT"]
- }
-
- def afterInterceptor = {
- log.debug("closing the session")
- irodsAccessObjectFactory.closeSession()
- }
-
-
- /**
- * Show the cart main view
- */
- def index = {
- log.info("index")
- render(view:"index")
- }
-
-
- /**
+
+ IRODSAccessObjectFactory irodsAccessObjectFactory
+ IRODSAccount irodsAccount
+ ShoppingCartSessionService shoppingCartSessionService
+ def grailsApplication
+
+ /**
+ * Interceptor grabs IRODSAccount from the SecurityContextHolder
+ */
+ def beforeInterceptor = [action:this.&auth]
+
+ def auth() {
+ if(!session["SPRING_SECURITY_CONTEXT"]) {
+ redirect(controller:"login", action:"login")
+ return false
+ }
+ irodsAccount = session["SPRING_SECURITY_CONTEXT"]
+ }
+
+ def afterInterceptor = {
+ log.debug("closing the session")
+ irodsAccessObjectFactory.closeSession()
+ }
+
+
+ /**
+ * Show the cart main view
+ */
+ def index = {
+ log.info("index")
+ render(view:"index")
+ }
+
+
+ /**
* Build the JTable entries for the contents of the shopping cart
*/
def listCart = {
@@ -96,6 +96,19 @@ class ShoppingCartController {
render "OK"
}
+ /**
+ * Add one file to the cart
+ */
+ def addFileToCart = {
+ log.info("addFileToCart")
+ def absPath = params['absPath']
+
+ log.info("absPath: ${absPath}")
+ shoppingCartSessionService.addToCart(absPath)
+
+ render absPath
+ }
+
/**
* Process a bulk add to cart action based on data input from the browse details form
diff --git a/idrop-web/grails-app/i18n/messages.properties b/idrop-web/grails-app/i18n/messages.properties
index c3ccc1e..b28e78c 100755
--- a/idrop-web/grails-app/i18n/messages.properties
+++ b/idrop-web/grails-app/i18n/messages.properties
@@ -173,7 +173,7 @@ heading.upload.ticket.collection=Select a local file to upload to the ticket col
#page specific text
-browse.page.prompt=Select a directory or file to see info and tags based on the view option
+browse.page.prompt=Select a directory or file to see info and actions
# messages
error.confirm.password.missing=Confirmation password is null or blank
diff --git a/idrop-web/grails-app/services/org/irods/mydrop/service/ViewStateService.groovy b/idrop-web/grails-app/services/org/irods/mydrop/service/ViewStateService.groovy
index baabfcb..228e00e 100644
--- a/idrop-web/grails-app/services/org/irods/mydrop/service/ViewStateService.groovy
+++ b/idrop-web/grails-app/services/org/irods/mydrop/service/ViewStateService.groovy
@@ -52,6 +52,27 @@ class ViewStateService {
return viewState.browseView
}
+ /**
+ * Save a path and mode in the view state for later retrieval
+ * @param viewMode
+ * @param absolutePath
+ */
+ public ViewState saveViewModeAndSelectedPath(String viewMode, String absolutePath) {
+
+ if (viewMode == null) {
+ throw new IllegalArgumentException("null viewMode")
+ }
+
+ if (absolutePath == null) {
+ throw new IllegalArgumentException("null absolutePath")
+ }
+
+ ViewState viewState = getViewStateFromSessionAndCreateIfNotThere()
+ viewState.browseView = viewMode
+ viewState.selectedPath = absolutePath
+ return viewState
+ }
+
public void saveViewMode(String viewMode) {
if (viewMode == null) {
throw new IllegalArgumentException("null viewMode")
diff --git a/idrop-web/grails-app/views/browse/_browseTabContent.gsp b/idrop-web/grails-app/views/browse/_browseTabContent.gsp
index a4e775e..2d27b70 100755
--- a/idrop-web/grails-app/views/browse/_browseTabContent.gsp
+++ b/idrop-web/grails-app/views/browse/_browseTabContent.gsp
@@ -13,6 +13,7 @@
<div id="browseDialogArea"><!-- general area to spawn jquery dialogs --></div>
+
<div id="browser" class="wrapper" style="height:85%;width:100%;clear:both;overflow:hidden;">
<div id="dataTreeView" style="width: 100%; height: 700px; overflow: hidden;">
diff --git a/idrop-web/grails-app/views/browse/_collectionInfoToolbar.gsp b/idrop-web/grails-app/views/browse/_collectionInfoToolbar.gsp
index 759543d..4c1eb28 100755
--- a/idrop-web/grails-app/views/browse/_collectionInfoToolbar.gsp
+++ b/idrop-web/grails-app/views/browse/_collectionInfoToolbar.gsp
@@ -19,7 +19,7 @@
</div>
<div id="collectionInfoButtonGroup2" class="btn-group">
- <button id="addCollectionToCart" onclick="cibAddToCart()"><img class="icon-shopping-cart"/><g:message
+ <button id="addCollectionToCart" onclick="addToCartViaToolbar()"><img class="icon-shopping-cart"/><g:message
code="text.add.to.cart" /></button>
<button id="uploadViaBrowser" onclick="cibUploadViaBrowser()"><img class="icon-upload"/><g:message
code="text.upload" /></button>
diff --git a/idrop-web/grails-app/views/browse/_dataObjectInfoToolbar.gsp b/idrop-web/grails-app/views/browse/_dataObjectInfoToolbar.gsp
index e0a673e..20b7923 100755
--- a/idrop-web/grails-app/views/browse/_dataObjectInfoToolbar.gsp
+++ b/idrop-web/grails-app/views/browse/_dataObjectInfoToolbar.gsp
@@ -13,7 +13,7 @@
</g:else>
<button id="downloadFile" onclick="dibDownloadFile()"><img class="icon-download"/><g:message
code="text.download" /></button>
- <button id="addToCart" onclick="dibAddToCart()"><img class="icon-shopping-cart"/><g:message
+ <button id="addToCart" onclick="addToCartViaToolbar()"><img class="icon-shopping-cart"/><g:message
code="text.add.to.cart" /></button>
</div>
<div id="dataObjectInfoButtonGroup2" class="btn-group">
diff --git a/idrop-web/grails-app/views/browse/index.gsp b/idrop-web/grails-app/views/browse/index.gsp
index c69296e..4280795 100755
--- a/idrop-web/grails-app/views/browse/index.gsp
+++ b/idrop-web/grails-app/views/browse/index.gsp
@@ -6,7 +6,9 @@
<div class="wrapper clearfix"
style="height: 820px; overflow:hidden;">
<g:hiddenField name="mode" id="mode" value="${mode}"/>
- <g:hiddenField name="presetPath" id="presetPath" value="${path}"/>
+ <g:hiddenField name="viewStateBrowseOptionVal" id="viewStateBrowseOptionVal" value="${viewState.browseView}"/>
+ <g:hiddenField name="presetPath" id="presetPath" value="${viewState.rootPath}"/>
+ <g:hiddenField id="viewStateSelectedPath" name="viewStateSelectedPath" value="${viewState.selectedPath}"/>
<g:render template="/browse/browseTabContent" />
</div>
@@ -31,12 +33,15 @@
});
var mode = $("#mode").val();
- var startPath = $("#presetPath").val();
+ browseOptionVal = $("#viewStateBrowseOptionVal").val();
+ dataTreePath = $("#presetPath").val();
+ var thisSelectedPath = $("#viewStateSelectedPath").val();
+
if (mode == null || mode=="") {
- retrieveBrowserFirstView("detect","");
+ retrieveBrowserFirstView("detect","", thisSelectedPath);
} else {
- retrieveBrowserFirstView(mode, startPath);
+ retrieveBrowserFirstView(mode, dataTreePath, thisSelectedPath);
}
$(window).bind( 'hashchange', function(e) {
diff --git a/idrop-web/grails-app/views/common/_topbar.gsp b/idrop-web/grails-app/views/common/_topbar.gsp
index b1184f2..418a650 100755
--- a/idrop-web/grails-app/views/common/_topbar.gsp
+++ b/idrop-web/grails-app/views/common/_topbar.gsp
@@ -16,9 +16,9 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<g:message code="text.search" /><b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a href="#" id="searchFileName" onclick="xxx()")>Search By File Name</a></li>
+ <!-- <li><a href="#" id="searchFileName" onclick="xxx()")>Search By File Name</a></li> -->
<li><a href="#" id="searchTag"><g:link controller="tags" action="index"><g:message code="text.tags" /></g:link></li>
- <li><a href="#" id="searchMetadata" onclick="xxx()")>Search By Metadata</a></li>
+ <!-- <li><a href="#" id="searchMetadata" onclick="xxx()")>Search By Metadata</a></li> -->
</ul>
</li>
<li id="topbarTools" class="dropdown">
diff --git a/idrop-web/grails-app/views/layouts/mainNoSidebar.gsp b/idrop-web/grails-app/views/layouts/mainNoSidebar.gsp
index f3bd869..dc397f8 100755
--- a/idrop-web/grails-app/views/layouts/mainNoSidebar.gsp
+++ b/idrop-web/grails-app/views/layouts/mainNoSidebar.gsp
@@ -29,7 +29,7 @@
jQuery.i18n.properties({
name:'messages',
- path:'js/bundles/',
+ path:context + '/js/bundles/',
mode:'both'
});
diff --git a/idrop-web/grails-app/views/login/login.gsp b/idrop-web/grails-app/views/login/login.gsp
index 36f6dfc..bacffe7 100755
--- a/idrop-web/grails-app/views/login/login.gsp
+++ b/idrop-web/grails-app/views/login/login.gsp
@@ -20,7 +20,7 @@
<div id="normalLoginWrapper">
<!--begin-normalLogin-->
- <div id="normalLoginForm" class="roundedContainer" style="float:left;clear:both;background:grey">
+ <div id="normalLoginForm" class="roundedContainer" style="width:auto;height:auto;margin-top:100px;clear:both;background:grey">
<g:form class="normalLogin" id="normalLogin" method="post" controller="login" action="authenticate">