|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.module.core.MMTable
|
+--org.mmbase.module.core.MMObjectBuilder
|
+--org.mmbase.module.builders.MultiRelations
MultiRelations is a builder which creates 'virtual' nodes.
The nodes are build out of a set of fields from different nodes, combined through a complex query,
which is in turn based on the relations that exist between nodes.
The builder supplies a method to retrieve these virtual nodes, searchMultiLevelVector(int, java.util.Vector, java.lang.String, java.util.Vector, java.lang.String, java.util.Vector, java.util.Vector).
Other public methods in this builder function to handle the requests for data obtained from this particular node.
| Field Summary | |
static int |
SEARCH_ALL
Search for all relations. |
static int |
SEARCH_BOTH
Search for all valid relations. |
static int |
SEARCH_DESTINATION
Search for destinations, When searching relations, return only relations from source to deastination. |
static int |
SEARCH_EITHER
Search for eitehr destination or source. |
static int |
SEARCH_SOURCE
Seach for sources. |
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, REPLACE_CACHE, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual |
| Fields inherited from class org.mmbase.module.core.MMTable |
mmb, tableName |
| Constructor Summary | |
MultiRelations(MMBase m)
Creates an instance of the MultiRelations builder. |
|
| Method Summary | |
boolean |
create()
Creates a new builder table in the current database. |
int |
getDBType(java.lang.String fieldName)
Return a field's database type. |
java.lang.String |
getGUIIndicator(MMObjectNode node)
What should a GUI display for this node. |
java.lang.String |
getGUIIndicator(java.lang.String field,
MMObjectNode node)
What should a GUI display for this node/field combo. |
protected java.lang.String |
getRelationString(java.util.Vector alltables)
Creates a condition string which checks the relations between nodes. |
protected java.lang.String |
getRelationString(java.util.Vector alltables,
int searchdir)
Creates a condition string which checks the relations between nodes. |
protected java.lang.String |
getSelectString(java.util.Vector alltables,
java.util.Vector rfields)
Creates a select string for the Multi level query. |
byte[] |
getShortedByte(java.lang.String fieldname,
int number)
Get binary data of a database blob field. |
java.lang.String |
getShortedText(java.lang.String fieldname,
int number)
Get text from a blob field. |
protected java.lang.String |
getTableString(java.util.Vector alltables)
This method defines what is 'allowed' in tablenames. |
java.lang.Object |
getValue(MMObjectNode node,
java.lang.String fieldName)
Provides additional functionality when obtaining field values. |
protected java.lang.String |
idx2char(int idx)
Converts an index to a one-character string. |
int |
insert(java.lang.String owner,
MMObjectNode node)
Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided). |
java.util.Vector |
searchMultiLevelVector(int snode,
java.util.Vector fields,
java.lang.String pdistinct,
java.util.Vector tables,
java.lang.String where,
java.util.Vector orderVec,
java.util.Vector direction)
Return all the objects that match the searchkeys. |
java.util.Vector |
searchMultiLevelVector(java.util.Vector snodes,
java.util.Vector fields,
java.lang.String pdistinct,
java.util.Vector tables,
java.lang.String where,
java.util.Vector orderVec,
java.util.Vector direction)
Return all the objects that match the searchkeys. |
java.util.Vector |
searchMultiLevelVector(java.util.Vector snodes,
java.util.Vector fields,
java.lang.String pdistinct,
java.util.Vector tables,
java.lang.String where,
java.util.Vector orderVec,
java.util.Vector direction,
int searchdir)
Return all the objects that match the searchkeys. |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int SEARCH_BOTH
public static final int SEARCH_DESTINATION
public static final int SEARCH_SOURCE
public static final int SEARCH_ALL
public static final int SEARCH_EITHER
| Constructor Detail |
public MultiRelations(MMBase m)
m - the MMbase cloud creating the node| Method Detail |
public boolean create()
create in class MMObjectBuilder
public int insert(java.lang.String owner,
MMObjectNode node)
insert in class MMObjectBuilderowner - The administrator creating the nodenode - The object to insertpublic java.lang.String getGUIIndicator(MMObjectNode node)
getGUIIndicator in class MMObjectBuildernode - The node to displayString
public java.lang.String getGUIIndicator(java.lang.String field,
MMObjectNode node)
getGUIIndicator in class MMObjectBuildernode - The node to displayfield - the name field of the field to displayString, null if not specifiedpublic int getDBType(java.lang.String fieldName)
getDBType in class MMObjectBuilderthe - requested field's name
public java.lang.Object getValue(MMObjectNode node,
java.lang.String fieldName)
getValue in class MMObjectBuildernode - the node whos efields are queriesfield - the fieldname that is requested
public java.util.Vector searchMultiLevelVector(int snode,
java.util.Vector fields,
java.lang.String pdistinct,
java.util.Vector tables,
java.lang.String where,
java.util.Vector orderVec,
java.util.Vector direction)
snode - The number of the node to start the search with. The node has 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 contraint. this is in essence a SQL where clause, using the NodeManager names from the nodes as tablenames.
The syntax is either sql (if preceded by "WHERE') or
Examples: "WHERE people.email IS NOT NULL", "(authrel.creat=1) and (people.lastname='admin')"orderVec - the fieldnames on which you want to sort.direction - 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'.Vector containing all matching nodes
public java.util.Vector searchMultiLevelVector(java.util.Vector snodes,
java.util.Vector fields,
java.lang.String pdistinct,
java.util.Vector tables,
java.lang.String where,
java.util.Vector orderVec,
java.util.Vector direction)
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 contraint. this is in essence a SQL where clause, using the NodeManager names from the nodes as tablenames.
The syntax is either sql (if preceded by "WHERE') or
Examples: "WHERE people.email IS NOT NULL", "(authrel.creat=1) and (people.lastname='admin')"orderVec - the fieldnames on which you want to sort.direction - 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'.Vector containing all matching nodes
public java.util.Vector searchMultiLevelVector(java.util.Vector snodes,
java.util.Vector fields,
java.lang.String pdistinct,
java.util.Vector tables,
java.lang.String where,
java.util.Vector orderVec,
java.util.Vector direction,
int searchdir)
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 contraint. this is in essence a SQL where clause, using the NodeManager names from the nodes as tablenames.
The syntax is either sql (if preceded by "WHERE') or
Examples: "WHERE people.email IS NOT NULL", "(authrel.creat=1) and (people.lastname='admin')"orderVec - the fieldnames on which you want to sort.direction - 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'.Vector containing all matching nodes
protected java.lang.String getSelectString(java.util.Vector alltables,
java.util.Vector rfields)
alltables - the tablenames to userfields - the fields that were requestedStringprotected java.lang.String getTableString(java.util.Vector alltables)
protected java.lang.String getRelationString(java.util.Vector alltables)
alltables - the tablenames to useString
protected java.lang.String getRelationString(java.util.Vector alltables,
int searchdir)
alltables - the tablenames to usesearchdir - the directionality option to useStringprotected java.lang.String idx2char(int idx)
idx - the indexString
public java.lang.String getShortedText(java.lang.String fieldname,
int number)
getShortedText in class MMObjectBuilderfieldname - name of the fieldnumber - number of the object in the tableString containing the contents of a field as text
public byte[] getShortedByte(java.lang.String fieldname,
int number)
getShortedByte in class MMObjectBuilderfieldname - name of the fieldnumber - number of the object in the tablebyte containing the contents of a field as text
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||