Java Doc for Search.java in  » Portal » Open-Portal » com » sun » portal » search » demo » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.search.demo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.portal.search.demo.Search

All known Subclasses:   com.sun.portal.search.providers.SearchContext,
Search
public class Search (Code)
Search encapsulation class.


Field Summary
protected  StringRDMServer
    
protected  StringRDMType
     The RDM request type.
protected  StringSSOToken
     Identity Server Single Sign On token.
protected  Stringdatabase
     The comma delimited list of databases to be searched.
protected  intfirstHit
     The first hit to be returned (counting from 1).
public  StringproxyDN
    
protected  Stringquery
     The fully formatted URL query string that will be sent to the server.
protected  StringqueryLanguage
     The query language.
protected  Stringscope
     The query string.
protected  StringviewAttributes
     The comma delimited requested result attribute list.
protected  intviewHits
     The maximum number of results requested.
protected  StringviewOrder
     The comma delimited sort order w/ +ascending and -descending.

Eg, "-score,+title".


Constructor Summary
public  Search()
     Constructor.
public  Search(String scope, String RDMServer)
     Constructor.

Default values implicit in this constructor are:
- viewAttributes: null.

public  Search(String scope, String viewAttributes, String viewOrder, int firstHit, int viewHits, String queryLanguage, String database, String RDMServer, String ssoToken)
     Constructor.

Method Summary
public  voiddoQuery()
     Execute the query.
public  voiddoQuery(boolean catchException)
    
public  voiddoQuery(int firstHit, int viewHits)
     Execute the query, returning viewHits hits starting at firstHit.
public  StringgetDatabase()
    
public  intgetDocumentCount()
     The total number of documents available to be searched.
public  intgetFirstHit()
     Get the starting hit offset.
public  intgetHitCount()
     The total number of results that matched the search.
public  StringgetProxyDN()
     Returns the current target DN for the search.
public  StringgetQuery()
     Return the fully formatted query url sent to the server.
public  StringgetQueryLanguage()
     Returns the current query language.
public  SOIFgetRDMHeaderSOIF()
     Return the SOIF RDM result header.
public  StringgetRDMServer()
     Returns the current RDMServer variable.
public  StringgetRDMType()
     Returns the current RDMType.
public  intgetResultCount()
     The number of results returned by the search.
public  SOIFInputStreamgetResultStream()
     Return results as a DataInputStream.
public  StringgetScope()
     Returns the current scope (query) for the search.
public  StringgetSessionID()
    
public  intgetToHit()
    
public  StringgetViewAttributes()
    
public  intgetViewHits()
     Get the maximum number of hits returned.
public  StringgetViewOrder()
     Gets the sorting order for results.

Parameters:
  strVal - A null string will return sorting according tothe server default of -score (descending relevance).
public  booleannoHits()
    
public  voidsetDatabase(String database)
    
public  voidsetFirstHit(int firstHit)
     Set the starting hit offset.
public  voidsetProxyDN(String proxyDN)
     Sets the target DN for the search.
public  voidsetQueryLanguage(String queryLanguage)
     Sets the query language.
Parameters:
  queryLanguage - Can be one of:
  • search: The default query language.
public  voidsetRDMServer(String RDMServer)
     Sets the RDMServer variable.
public  voidsetRDMType(String RDMType)
     Sets the RDM Request type.
Parameters:
  RDMType - Can be one of:
  • rd-request: The default request.
public  voidsetSOIFParse(boolean b)
     Set whether SOIF parsing is to be done or not.
public  voidsetScope(String scope)
     Sets the scope (query) for the search.
public  voidsetSessionID(String sessID)
    
public  voidsetStreamMode(boolean m)
     Sets whether streaming is enabled or disabled. By default, this is set to false.
When stream mode is enabled, the search results RDM header SOIF will still be parsed, so that result, hit and document counts are available, but the document hit data will not be parsed.
public  voidsetViewAttributes(String viewAttributes)
     Sets the SOIF attributes which are returned for the search.
public  voidsetViewHits(int viewHits)
     Set the maximum number of hits returned.
public  voidsetViewOrder(String viewOrder)
     Sets the sorting order for results.

Parameters:
  viewOrder - A null string will return sorting according tothe server default of -score (descending relevance).
public  StringtoString()
     Return debug string version of Search instance.

