summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app
diff options
context:
space:
mode:
authormconway <michael.c.conway@gmail.com>2012-12-13 14:01:07 (GMT)
committer mconway <michael.c.conway@gmail.com>2012-12-13 14:01:07 (GMT)
commita9f78fe1e328652202ceda04da6dd6b187f69a09 (patch)
treeeecc817c351972b41bbfd0a99c117fc433a27dff /idrop-web/grails-app
parentd32e73cce8bf3b1c0bd0652e9e400a6a66f8eaef (diff)
downloadQCG-Data-a9f78fe1e328652202ceda04da6dd6b187f69a09.zip
QCG-Data-a9f78fe1e328652202ceda04da6dd6b187f69a09.tar.gz
QCG-Data-a9f78fe1e328652202ceda04da6dd6b187f69a09.tar.bz2
[#984] listing of starred
Diffstat (limited to 'idrop-web/grails-app')
-rwxr-xr-xidrop-web/grails-app/controllers/org/irods/mydrop/controller/HomeController.groovy17
-rw-r--r--idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy18
-rwxr-xr-xidrop-web/grails-app/views/browse/starDialog.gsp40
-rwxr-xr-xidrop-web/grails-app/views/home/index.gsp145
-rw-r--r--idrop-web/grails-app/views/home/quickViewList.gsp30
5 files changed, 173 insertions, 77 deletions
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/HomeController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/HomeController.groovy
index 51c3201..8e5520b 100755
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/HomeController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/HomeController.groovy
@@ -2,10 +2,12 @@ package org.irods.mydrop.controller
import org.irods.jargon.core.connection.IRODSAccount
import org.irods.jargon.core.utils.MiscIRODSUtils
+import org.irods.mydrop.service.StarringService;
class HomeController {
-
+ StarringService starringService
+
/**
* Interceptor grabs IRODSAccount from the SecurityContextHolder
*/
@@ -59,6 +61,19 @@ class HomeController {
render(view:"link", model:[absPath:filePath])
}
+
+ def starredCollections() {
+ log.info "starredCollections()"
+
+ def listing = starringService.listStarredCollections(irodsAccount, 0)
+ render(view:"quickViewList",model:[listing:listing])
+ }
+
+ def starredDataObjects() {
+ log.info "starredDataObjects()"
+ def listing = starringService.listStarredDataObjects(irodsAccount, 0)
+ render(view:"quickViewList",model:[listing:listing])
+ }
// FIXME: refactor into jargon-core
private IRODSAccount anonymousIrodsAccountForURIString(String uriString) {
diff --git a/idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy b/idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy
index 98467b6..fbc1c20 100644
--- a/idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy
+++ b/idrop-web/grails-app/services/org/irods/mydrop/service/StarringService.groovy
@@ -49,6 +49,24 @@ class StarringService {
}
+ List<IRODSStarredFileOrCollection> listStarredCollections(IRODSAccount irodsAccount, int pagingOffset) throws JargonException {
+ if (irodsAccount == null) {
+ throw new IllegalArgumentException("null irodsAccount");
+ }
+
+ IRODSStarringService irodsStarringService = new IRODSStarringServiceImpl(irodsAccessObjectFactory, irodsAccount)
+ return irodsStarringService.listStarredCollections(pagingOffset)
+ }
+
+ List<IRODSStarredFileOrCollection> listStarredDataObjects(IRODSAccount irodsAccount, int pagingOffset) throws JargonException {
+ if (irodsAccount == null) {
+ throw new IllegalArgumentException("null irodsAccount");
+ }
+
+ IRODSStarringService irodsStarringService = new IRODSStarringServiceImpl(irodsAccessObjectFactory, irodsAccount)
+ return irodsStarringService.listStarredDataObjects(pagingOffset)
+ }
+
diff --git a/idrop-web/grails-app/views/browse/starDialog.gsp b/idrop-web/grails-app/views/browse/starDialog.gsp
new file mode 100755
index 0000000..28e4379
--- /dev/null
+++ b/idrop-web/grails-app/views/browse/starDialog.gsp
@@ -0,0 +1,40 @@
+<div id="starDialog">
+
+ <div class="modal-header">
+ <h3><g:message code="heading.star.dialog"/></h3>
+ </div>
+
+ <div class="modal-body">
+
+ <fieldset id="verticalForm">
+ <label for="fileName"><g:message code="text.name" />:</label>
+ ${absPath}
+
+ <label for="description"><g:message code="text.description" />:</label>
+ <g:textArea name="description" value="" rows="5" cols="40"/>
+
+ <g:hiddenField name="absPath" id="absPath" value = "${absPath}" />
+ </fieldset>
+ </div>
+
+ <div class="modal-footer">
+ <div id="starDialogToolbar">
+ <div id="starDialogMenu" class="pull-right">
+ <button type="button" id="starFileButton"
+ value="update"
+ onclick="submitStarDialog()")><g:message code="default.button.update.label" /></button>
+ <button type="button" id="cancelStarButton"
+ value="cancelStar"
+ onclick="closeStarDialog()")><g:message code="text.cancel" /></button>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+
+ $(function() {
+ $("#starDialog").dialog({width:500, modal:true});
+ });
+
+</script>
diff --git a/idrop-web/grails-app/views/home/index.gsp b/idrop-web/grails-app/views/home/index.gsp
index 0520a43..5610d9b 100755
--- a/idrop-web/grails-app/views/home/index.gsp
+++ b/idrop-web/grails-app/views/home/index.gsp
@@ -2,96 +2,89 @@
<meta name="layout" content="mainNoSidebar" />
<g:javascript library="mydrop/home" />
</head>
-<div class="row-fluid">
- <div class="span12">
- <center><h1>iDrop Dashboard</h1></center>
- </div>
-<div class="row-fluid">
- <div class="span1 offset4" ><g:img dir="images" file="upload.png" style="margin-top:40px;" width="100" height="100"/></div>
- <div class="span4 well"><h2>Quick upload</h2> - Use this option to quickly upload files to iRODS, automatically organized based on rules on the current grid.</div>
-</div>
-<div class="row-fluid">
- <div class="span12">
- <center><h1>iDrop Quick Folders</h1></center>
- </div>
-</div>
-<g:render template="/common/browseLegend" />
-
<div>
-<h2>stuff</h2>
-<a href="#" id="tooltip" rel="tooltop" data-original-title="Testing 123!!!"> Sample Text</a>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#tooltip").tooltip({ selector: "a" });
- });
-</script>
+ <div class="row-fluid">
+ <div class="span12">
+ <center>
+ <h1>iDrop Dashboard</h1>
+ </center>
+ </div>
+ </div>
+ <div class="row-fluid well">
+ <div class="span1 offset4">
+ <g:img dir="images" file="upload.png" style="margin-top:5px;"
+ width="80" height="80" />
+ </div>
+ <div class="span2">
+ <button type="button" id="quickUpload" style="margin-top: 40px;">Quick
+ Upload</button>
+ </div>
+ </div>
+ <div class="row-fluid">
+ <div class="span12">
+ <center>
+ <h3>iDrop Quick Folders</h3>
+ </center>
+ </div>
+ </div>
+ <!-- <g:render template="/common/browseLegend" /> -->
-</div>
+
+ <div id="uploadDialog">
+ <!-- target div for creating upload dialogs -->
+ </div>
+ <div class="row-fluid">
+ <div class=span3>
+ <!-- nav for table -->
+ <ul class="nav nav-list">
+ <li class="nav-header">Starred</li>
+ <li id="quickStarredFiles" class="quicknav"><a href="#" onclick="quickViewShowStarredFiles()">Starred Files</a></li>
+ <li id="quickStarredFolders" class="quicknav"><a href="#" onclick="quickViewShowStarredFolders()">Starred Folders</a></li>
+ </ul>
-<div class="row-fluid">
- <div class="span8 offset2">
- <table class="table table-striped table-hover">
- <thead>
- <tr>
- <th></th>
- <th>Action</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><g:img dir="images" file="folder_icon.png" width="20" height="20"/></td>
- <td><i class="icon-folder-open"></i><i class="icon-upload"></i></td>
- <td>Some Name</td>
- <td>Description text</td>
- </tr>
- <tr>
- <td><g:img dir="images" file="folder_icon.png" width="20" height="20"/></td>
- <td><i class="icon-folder-open"></i><i class="icon-upload"></i></td>
- <td>Some Name</td>
- <td>Description text</td>
- </tr>
- <tr>
- <td><g:img dir="images" file="folder_icon.png" width="20" height="20"/></td>
- <td><i class="icon-folder-open"></i><i class="icon-upload"></i></td>
- <td>Some Name</td>
- <td>Description text</td>
- </tr>
- <tr>
- <td><g:img dir="images" file="folder_icon.png" width="20" height="20"/></td>
- <td><i class="icon-folder-open"></i><i class="icon-upload"></i></td>
- <td>Some Name</td>
- <td>Description text</td>
- </tr>
- <tr>
- <td><g:img dir="images" file="folder_icon.png" width="20" height="20"/></td>
- <td><i class="icon-folder-open"></i><i class="icon-upload"></i></td>
- <td>Some Name</td>
- <td>Description text</td>
- </tr>
- <tr>
- <td><g:img dir="images" file="folder_icon.png" width="20" height="20"/></td>
- <td><i class="icon-folder-open"></i><i class="icon-upload"></i></td>
- <td>Some Name</td>
- <td>Description text</td>
- </tr>
- </tbody>
-
- </table>
+ </div>
+ <div id="quickViewListContainer" class="span8"></div>
</div>
</div>
<script type="text/javascript">
-
$(document).ready(function() {
$.ajaxSetup({
cache : false
});
$("#topbarHome").addClass("active");
+ quickViewShowStarredFiles();
});
-</script>
+
+
+ function quickViewShowStarredFolders() {
+ resetQuicknav();
+ $("#quickStarredFolders").addClass("active");
+ var url = "/home/starredCollections";
+ var params = {
+
+ }
+ lcSendValueWithParamsAndPlugHtmlInDiv(url, params, "#quickViewListContainer", null);
+ }
+
+
+ function quickViewShowStarredFiles() {
+ resetQuicknav();
+ $("#quickStarredFiles").addClass("active");
+ var url = "/home/starredDataObjects";
+ var params = {
+
+ }
+ lcSendValueWithParamsAndPlugHtmlInDiv(url, params, "#quickViewListContainer", null);
+ }
+
+ function resetQuicknav() {
+ $(".quicknav").removeClass("active");
+ }
+
+
+</script> \ No newline at end of file
diff --git a/idrop-web/grails-app/views/home/quickViewList.gsp b/idrop-web/grails-app/views/home/quickViewList.gsp
new file mode 100644
index 0000000..940a21d
--- /dev/null
+++ b/idrop-web/grails-app/views/home/quickViewList.gsp
@@ -0,0 +1,30 @@
+ <%@page import="org.irods.jargon.core.query.MetaDataAndDomainData" %>
+<table class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th></th>
+ <th>Action</th>
+ <th>Name</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <g:each in="${listing}" var="entry">
+ <tr>
+ <g:if test="${entry.metadataDomain == MetaDataAndDomainData.MetadataDomain.COLLECTION}">
+ <td><g:img dir="images" file="folder_icon.png" width="20"
+ height="20" /></td>
+ <td><i class="icon-folder-open"></i><i class="icon-upload"></i></td>
+ <td>${entry.domainUniqueName}</td> <td>${entry.description}</td>
+ </g:if>
+ <g:else>
+ <td><g:img dir="images" file="file.png" width="20"
+ height="20" /></td>
+ <td><i class="icon-folder-open"></i><i class="icon-downloadload"></i></td>
+ <td>${entry.domainUniqueName}</td> <td>${entry.description}</td>>
+ </g:else>
+ </tr>
+ </g:each>
+ </tbody>
+
+</table> \ No newline at end of file