[opencms-dev] Lucene Search & News Module, how to link a result ot the proper URL

Andres Garay ag at colombiaemb.org
Wed Jun 30 22:38:02 CEST 2004


It is really strange. I have the following definition:

            <contentDefinitions>
                <contentDefinition type="news">
 
<class>com.opencms.modules.homepage.news.NewsContentDefinition</class>
 
<initClass>net.grcomputing.opencms.search.lucene.NewsInitialization</ini
tClass>
                    <listMethod name="getNewsList">
                        <param type="java.lang.Integer">10</param>
                        <param type="java.lang.String">-1</param>
                    </listMethod>
                    <page uri="extras/news_item.html">
                        <param method="getIntId" name="id"/>
                    </page>
                </contentDefinition>
            </contentDefinitions>

However, on the search index, the link points to news_item_12.html
soemtimes and news_item.html?id=12 other times. I think it changes every
time the index is rebuilt.

Any ideas?

Andres Garay

-----Original Message-----
From: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org] On Behalf Of Stephan Hartmann
Sent: Tuesday, June 29, 2004 5:58 AM
To: opencms-dev at opencms.org
Subject: Re: [opencms-dev] Lucene Search & News Module, how to link a
result ot the proper URL

If you genereate the link in your result page with <cms:link> or
CmsJspActionElement.link(...) this is the reason why the link points to
/export/news_xxx.html. But if your news are statically exported this
should work fine. If you don't want that, you can disable static export
for /news.html by setting the page property export=false.
If you want your links to look like /news.html?id=xx you have to define
the page tag like this:
                   <page uri="/news.html">
                        <param method="getIntId" name="id"/>

Note: the link is stored in the lucene index, so if you modify this tag,
you have to regenerate your lucene index.


----- Original Message -----
From: "Andres Garay" <ag at colombiaemb.org>
To: <opencms-dev at opencms.org>
Sent: Monday, June 28, 2004 11:22 PM
Subject: [opencms-dev] Lucene Search & News Module, how to link a result
ot the proper URL


I'm being able to do a search using the Lucene module, and I'm searching
the news entered using the news module. However, when I display the
results, a news item has a link that points to /export/news_xx.html
where xx is the id of the news item.

I want the result to link to /news.html?id=xx So, there are two points
in this:
First, how do I take out the /export/ from the link? Is it by editing
the opencms.properties file?
Second, how do I change the page name and parameter th news.html?id=xx?
In the registry.xml file I have the following two lines for the news
content definition:
                   <page uri="/extras/news_item.html?">
                        <param method="getIntId" name="id"/> Obviously,
something is missing.

Andres Garay
_______________________________________________
This mail is send to you from the opencms-dev mailing list To change
your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev


_______________________________________________
This mail is send to you from the opencms-dev mailing list To change
your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list