Field Detail
RDMServer
protected String RDMServer(Code)
The RDM server URL



RDMType
protected String RDMType(Code)
The RDM request type.



SSOToken
protected String SSOToken(Code)
Identity Server Single Sign On token.



database
protected String database(Code)
The comma delimited list of databases to be searched.



firstHit
protected int firstHit(Code)
The first hit to be returned (counting from 1).



proxyDN
public String proxyDN(Code)



query
protected String query(Code)
The fully formatted URL query string that will be sent to the server.



queryLanguage
protected String queryLanguage(Code)
The query language.



scope
protected String scope(Code)
The query string.



viewAttributes
protected String viewAttributes(Code)
The comma delimited requested result attribute list.



viewHits
protected int viewHits(Code)
The maximum number of results requested.



viewOrder
protected String viewOrder(Code)
The comma delimited sort order w/ +ascending and -descending.

Eg, "-score,+title". Default value is "-score".





Constructor Detail
Search
public Search()(Code)
Constructor.



Search
public Search(String scope, String RDMServer)(Code)
Constructor.

Default values implicit in this constructor are:
- viewAttributes: null. Return all attributes
- viewOrder: null. Return server default (ie, sorted by relevance)
- firsthit: 1. Start hits at hit number 1
- viewhits: 10. Return 10 hits only
- query language: search. Search documents
- database: null. Use the default database for the server

Parameters:
  scope - the query qualification
Parameters:
  RDMServer - Search server URL, eg, http://portal.siroe.com:2222/portal/search
since:
   3.01C




Search
public Search(String scope, String viewAttributes, String viewOrder, int firstHit, int viewHits, String queryLanguage, String database, String RDMServer, String ssoToken)(Code)
Constructor.
Parameters:
  scope - the search query
Parameters:
  viewAttributes - comma delimited desired result attributes
Parameters:
  viewOrder - comma delimited sort order w/ +ascend and -descend
Parameters:
  firstHit - first requested hit (numbered from 1)
Parameters:
  viewHits - number of results requested (starting with the firstHit result)
Parameters:
  queryLanguage - query language
Parameters:
  database - name (can be null for server's default database)
Parameters:
  RDMServer - Search server URL, eg, http://portal.siroe.com:2222/portal/search
Parameters:
  sessID - Identity Server single sign-on session ID




Method Detail
doQuery
public void doQuery()(Code)
Execute the query.

Note: Query results are concatenated into a single StringBuffer. Use Search.doQuery(int,int) to process search results iteratively.




doQuery
public void doQuery(boolean catchException) throws Exception(Code)



doQuery
public void doQuery(int firstHit, int viewHits)(Code)
Execute the query, returning viewHits hits starting at firstHit.



getDatabase
public String getDatabase()(Code)



getDocumentCount
public int getDocumentCount()(Code)
The total number of documents available to be searched.
since:
   3.01C



getFirstHit
public int getFirstHit()(Code)
Get the starting hit offset.
See Also:   Search.setFirstHit



getHitCount
public int getHitCount()(Code)
The total number of results that matched the search.
since:
   3.01C



getProxyDN
public String getProxyDN()(Code)
Returns the current target DN for the search.
See Also:   Search.setProxyDN
since:
   6.3



getQuery
public String getQuery()(Code)
Return the fully formatted query url sent to the server.



getQueryLanguage
public String getQueryLanguage()(Code)
Returns the current query language.
See Also:   Search.setQueryLanguage
since:
   3.01C



getRDMHeaderSOIF
public SOIF getRDMHeaderSOIF()(Code)
Return the SOIF RDM result header.



getRDMServer
public String getRDMServer()(Code)
Returns the current RDMServer variable.
since:
   3.01C



getRDMType
public String getRDMType()(Code)
Returns the current RDMType.
See Also:   Search.setRDMType
since:
   3.01C



getResultCount
public int getResultCount()(Code)
The number of results returned by the search. Returns -1 on error. The result count is based on the RDM header SOIF, so if doSOIFParse is false, -1 will be returned.
since:
   3.01C



getResultStream
public SOIFInputStream getResultStream()(Code)
Return results as a DataInputStream. Can only be used if stream mode is enabled.
See Also:   Search.setStreamMode



getScope
public String getScope()(Code)
Returns the current scope (query) for the search.
See Also:   Search.setScope
since:
   3.01C



getSessionID
public String getSessionID()(Code)



getToHit
public int getToHit()(Code)
Gets the last hit value being displayed firstHit+resultCount-1



getViewAttributes
public String getViewAttributes()(Code)
Returns the SOIF attributes which are retrieved by a search.
viewAttributes as set by setViewAttributes.A comma delimited list of attributes, returned by a search, eg
"score,title,description,url"
NB: a null string denotes that ALL SOIF attributes are returned.
See Also:   Search.setViewAttributes
since:
   3.01C



getViewHits
public int getViewHits()(Code)
Get the maximum number of hits returned.
See Also:   Search.setViewHits



getViewOrder
public String getViewOrder()(Code)
Gets the sorting order for results.

Parameters:
  strVal - A null string will return sorting according tothe server default of -score (descending relevance). A commadelimited list of attributes is accepted, with + to denoteascending order and - to denote descending order, eg
"-score,+title"

See Also:   Search.setViewOrder
since:
   3.01C



noHits
public boolean noHits()(Code)
true if no matches were found and false otherwise



setDatabase
public void setDatabase(String database)(Code)

Parameters:
  The - database name



setFirstHit
public void setFirstHit(int firstHit)(Code)
Set the starting hit offset.
See Also:   Search.setFirstHit



setProxyDN
public void setProxyDN(String proxyDN)(Code)
Sets the target DN for the search.
See Also:   Search.getProxyDN
since:
   6.3



setQueryLanguage
public void setQueryLanguage(String queryLanguage)(Code)
Sets the query language.
Parameters:
  queryLanguage - Can be one of:
  • search: The default query language. Searches documents or the taxonomy.
  • taxonomy-basic: Used for requesting branches or parts of the taxonomy.
  • schema-basic: Queries the search schema.
  • url: Retrieves RDs by url (scope=url).

See Also:   Search.getQueryLanguage
See Also:   Search.setRDMType
since:
   3.01C



setRDMServer
public void setRDMServer(String RDMServer)(Code)
Sets the RDMServer variable.
Parameters:
  RDMServer - Search server URL, eg, http://portal.siroe.com:2222/portal/search (Portal server)http://compass.siroe.com:2222/rdm/incoming (Compass server)
since:
   3.01C



setRDMType
public void setRDMType(String RDMType)(Code)
Sets the RDM Request type.
Parameters:
  RDMType - Can be one of:
  • rd-request: The default request. Resource descriptions (documents).
  • taxonomy-request: Taxonomy.
  • schema-request: The schema.
  • server-request: Server information.
  • status-request: Server status information.

See Also:   Search.getRDMType
See Also:   Search.setQueryLanguage
since:
   3.01C



setSOIFParse
public void setSOIFParse(boolean b)(Code)
Set whether SOIF parsing is to be done or not. By default, SOIF parsing is true.



setScope
public void setScope(String scope)(Code)
Sets the scope (query) for the search.
See Also:   Search.getScope
since:
   3.01C



setSessionID
public void setSessionID(String sessID)(Code)

Parameters:
  The - access token from the portal server



setStreamMode
public void setStreamMode(boolean m)(Code)
Sets whether streaming is enabled or disabled. By default, this is set to false.
When stream mode is enabled, the search results RDM header SOIF will still be parsed, so that result, hit and document counts are available, but the document hit data will not be parsed. Instead, use Search.getResultStream to access the document SOIF DataInputStream directly.
since:
   3.01C



setViewAttributes
public void setViewAttributes(String viewAttributes)(Code)
Sets the SOIF attributes which are returned for the search.
Parameters:
  viewAttributes - A null string will return all attributes.A comma delimited list of attributes is accepted, eg
"score,title,description,url"
See Also:   Search.getViewAttributes
since:
   3.01C



setViewHits
public void setViewHits(int viewHits)(Code)
Set the maximum number of hits returned.
See Also:   Search.getViewHits



setViewOrder
public void setViewOrder(String viewOrder)(Code)
Sets the sorting order for results.

Parameters:
  viewOrder - A null string will return sorting according tothe server default of -score (descending relevance). A comma delimitedlist of attributes is accepted, with + to denote ascending order and - todenote descending order, eg
"-score,-title,+description"

See Also:   Search.getViewOrder
since:
   3.01C



toString
public String toString()(Code)
Return debug string version of Search instance.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.