<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi people, I'm truying to obtain the UserCreate of a file in the
result.jsp, with code:<br>
I've trying to use the CmsResource.getUserCreated() as you can see in
the following, but all the sintaxis that I've tried is wrong. <br>
Anyone could help me with it, please?<br>
I don't understand what to do with:<br>
<br>
<table summary="" border="1" cellpadding="3" cellspacing="0"
width="100%">
<tbody>
<tr class="TableRowColor" bgcolor="white">
<td align="right" valign="top" width="1%"><font size="-1"><code> <a
title="class in org.opencms.util"
href="../../../org/opencms/util/CmsUUID.html">CmsUUID</a></code></font></td>
<td><code><b><a
href="../../../org/opencms/file/CmsResource.html#getUserCreated%28%29">getUserCreated</a></b>()</code>
<br>
Returns the user id of the user who created this resource.</td>
</tr>
</tbody>
</table>
<br>
<br>
<%@ page buffer="none" import="org.opencms.main.*,
org.opencms.search.*, org.opencms.file.*, org.opencms.util.*,
org.opencms.jsp.*, java.util.*" %><% <br>
<br>
// Create a JSP action element<br>
org.opencms.jsp.CmsJspActionElement cms = new
CmsJspActionElement(pageContext, request, response);<br>
<br>
// Get the search manager<br>
CmsSearchManager searchManager = OpenCms.getSearchManager(); <br>
%><br>
<br>
<jsp:useBean id="search" scope="request"
class="org.opencms.search.CmsSearch"><br>
<jsp:setProperty name = "search" property="matchesPerPage"
param="matchesperpage"/><br>
<jsp:setProperty name = "search" property="displayPages"
param="displaypages"/><br>
<jsp:setProperty name = "search" property="*"/><br>
<% <br>
search.init(cms.getCmsObject()); <br>
%><br>
</jsp:useBean><br>
<br>
<html><br>
<head><br>
<title>Search result</title><br>
</head><br>
<br>
<body><br>
<img src=resources/logo_opencms_large.png alt="Alcatel Logo"
title="Alcatel Logo" width="250" height="63" border="0"
align="right"><br>
<h1>Search result</h1><br>
<br>
<%<br>
int resultno = 1;<br>
int pageno = 0;<br>
if (request.getParameter("searchPage")!=null) { <br>
pageno = Integer.parseInt(request.getParameter("searchPage"))-1;<br>
}<br>
resultno = (pageno*search.getMatchesPerPage())+1;<br>
<br>
String fields = search.getFields();<br>
if (fields==null) {<br>
fields = request.getParameter("fields");<br>
}<br>
<br>
List result = search.getSearchResult();<br>
if (result == null) {<br>
%><br>
<%<br>
if (search.getLastException() != null) { <br>
%><br>
<h3>Error</h3><br>
<%= search.getLastException().toString() %> <br>
<%<br>
}<br>
<br>
} else {<br>
<br>
ListIterator iterator = result.listIterator();<br>
%><br>
<h3><%= search.getSearchResult().size() %> Results found
for query <<%= search.getQuery() %>> in fields
<%= fields %></h3><br>
<%<br>
while (iterator.hasNext()) {<br>
CmsSearchResult entry = (CmsSearchResult)iterator.next();<br>
%><br>
<br>
<h3><%= resultno %>. <a
href="<%=
cms.link(cms.getRequestContext().removeSiteRoot(entry.getPath()))
%>"><%= entry.getTitle() %></a> (<%=
entry.getScore() %>%)</h3><br>
<h4>Keywords</h6><br>
<%= entry.getKeywords() %><br>
<h4>Content</h6><br>
<%= entry.getExcerpt() %><br>
<h4>Description</h6><br>
<%= entry.getDescription() %><br>
<h4>Last Modified Date</h6><br>
<%= entry.getDateLastModified() %><br>
<h4>Created by</h6><br>
<%=CmsResource.getUserCreated()%><br>
<h4>Path</h6><br>
<%= entry.getPath() %><br>
<br>
<br>
<br>
<HTML><br>
<br>
<HEAD><br>
<br>
</HEAD><br>
<br>
<BODY><br>
<BR><br>
<BR><br>
<BR><br>
</BODY><br>
<br>
</HTML><br>
<br>
<br>
<br>
<%<br>
resultno++; <br>
}<br>
}<br>
%> <br>
<%<br>
if (search.getPreviousUrl() != null) {<br>
%><br>
<input type="button" value="<< previous"
onclick="location.href='<%= cms.link(search.getPreviousUrl())
%>&fields=<%= fields %>';"><br>
<%<br>
}<br>
Map pageLinks = search.getPageLinks();<br>
Iterator i = pageLinks.keySet().iterator();<br>
while (i.hasNext()) {<br>
int pageNumber = ((Integer)i.next()).intValue();<br>
String pageLink = cms.link((String)pageLinks.get(new
Integer(pageNumber))); <br>
out.print(" ");<br>
if (pageNumber != search.getSearchPage()) {<br>
%><br>
<a href="<%= pageLink %>&fields=<%= fields
%>"><%= pageNumber %></a><br>
<%<br>
} else {<br>
%><br>
<span class="currentpage"><%= pageNumber
%></span><br>
<%<br>
}<br>
}<br>
if (search.getNextUrl() != null) {<br>
%><br>
<input type="button" value="next
>>" onclick="location.href='<%=
cms.link(search.getNextUrl()) %>&fields=<%= fields
%>';"><br>
<%<br>
} <br>
<br>
%><br>
<br>
</body><br>
<br>
<br>
Christian Steinert escribió:
<blockquote cite="mid1898120774@web.de" type="cite">
<pre wrap="">You have to read the file yourself.
The search index gives you just some selected information. If you need more infos then you have to read the file/folder from the virtual file system
Take a look at the class CmsResource and the method CmsObject.readResource(...)
christian
</pre>
<blockquote type="cite">
<pre wrap="">-----Ursprüngliche Nachricht-----
Von: The OpenCms mailing list <a class="moz-txt-link-rfc2396E" href="mailto:opencms-dev@opencms.org"><opencms-dev@opencms.org></a>
Gesendet: 02.08.06 18:52:51
An: The OpenCms mailing list <a class="moz-txt-link-rfc2396E" href="mailto:opencms-dev@opencms.org"><opencms-dev@opencms.org></a>
Betreff: Re: [opencms-dev] Created by in Search result
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">I've found the PARAM_EXPLORER_FILEUSERCREATED
public static final java.lang.String Request parameter name for the
explorer file user created from
org-opencms.workplace.commons.CmsPreferences, but I don't know how to
use it:
|public static final java.lang.String| |PARAM_EXPLORER_FILEUSERCREATED
<org/opencms/workplace/commons/CmsPreferences.html#PARAM_EXPLORER_FILEUSERCREATED>|
|"tabexfileusercreated"|
Thanks!!!
<a class="moz-txt-link-abbreviated" href="mailto:maria.freixes_graells@alcatel.es">maria.freixes_graells@alcatel.es</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hey!
Nobody knows a method from a class from I could obtain this value
"created by"?
Thanks!!
<a class="moz-txt-link-abbreviated" href="mailto:maria.freixes_graells@alcatel.es">maria.freixes_graells@alcatel.es</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello people!
I'm using the *CmsSearchResult *class for view my searches, but I
would like to view also de "created by"
field for a file, and this class doesn't have this method. Anyone
knows how can I obtain the "created by" in my result?
Thanks and best regards,
Maria
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
<pre wrap=""><!---->
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
<a class="moz-txt-link-freetext" href="http://smartsurfer.web.de/?mc=100071&distributionid=000000000071">http://smartsurfer.web.de/?mc=100071&distributionid=000000000071</a>
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>