## Número de resultado que mostraremos por página
#set ($numResults4Page = 2)
#set ($muvas = $portal.getClass().forName("es.muvas.MuvasSemanticServices").newInstance())
#set($tags= $httpUtil.getParameter($httpUtil.decodeURL($request.attributes.CURRENT_URL), "tags", false))
#set($minusTags= $httpUtil.getParameter($httpUtil.decodeURL($request.attributes.CURRENT_URL), "minusTags", false))
#set ($page = $getterUtil.getInteger($httpUtil.getParameter($httpUtil.decodeURL($request.attributes.CURRENT_URL), "page", false)))
#set ($renderUrlWithoutPage = $stringUtil.remove($httpUtil.decodeURL($request.attributes.CURRENT_URL), "&page=$page",""))
#set ($renderUrlWithoutPage = $stringUtil.remove($httpUtil.decodeURL($request.attributes.CURRENT_URL), "page=$page",""))
#if ($page == 0)
#set ($page = 1)
#end
#set ($company = ""+$companyId)
#set ($renderUrl = $request.get("render-url"))
#set ($namespace = $request.get("portlet-namespace"))
## Comienzo div principal
<div class="results-grid">
<table class="taglib-search-iterator">
<tr class="portlet-section-header results-header">
<th class="col-1">#</th>
<th class="col-2">Nombre</th>
<th class="col-3">Contenido</th>
</tr>
#set($articlesVisorBaseUrl = "/web/guest/article/-/journal_content/56_INSTANCE_2ABK/")
#set($searchContainer = $muvas.searchJournalArticles($company, $tags, $minusTags, ""))
#set ($results = $searchContainer.getResults($numResults4Page, $page))
#set ($numPages = $searchContainer.getNumPages($numResults4Page))
#foreach ($result in $results)
#set ($articleUrl = $articlesVisorBaseUrl + $result.groupId + "/" + $result.articleId)
#if ($velocityCount % 2 == 0)
<tr class="portlet-section-alternate results-row alt"
onmouseover="this.className = 'portlet-section-alternate-hover results-row alt hover';" onmouseout="this.className = 'portlet-section-alternate results-row alt';">
<td align="left" class="col-1" colspan="1" valign="middle">
$result.index.
</td>
<td align="left" class="col-2" colspan="1" valign="middle">
$result.titlehighlight
</td>
<td align="left" class="col-3" colspan="1" valign="middle">
$result.content
<br />
<span style="font-size: xx-small;">
<br /><a title="Ver artículo: $result.title" href="$articleUrl">$result.title</a>
</span>
</td>
</tr>
#else
<tr class="portlet-section-body results-row"
onmouseover="this.className = 'portlet-section-body-hover results-row hover';" onmouseout="this.className = 'portlet-section-body results-row';">
<td align="left" class="col-1" colspan="1" valign="middle">
$result.index.
</td>
<td align="left" class="col-2" colspan="1" valign="middle">
$result.titlehighlight
</td>
<td align="left" class="col-3" colspan="1" valign="middle">
$result.content
<br />
<span style="font-size: xx-small;">
<br /><a title="Ver artículo: $result.title" href="$articleUrl">$result.title</a>
</span>
</td>
</tr>
#end
#end
</table>
#if ($searchContainer.length > 0)
<div class="taglib-search-iterator-page-iterator-bottom">
<div class="taglib-page-iterator">
#set ($last= $results.size() - 1)
<div class="search-results">
#set ($beginIndex = $results.get(0).index)
#set ($lastIndex = $results.get($last).index)
#if ($beginIndex == $lastIndex)
Mostrando resultado $beginIndex de $searchContainer.length resultados.
#else
Mostrando resultados $beginIndex - $lastIndex de $searchContainer.length resultados.
#end
</div>
<div class="search-pages">
<div class="delta-selector"> Items per Page
<select>
<option value="5">5</option>
<option value="10">10</option>
<option selected="selected" value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="75">75</option>
</select>
</div>
<script type="text/javascript">
function _submitMyPageIterator() {
var curValue = jQuery("option:selected", this).val();
var href = "${renderUrlWithoutPage}&page="+curValue;
location.href = href;
}
jQuery(
function() {
jQuery('.page-selector-select').change(_submitMyPageIterator);
}
);
</script>
<div class="page-selector"> Página
<select class="page-selector-select">
#foreach ($i in [1..$numPages])
#if ($i == $page)
<option selected="selected" value="$i">$i</option>
#else
<option value="$i">$i</option>
#end
#end
</select> de $numPages
</div>
<div class="page-links">
#set ($prev = $page - 1)
#set ($next = $page + 1)
#if ($page == 1)
<span class="first"> Primero </span>
<span class="previous"> Anterior </span>
#else
<a class="first" href="$httpUtil.addParameter($renderUrlWithoutPage, "page", 1)"> Primero </a>
<a class="previous" href="$httpUtil.addParameter($renderUrlWithoutPage, "page", $prev)"> Anterior </a>
#end
#if ($numPages == $page)
<span class="next"> Siguiente </span>
<span class="last"> Último </span>
#else
<a class="next" href="$httpUtil.addParameter($renderUrlWithoutPage, "page", $next)"> Siguiente </a>
<a class="last" href="$httpUtil.addParameter($renderUrlWithoutPage, "page", $numPages)"> Último </a>
#end
</div>
</div>
</div>
</div>
#end
</div>
martes, 16 de junio de 2009
Liferay: Mi visor
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario