<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2>Maria -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2>The method .getUserCreated() is a method on a
<EM>instance</EM> of CmsResource, not on the class itself; so you'll need to get
an instance of CmsResource. That makes sense, since it's a
resource-specific result which you are seeking.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2>As you can see from the API for CmsSearchResult, the only
method of any use in getting hold of a resource is getPath(). Once you
have a resource's path, you can get the resource (i.e. an instance of
CmsResource) from cmsObject.readResourcePath(String relativeResourcePath) where
'cmsObject' is an instance of 'CmsObject'.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2>You need to be careful about what requires an absolute path
and what requires a relative one. Most methods in the OpenCms API expect
or return relative paths - that is, paths relative to the context provided in
prevailing instances of CmsObject, CmsRequestContext etc.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=075114511-03082006><FONT face=Arial
color=#0000ff size=2>Jon</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of
</B>maria.freixes_graells@alcatel.es<BR><B>Sent:</B> 03 August 2006
10:13<BR><B>To:</B> The OpenCms mailing list<BR><B>Subject:</B> Re:
[opencms-dev] Created by in Search result<BR></FONT><BR></DIV>
<DIV></DIV>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 cellSpacing=0 cellPadding=3 width="100%" summary="" border=1>
<TBODY>
<TR class=TableRowColor bgColor=white>
<TD vAlign=top align=right 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>