|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.util.functions.FunctionProvider
org.mmbase.module.core.MMTable
org.mmbase.module.core.MMObjectBuilder
org.mmbase.module.core.VirtualBuilder
org.mmbase.module.core.ClusterBuilder
The builder for clusternodes.
Provides these methods to retrieve clusternodes:
getClusterNodes(SearchQuery)
to retrieve clusternodes using a SearchQuery (recommended).
getMultiLevelSearchQuery(List,List,String,List,String,List,List,int)
as a convenience method to create a SearchQuery
searchMultiLevelVector(List,List,String,List,String,List,List,int)
to retrieve clusternodes using a constraint string.
Individual nodes in a 'cluster' node can be retrieved by calling the node's
getNodeValue() method, using
the builder name (or step alias) as argument.
ClusterNode| Field Summary | |
static int |
SEARCH_ALL
Deprecated. use RelationStep.DIRECTIONS_ALL |
static int |
SEARCH_BOTH
Deprecated. use RelationStep.DIRECTIONS_BOTH
In future versions of MMBase (1.8 and up) this will be the default value |
static int |
SEARCH_DESTINATION
Deprecated. use RelationStep.DIRECTIONS_DESTINATION |
static int |
SEARCH_EITHER
Deprecated. use RelationStep.DIRECTIONS_EITHER.
In future versions of MMBase (1.8 and up) the default value will be
RelationStep.DIRECTIONS_BOTH |
static int |
SEARCH_SOURCE
Deprecated. use RelationStep.DIRECTIONS_SOURCE |
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctions, GUI_PARAMETERS, guiFunction, infoFunction, internalVersion, nodeCache, oType, searchAge, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, temporaryNodes, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunction |
| Fields inherited from class org.mmbase.module.core.MMTable |
maxNodesFromQuery, mmb, storageConnector, tableName |
| Fields inherited from class org.mmbase.util.functions.FunctionProvider |
functions |
| Constructor Summary | |
ClusterBuilder(MMBase m)
Creates ClusterBuilder instance. |
|
| Method Summary | |
String |
getBuilderNameFromField(String fieldName)
Determines the builder part of a specified field. |
List |
getClusterNodes(SearchQuery query)
Executes query, returns results as clusternodes or MMObjectNodes if the
query is a Node-query. |
FieldDefs |
getField(String fieldName)
Return a field. |
static String |
getFieldNameFromField(String fieldname)
Determines the fieldname part of a specified field (without the builder name). |
Collection |
getFields()
Return a copy of the list of field definitions of this table. |
List |
getFields(int order)
Gets the field definitions for the editor, sorted according to the specified order, and excluding the fields that have not been assigned a valid position (valid is >= 0). |
Map |
getFields(MMObjectNode node)
Get text from a blob field from a database. |
String |
getGUIIndicator(MMObjectNode node)
What should a GUI display for this node. |
protected String |
getGUIIndicator(MMObjectNode node,
Parameters pars)
What should a GUI display for this node/field combo. |
BasicSearchQuery |
getMultiLevelSearchQuery(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
int searchDir)
Deprecated. use getMultiLevelSearchQuery(List snodes, List fields, String pdistinct, List tables, String where,
List orderVec, List directions, int searchDir) |
BasicSearchQuery |
getMultiLevelSearchQuery(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
List searchDirs)
Creates search query that selects all the objects that match the searchkeys. |
MMObjectNode |
getNewNode(String owner)
Get a new node, using this builder as its parent. |
static int |
getSearchDir(String search)
Translates a string to a search direction constant. |
static String |
getSearchDirString(int search)
Translates a search direction constant to a string. |
byte[] |
getShortedByte(String fieldname,
int number)
Get binary data of a database blob field. |
String |
getShortedText(String fieldname,
int number)
Get text from a blob field. |
Vector |
searchMultiLevelVector(int snode,
Vector fields,
String pdistinct,
Vector tables,
String where,
Vector orderVec,
Vector direction)
Same as searchMultiLevelVector(snodes, fields, pdistinct, tables, where, orderVec, direction, RelationStep.DIRECTIONS_EITHER),
where snodes contains just the number specified by snode. |
Vector |
searchMultiLevelVector(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
int searchDir)
Deprecated. use searchMultiLevelVector(List snodes, List fields, String pdistinct, List tables, String where,
List orderVec, List directions, List searchDirs) |
Vector |
searchMultiLevelVector(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
List searchDirs)
Return all the objects that match the searchkeys. |
Vector |
searchMultiLevelVector(Vector snodes,
Vector fields,
String pdistinct,
Vector tables,
String where,
Vector orderVec,
Vector direction)
Same as searchMultiLevelVector(snodes, fields, pdistinct, tables, where, orderVec, direction, RelationStep.DIRECTIONS_EITHER). |
| Methods inherited from class org.mmbase.module.core.VirtualBuilder |
create, getDBState, getShortedByte, getShortedText, init, insert |
| Methods inherited from class org.mmbase.module.core.MMTable |
count, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, size |
| Methods inherited from class org.mmbase.util.functions.FunctionProvider |
addFunction, createParameters, getFunction, getFunctions, getFunctionValue |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int SEARCH_BOTH
RelationStep.DIRECTIONS_BOTH
In future versions of MMBase (1.8 and up) this will be the default value
public static final int SEARCH_DESTINATION
RelationStep.DIRECTIONS_DESTINATION
public static final int SEARCH_SOURCE
RelationStep.DIRECTIONS_SOURCE
public static final int SEARCH_ALL
RelationStep.DIRECTIONS_ALL
public static final int SEARCH_EITHER
RelationStep.DIRECTIONS_EITHER.
In future versions of MMBase (1.8 and up) the default value will be
RelationStep.DIRECTIONS_BOTH
| Constructor Detail |
public ClusterBuilder(MMBase m)
ClusterBuilder instance.
Must be called from the MMBase class.
m - the MMbase cloud creating the node| Method Detail |
public static int getSearchDir(String search)
public static String getSearchDirString(int search)
public MMObjectNode getNewNode(String owner)
getNewNode in class VirtualBuilderowner - The administrator creating the new node (ignored).
VirtualNode.public String getGUIIndicator(MMObjectNode node)
getGUIIndicator in class VirtualBuildernode - The node to display
String
protected String getGUIIndicator(MMObjectNode node,
Parameters pars)
getGUIIndicator in class MMObjectBuildernode - The node to displaypars - Parameters, see MMObjectBuilder.GUI_PARAMETERS
String, null if not specifiedpublic String getBuilderNameFromField(String fieldName)
fieldName - the name of the field
public static String getFieldNameFromField(String fieldname)
fieldname - the name of the field
public FieldDefs getField(String fieldName)
getField in class MMObjectBuilderfieldName - the requested field's name
public List getFields(int order)
MMObjectBuilder
getFields in class MMObjectBuilderorder - One of the sortorders defined in
CoreField
public Collection getFields()
MMObjectBuilder
getFields in class MMObjectBuilderCollection with the tables fieldspublic Map getFields(MMObjectNode node)
VirtualBuilder
getFields in class VirtualBuilder
public Vector searchMultiLevelVector(int snode,
Vector fields,
String pdistinct,
Vector tables,
String where,
Vector orderVec,
Vector direction)
searchMultiLevelVector(snodes, fields, pdistinct, tables, where, orderVec, direction, RelationStep.DIRECTIONS_EITHER),
where snodes contains just the number specified by snode.
searchMultiLevelVector(List, List, String, List, String, List, List, List)
public Vector searchMultiLevelVector(Vector snodes,
Vector fields,
String pdistinct,
Vector tables,
String where,
Vector orderVec,
Vector direction)
searchMultiLevelVector(snodes, fields, pdistinct, tables, where, orderVec, direction, RelationStep.DIRECTIONS_EITHER).
searchMultiLevelVector(List,List,String,List,String,List,List,int)
public Vector searchMultiLevelVector(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
int searchDir)
searchMultiLevelVector(List snodes, List fields, String pdistinct, List tables, String where,
List orderVec, List directions, List searchDirs)
QueryConvertor#setConstraint().
snodes - The numbers of the nodes to start the search with. These have to be present in the first table
listed in the tables parameter.fields - The fieldnames to return. This should include the name of the builder. Fieldnames without a builder prefix are ignored.
Fieldnames are accessible in the nodes returned in the same format (i.e. with manager indication) as they are specified in this parameter.
Examples: 'people.lastname'pdistinct - 'YES' indicates the records returned need to be distinct. Any other value indicates double values can be returned.tables - The builder chain. A list containing builder names.
The search is formed by following the relations between successive builders in the list. It is possible to explicitly supply
a relation builder by placing the name of the builder between two builders to search.
Example: company,people or typedef,authrel,people.where - The constraint, must be in one of the formats specified by QueryConvertor#setConstraint().
E.g. "WHERE news.title LIKE '%MMBase%' AND news.title > 100"sortFields - the fieldnames on which you want to sort.directions - A list of values containing, for each field in the order parameter, a value indicating whether the sort is
ascending (UP) or descending (DOWN). If less values are syupplied then there are fields in order,
the first value in the list is used for the remaining fields. Default value is 'UP'.searchDir - Specifies in which direction relations are to be
followed, this must be one of the values defined by this class.
Vector containing all matching nodes
public Vector searchMultiLevelVector(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
List searchDirs)
QueryConvertor#setConstraint().
snodes - The numbers of the nodes to start the search with. These have to be present in the first table
listed in the tables parameter.fields - The fieldnames to return. This should include the name of the builder. Fieldnames without a builder prefix are ignored.
Fieldnames are accessible in the nodes returned in the same format (i.e. with manager indication) as they are specified in this parameter.
Examples: 'people.lastname'pdistinct - 'YES' indicates the records returned need to be distinct. Any other value indicates double values can be returned.tables - The builder chain. A list containing builder names.
The search is formed by following the relations between successive builders in the list. It is possible to explicitly supply
a relation builder by placing the name of the builder between two builders to search.
Example: company,people or typedef,authrel,people.where - The constraint, must be in one of the formats specified by QueryConvertor#setConstraint().
E.g. "WHERE news.title LIKE '%MMBase%' AND news.title > 100"sortFields - the fieldnames on which you want to sort.directions - A list of values containing, for each field in the order parameter, a value indicating whether the sort is
ascending (UP) or descending (DOWN). If less values are syupplied then there are fields in order,
the first value in the list is used for the remaining fields. Default value is 'UP'.searchDirs - Specifies in which direction relations are to be followed. You can specify a direction for each
relation in the path. If you specify less directions than there are relations, the last specified direction is used
for the remaining relations. If you specify an empty list the default direction is BOTH.
Vector containing all matching nodes
public List getClusterNodes(SearchQuery query)
throws SearchQueryException
clusternodes or MMObjectNodes if the
query is a Node-query.
query - The query.
SearchQueryException - When an exception occurred while retrieving the results.SearchQueryHandler.getNodes(org.mmbase.storage.search.SearchQuery, org.mmbase.module.core.MMObjectBuilder)
public String getShortedText(String fieldname,
int number)
fieldname - name of the fieldnumber - number of the object in the table
String containing the contents of a field as text
public byte[] getShortedByte(String fieldname,
int number)
fieldname - name of the fieldnumber - number of the object in the table
byte containing the contents of a field as text
public BasicSearchQuery getMultiLevelSearchQuery(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
int searchDir)
getMultiLevelSearchQuery(List snodes, List fields, String pdistinct, List tables, String where,
List orderVec, List directions, int searchDir)
QueryConvertor#setConstraint().
snodes - null or a list of numbers
of nodes to start the search with.
These have to be present in the first table listed in the
tables parameter.fields - List of fieldnames to return.
These should be formatted as stepalias.field,
e.g. 'people.lastname'pdistinct - 'YES' if the records returned need to be
distinct (ignoring case).
Any other value indicates double values can be returned.tables - The builder chain, a list containing builder names.
The search is formed by following the relations between
successive builders in the list.
It is possible to explicitly supply a relation builder by
placing the name of the builder between two builders to search.
Example: company,people or typedef,authrel,people.where - The constraint, must be in one of the formats specified by QueryConvertor#setConstraint().
E.g. "WHERE news.title LIKE '%MMBase%' AND news.title > 100"sortFields - null or a list of fieldnames on which you want to sort.directions - null or a list of values containing, for each field in the
sortFields parameter, a value indicating whether the sort is
ascending (UP) or descending (DOWN).
If less values are supplied then there are fields in order,
the first value in the list is used for the remaining fields.
Default value is 'UP'.searchDir - Specifies in which direction relations are to be
followed, this must be one of the values defined by this class.
public BasicSearchQuery getMultiLevelSearchQuery(List snodes,
List fields,
String pdistinct,
List tables,
String where,
List sortFields,
List directions,
List searchDirs)
QueryConvertor#setConstraint().
snodes - null or a list of numbers
of nodes to start the search with.
These have to be present in the first table listed in the
tables parameter.fields - List of fieldnames to return.
These should be formatted as stepalias.field,
e.g. 'people.lastname'pdistinct - 'YES' if the records returned need to be
distinct (ignoring case).
Any other value indicates double values can be returned.tables - The builder chain, a list containing builder names.
The search is formed by following the relations between
successive builders in the list.
It is possible to explicitly supply a relation builder by
placing the name of the builder between two builders to search.
Example: company,people or typedef,authrel,people.where - The constraint, must be in one of the formats specified by QueryConvertor#setConstraint().
E.g. "WHERE news.title LIKE '%MMBase%' AND news.title > 100"sortFields - null or a list of fieldnames on which you want to sort.directions - null or a list of values containing, for each field in the
sortFields parameter, a value indicating whether the sort is
ascending (UP) or descending (DOWN).
If less values are supplied then there are fields in order,
the first value in the list is used for the remaining fields.
Default value is 'UP'.searchDirs - Specifies in which direction relations are to be
followed, this must be one of the values defined by this class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||