Forum Stats

  • 3,853,839 Users
  • 2,264,285 Discussions
  • 7,905,471 Comments

Discussions

Search Sort Error

648793
648793 Member Posts: 96
edited Sep 9, 2008 10:44AM in WebLogic Portal
Hi Guys

I am facing a strange error related to search sorting in WLP10.2
I have an explicit property (displayOrder), mapped to CM_NODE table as priority column.
I get right result if i use jsp search tag i.e <cm:search id="queryResult" useCache="true" query="<%=queryString%>" sortBy="displayOrder ASC" />
But if i use the Search API in the pageflow controller then i get an exception saying that "Invalid sort criteria "toProperty('displayOrder') ASC". Property "displayOrder" must be a system property or explicit property."
ContentContext context=new ContentContext();
SortCriteria sortCriteria[]={new SortCriteria("displayOrder", true)};
String queryString ="(cm_objectClass='"+selectedContentType+"')&&(cm_path like '/"+ROOT_ID+selectdFolderPath+"/*')"+
" && (!(cm_path like '/"+ROOT_ID+selectdFolderPath+"/*/*'))";
Expression expression=ExpressionHelper.parse(queryString );

Search search=new Search("/"+ROOT_ID,-1,sortCriteria,expression);
System.out.println("search="+search.toString());
ISearchManager searchManager=ContentManagerFactory.getSearchManager();

ISortableFilterablePagedList <Node> nodePagedList=null;
try
{
nodePagedList=searchManager.search(context, search);
}catch(Exception e)
{
e.printStackTrace();
}


This code used to work fine in WLP10.0.
Does any one know, has there been any changes in the API? or some one else has encountered the same problem?
==============================================================
Here is the full stacktrace:
<Aug 22, 2008 11:48:39 AM EDT> <Error> <ContentManagement> <BEA-000000> <
com.bea.content.RepositoryException: Invalid sort criteria "toProperty('displayOrder') ASC". Property "displayOrder" mus
t be a system property or explicit property.
at com.bea.content.expression.internal.FullTextSearchHelper.validatePropertyForSort(FullTextSearchHelper.java:40
4)
at com.bea.content.expression.internal.FullTextSearchHelper.validateSortCriteria(FullTextSearchHelper.java:171)
at com.bea.content.expression.internal.FullTextSearchHelper.validateSearch(FullTextSearchHelper.java:132)
at com.bea.content.federated.internal.SearchManagerImpl.search(SearchManagerImpl.java:53)
at com.alger.cms.content.location.ContentLocationController.folderSelected(ContentLocationController.java:78)
Truncated. see log file for complete stacktrace
>
com.bea.content.RepositoryException: Invalid sort criteria "toProperty('displayOrder') ASC". Property "displayOrder" mus
t be a system property or explicit property.
at com.bea.content.expression.internal.FullTextSearchHelper.validatePropertyForSort(FullTextSearchHelper.java:40
4)
at com.bea.content.expression.internal.FullTextSearchHelper.validateSortCriteria(FullTextSearchHelper.java:171)
at com.bea.content.expression.internal.FullTextSearchHelper.validateSearch(FullTextSearchHelper.java:132)
at com.bea.content.federated.internal.SearchManagerImpl.search(SearchManagerImpl.java:53)
at com.alger.cms.content.location.ContentLocationController.folderSelected(ContentLocationController.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java
:2044)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.c
ontinueChain(ActionInterceptors.java:64)
at org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptor.wrapAction(ActionInterceptor.java:184)

at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.i
nvoke(ActionInterceptors.java:50)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.c
ontinueChain(ActionInterceptors.java:58)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptor
s.java:87)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java
:2116)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)

at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.jav
a:686)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSup
port.java:142)
at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:106)
at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
at com.bea.netuix.servlets.controls.portlet.events.FirePageFlowActionDecorator.handleEvent(FirePageFlowActionDec
orator.java:101)
at com.bea.netuix.events.manager.EventManager.doFireEvents(EventManager.java:282)
at com.bea.netuix.events.manager.EventManager.fireEvents(EventManager.java:217)
at com.bea.netuix.nf.ControlLifecycle$4.postVisitRoot(ControlLifecycle.java:324)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:341)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:211)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:196)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
at com.bea.netuix.servlets.manager.PortalServlet.service(PortalServlet.java:686)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3393)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

Thanks

Comments

  • 657795
    657795 Member Posts: 11
    Hi,
    Have you tried to use instead of search method the postSearchSort. Then in the ISortableFilterablePagedList object you get you can run the reSort method like this

    results.reSort(SortOrder.ASCENDING,"displayOrder", Locale.getDefault());

    also you can inspect what properties are available to sort with getAllSortableProperties()

    if your properties doesn't show it may be your property is not in the CM_NODE table (I know you said it is, you can double check)

    hope it helps

    regards
  • 648793
    648793 Member Posts: 96
    Hi

    Thanks for the reply. I know i can do a post search sorting. But i think database sorting will faster. Moreover the product support it so its batter to use it. I have already opened a case. It seems they have messed it up in WLP10.2 :)
  • 657795
    657795 Member Posts: 11
    Can you share the case # you opened?
This discussion has been closed.