[jboss-svn-commits] JBL Code SVN: r18935 - in labs/jbossforums/branches/multipleforums110P26: forums/src/main/org/jboss/portlet/forums/search and 4 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Mar 13 15:17:04 EDT 2008
Author: unibrew
Date: 2008-03-13 15:17:04 -0400 (Thu, 13 Mar 2008)
New Revision: 18935
Removed:
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/CategoryIdBridge.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumIdBridge.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumNameBridge.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/MessageTextBridge.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/TopicSubjectBridge.java
Modified:
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml
labs/jbossforums/branches/multipleforums110P26/thirdparty/jboss-hibernate-search/lib/hibernate-search.jar
labs/jbossforums/branches/multipleforums110P26/thirdparty/jboss-hibernate-search/lib/lucene-core.jar
Log:
[JBFORUMS-2] Hibernate Search update to 3.0.1
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/CategoryImpl.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -14,6 +14,8 @@
import java.util.List;
import java.util.ArrayList;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Indexed;
import org.jboss.portlet.forums.model.Category;
import org.jboss.portlet.forums.model.Forum;
@@ -28,6 +30,7 @@
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
* @version $Revision: 916 $
*/
+ at Indexed(index="categories")
public class CategoryImpl
implements Serializable,
Category
@@ -39,6 +42,8 @@
private ForumInstance forumInstance;
private int order;
private String title;
+
+ @DocumentId
private Integer id;
/**
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/ForumImpl.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -22,6 +22,12 @@
import org.hibernate.Query;
import org.hibernate.Session;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
+import org.hibernate.search.annotations.Store;
import org.jboss.portlet.forums.ForumsModule;
import org.jboss.portlet.forums.model.Category;
@@ -38,6 +44,7 @@
* @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
* @version $Revision: 1124 $
*/
+ at Indexed(index="forums")
public class ForumImpl
implements Serializable,
Forum
@@ -50,10 +57,15 @@
setTopics(new ArrayList());
}
+ @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.CategoryImpl.class)
private Category category;
private String description;
+
+ @DocumentId
private Integer id;
//private Post lastPost;
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
private String name;
private int order;
private int topicCount;
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/MessageImpl.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -12,6 +12,8 @@
import java.io.Serializable;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
import org.jboss.portlet.forums.model.Message;
/**
@@ -27,9 +29,9 @@
Serializable,
Cloneable
{
- //@Field(index=Index.TOKENIZED)
private String subject = "";
- //@Field(index=Index.TOKENIZED)
+
+ @Field(index=Index.TOKENIZED)
private String text = "";
private boolean BBCodeEnabled = true;
private boolean HTMLEnabled = false;
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PostImpl.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -22,6 +22,7 @@
import org.hibernate.search.annotations.Fields;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Resolution;
import org.hibernate.search.annotations.Store;
import org.jboss.portal.identity.User;
@@ -43,18 +44,7 @@
Post
{
- @Fields( {
- @Field(name="subject", index=Index.TOKENIZED,
- bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.TopicSubjectBridge.class)),
- @Field(name="subject_forSort", index=Index.UN_TOKENIZED, store=Store.YES,
- bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.TopicSubjectBridge.class)),
- @Field(name="forumId", index=Index.UN_TOKENIZED, store=Store.YES,
- bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.ForumIdBridge.class)),
- @Field(name="forumName", index=Index.UN_TOKENIZED, store=Store.YES,
- bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.ForumNameBridge.class)),
- @Field(name="categoryId", index=Index.UN_TOKENIZED, store=Store.YES,
- bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.CategoryIdBridge.class))
- } )
+ @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.TopicImpl.class)
private Topic topic;
private User user;
private int count;
@@ -67,8 +57,7 @@
@DateBridge(resolution=Resolution.MINUTE)
private Date createDate;
- @Field(index=Index.TOKENIZED,
- bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.MessageTextBridge.class))
+ @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.MessageImpl.class)
private Message message;
@Field(name="userName", index=Index.UN_TOKENIZED, store=Store.YES,
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/PosterImpl.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -13,6 +13,12 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.FieldBridge;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.Store;
import org.jboss.portal.identity.User;
import org.jboss.portal.core.modules.ModuleConstants;
import org.jboss.portal.core.modules.ModuleException;
@@ -27,12 +33,17 @@
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
* @version $Revision: 2811 $
*/
+//@Indexed(index="posters")
public class PosterImpl
implements Poster
{
+ //@DocumentId
private Integer id;
private String userId;
//private String userName;
+
+ //@Field(name="userName", index=Index.UN_TOKENIZED, store=Store.YES,
+ // bridge=@FieldBridge(impl=org.jboss.portlet.forums.search.bridge.UserNameTextBridge.class))
private User user;
private int nbPosts = 0;
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/impl/TopicImpl.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -16,8 +16,10 @@
import org.hibernate.search.annotations.ContainedIn;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Fields;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Store;
import org.jboss.portlet.forums.model.*;
@@ -27,14 +29,18 @@
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
* @version $Revision: 916 $
*/
+ at Indexed(index="topics")
public class TopicImpl
implements Serializable,
Comparable,
Topic
{
+ @DocumentId
private Integer id;
private List posts;
+
+ @IndexedEmbedded(targetElement=org.jboss.portlet.forums.impl.ForumImpl.class)
private Forum forum;
private int viewCount;
//private Date date;
@@ -48,7 +54,11 @@
private int type;
private int status;
//private Topic target;
- //@Field(index=Index.TOKENIZED)
+
+ @Fields( {
+ @Field(index=Index.TOKENIZED),
+ @Field(name="subject_forSort", index=Index.UN_TOKENIZED, store=Store.YES)
+ } )
private String subject;
private List watches;
private Poll poll;
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsIndexBuilder.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -164,8 +164,6 @@
transaction = fullTextSession.beginTransaction();
ScrollableResults results = fullTextSession.createCriteria(PostImpl.class).
- //setFetchMode("topic", FetchMode.JOIN).
- //setFetchMode("topic.forum", FetchMode.JOIN).
setFetchMode("topic.forum.category", FetchMode.JOIN).
setFetchMode("poster", FetchMode.JOIN).
createCriteria("topic").
@@ -232,8 +230,6 @@
transaction = fullTextSession.beginTransaction();
ScrollableResults results = fullTextSession.createCriteria(PostImpl.class).
- //setFetchMode("topic", FetchMode.JOIN).
- //setFetchMode("topic.forum", FetchMode.JOIN).
setFetchMode("topic.forum.category", FetchMode.JOIN).
setFetchMode("poster", FetchMode.JOIN).
createAlias("topic", "t").
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/ForumsSearchModuleImpl.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -72,11 +72,11 @@
Searching searching = Searching.valueOf(criteria.getSearching());
switch(searching) {
case TITLE_MSG:
- fields = new String[] { "message", "subject" };
+ fields = new String[] { "message.text", "topic.subject" };
break;
case MSG:
- fields = new String[] { "message" };
+ fields = new String[] { "message.text" };
break;
}
@@ -87,18 +87,19 @@
String forumId = criteria.getForum();
if (forumId != null && forumId.length() != 0) {
- query.add(new TermQuery(new Term("forumId", forumId)), Occur.MUST);
+ query.add(new TermQuery(new Term("topic.forum.id", forumId)), Occur.MUST);
}
String categoryId = criteria.getCategory();
if (categoryId != null && categoryId.length() != 0) {
- query.add(new TermQuery(new Term("categoryId", categoryId)), Occur.MUST);
+ query.add(new TermQuery(new Term("topic.forum.category.id", categoryId)), Occur.MUST);
}
String userName = criteria.getAuthor();
if (userName != null && userName.length() != 0) {
//query.add(new TermQuery(new Term("userName", userName)), Occur.MUST);
//QueryParser parser = new QueryParser(userName, new StandardAnalyzer());
+ //query.add(new WildcardQuery(new Term("poster.userName", userName)), Occur.MUST);
query.add(new WildcardQuery(new Term("userName", userName)), Occur.MUST);
}
@@ -113,7 +114,7 @@
SortBy sortBy = SortBy.valueOf(criteria.getSortBy());
fullTextQuery.setSort(getSort(sortBy, sortOrder));
- fullTextQuery.setFirstResult(criteria.getPageSize() * criteria.getPageNumber() + 1);
+ fullTextQuery.setFirstResult(criteria.getPageSize() * criteria.getPageNumber());
fullTextQuery.setMaxResults(criteria.getPageSize());
ResultPage<Post> resultPage = new ResultPage<Post>();
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/SortBy.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -3,9 +3,9 @@
public enum SortBy {
POST_TIME("createDate"),
- POST_SUBJECT("subject_forSort"),
+ POST_SUBJECT("topic.subject_forSort"),
AUTHOR("userName"),
- FORUM("forumId");
+ FORUM("topic.forum.id");
private String fieldName;
Deleted: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/CategoryIdBridge.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/CategoryIdBridge.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/CategoryIdBridge.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -1,16 +0,0 @@
-package org.jboss.portlet.forums.search.bridge;
-
-import org.hibernate.search.bridge.builtin.StringBridge;
-import org.jboss.portlet.forums.model.Topic;
-
-public class CategoryIdBridge extends StringBridge {
-
- @Override
- public String objectToString(Object object) {
- Topic topic = (Topic) object;
-
- return topic.getForum().getCategory().getId().toString();
- }
-
-}
-
\ No newline at end of file
Deleted: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumIdBridge.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumIdBridge.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumIdBridge.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -1,15 +0,0 @@
-package org.jboss.portlet.forums.search.bridge;
-
-import org.hibernate.search.bridge.builtin.StringBridge;
-import org.jboss.portlet.forums.model.Topic;
-
-public class ForumIdBridge extends StringBridge {
-
- @Override
- public String objectToString(Object object) {
- Topic topic = (Topic) object;
-
- return topic.getForum().getId().toString();
- }
-
-}
Deleted: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumNameBridge.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumNameBridge.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/ForumNameBridge.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -1,17 +0,0 @@
-package org.jboss.portlet.forums.search.bridge;
-
-import org.hibernate.search.bridge.builtin.StringBridge;
-import org.jboss.portlet.forums.model.Topic;
-
-public class ForumNameBridge extends StringBridge {
-
- @Override
- public String objectToString(Object object) {
- Topic topic = (Topic) object;
-
- return topic.getForum().getName();
- }
-
-}
-
-
\ No newline at end of file
Deleted: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/MessageTextBridge.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/MessageTextBridge.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/MessageTextBridge.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -1,16 +0,0 @@
-package org.jboss.portlet.forums.search.bridge;
-
-import org.hibernate.search.bridge.builtin.StringBridge;
-import org.jboss.portlet.forums.model.Message;
-
-public class MessageTextBridge extends StringBridge {
-
- @Override
- public String objectToString(Object object) {
- Message message = (Message) object;
-
- return message.getText();
- }
-
-}
-
Deleted: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/TopicSubjectBridge.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/TopicSubjectBridge.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/TopicSubjectBridge.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -1,15 +0,0 @@
-package org.jboss.portlet.forums.search.bridge;
-
-import org.hibernate.search.bridge.builtin.StringBridge;
-import org.jboss.portlet.forums.model.Topic;
-
-public class TopicSubjectBridge extends StringBridge {
-
- @Override
- public String objectToString(Object object) {
- Topic topic = (Topic) object;
-
- return topic.getSubject();
- }
-
-}
\ No newline at end of file
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/search/bridge/UserNameTextBridge.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -35,6 +35,10 @@
}
return PortalUtil.getUserNA().getUserName();
+
+ /*User user = (User) object;
+
+ return user.getUserName();*/
}
}
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSearch.java 2008-03-13 19:17:04 UTC (rev 18935)
@@ -100,54 +100,32 @@
ResultPage<Post> resultPage = BaseController.getSearchModule().findPosts(criteria);
- if (resultPage != null) {
- posts = resultPage.getPage();
-
+ //if (resultPage != null) {
+ posts = resultPage.getPage();
+
if (posts.isEmpty())
posts = null;
- this.pageNavigator =
- new PageNavigator(resultPage.getResultSize(),
- criteria.getPageSize(),
- currentPage) {
+ this.pageNavigator =
+ new PageNavigator(resultPage.getResultSize(),
+ criteria.getPageSize(),
+ currentPage) {
- protected Collection<Post> initializePage() {
+ protected Collection<Post> initializePage() {
- int beginIndex = this.getBeginIndex();
- int totalEntries = this.getNumberOfEntries();
+ int beginIndex = this.getBeginIndex();
+ int totalEntries = this.getNumberOfEntries();
- //reset the page navigation if the start cursor is outside the range (both forward and backward)
- if(beginIndex >= totalEntries || beginIndex < 0)
- {
- this.setCurrentPage(0); //go to the first page
- beginIndex = this.getBeginIndex();
- }
-
- return getPosts();
+ //reset the page navigation if the start cursor is outside the range (both forward and backward)
+ if (beginIndex >= totalEntries || beginIndex < 0)
+ {
+ this.setCurrentPage(0); //go to the first page
+ beginIndex = this.getBeginIndex();
}
- };
- } else {
- this.pageNavigator =
- new PageNavigator(0,
- criteria.getPageSize(),
- currentPage) {
-
- protected Collection<Post> initializePage() {
-
- int beginIndex = this.getBeginIndex();
- int totalEntries = this.getNumberOfEntries();
- //reset the page navigation if the start cursor is outside the range (both forward and backward)
- if(beginIndex >= totalEntries || beginIndex < 0)
- {
- this.setCurrentPage(0); //go to the first page
- beginIndex = this.getBeginIndex();
- }
-
- return getPosts();
- }
- };
- }
+ return getPosts();
+ }
+ };
}
}
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml 2008-03-13 19:08:49 UTC (rev 18934)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml 2008-03-13 19:17:04 UTC (rev 18935)
@@ -27,7 +27,7 @@
<property name="hibernate.search.autoregister_listeners">false</property>
<property name="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</property>
- <property name="hibernate.search.default.indexBase">/Users/dejp/lucene/indexes</property>
+ <property name="hibernate.search.default.indexBase">/HibernateSearch/indexes</property>
<property name="hibernate.search.default.optimizer.operation_limit.max">2000</property>
<property name="org.hibernate.worker.batch_size">2000</property>
Modified: labs/jbossforums/branches/multipleforums110P26/thirdparty/jboss-hibernate-search/lib/hibernate-search.jar
===================================================================
(Binary files differ)
Modified: labs/jbossforums/branches/multipleforums110P26/thirdparty/jboss-hibernate-search/lib/lucene-core.jar
===================================================================
(Binary files differ)
More information about the jboss-svn-commits
mailing list