vendredi 10 avril 2015

How to show files in a list only for one parameter URL address

Imagine we have three users that need to access a list of files in a page we call



listOfFile.gsp




<g:each in="${documentInstanceList}" status="i" var="documentInstance">
<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
<td><g:link action="download" id="${documentInstance.id}">${documentInstance.filename}</g:link></td>
<td><g:link id="${documentInstance.id}">${documentInstance.fileSize}MB</g:link></td>
<td><g:formatDate date="${documentInstance.uploadDate}" /></td>
<td><span class="button"><g:actionSubmit class="delete" controller="Document" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span></td>
</tr>
</g:each>


now Imagine we have a page called selection.gsp, that have a dropdown menu of three users selection, whichever they click the three of them should direct to listOfFiles.gsp


However the only difference is the parameter assigned below. So the URL will be different


example if we click on user1, will have this URL address:



http://localhost:8080/file_down/document/listOfFiles?company=user1



in this URL address, there are files in the list I do not want to show, is there a way to do that ?



<ul class="dropdown-menu" role="menu">
<li><g:link controller='Document' action='list' params='[company:"user1"]'>user1</g:link></li>
<li><g:link controller='Document' action='list' params='[company:"user2"]'>user2</g:link></li>
<li><g:link controller='Document' action='list' params='[company:"user3"]'>user3</g:link></li>
</ul>




Aucun commentaire:

Enregistrer un commentaire