summaryrefslogtreecommitdiffstats
path: root/idrop-web
diff options
context:
space:
mode:
Diffstat (limited to 'idrop-web')
-rw-r--r--idrop-web/application.properties6
-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
-rwxr-xr-xidrop-web/release_notes.txt20
-rwxr-xr-xidrop-web/web-app/js/bundles/messages.properties29
-rwxr-xr-xidrop-web/web-app/js/mydrop/home.js63
-rwxr-xr-xidrop-web/web-app/js/mydrop/lingo_common.js77
-rwxr-xr-xidrop-web/web-app/js/mydrop/shopping_cart.js7
-rwxr-xr-xidrop-web/web-app/js/mydrop/ticket.js22
22 files changed, 260 insertions, 140 deletions
diff --git a/idrop-web/application.properties b/idrop-web/application.properties
index 5a64f1f..56c36c1 100644
--- a/idrop-web/application.properties
+++ b/idrop-web/application.properties
@@ -1,8 +1,8 @@
#Grails Metadata file
-
+#Wed Feb 13 08:58:43 EST 2013
app.grails.version=2.1.1
app.name=idrop-web2
app.servlet.version=2.5
app.version=2.0.0
-plugins.hibernate=2.1.1
-plugins.tomcat=2.1.1
+plugins.tomcat=2.1.2
+
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">
diff --git a/idrop-web/release_notes.txt b/idrop-web/release_notes.txt
index 8185f61..22cc7e5 100755
--- a/idrop-web/release_notes.txt
+++ b/idrop-web/release_notes.txt
@@ -1,8 +1,15 @@
+<<<<<<< HEAD
*'''Project''': idrop-web version 2
*'''Date''': 02/11/2013
*'''Release Version''': 2.0.0-beta1
*'''git tag''': 2.0.0-beta1
+=======
+*'''Project''': idrop-web
+*'''Date''': 02/13/2013
+*'''Release Version''': 2.0.0-beta1
+*'''git tag''': 2.0.0-beta1
+>>>>>>> a0b1644912dcc14325344b3e988b0c27d146d32a
==News==
@@ -19,10 +26,19 @@ Note that the following bug and feature requests are logged in GForge with relat
==Bug Fixes==
-* [#1181] fix memory in idrop web2 when changing login
+*[#1181] fix memory in idrop web2 when changing login
+
+*[#1205] error accessing tickets (-80600) on srbbrick15
+**more gracefully handle ticket errors in display
+
+*[#1204] cleanup initial view (should be info)
+**Added re-initialization of tree location when returning back to the Browse tab from elsewhere, or on a reload
+
+*[#1119] Error when updating profile.
+**Better error trapping when an exception occurs updating the profile
==Features==
*[#984] iDrop web '2.0' redesign effort
-*[#78] very large collection paging \ No newline at end of file
+*[#78] very large collection paging
diff --git a/idrop-web/web-app/js/bundles/messages.properties b/idrop-web/web-app/js/bundles/messages.properties
index b47b976..2218e52 100755
--- a/idrop-web/web-app/js/bundles/messages.properties
+++ b/idrop-web/web-app/js/bundles/messages.properties
@@ -1,22 +1,21 @@
-# This line is ignored by the plugin
-msg_hello = Hello
-msg_world = World
-msg_complex = Good morning {0}!
-msg_delete_selected_file=Delete selected file?
-msg_delete_share=Delete the share? Note that permissions will remain, but the share will not appear in the user's home page
-msg_file_deleted=File deleted
-msg_file_starred=File starred
-msg_file_unstarred=File unstarred
+msg_ticket_error = Tickets do not seem to be supported on this server
msg_action_missing = No action provided
-msg.path.missing = No file selected
+msg_confirm_delete = Delete selected items?
+msg_complex = Good morning {0}!
+msg_delete_successful = Delete successful
+msg_delete_selected_file = Delete selected file?
+msg_delete_share = Delete the share? Note that permissions will remain, but the share will not appear in the user's home page
+msg_file_deleted = File deleted
+msg_file_starred = File starred
+msg_file_unstarred = File unstarred
+msg_path_missing = No file selected
msg_password_no_data = No password data found
msg_password_successful = Password change successful
msg_ticket_update_successful = Ticket update successful
-msg_ticket_no_data = Error - No ticket data found
+msg_ticket_no_data = No ticket data found
msg_upload_complete = Upload complete
msg_nothing_selected_for_edit = Nothing was selected for editing
-msg_confirm_delete = Delete selected items?
-msg_delete_successful = Delete successful
-msg_resource_changed = Resource changed successfully
-msg_search_missing=Search term missing
msg_profile_update_successful = Profile update successful
+msg_resource_changed = Resource changed successfully
+msg_search_missing = Search term missing
+
diff --git a/idrop-web/web-app/js/mydrop/home.js b/idrop-web/web-app/js/mydrop/home.js
index 7999f71..18e6d17 100755
--- a/idrop-web/web-app/js/mydrop/home.js
+++ b/idrop-web/web-app/js/mydrop/home.js
@@ -20,8 +20,9 @@ var dataTree;
var dataTreeView = "";
var dataTreePath = "";
-var browseOptionVal = "browse";
+var browseOptionVal = "info";
var selectedPath = null;
+var requestedSelectedPath = null;
var selectedNode = null;
var fileUploadUI = null;
var aclDialogMessageSelector = "#aclDialogMessageArea";
@@ -57,7 +58,7 @@ var fileStarUrl = '/browse/starFile'
*
* @return
*/
-function retrieveBrowserFirstView(type, path) {
+function retrieveBrowserFirstView(type, path, pathSelectedInTree) {
if (dataTree != null) {
dataTree = null;
$("#dataTreeDiv").html("");
@@ -89,6 +90,7 @@ function retrieveBrowserFirstView(type, path) {
dataTreeView = type;
dataTreePath = path;
+ requestedSelectedPath = pathSelectedInTree;
$.bbq.pushState(state);
@@ -194,7 +196,15 @@ function browserFirstViewRetrieved(data) {
}
});
-
+
+
+ $("#dataTreeDiv").bind("loaded.jstree", function(e, data) {
+ if (requestedSelectedPath) {
+ selectTreePathFromIrodsPath(requestedSelectedPath);
+ }
+ });
+
+
$("#dataTreeDiv").bind("select_node.jstree", function(e, data) {
nodeSelected(e, data.rslt.obj);
});
@@ -245,7 +255,22 @@ function browserFirstViewRetrieved(data) {
});
- updateBrowseDetailsForPathBasedOnCurrentModel(baseAbsPath);
+ /*
+ * selected path is set if a node in the tree was selected by user. If it's there it's a selection, so show that path in the tree
+ *
+ * if the selected path is not there, see if I am asking for a particular path to be revealed, this is passed by the index.gsp for
+ * the browse view and is used to initialize the requestedSelectedPath. In this case, select the path by finding it in the tree,
+ * causing the browse view to also be updated
+ *
+ * otherwise, just use the root of the tree as the initial selection
+ */
+ if (selectedPath) {
+ updateBrowseDetailsForPathBasedOnCurrentModel(selectedPath);
+ } else if (requestedSelectedPath) {
+ // wait and do this after the tree loads, look at above function bound to load event
+ } else {
+ updateBrowseDetailsForPathBasedOnCurrentModel(baseAbsPath);
+ }
}
@@ -637,11 +662,10 @@ function updateBrowseDetailsForPathBasedOnCurrentModel(absPath) {
absPath = baseAbsPath;
}
- if (browseOptionVal == null) {
+ if (browseOptionVal == null || browseOptionVal == "") {
browseOptionVal = "info";
}
-
setPathCrumbtrail(absPath);
if (browseOptionVal == "browse") {
@@ -673,6 +697,7 @@ function showBrowseView(absPath) {
lcShowBusyIconInDiv("#infoDiv");
+
var jqxhr = $.get(
context + "/browse/displayBrowseGridDetails?absPath="
+ encodeURIComponent(absPath), null,
@@ -846,13 +871,11 @@ function showGalleryView(absPath) {
absPath = baseAbsPath;
}
+
var state = {};
state["absPath"] = absPath;
state["browseOptionVal"] = "gallery";
$.bbq.pushState(state);
-
-
-
targetDiv = "#infoDiv";
try {
@@ -2019,7 +2042,7 @@ function addANodeToTheParentInTheTree(parentAbsolutePath, childRelativeName) {
* Given an iRODS absolute path to a node, find and select that node
*
* @param irodsAbsolutePath
- * irods absolute path
+ * irods absolute path is a string with a path, in the form /a/path/to/something
*/
function selectTreePathFromIrodsPath(irodsAbsolutePath) {
@@ -2030,8 +2053,10 @@ function selectTreePathFromIrodsPath(irodsAbsolutePath) {
if (irodsAbsolutePath == "/") {
return false;
}
+
+ var splitPath = irodsAbsolutePath.split("/");
- selectTreePath(irodsAbsolutePath.split("/"), null, null);
+ selectTreePath(splitPath, null, null);
}
@@ -2140,7 +2165,15 @@ function selectTreePath(path, currentNode, currentIndex) {
performOperationAtGivenTreePath(path, null, null, function(path, dataTree,
currentNode) {
$.jstree._reference(dataTree).open_node(currentNode);
- $.jstree._reference(dataTree).select_node(currentNode, true);
+
+ // see if this node should be selected by comparing paths
+
+ var currentId = currentNode[0].id;
+ var idPath = currentId.split("/");
+ if (path.length == idPath.length) {
+ $.jstree._reference(dataTree).select_node(currentNode, true);
+ }
+
});
}
@@ -2306,7 +2339,7 @@ function performOperationAtGivenTreePath(path, currentNode, currentIndex,
currentNode);
currentNode = getPathInNode(children, value);
if (currentNode == null) {
- setMessage("Path not found in tree, please reload");
+ //setMessage("Path not found in tree, please reload");
return false;
} /*
* else { if (index == path.length - 1) { end = true; } }
@@ -2346,8 +2379,8 @@ function processStateChange(state) {
}
}
- if (view == null && browseOptionVal == "info") {
- browseOptionVal = "browse";
+ if (statePath && view == null && browseOptionVal == "info") {
+ browseOptionVal = "info";
selectTreePathFromIrodsPath(statePath);
} else if (view != browseOptionVal && statePath == selectedPath) {
// view change only
diff --git a/idrop-web/web-app/js/mydrop/lingo_common.js b/idrop-web/web-app/js/mydrop/lingo_common.js
index 137aa89..3f353a4 100755
--- a/idrop-web/web-app/js/mydrop/lingo_common.js
+++ b/idrop-web/web-app/js/mydrop/lingo_common.js
@@ -31,6 +31,29 @@ function checkForSessionTimeout(data, xhr) {
}
/**
+ * Display the given text as an html alert div inside the given selector
+ * @param message
+ * @param targetDiv
+ * @returns {Boolean}
+ */
+function displayMessageAsBootstrapAlert(message, targetDiv) {
+
+ if (message == null || message == "") {
+ message = "Unknown message, please specify";
+ }
+
+ if (targetDiv == null || targetDiv == "") {
+ return false;
+ }
+
+ var divTag = document.createElement("div");
+ $(divTag).addClass('alert');
+ $(divTag).html(message);
+ $(targetDiv).html(divTag);
+
+}
+
+/**
* FIXME: remove..this is dumb check HTML coming back from an AJAX call for an
* indication of an error, and if an error is found, then set the message in the
* div using the given id. Then the appropriate exception will be thrown.
@@ -338,8 +361,7 @@ function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context,
throw ("no get url for call");
}
- var img = document.createElement('IMG');
- img.setAttribute("src", +context + "/images/ajax-loader.gif");
+ showBlockingPanel();
$(resultDiv).html(img);
@@ -350,6 +372,7 @@ function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context,
if (continueReq) {
lcFillInDivWithHtml(data, resultDiv, postLoadFunction);
}
+ unblockPanel();
}, "html").error(function(xhr, status, error) {
resultDiv.html("");
@@ -363,6 +386,7 @@ function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context,
} catch(err) {
// ignore
}
+ unblockPanel();
setErrorMessage(err);
}
@@ -378,10 +402,7 @@ function lcSendValueWithParamsAndPlugHtmlInDiv(getUrl, params, resultDiv,
throw ("no get url for call");
}
- var img = document.createElement('IMG');
- img.setAttribute("src", context + "/images/ajax-loader.gif");
-
- $(resultDiv).html(img);
+ showBlockingPanel();
try {
@@ -390,9 +411,11 @@ function lcSendValueWithParamsAndPlugHtmlInDiv(getUrl, params, resultDiv,
if (continueReq) {
lcFillInDivWithHtml(data, resultDiv, postLoadFunction);
}
+ unblockPanel();
}, "html").error(function(xhr, status, error) {
$(resultDiv).html("");
setErrorMessage(xhr.responseText);
+ unblockPanel();
});
} catch (err) {
@@ -403,6 +426,7 @@ function lcSendValueWithParamsAndPlugHtmlInDiv(getUrl, params, resultDiv,
} catch(err) {
// ignore
}
+ unblockPanel();
setErrorMessage(err);
// console.log("javascript error:" + err);
}
@@ -421,10 +445,7 @@ function lcSendValueAndCallbackHtmlAfterErrorCheck(getUrl, divForAjaxError,
return;
}
- var img = document.createElement('IMG');
- img.setAttribute("src", context + "/images/ajax-loader.gif");
-
- $(divForLoadingGif).html(img);
+ showBlockingPanel();
try {
@@ -439,11 +460,13 @@ function lcSendValueAndCallbackHtmlAfterErrorCheck(getUrl, divForAjaxError,
$(divForLoadingGif).html(data);
}
+ unblockPanel();
}
}, "html").error(function(xhr, status, error) {
$(divForLoadingGif).html("");
setErrorMessage(xhr.responseText);
+ unblockPanel();
});
} catch (err) {
@@ -452,6 +475,7 @@ function lcSendValueAndCallbackHtmlAfterErrorCheck(getUrl, divForAjaxError,
} catch(err) {
// ignore
}
+ unblockPanel();
setErrorMessage(err);
// console.log("javascript error:" + err);
}
@@ -470,11 +494,8 @@ function lcSendValueAndCallbackHtmlAfterErrorCheckPreserveMessage(getUrl, divFor
return;
}
- var img = document.createElement('IMG');
- img.setAttribute("src", context + "/images/ajax-loader.gif");
-
- $(divForLoadingGif).html(img);
-
+ showBlockingPanel();
+
try {
$.get(context + getUrl, function(data, status, xhr) {
@@ -489,6 +510,7 @@ function lcSendValueAndCallbackHtmlAfterErrorCheckPreserveMessage(getUrl, divFor
}
}
+ unblockPanel();
}, "html").error(function(xhr, status, error) {
try {
@@ -496,11 +518,13 @@ function lcSendValueAndCallbackHtmlAfterErrorCheckPreserveMessage(getUrl, divFor
} catch(err) {
// ignore
}
+ unblockPanel();
setErrorMessage(xhr.responseText);
});
} catch (err) {
$(divForLoadingGif).html("");
+ unblockPanel();
if (err.indexOf("Runtime") > -1) {
err = "Unable to view data, this may be a permissions issue";
@@ -524,11 +548,7 @@ function lcSendValueAndCallbackHtmlAfterErrorCheckThrowsException(getUrl,
return;
}
- var img = document.createElement('IMG');
- img.setAttribute("src", context + "/images/ajax-loader.gif");
-
- $(divForLoadingGif).html(img);
-
+ showBlockingPanel();
$.get(context + getUrl, function(data, status, xhr) {
var continueReq = checkForSessionTimeout(data, xhr);
if (continueReq) {
@@ -539,6 +559,7 @@ function lcSendValueAndCallbackHtmlAfterErrorCheckThrowsException(getUrl,
$(divForLoadingGif).html(data);
}
}
+ unblockPanel();
}, "html").error(function(xhr, status, error) {
$(divForLoadingGif).html("");
if (errorHandlingFunction == null) {
@@ -546,6 +567,7 @@ function lcSendValueAndCallbackHtmlAfterErrorCheckThrowsException(getUrl,
} else {
errorHandlingFunction();
}
+ unblockPanel();
});
@@ -577,11 +599,7 @@ function lcSendValueViaPostAndCallbackHtmlAfterErrorCheck(postUrl, params,
throw ("no post url for call");
}
- var img = document.createElement('IMG');
- img.setAttribute("src", context + "/images/ajax-loader.gif");
-
- $(divForLoadingGif).html(img);
-
+ showBlockingPanel();
try {
$.post(context + postUrl, params, function(data, status, xhr) {
@@ -595,11 +613,13 @@ function lcSendValueViaPostAndCallbackHtmlAfterErrorCheck(postUrl, params,
$(divForLoadingGif).html(data);
}
}
+ unblockPanel();
}, "html").error(function(xhr, status, error) {
if (divForLoadingGif != null) {
$(divForLoadingGif).html("");
}
setErrorMessage(xhr.responseText);
+ unblockPanel();
});
@@ -610,6 +630,7 @@ function lcSendValueViaPostAndCallbackHtmlAfterErrorCheck(postUrl, params,
// ignore
}
setErrorMessage(err);
+ unblockPanel();
}
}
@@ -633,11 +654,9 @@ function lcSendValueAndCallbackWithJsonAfterErrorCheck(getUrl, parms,
callbackFunction(data);
}
}, "json").error(function(xhr, status, error) {
- // continue?
- var continueReq = checkForSessionTimeout(null, xhr);
- if (continueReq) {
+
setErrorMessage(xhr.responseText);
- }
+
});
} catch (err) {
setErrorMessage(err);
diff --git a/idrop-web/web-app/js/mydrop/shopping_cart.js b/idrop-web/web-app/js/mydrop/shopping_cart.js
index da96c91..22f4cdf 100755
--- a/idrop-web/web-app/js/mydrop/shopping_cart.js
+++ b/idrop-web/web-app/js/mydrop/shopping_cart.js
@@ -40,7 +40,7 @@ function addToCartGivenPath(absPath) {
absPath : absPath
}
- lcShowBusyIconInDiv("#cartTableDiv");
+ showBlockingPanel();
var jqxhr = $.post(context + addToCartUrl, params, "html").success(
function(returnedData, status, xhr) {
@@ -49,11 +49,14 @@ function addToCartGivenPath(absPath) {
return false;
}
setMessage("file added to cart:" + xhr.responseText);
- refreshCartFiles();
+ unblockPanel();
+
})
.error(function(xhr, status, error) {
setErrorMessage(xhr.responseText);
+ unblockPanel();
+
});
}
diff --git a/idrop-web/web-app/js/mydrop/ticket.js b/idrop-web/web-app/js/mydrop/ticket.js
index f19aaff..1ca26f1 100755
--- a/idrop-web/web-app/js/mydrop/ticket.js
+++ b/idrop-web/web-app/js/mydrop/ticket.js
@@ -30,14 +30,18 @@ function reloadTicketTable(absPath) {
var jqxhr = $.get(context + ticketTableUrl, params,
function(data, status, xhr) {
$('#ticketTableDiv').html(data);
- }, "html").error(function(xhr, status, error) {
- setErrorMessage(xhr.responseText);
- }).success(function(data, status, xhr) {
- var continueReq = checkForSessionTimeout(data, xhr);
- if (!continueReq) {
- return false;
- }
- buildTicketTableInPlace();
+ }, "html")
+ .error(function(xhr, status, error) {
+ var message = jQuery.i18n.prop('msg_ticket_error');
+ displayMessageAsBootstrapAlert(message, "#infoAccordionTicketsInner");
+ setErrorMessage(xhr.responseText);
+ }).success(function(data, status, xhr) {
+ var continueReq = checkForSessionTimeout(data, xhr);
+ if (!continueReq) {
+ return false;
+ buildTicketTableInPlace();
+ }
+
});
}
@@ -149,7 +153,7 @@ function reloadTickets() {
}
/**
- * Show ticket details dailog area
+ * Show ticket details dialog area
*
* @param create -
* is this a create or edit