summaryrefslogtreecommitdiffstats
path: root/idrop-web
diff options
context:
space:
mode:
authorJason Reilly <jdr0887@renci.org>2011-02-23 15:31:57 (GMT)
committer Jason Reilly <jdr0887@renci.org>2011-02-23 15:31:57 (GMT)
commit98d7899863c7f4a42e8485b00e5fc5224a86b8f6 (patch)
tree7ea92487011e3e7dd0512be8616647da206e320b /idrop-web
parentd5991dc4a286cba5ae29f7d53d7bc462d4134778 (diff)
parenta15b1277ccd81614e16bc162008f143a33a6c9ff (diff)
downloadQCG-Data-98d7899863c7f4a42e8485b00e5fc5224a86b8f6.zip
QCG-Data-98d7899863c7f4a42e8485b00e5fc5224a86b8f6.tar.gz
QCG-Data-98d7899863c7f4a42e8485b00e5fc5224a86b8f6.tar.bz2
Merge branch 'master' of ssh://code.renci.org/gitroot/irodsidrop
Diffstat (limited to 'idrop-web')
-rw-r--r--idrop-web/application.properties11
-rw-r--r--idrop-web/grails-app/conf/BuildConfig.groovy10
-rw-r--r--idrop-web/grails-app/conf/Config.groovy2
-rw-r--r--idrop-web/grails-app/conf/spring/resources.groovy8
-rw-r--r--idrop-web/grails-app/conf/spring/resources.xml (renamed from idrop-web/web-app/WEB-INF/resources.xml)5
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy101
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy18
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/TagsController.groovy37
-rw-r--r--idrop-web/grails-app/taglib/AuthTagLib.groovy26
-rw-r--r--idrop-web/grails-app/views/browse/collectionInfo.gsp18
-rw-r--r--idrop-web/grails-app/views/browse/dataObjectInfo.gsp24
-rw-r--r--idrop-web/grails-app/views/browse/index.gsp8
-rw-r--r--idrop-web/grails-app/views/browse/loadTree.gsp5
-rw-r--r--idrop-web/grails-app/views/common/_secondarymain.gsp12
-rw-r--r--idrop-web/grails-app/views/layouts/main.gsp2
-rw-r--r--idrop-web/grails-app/views/tags/tagCloud.gsp5
-rw-r--r--idrop-web/pom.xml8
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/BrowseControllerTests.groovy129
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/LoginControllerTests.groovy29
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/TagsControllerTests.groovy62
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/taglib/AuthTagLibTests.groovy17
-rw-r--r--idrop-web/web-app/WEB-INF/applicationContext.xml3
-rw-r--r--idrop-web/web-app/css/main.css245
-rw-r--r--idrop-web/web-app/js/mydrop/home.js32
-rw-r--r--idrop-web/web-app/js/mydrop/lingo_common.js54
25 files changed, 669 insertions, 202 deletions
diff --git a/idrop-web/application.properties b/idrop-web/application.properties
index 66cc0e0..4f0f2d3 100644
--- a/idrop-web/application.properties
+++ b/idrop-web/application.properties
@@ -1,8 +1,9 @@
#Grails Metadata file
-#Mon Dec 13 18:50:00 EST 2010
-app.grails.version=1.3.6
-app.name=idrop-web
+#Wed Feb 16 18:41:31 EST 2011
+app.version=0.9.1-SNAPSHOT
+plugins.acegi=0.5.3.2
app.servlet.version=2.4
-app.version=0.9.0-SNAPSHOT
-plugins.hibernate=1.3.5
+app.grails.version=1.3.6
plugins.tomcat=1.3.5
+plugins.hibernate=1.3.5
+app.name=idrop-web
diff --git a/idrop-web/grails-app/conf/BuildConfig.groovy b/idrop-web/grails-app/conf/BuildConfig.groovy
index b55bd82..873166a 100644
--- a/idrop-web/grails-app/conf/BuildConfig.groovy
+++ b/idrop-web/grails-app/conf/BuildConfig.groovy
@@ -5,7 +5,7 @@ grails.project.test.reports.dir = "target/test-reports"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
- // uncomment to disable ehcache
+ // uncomment to disable ehcace
excludes 'ehcache'
}
log "warn" // LOG level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
@@ -27,8 +27,13 @@ grails.project.dependency.resolution = {
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
test 'org.irods.jargon:jargon-test:2.4.1-SNAPSHOT'
+ test 'org.mockito:mockito-all:1.8.1'
+ provided 'junit:junit:4.8.1'
compile 'org.irods.jargon:jargon-core:2.4.1-SNAPSHOT'
compile 'org.irods.jargon:jargon-security:2.4.1-SNAPSHOT'
+ compile ('org.irods.jargon:jargon-user-tagging:2.4.1-SNAPSHOT') {
+ exclude 'junit'
+ }
compile 'org.springframework.security:spring-security-core:3.0.5.RELEASE'
compile 'org.springframework.security:spring-security-web:3.0.5.RELEASE'
compile 'org.springframework.security:spring-security-config:3.0.5.RELEASE'
@@ -36,7 +41,6 @@ grails.project.dependency.resolution = {
compile 'javax.servlet:servlet-api:2.5'
compile( group: 'log4j', name: 'log4j', version: '1.2.16', export: false )
- //compile 'log4j:log4j:1.2.16'
- // runtime 'mysql:mysql-connector-java:5.1.5'
+
}
}
diff --git a/idrop-web/grails-app/conf/Config.groovy b/idrop-web/grails-app/conf/Config.groovy
index 21a0162..07473a0 100644
--- a/idrop-web/grails-app/conf/Config.groovy
+++ b/idrop-web/grails-app/conf/Config.groovy
@@ -67,7 +67,7 @@ environments {
log4j = {
root {
- warn()
+ info()
additivity = true
}
diff --git a/idrop-web/grails-app/conf/spring/resources.groovy b/idrop-web/grails-app/conf/spring/resources.groovy
index 5f35c93..d8f633e 100644
--- a/idrop-web/grails-app/conf/spring/resources.groovy
+++ b/idrop-web/grails-app/conf/spring/resources.groovy
@@ -1,12 +1,14 @@
// Place your Spring DSL code here
beans = {
-
- irodsAuthenticationHelperService(mydrop.IRODSAuthenticationHelperService) {
+
+ browserController(org.irods.mydrop.controller.BrowseController) {
irodsAccessObjectFactory = ref("irodsAccessObjectFactory")
+ taggingServiceFactory = ref("taggingServiceFactory")
}
- browserController(org.irods.mydrop.controller.BrowseController) {
+ tagsController(org.irods.mydrop.controller.TagsController) {
irodsAccessObjectFactory = ref("irodsAccessObjectFactory")
+ taggingServiceFactory = ref("taggingServiceFactory")
}
}
diff --git a/idrop-web/web-app/WEB-INF/resources.xml b/idrop-web/grails-app/conf/spring/resources.xml
index 8806efd..93b3490 100644
--- a/idrop-web/web-app/WEB-INF/resources.xml
+++ b/idrop-web/grails-app/conf/spring/resources.xml
@@ -20,6 +20,11 @@
class="org.irods.jargon.core.pub.IRODSAccessObjectFactoryImpl">
<beans:constructor-arg ref="irodsSession"></beans:constructor-arg>
</beans:bean>
+
+ <beans:bean id="taggingServiceFactory"
+ class="org.irods.jargon.usertagging.TaggingServiceFactoryImpl">
+ <beans:constructor-arg ref="irodsAccessObjectFactory"></beans:constructor-arg>
+ </beans:bean>
<beans:bean id="authenticationManager"
class="org.irods.jargon.spring.security.IRODSAccountAuthenticationManager">
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 95344e4..8be653d 100644
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy
@@ -1,11 +1,14 @@
package org.irods.mydrop.controller
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.irods.jargon.core.pub.*;
-import org.irods.jargon.core.connection.*;
-import org.irods.jargon.core.exception.*;
-import grails.converters.*;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import grails.converters.*
+
+import org.irods.jargon.core.connection.*
+import org.irods.jargon.core.exception.*
+import org.irods.jargon.core.pub.*
+import org.irods.jargon.core.pub.domain.DataObject
+import org.irods.jargon.usertagging.FreeTaggingService
+import org.irods.jargon.usertagging.TaggingServiceFactory
+import org.springframework.security.core.context.SecurityContextHolder
/**
@@ -14,38 +17,39 @@ import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
*/
class BrowseController {
-
+
IRODSAccessObjectFactory irodsAccessObjectFactory
+ TaggingServiceFactory taggingServiceFactory
IRODSAccount irodsAccount
-
+
/**
* Interceptor grabs IRODSAccount from the SecurityContextHolder
*/
def beforeInterceptor = {
def irodsAuthentication = SecurityContextHolder.getContext().authentication
-
+
if (irodsAuthentication == null) {
throw new JargonRuntimeException("no irodsAuthentication in security context!")
}
-
+
irodsAccount = irodsAuthentication.irodsAccount
log.debug("retrieved account for request: ${irodsAccount}")
}
-
-
+
+
/**
* Display initial browser
*/
def index = { }
-
-
+
+
/**
* Render the tree node data for the given parent. This will use the HTML style AJAX response to depict the children using unordered lists.
* <p/>
* Requires param 'dir' from request to derive parent
*
*/
- def loadTree = {
+ def loadTree = {
def parent = params['dir']
log.info "loading tree for parent path: ${parent}"
def collectionAndDataObjectListAndSearchAO = irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount)
@@ -54,18 +58,18 @@ class BrowseController {
//render(view:"loadTree",model:[collectionAndDataObjectList:collectionAndDataObjectList, parent:parent])
render collectionAndDataObjectList as JSON
}
-
+
def ajaxDirectoryListingUnderParent = {
def parent = params['dir']
log.info "ajaxDirectoryListingUnderParent path: ${parent}"
def collectionAndDataObjectListAndSearchAO = irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount)
def collectionAndDataObjectList = collectionAndDataObjectListAndSearchAO.listDataObjectsAndCollectionsUnderPath(parent)
log.debug("retrieved collectionAndDataObjectList: ${collectionAndDataObjectList}")
-
+
def jsonBuff = []
-
- collectionAndDataObjectList.each {
-
+
+ collectionAndDataObjectList.each {
+
def icon
def state
def type
@@ -78,35 +82,44 @@ class BrowseController {
state = "closed"
type = "folder"
}
-
+
def attrBuf = ["id":it.formattedAbsolutePath, "rel":type]
-
+
jsonBuff.add(
["data": it.nodeLabelDisplayValue,"attr":attrBuf, "state":state,"icon":icon, "type":type]
)
-
}
-
+
render jsonBuff as JSON
-
- /*
- render(contentType:"text/json") {
- children = array {
- for (entry in collectionAndDataObjectList) {
- data = entry.nodeValueForDisplay
- attr = {id=entry.formattedAbsolutePath}
- state="closed"
- children=[]
- if (entry.getObjectType == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
- icon="folder"
- } else {
- icon="/"
- }
- }
- }
- }
- */
-
}
-
+
+ def fileInfo = {
+ def absPath = params['absPath']
+ if (absPath == null) {
+ throw new JargonException("no absolute path passed to the method")
+ }
+
+ log.info "fileInfo for absPath: ${absPath}"
+ CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount)
+
+ // TODO: some sort of catch and display of no data available in info?
+ def retObj = collectionAndDataObjectListAndSearchAO.getFullObjectForType(absPath)
+
+ def isDataObject = retObj instanceof DataObject
+
+ log.info "is this a data object? ${isDataObject}"
+
+ FreeTaggingService freeTaggingService = taggingServiceFactory.instanceFreeTaggingService(irodsAccount)
+ if (isDataObject) {
+ log.info("getting free tags for data object")
+ def freeTags = freeTaggingService.getTagsForDataObjectInFreeTagForm(absPath)
+ log.info("rendering as data object: ${retObj}")
+ render(view:"dataObjectInfo", model:[dataObject:retObj,tags:freeTags])
+ } else {
+ log.info("getting free tags for collection")
+ def freeTags = freeTaggingService.getTagsForCollectionInFreeTagForm(absPath)
+ log.info("rendering as collection: ${retObj}")
+ render(view:"collectionInfo", model:[collection:retObj,tags:freeTags])
+ }
+ }
}
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 ba34f24..00d874a 100644
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy
@@ -1,18 +1,10 @@
package org.irods.mydrop.controller
-import org.codehaus.groovy.grails.validation.Validateable;
-
class LoginController {
-
-
- def login = {
- render(view:"login")
- }
-
- def index ={
- redirect(action: "login")
- }
-
+
+ def login = { render(view:"login") }
+
+ def index ={ redirect(action: "login") }
+
def logout = {}
-
}
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/TagsController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/TagsController.groovy
index 7550c23..d1e13fc 100644
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/TagsController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/TagsController.groovy
@@ -1,9 +1,44 @@
package org.irods.mydrop.controller
+import org.irods.jargon.core.connection.IRODSAccount
+import org.irods.jargon.core.exception.JargonRuntimeException
+import org.irods.jargon.core.pub.IRODSAccessObjectFactory
+import org.irods.jargon.usertagging.TaggingServiceFactory
+import org.irods.jargon.usertagging.UserTagCloudService
+import org.irods.jargon.usertagging.domain.UserTagCloudView
+import org.springframework.security.core.context.SecurityContextHolder
+
class TagsController {
+
+ IRODSAccessObjectFactory irodsAccessObjectFactory
+ TaggingServiceFactory taggingServiceFactory
+ IRODSAccount irodsAccount
+
+ /**
+ * Interceptor grabs IRODSAccount from the SecurityContextHolder
+ */
+ def beforeInterceptor = {
+ def irodsAuthentication = SecurityContextHolder.getContext().authentication
+
+ if (irodsAuthentication == null) {
+ throw new JargonRuntimeException("no irodsAuthentication in security context!")
+ }
+
+ irodsAccount = irodsAuthentication.irodsAccount
+ log.debug("retrieved account for request: ${irodsAccount}")
+ }
+
def index = { }
- def tagCloud = {}
+ def tagCloud = {
+
+ log.info("getting tag cloud for user: ${irodsAccount}")
+ UserTagCloudService userTagCloudService = taggingServiceFactory.instanceUserTagCloudService(irodsAccount)
+ UserTagCloudView userTagCloudView = userTagCloudService.getTagCloud()
+ def entries = userTagCloudView.getTagCloudEntries().values()
+ render(view:"tagCloud", model:[tagCloud:entries])
+
+ }
}
diff --git a/idrop-web/grails-app/taglib/AuthTagLib.groovy b/idrop-web/grails-app/taglib/AuthTagLib.groovy
new file mode 100644
index 0000000..fee2283
--- /dev/null
+++ b/idrop-web/grails-app/taglib/AuthTagLib.groovy
@@ -0,0 +1,26 @@
+
+import org.springframework.security.core.context.SecurityContextHolder
+
+class AuthTagLib {
+
+ private boolean isAuthenticated() {
+ //auth = session.SPRING_SECURITY_CONTEXT?.authentication?.authenticated
+ def auth = session["SPRING_SECURITY_CONTEXT"]
+ //log.info("auth is: ${auth}")
+ return auth != null
+ }
+
+
+ def ifAuthenticated = { attrs, body ->
+ if (isAuthenticated()) {
+ out << body()
+ }
+ }
+
+ def ifNotAuthenticated = { attrs, body ->
+ if (!isAuthenticated()) {
+ out << body()
+ }
+ }
+
+}
diff --git a/idrop-web/grails-app/views/browse/collectionInfo.gsp b/idrop-web/grails-app/views/browse/collectionInfo.gsp
new file mode 100644
index 0000000..9656a5c
--- /dev/null
+++ b/idrop-web/grails-app/views/browse/collectionInfo.gsp
@@ -0,0 +1,18 @@
+<fieldset id="verticalForm">
+
+<label for="">Parent
+Collection:</label> <g:textField name="collectionParentName"
+ value="${collection.collectionParentName}" readonly="true" /> <br />
+
+<label for="collectionName">Collection Name:</label> <g:textField name="collectionName"
+ value="${collection.collectionName}" readonly="true" /> <br />
+
+<label for="createdAt">Created At:</label> <g:textField name="createdAt"
+ value="${collection.createdAt}" readonly="true" /> <br />
+
+<label for="tags">Tags:</label> <g:textField name="tags"
+ value="${tags.spaceDelimitedTagsForDomain}" /> <br />
+
+
+
+</fieldset> \ No newline at end of file
diff --git a/idrop-web/grails-app/views/browse/dataObjectInfo.gsp b/idrop-web/grails-app/views/browse/dataObjectInfo.gsp
new file mode 100644
index 0000000..ad9fa3b
--- /dev/null
+++ b/idrop-web/grails-app/views/browse/dataObjectInfo.gsp
@@ -0,0 +1,24 @@
+<fieldset id="verticalForm">
+
+<label for="collectionName">Parent
+Collection:</label> <g:textField name="collectionName"
+ value="${dataObject.collectionName}" readonly="true" /> <br />
+
+<label for="dataName">File Name:</label> <g:textField name="dataName"
+ value="${dataObject.dataName}" readonly="true" /> <br />
+
+<label for="createdAt">Created At:</label> <g:textField name="createdAt"
+ value="${dataObject.createdAt}" readonly="true" /> <br />
+
+<label for="dataSize">Size:</label> <g:textField name="dataSize"
+ value="${dataObject.dataSize}" readonly="true" /> <br />
+
+<label for="checksum">Checksum:</label> <g:textField name="checksum"
+ value="${dataObject.checksum}" readonly="true" /> <br />
+
+<label for="tags">Tags:</label> <g:textField name="tags"
+ value="${tags.spaceDelimitedTagsForDomain}" /> <br />
+
+
+
+</fieldset> \ No newline at end of file
diff --git a/idrop-web/grails-app/views/browse/index.gsp b/idrop-web/grails-app/views/browse/index.gsp
index a214936..a80601a 100644
--- a/idrop-web/grails-app/views/browse/index.gsp
+++ b/idrop-web/grails-app/views/browse/index.gsp
@@ -7,11 +7,11 @@ $(function() {
});
</script>
-<div id="browser" style="height:800px; display:inline-block;">
+<div id="browser" class="wrapper">
<div id="dataTreeView"
- style="float: left; height:800px; width=600px; display:inline-block"><!-- no empty divs -->
-<div id="dataTreeDiv">
+ style="float: left; position: relative; width: auto; display:inline-block; overflow:auto;"><!-- no empty divs -->
+<div id="dataTreeDiv" class="colLeft"><!-- no empty divs --></div>
+<div id="infoDiv" class="colRight roundedContainer"><h2>Select a directory or file to see info and tags</h2></div>
</div>
-</div>
</div> \ No newline at end of file
diff --git a/idrop-web/grails-app/views/browse/loadTree.gsp b/idrop-web/grails-app/views/browse/loadTree.gsp
index 198e6f7..0ef3671 100644
--- a/idrop-web/grails-app/views/browse/loadTree.gsp
+++ b/idrop-web/grails-app/views/browse/loadTree.gsp
@@ -1,4 +1 @@
-<g:each in="${collectionAndDataObjectList}" var="entry">
-<li><a href="${entry.formattedAbsolutePath}">${entry}</a>
-</li>
-</g:each> \ No newline at end of file
+<h1>Data Object info will be here</h1> \ No newline at end of file
diff --git a/idrop-web/grails-app/views/common/_secondarymain.gsp b/idrop-web/grails-app/views/common/_secondarymain.gsp
index c85470c..9eee188 100644
--- a/idrop-web/grails-app/views/common/_secondarymain.gsp
+++ b/idrop-web/grails-app/views/common/_secondarymain.gsp
@@ -1,6 +1,8 @@
<script>
$(function() {
$("#secondaryTabs").tabs();
+ lcSendValueAndCallbackHtmlAfterErrorCheck("/tags/tagCloud", "#tagCloudDiv",
+ "#tagCloudDiv", null);
});
</script>
<div id="secondaryTabs">
@@ -10,11 +12,11 @@
</ul>
<div id="tabs-1">
-<ul>
- <li>tag1</li>
- <li>tag2</li>
- <li>tag3</li>
-</ul>
+<div id="tagCloudDiv" class="scroll">
+
+<!-- tag cloud div is ajax loaded -->
+
+</div>
</div>
<div id="tabs-2">
<ul>
diff --git a/idrop-web/grails-app/views/layouts/main.gsp b/idrop-web/grails-app/views/layouts/main.gsp
index bb825a2..9dcc726 100644
--- a/idrop-web/grails-app/views/layouts/main.gsp
+++ b/idrop-web/grails-app/views/layouts/main.gsp
@@ -37,7 +37,9 @@
<g:layoutBody />
</div>
<div class="yui-u"><!-- PUT MAIN COLUMN 2 CODE HERE -->
+<g:ifAuthenticated>
<g:render template="/common/secondarymain"/>
+</g:ifAuthenticated>
</div>
</div>
diff --git a/idrop-web/grails-app/views/tags/tagCloud.gsp b/idrop-web/grails-app/views/tags/tagCloud.gsp
new file mode 100644
index 0000000..9bc96d5
--- /dev/null
+++ b/idrop-web/grails-app/views/tags/tagCloud.gsp
@@ -0,0 +1,5 @@
+<ul>
+<g:each in="${tagCloud}" var="tagVal">
+ <li>${tagVal.irodsTagValue.tagData}</li>
+</g:each>
+</ul> \ No newline at end of file
diff --git a/idrop-web/pom.xml b/idrop-web/pom.xml
index df074f3..662c834 100644
--- a/idrop-web/pom.xml
+++ b/idrop-web/pom.xml
@@ -16,18 +16,18 @@
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-bootstrap</artifactId>
- <version>1.3.2</version>
+ <version>1.3.6</version>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-crud</artifactId>
- <version>1.3.2</version>
+ <version>1.3.6</version>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-gorm</artifactId>
- <version>1.3.2</version>
+ <version>1.3.6</version>
</dependency>
<!-- Needed in the case of AOP usage -->
@@ -151,7 +151,7 @@
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
- <version>1.3.2</version>
+ <version>1.3.6</version>
<extensions>true</extensions>
<executions>
<execution>
diff --git a/idrop-web/test/unit/org/irods/mydrop/controller/BrowseControllerTests.groovy b/idrop-web/test/unit/org/irods/mydrop/controller/BrowseControllerTests.groovy
index 2daaa52..5aab305 100644
--- a/idrop-web/test/unit/org/irods/mydrop/controller/BrowseControllerTests.groovy
+++ b/idrop-web/test/unit/org/irods/mydrop/controller/BrowseControllerTests.groovy
@@ -1,31 +1,37 @@
+
package org.irods.mydrop.controller
+import grails.converters.*
import grails.test.*
+
import java.util.Properties
-import org.irods.jargon.core.connection.IRODSAccount
+
+import org.irods.jargon.core.connection.IRODSAccount
+import org.irods.jargon.core.exception.JargonException
+import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO
import org.irods.jargon.core.pub.IRODSAccessObjectFactory
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.pub.io.IRODSFile
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry
-import org.irods.jargon.testutils.TestingPropertiesHelper
-import org.irods.jargon.testutils.filemanip.FileGenerator
+import org.irods.jargon.core.pub.IRODSFileSystem
+import org.irods.jargon.core.pub.domain.DataObject
+import org.irods.jargon.core.pub.domain.Collection
+import org.irods.jargon.core.query.MetaDataAndDomainData
+import org.irods.jargon.spring.security.IRODSAuthenticationToken
import org.irods.jargon.testutils.TestingPropertiesHelper
-import org.irods.jargon.spring.security.IRODSAuthenticationToken;
-import org.springframework.security.core.context.SecurityContextHolder;
-import grails.converters.*
-
-
+import org.irods.jargon.usertagging.FreeTaggingService
+import org.irods.jargon.usertagging.TaggingServiceFactory
+import org.irods.jargon.usertagging.domain.IRODSTagGrouping
+import org.mockito.Mockito
+import org.springframework.security.core.context.SecurityContextHolder
class BrowseControllerTests extends ControllerUnitTestCase {
-
+
IRODSAccessObjectFactory irodsAccessObjectFactory
IRODSAccount irodsAccount
Properties testingProperties
TestingPropertiesHelper testingPropertiesHelper
IRODSFileSystem irodsFileSystem
-
-
- protected void setUp() {
+
+
+ protected void setUp() {
super.setUp()
testingPropertiesHelper = new TestingPropertiesHelper()
testingProperties = testingPropertiesHelper.getTestProperties()
@@ -34,13 +40,13 @@ class BrowseControllerTests extends ControllerUnitTestCase {
irodsAccessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory()
def irodsAuthentication = new IRODSAuthenticationToken(irodsAccount)
SecurityContextHolder.getContext().authentication = irodsAuthentication
- }
+ }
- protected void tearDown() {
- super.tearDown()
- }
+ protected void tearDown() {
+ super.tearDown()
+ }
- void testBrowse() {
+ void testBrowse() {
controller.params.dir = "/"
controller.irodsAccessObjectFactory = irodsAccessObjectFactory
controller.irodsAccount = irodsAccount
@@ -48,15 +54,8 @@ class BrowseControllerTests extends ControllerUnitTestCase {
def controllerResponse = controller.response.contentAsString
def jsonResult = JSON.parse(controllerResponse)
assertNotNull("missing json result", jsonResult)
- /*def mav = controller.modelAndView
- def name = mav.viewName
- assertNotNull("null mav", mav)
- assertEquals("view name should be loadTree", "loadTree", name)
- def parent = mav.model.linkedHashMap.parent
- assertEquals("parent dir not found", "/", parent)*/
-
- }
-
+ }
+
void testAjaxDirectoryListingUnderParent() {
controller.params.dir = "/"
controller.irodsAccessObjectFactory = irodsAccessObjectFactory
@@ -65,12 +64,74 @@ class BrowseControllerTests extends ControllerUnitTestCase {
def controllerResponse = controller.response.contentAsString
def jsonResult = JSON.parse(controllerResponse)
assertNotNull("missing json result", jsonResult)
- /*def mav = controller.modelAndView
+ }
+
+ void testFileInfoNoParam() {
+ controller.irodsAccessObjectFactory = irodsAccessObjectFactory
+ controller.irodsAccount = irodsAccount
+ shouldFail(JargonException) { controller.fileInfo() }
+ }
+
+ void testFileInfoWithPath() {
+ def testPath = "/testpath.txt"
+ def irodsAccessObjectFactory = Mockito.mock(IRODSAccessObjectFactory.class)
+ CollectionAndDataObjectListAndSearchAO collectionListAndSearchAO = Mockito.mock(CollectionAndDataObjectListAndSearchAO.class)
+ DataObject retObject = new DataObject()
+ retObject.setDataName(testPath)
+ Mockito.when(collectionListAndSearchAO.getFullObjectForType(testPath)).thenReturn(retObject)
+ Mockito.when(irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount)).thenReturn(collectionListAndSearchAO)
+ controller.irodsAccessObjectFactory = irodsAccessObjectFactory
+ FreeTaggingService freeTaggingService = Mockito.mock(FreeTaggingService.class)
+ TaggingServiceFactory taggingServiceFactory = Mockito.mock(TaggingServiceFactory.class)
+ IRODSTagGrouping grouping = new IRODSTagGrouping(MetaDataAndDomainData.MetadataDomain.DATA, "name", "tags", "user")
+ Mockito.when(freeTaggingService.getTagsForDataObjectInFreeTagForm(testPath)).thenReturn(grouping)
+ Mockito.when(taggingServiceFactory.instanceFreeTaggingService(irodsAccount)).thenReturn(freeTaggingService)
+ controller.irodsAccount = irodsAccount
+ controller.taggingServiceFactory = taggingServiceFactory
+ controller.params.absPath = testPath
+ controller.fileInfo()
+ def mav = controller.modelAndView
def name = mav.viewName
+
assertNotNull("null mav", mav)
- assertEquals("view name should be loadTree", "loadTree", name)
- def parent = mav.model.linkedHashMap.parent
- assertEquals("parent dir not found", "/", parent)*/
-
+ assertEquals("view name should be dataObjectInfo", "dataObjectInfo", name)
+ def dataObj = mav.model.dataObject
+ assertNotNull("null data object", dataObj)
+ assertEquals("did not find expected path", testPath, dataObj.dataName)
+ def tags = mav.model.tags
+ assertNotNull("null tag in model", tags)
+
}
+
+ void testFileInfoWithPathWhenCollection() {
+ def testPath = "/testpath"
+ def irodsAccessObjectFactory = Mockito.mock(IRODSAccessObjectFactory.class)
+ CollectionAndDataObjectListAndSearchAO collectionListAndSearchAO = Mockito.mock(CollectionAndDataObjectListAndSearchAO.class)
+ Collection retObject = new Collection()
+ retObject.setCollectionName(testPath)
+ Mockito.when(collectionListAndSearchAO.getFullObjectForType(testPath)).thenReturn(retObject)
+ Mockito.when(irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount)).thenReturn(collectionListAndSearchAO)
+ controller.irodsAccessObjectFactory = irodsAccessObjectFactory
+ FreeTaggingService freeTaggingService = Mockito.mock(FreeTaggingService.class)
+ TaggingServiceFactory taggingServiceFactory = Mockito.mock(TaggingServiceFactory.class)
+ IRODSTagGrouping grouping = new IRODSTagGrouping(MetaDataAndDomainData.MetadataDomain.COLLECTION, "name", "tags", "user")
+ Mockito.when(freeTaggingService.getTagsForCollectionInFreeTagForm(testPath)).thenReturn(grouping)
+ Mockito.when(taggingServiceFactory.instanceFreeTaggingService(irodsAccount)).thenReturn(freeTaggingService)
+ controller.irodsAccount = irodsAccount
+ controller.taggingServiceFactory = taggingServiceFactory
+ controller.params.absPath = testPath
+ controller.fileInfo()
+ def mav = controller.modelAndView
+ def name = mav.viewName
+
+ assertNotNull("null mav", mav)
+ assertEquals("view name should be collectionInfo", "collectionInfo", name)
+ def collection = mav.model.collection
+ assertNotNull("null collection object", collection)
+ assertEquals("did not find expected path", testPath, collection.collectionName)
+ def tags = mav.model.tags
+ assertNotNull("null tag in model", tags)
+
+ }
+
}
diff --git a/idrop-web/test/unit/org/irods/mydrop/controller/LoginControllerTests.groovy b/idrop-web/test/unit/org/irods/mydrop/controller/LoginControllerTests.groovy
deleted file mode 100644
index 359b289..0000000
--- a/idrop-web/test/unit/org/irods/mydrop/controller/LoginControllerTests.groovy
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.irods.mydrop.controller
-
-
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.mydrop.controller.LoginController;
-import mydrop.*;
-import grails.test.*
-
-class LoginControllerTests extends ControllerUnitTestCase {
-
- protected void setUp() {
- super.setUp()
-
- }
-
- protected void tearDown() {
- super.tearDown()
- irodsFileSystem.closeAndEatExceptions()
- }
-
- void testLogin() {
- def loginController = new LoginController();
- loginController.login()
- def mav = loginController.modelAndView
- def name = mav.viewName
- assertEquals("should redirect to login view", "login", name)
- }
-
-}
diff --git a/idrop-web/test/unit/org/irods/mydrop/controller/TagsControllerTests.groovy b/idrop-web/test/unit/org/irods/mydrop/controller/TagsControllerTests.groovy
index f3a8063..ed2f326 100644
--- a/idrop-web/test/unit/org/irods/mydrop/controller/TagsControllerTests.groovy
+++ b/idrop-web/test/unit/org/irods/mydrop/controller/TagsControllerTests.groovy
@@ -1,18 +1,64 @@
+
package org.irods.mydrop.controller
+import java.util.Properties;
+
+import grails.converters.*
import grails.test.*
+import org.irods.jargon.core.connection.IRODSAccount
+import org.irods.jargon.core.pub.IRODSAccessObjectFactory
+import org.irods.jargon.core.pub.IRODSFileSystem
+import org.irods.jargon.testutils.TestingPropertiesHelper
+import org.irods.jargon.usertagging.UserTagCloudService
+import org.irods.jargon.usertagging.domain.UserTagCloudView
+import org.irods.jargon.usertagging.domain.IRODSTagValue
+import org.irods.jargon.usertagging.TaggingServiceFactory
+import org.irods.jargon.spring.security.IRODSAuthenticationToken
+import org.springframework.security.core.context.SecurityContextHolder
+import org.mockito.Mockito
+
+
class TagsControllerTests extends ControllerUnitTestCase {
- protected void setUp() {
- super.setUp()
- }
+
+ IRODSAccessObjectFactory irodsAccessObjectFactory
+ IRODSAccount irodsAccount
+ Properties testingProperties
+ TestingPropertiesHelper testingPropertiesHelper
+ IRODSFileSystem irodsFileSystem
- protected void tearDown() {
- super.tearDown()
- }
+ protected void setUp() {
+ super.setUp()
+ testingPropertiesHelper = new TestingPropertiesHelper()
+ testingProperties = testingPropertiesHelper.getTestProperties()
+ irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties)
+ irodsFileSystem = IRODSFileSystem.instance()
+ irodsAccessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory()
+ def irodsAuthentication = new IRODSAuthenticationToken(irodsAccount)
+ SecurityContextHolder.getContext().authentication = irodsAuthentication
+ }
- void testSomething() {
+ protected void tearDown() {
+ super.tearDown()
+ }
- }
+ void testGetTagCloud() {
+ controller.irodsAccessObjectFactory = irodsAccessObjectFactory
+ UserTagCloudService userTagCloudService = Mockito.mock(UserTagCloudService.class)
+ TaggingServiceFactory taggingServiceFactory = Mockito.mock(TaggingServiceFactory.class)
+ UserTagCloudView userTagCloudView = UserTagCloudView.instance(irodsAccount.getUserName(), new ArrayList<IRODSTagValue>(), new ArrayList<IRODSTagValue>())
+ Mockito.when(userTagCloudService.getTagCloud()).thenReturn(userTagCloudView)
+ Mockito.when(taggingServiceFactory.instanceUserTagCloudService(irodsAccount)).thenReturn(userTagCloudService)
+ controller.irodsAccount = irodsAccount
+ controller.taggingServiceFactory = taggingServiceFactory
+ controller.tagCloud()
+ def mav = controller.modelAndView
+ def name = mav.viewName
+ assertNotNull("null mav", mav)
+ assertEquals("view name should be tagCloud", "tagCloud", name)
+ def tagView = mav.model.tagCloud
+ assertNotNull("null tagView in model", tagView)
+
+ }
}
diff --git a/idrop-web/test/unit/org/irods/mydrop/taglib/AuthTagLibTests.groovy b/idrop-web/test/unit/org/irods/mydrop/taglib/AuthTagLibTests.groovy
new file mode 100644
index 0000000..479b6e9
--- /dev/null
+++ b/idrop-web/test/unit/org/irods/mydrop/taglib/AuthTagLibTests.groovy
@@ -0,0 +1,17 @@
+package org.irods.mydrop.taglib
+
+import grails.test.*
+
+class AuthTagLibTests extends TagLibUnitTestCase {
+ protected void setUp() {
+ super.setUp()
+ }
+
+ protected void tearDown() {
+ super.tearDown()
+ }
+
+ void testSomething() {
+
+ }
+}
diff --git a/idrop-web/web-app/WEB-INF/applicationContext.xml b/idrop-web/web-app/WEB-INF/applicationContext.xml
index d18a2c7..86acc04 100644
--- a/idrop-web/web-app/WEB-INF/applicationContext.xml
+++ b/idrop-web/web-app/WEB-INF/applicationContext.xml
@@ -4,8 +4,7 @@
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
- <import resource="resources.xml" />
-
+
<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
diff --git a/idrop-web/web-app/css/main.css b/idrop-web/web-app/css/main.css
index 57e306a..745e584 100644
--- a/idrop-web/web-app/css/main.css
+++ b/idrop-web/web-app/css/main.css
@@ -58,6 +58,61 @@ div.box label span {
text-align: right;
}
+div.scroll {
+ overflow: auto;
+ padding: 8px;
+}
+
+div#tabs {
+ overflow: auto;
+ width: 100%;
+ display: inline-block;
+ }
+
+.wrapper {
+ text-align: left;
+ margin: 0px auto;
+ padding: 0px;
+ border: 0;
+ width: 850px;
+ display: inline-block;
+ overflow: auto;
+
+}
+
+.colRight {
+ position: relative;
+ float: right;
+ width: 350px;
+ display: block;
+ overflow: auto;
+}
+
+.colLeft {
+ position: relative;
+ float: left;
+ width: 450px;
+ display: block;
+ overflow: auto;
+}
+
+.roundedContainer {
+ -moz-background-clip: border;
+ -moz-background-inline-policy: continuous;
+ -moz-background-origin: padding;
+ -moz-border-radius-bottomleft: 8pt;
+ -moz-border-radius-bottomright: 8pt;
+ -moz-border-radius-topleft: 8pt;
+ -moz-border-radius-topright: 8pt;
+ background: #FFFFFF none repeat scroll 0 0;
+ border: 3px solid #000000;
+ cursor: default;
+ padding: 3px;
+ margin: 3px;
+ display: block;
+}
+
+
.body {
float: left;
margin: 0 15px 10px 15px;
@@ -256,10 +311,9 @@ th.desc a {
.objectContainerDetails {
float: right;
- text-align: left;
+ text-align: left;
}
-
.objectHeader {
color: #210021;
font-weight: normal;
@@ -267,7 +321,6 @@ th.desc a {
margin: .8em 0 .3em 0;
}
-
.objectDescription {
color: #210021;
font-weight: normal;
@@ -277,13 +330,197 @@ th.desc a {
.objectContainerActions {
display: block;
- float: left;
+ float: left;
padding: 10px;
}
+/* standard form layouts */
+#columnarForm fieldset {
+ float: left;
+ display: block;
+ width: 17em;
+ margin: 0 1em 1em 0;
+ padding: 0 1em 1em 1em;
+}
+#columnarForm fieldset.radio {
+ width: 15em;
+ margin: 1em 0 2em 0;
+}
+#columnarForm fieldset.radio input {
+ clear: both;
+ float: left;
+ width: auto;
+}
+#columnarForm fieldset.radio label {
+ font-weight: normal;
+}
+#columnarForm input {
+ display: block;
+ width: 15em;
+}
+
+#columnarForm label {
+ display: block;
+ margin-bottom: 1em;
+ font-weight: bold;
+}
+
+#columnarForm label.first {
+ padding-top: 1em;
+}
+#columnarForm select {
+ display: block;
+}
+
+#horizontalForm fieldset {
+ display: block;
+ margin: 0 0 3em 0;
+ padding: 0 1em 1em 1em;
+}
+
+#horizontalForm fieldset.radio {
+ margin: 1em 0 2em 0;
+}
+
+#horizontalForm fieldset.radio input {
+ clear: both;
+ float: left;
+ width: auto;
+}
+
+#horizontalForm fieldset.radio label {
+ font-weight: normal;
+}
+
+#horizontalForm input {
+ display: block;
+ width: 15em;
+}
+
+#horizontalForm input.submit {
+ clear: both;
+}
+
+#horizontalForm label {
+ float: left;
+ display: block;
+ margin: 1em 1em 0 0;
+ font-weight: bold;
+}
+
+#horizontalForm select {
+ display: block;
+}
+
+#marginForm fieldset {
+ display: block;
+ margin: 0 0 1em 0;
+ border: 0 solid #FFFFFF;
+ border-top: 1px solid #000000;
+ padding: 0 1em 1em 1em;
+}
+
+#marginForm fieldset.radio {
+ margin: 0 0 0 -1em;
+ border: 0 solid #FFFFFF;
+}
+
+#marginForm fieldset.radio input {
+ position: static;
+ clear: both;
+ float: left;
+}
+
+#marginForm fieldset.radio label {
+ position: relative;
+ top: -1.25em;
+ display: inline;
+ width: auto;
+ margin: 0 0 0 8em;
+ font-weight: bold;
+ font-weight: normal;
+}
+
+#marginForm fieldset.radio legend {
+ float: left;
+ font-weight: bold;
+}
+
+#marginForm input {
+ position: relative;
+ top: -1.4em;
+ left: 8em;
+ display: block;
+}
+
+#marginForm input.submit {
+ clear: both;
+ top: 0;
+}
+
+#marginForm label {
+ clear: both;
+ float: left;
+ display: block;
+ width: 8em;
+ margin-top: -1em;
+ font-weight: bold;
+}
+
+#marginForm label.first {
+ margin-top: 1em;
+}
+
+#marginForm select {
+ position: relative;
+ top: -1.4em;
+ left: 8em;
+ display: block;
+}
+
+#verticalForm fieldset {
+ display: block;
+ width: 17em;
+ margin: 0 0 3em 0;
+ padding: 0 1em 1em 1em;
+}
+
+#verticalForm fieldset.radio {
+ width: 15em;
+ margin: 1em 0 2em 0;
+}
+
+#verticalForm fieldset.radio input {
+ clear: both;
+ float: left;
+ width: auto;
+}
+
+#verticalForm fieldset.radio label {
+ font-weight: normal;
+}
+
+#verticalForm input {
+ display: block;
+ width: 20em;
+}
+
+#verticalForm label {
+ display: block;
+ margin-bottom: 1em;
+ font-weight: bold;
+}
+
+#verticalForm label.first {
+ padding-top: 1em;
+}
+
+#verticalForm select {
+ display: block;
+} \ No newline at end of file
diff --git a/idrop-web/web-app/js/mydrop/home.js b/idrop-web/web-app/js/mydrop/home.js
index d32e5f7..585c4c6 100644
--- a/idrop-web/web-app/js/mydrop/home.js
+++ b/idrop-web/web-app/js/mydrop/home.js
@@ -21,6 +21,7 @@ function retrieveBrowserFirstView() {
browserFirstViewRetrieved);
}
+// get rid of
function useAjaxToRetrieveATreeNode(node, path) {
var url = "/browse/loadTree";
strPath = "";
@@ -45,6 +46,7 @@ function useAjaxToRetrieveATreeNode(node, path) {
}
+// get rid of
function nodeTreeRetrievedViaAjax(targetNode, jsonData) {
var directoryList = jsonData.directoryList;
@@ -84,6 +86,7 @@ function nodeTreeRetrievedViaAjax(targetNode, jsonData) {
* @param n
* @return
*/
+// get rid of
function buildDataForNodeRequest(n) {
var nodeData = {
@@ -137,6 +140,7 @@ function browserFirstViewRetrieved(data) {
},
+
"themes" : {
"theme" : "default",
"url" : context + "/css/style.css",
@@ -145,10 +149,17 @@ function browserFirstViewRetrieved(data) {
},
"plugins" : [ "json_data", "types", "ui", "crmm", "themes" ]
});
+
+ $("#dataTreeDiv").bind("select_node.jstree", function (e, data) {
+ // alert(data.rslt.obj); // this is the object that was clicked
+ nodeSelected(e, data.rslt.obj);
+ });
- dataTree.bind("click", function(event) {
- nodeSelected(event)
- });
+
+
+ /*dataTree.live("click", function(event, data) {
+ nodeSelected(event, data)
+ });*/
}
@@ -168,17 +179,12 @@ function nodeLoadedCallback() {
* javascript event containing a reference to the selected node
* @return
*/
-function nodeSelected(event) {
+function nodeSelected(event, data) {
// given the path, put in the node data
- /*
- * var path = $.jstree._reference("#root").get_path(event.target, false);
- * obj = $.jstree._reference(event.target)._get_node(event.target);
- *
- * if (isThisNodeLoaded(obj)) { // already loaded, just toggle
- * $.jstree._reference("#root").toggle_node(event.target, false, false);
- * synchronizeDetailView(event.target, path); } else {
- * //useAjaxToRetrieveATreeNode(obj, path); }
- */
+
+ var id = data[0].id;
+ lcSendValueAndCallbackHtmlAfterErrorCheck("/browse/fileInfo?absPath=" + id, "#infoDiv",
+ "#infoDiv", null);
}
diff --git a/idrop-web/web-app/js/mydrop/lingo_common.js b/idrop-web/web-app/js/mydrop/lingo_common.js
index 08f96dc..17f39d6 100644
--- a/idrop-web/web-app/js/mydrop/lingo_common.js
+++ b/idrop-web/web-app/js/mydrop/lingo_common.js
@@ -21,7 +21,6 @@ function prepareForCall() {
$(javascriptMessageArea).html();
}
-
/*
* 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.
@@ -57,7 +56,7 @@ function checkAjaxResultForErrorAndDisplayInGivenArea(resultHtml, messageAreaId)
"Unable to access, due to expired login or no authorization");
throw ("dataAccessError");
}
-
+
if (resultHtml.indexOf(appExceptionVal) > -1) {
exceptionStart = resultHtml.indexOf("_exception") + 12;
@@ -116,7 +115,7 @@ function checkAjaxResultForError(resultHtml) {
setMessage("Unable to access, due to expired login or no authorization");
throw ("dataAccessError");
}
-
+
if (resultHtml.indexOf(appExceptionVal) > -1) {
exceptionStart = resultHtml.indexOf("_exception") + 12;
@@ -127,18 +126,19 @@ function checkAjaxResultForError(resultHtml) {
}
}
-
/*
* Send a query via ajax that results in an HTML table to be displayed as a
- * JQuery data table
+ * JQuery data table
*
- * @param getUrl - url for ajax call as GET
+ * @param getUrl - url for ajax call as GET
*
- * @param tableDiv - selector for the div where the table HTML response will be placed
+ * @param tableDiv - selector for the div where the table HTML response will be
+ * placed
*
* @param newTableId - id for the new table
*
- * @param detailsFunction - function pointer for click event handler to be attached to each table node
+ * @param detailsFunction - function pointer for click event handler to be
+ * attached to each table node
*/
function lcSendValue(getUrl, tableDiv, newTableId, detailsFunction) {
@@ -158,7 +158,7 @@ function lcSendValue(getUrl, tableDiv, newTableId, detailsFunction) {
checkAjaxResultForError(data);
lcBuildTable(data, tableDiv, newTableId, detailsFunction);
}, "html");
-
+
$(tableDiv).ajaxError(function(e, xhr, settings, exception) {
$(tableDiv).html("");
checkAjaxResultForError(xhr.responseText);
@@ -195,8 +195,7 @@ function lcBuildTable(data, tableDiv, newTableId, detailsFunction) {
}
/*
- * Close table nodes when using +/- details icon
- * @param dataTable - reference to
+ * Close table nodes when using +/- details icon @param dataTable - reference to
* jquery dataTable (not a selector, the table)
*/
function lcCloseTableNodes(dataTable) {
@@ -222,11 +221,11 @@ function lcCloseDetails(minMaxIcon, rowActionIsOn, dataTable) {
dataTable.fnClose(rowActionIsOn);
}
-
/*
* Send a query via ajax that results in html plugged into the correct div
*/
-function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context, postLoadFunction) {
+function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context,
+ postLoadFunction) {
prepareForCall();
if (getUrl.length == 0) {
@@ -234,7 +233,7 @@ function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context, postLoadFunctio
}
var img = document.createElement('IMG');
- img.setAttribute("src", + context + "/images/ajax-loader.gif");
+ img.setAttribute("src", +context + "/images/ajax-loader.gif");
$(resultDiv).html(img);
@@ -244,7 +243,7 @@ function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context, postLoadFunctio
checkAjaxResultForError(data);
lcFillInDivWithHtml(data, resultDiv, postLoadFunction);
}, "html");
-
+
$(resultDiv).ajaxError(function(e, xhr, settings, exception) {
$(resultDiv).html("");
checkAjaxResultForError(xhr.responseText);
@@ -260,11 +259,11 @@ function lcSendValueAndPlugHtmlInDiv(getUrl, resultDiv, context, postLoadFunctio
}
-
/*
* Send a query via ajax that results in html plugged into the correct div
*/
-function lcSendValueAndCallbackHtmlAfterErrorCheck(getUrl,divForAjaxError, divForLoadingGif, callbackFunction) {
+function lcSendValueAndCallbackHtmlAfterErrorCheck(getUrl, divForAjaxError,
+ divForLoadingGif, callbackFunction) {
prepareForCall();
if (getUrl.length == 0) {
@@ -281,10 +280,14 @@ function lcSendValueAndCallbackHtmlAfterErrorCheck(getUrl,divForAjaxError, divFo
$.get(context + getUrl, function(data) {
checkAjaxResultForError(data);
$(divForLoadingGif).html("");
- var myHtml = data;
- callbackFunction(myHtml);
+ if (callbackFunction != null) {
+ var myHtml = data;
+ callbackFunction(myHtml);
+ } else {
+ $(divForLoadingGif).html(data);
+ }
}, "html");
-
+
$(divForAjaxError).ajaxError(function(e, xhr, settings, exception) {
$(divForLoadingGif).html("");
checkAjaxResultForError(xhr.responseText);
@@ -298,11 +301,12 @@ function lcSendValueAndCallbackHtmlAfterErrorCheck(getUrl,divForAjaxError, divFo
}
-
/*
- * Send a query via ajax that results in json that will be returned to a callback function
+ * Send a query via ajax that results in json that will be returned to a
+ * callback function
*/
-function lcSendValueAndCallbackWithJsonAfterErrorCheck(getUrl, parms, divForAjaxError, callbackFunction) {
+function lcSendValueAndCallbackWithJsonAfterErrorCheck(getUrl, parms,
+ divForAjaxError, callbackFunction) {
prepareForCall();
if (getUrl.length == 0) {
@@ -314,7 +318,7 @@ function lcSendValueAndCallbackWithJsonAfterErrorCheck(getUrl, parms, divForAja
$.get(context + getUrl, parms, function(data) {
callbackFunction(data);
}, "json");
-
+
$(divForAjaxError).ajaxError(function(e, xhr, settings, exception) {
checkAjaxResultForError(xhr.responseText);
});
@@ -331,5 +335,5 @@ function lcFillInDivWithHtml(data, resultDiv, postLoadFunction) {
if (postLoadFunction != null) {
postLoadFunction(data);
}
-
+
}