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 void
deleteMany
(org.bson.conversions.Bson filter) Delete all components matching a given filterstatic boolean
Attempt to delete a component given its id.static List
<org.bson.Document> findMany
(MongoDBFilters filters) Retrieve one or more components from the database given aMongoDBFilters
object.static org.bson.Document
findOneById
(String id) Retrieve one component given its id.static org.bson.Document
Create and retrieve a default component.static org.bson.Document
Create and retrieve default options for a component.static org.bson.Document
insertOne
(org.bson.Document component) Attempt to create and insert a new component into the database.static org.bson.Document
mergeOptions
(org.bson.Document options) Given aDocument
of options for a component, compare to the default options by filling out missing values and checking invalid entries.static void
Sets the index of the component, meaning the position in its pipeline.static org.bson.Document
Attempt 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
Document
with 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
Document
with the default properties for options of a component set.
-
mergeOptions
public static org.bson.Document mergeOptions(org.bson.Document options) Given aDocument
of 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
Document
containing the component data or null if nothing matched.
-
findMany
Retrieve one or more components from the database given aMongoDBFilters
object.- Parameter:
filters
- AMongoDBFilters
object 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
- ABson
filter 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.
-