Klasse DUUIComponentController
java.lang.Object
org.texttechnologylab.duui.api.controllers.components.DUUIComponentController
A Controller for database operations related to the components collection.
- Autor:
- Cedric Borkowski
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic voiddeleteMany(org.bson.conversions.Bson filter) Delete all components matching a given filterstatic booleanAttempt to delete a component given its id.static List<org.bson.Document> findMany(MongoDBFilters filters) Retrieve one or more components from the database given aMongoDBFiltersobject.static org.bson.DocumentfindOneById(String id) Retrieve one component given its id.static org.bson.DocumentCreate and retrieve a default component.static org.bson.DocumentCreate and retrieve default options for a component.static org.bson.DocumentinsertOne(org.bson.Document component) Attempt to create and insert a new component into the database.static org.bson.DocumentmergeOptions(org.bson.Document options) Given aDocumentof options for a component, compare to the default options by filling out missing values and checking invalid entries.static voidSets the index of the component, meaning the position in its pipeline.static org.bson.DocumentAttempt to update a component given its id and a JSON object with updates.
-
Konstruktordetails
-
DUUIComponentController
public DUUIComponentController()
-
-
Methodendetails
-
getDefaultComponent
public static org.bson.Document getDefaultComponent()Create and retrieve a default component.- Gibt zurück:
- a
Documentwith the default properties for a component set.
-
getDefaultOptions
public static org.bson.Document getDefaultOptions()Create and retrieve default options for a component.- Gibt zurück:
- a
Documentwith the default properties for options of a component set.
-
mergeOptions
public static org.bson.Document mergeOptions(org.bson.Document options) Given aDocumentof options for a component, compare to the default options by filling out missing values and checking invalid entries.- Parameter:
options- the user defined options for a component.- Gibt zurück:
- the options with added missing entries.
-
findOneById
Retrieve one component given its id.- Parameter:
id- A unique 24 character identifier generated by MongoDB.- Gibt zurück:
- A
Documentcontaining the component data or null if nothing matched.
-
findMany
Retrieve one or more components from the database given aMongoDBFiltersobject.- Parameter:
filters- AMongoDBFiltersobject that contains filter options.- Gibt zurück:
- A Document containing a list of matched components.
-
insertOne
public static org.bson.Document insertOne(org.bson.Document component) Attempt to create and insert a new component into the database.- Parameter:
component- the component to create- Gibt zurück:
- the inserted component.
-
updateOne
Attempt to update a component given its id and a JSON object with updates.- Parameter:
id- the id of the componentupdates- the JSON object with updates to the component- Gibt zurück:
- the updated component
-
deleteOne
Attempt to delete a component given its id.- Parameter:
id- the id of the component- Gibt zurück:
- a confirmation flag.
-
deleteMany
public static void deleteMany(org.bson.conversions.Bson filter) Delete all components matching a given filter- Parameter:
filter- ABsonfilter to delete only selected components
-
setIndex
Sets the index of the component, meaning the position in its pipeline.- Parameter:
id- The component's id.index- The index in the pipeline.
-