3D Repo Bouncer  1.4
Public Member Functions | List of all members
repo::manipulator::RepoManipulator Class Reference

Public Member Functions

void cleanUp (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &dbName, const std::string &projectName)
 
bool connectAndAuthenticate (std::string &errMsg, const std::string &address, const uint32_t &port, const uint32_t &maxConnections, const std::string &dbName, const std::string &username, const std::string &password, const bool &pwDigested=false)
 
bool connectAndAuthenticate (std::string &errMsg, const std::string &address, const uint32_t &port, const uint32_t &maxConnections, const std::string &dbName, const repo::core::model::RepoBSON *credentials)
 
bool connectAndAuthenticateWithAdmin (std::string &errMsg, const std::string &address, const uint32_t &port, const uint32_t &maxConnections, const std::string &username, const std::string &password, const bool &pwDigested=false)
 
bool commitScene (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene, const std::string &owner="", const std::string &tag="", const std::string &desc="")
 
void compareScenes (repo::core::model::RepoScene *base, repo::core::model::RepoScene *compare, repo_diff_result_t &baseResults, repo_diff_result_t &compResults, const repo::DiffMode &diffMode, const repo::core::model::RepoScene::GraphType &gType=repo::core::model::RepoScene::GraphType::DEFAULT)
 
repo::core::model::RepoBSONcreateCredBSON (const std::string &databaseAd, const std::string &username, const std::string &password, const bool &pwDigested)
 
repo::core::model::RepoScenecreateFederatedScene (const std::map< repo::core::model::TransformationNode, repo::core::model::ReferenceNode > &fedMap)
 
repo::core::model::RepoScenecreateMapScene (const repo::core::model::MapNode &mapNode)
 
uint64_t countItemsInCollection (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &collection, std::string &errMsg)
 
void disconnectFromDatabase (const std::string &databaseAd)
 
bool dropCollection (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &databaseName, const std::string &collectionName, std::string &errMsg)
 
bool dropDatabase (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &databaseName, std::string &errMsg)
 
std::list< std::string > fetchDatabases (const std::string &databaseAd, const repo::core::model::RepoBSON *cred)
 
std::list< std::string > fetchCollections (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database)
 
repo::core::model::RepoScenefetchScene (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &collection, const repoUUID &uuid, const bool &headRevision=false, const bool &lightFetch=false)
 
void fetchScene (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene)
 
bool generateAndCommitSelectionTree (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene)
 
bool generateAndCommitStashGraph (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene)
 
bool generateAndCommitWebViewBuffer (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene, repo_web_buffers_t &buffers, const modelconvertor::WebExportType &exType)
 
bool generateAndCommitGLTFBuffer (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene)
 
bool generateAndCommitSRCBuffer (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene)
 
repo_web_buffers_t generateGLTFBuffer (repo::core::model::RepoScene *scene)
 
repo_web_buffers_t generateSRCBuffer (repo::core::model::RepoScene *scene)
 
bool generateStashGraph (repo::core::model::RepoScene *scene)
 
std::vector< repo::core::model::RepoBSONgetAllFromCollectionTailable (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &collection, const uint64_t &skip=0, const uint32_t &limit=0)
 
std::vector< repo::core::model::RepoBSONgetAllFromCollectionTailable (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &collection, const std::list< std::string > &fields, const std::string &sortField=std::string(), const int &sortOrder=-1, const uint64_t &skip=0, const uint32_t &limit=0)
 
repo::core::model::CollectionStats getCollectionStats (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &collection, std::string &errMsg)
 
std::map< std::string, std::list< std::string > > getDatabasesWithProjects (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::list< std::string > &databases)
 
std::list< std::string > getAdminDatabaseRoles (const std::string &databaseAd)
 
repo::core::model::RepoRoleSettings getRoleSettingByName (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &uniqueRoleName)
 
std::shared_ptr< repo_partitioning_tree_tgetScenePartitioning (const repo::core::model::RepoScene *scene, const uint32_t &maxDepth=8)
 
std::list< std::string > getStandardDatabaseRoles (const std::string &databaseAd)
 
std::string getNameOfAdminDatabase (const std::string &databaseAd) const
 
bool hasCollection (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &dbName, const std::string &project)
 
bool hasDatabase (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &dbName)
 
void insertBinaryFileToDatabase (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &collection, const std::string &name, const std::vector< uint8_t > &rawData, const std::string &mimeType="")
 
void insertRole (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const repo::core::model::RepoRole &role)
 
void insertUser (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const repo::core::model::RepoUser &user)
 
repo::core::model::RepoNodeSet loadMetadataFromFile (const std::string &filePath, const char &delimiter= ',')
 
repo::core::model::RepoSceneloadSceneFromFile (const std::string &filePath, std::string &msg, const bool &applyReduction=true, const bool &rotateModel=false, const repo::manipulator::modelconvertor::ModelImportConfig *config=nullptr)
 
void removeDocument (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &databaseName, const std::string &collectionName, const repo::core::model::RepoBSON &bson)
 
bool removeProject (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &databaseName, const std::string &projectName, std::string &errMsg)
 
void reduceTransformations (repo::core::model::RepoScene *scene, const repo::core::model::RepoScene::GraphType &gType=repo::core::model::RepoScene::GraphType::DEFAULT)
 
bool removeStashGraphFromDatabase (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, repo::core::model::RepoScene *scene)
 
void removeRole (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const repo::core::model::RepoRole &role)
 
void removeUser (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const repo::core::model::RepoUser &user)
 
void saveOriginalFiles (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const repo::core::model::RepoScene *scene, const std::string &directory)
 
void saveOriginalFiles (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &database, const std::string &project, const std::string &directory)
 
bool saveSceneToFile (const std::string &filePath, const repo::core::model::RepoScene *scene)
 
void updateRole (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const repo::core::model::RepoRole &role)
 
void updateUser (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const repo::core::model::RepoUser &user)
 
void upsertDocument (const std::string &databaseAd, const repo::core::model::RepoBSON *cred, const std::string &databaseName, const std::string &collectionName, const repo::core::model::RepoBSON &bson)
 

Member Function Documentation

void RepoManipulator::cleanUp ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  dbName,
const std::string &  projectName 
)

Clean up any incomplete commits within the project

Parameters
addressmongo database address
portport number
dbNamename of the database
projectNamename of the project
bool RepoManipulator::commitScene ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene,
const std::string &  owner = "",
const std::string &  tag = "",
const std::string &  desc = "" 
)

Commit a scene graph

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
scenescene to commit
ownerspecify the owner of the scene (by default it is the user authorised to commit)
void RepoManipulator::compareScenes ( repo::core::model::RepoScene base,
repo::core::model::RepoScene compare,
repo_diff_result_t baseResults,
repo_diff_result_t compResults,
const repo::DiffMode &  diffMode,
const repo::core::model::RepoScene::GraphType gType = repo::core::model::RepoScene::GraphType::DEFAULT 
)

Compare 2 scenes.

Parameters
basebase scene to compare against
comparescene to compare base scene against
baseResultsDiff results in the perspective of base
compResultsDiff results in the perspective of compare
repo::DiffModethe mode to use to compare the scenes
gTypegraph type to diff (default: unoptimised)
bool RepoManipulator::connectAndAuthenticate ( std::string &  errMsg,
const std::string &  address,
const uint32_t &  port,
const uint32_t &  maxConnections,
const std::string &  dbName,
const std::string &  username,
const std::string &  password,
const bool &  pwDigested = false 
)

Connect to the given database address/port and authenticat the user

Parameters
errMsgerror message if the function returns false
addressmongo database address
portport number
maxConnectionsmaxmimum number of concurrent connections allowed to the database
dbNamedatabase name to authenticate against
usernameuser name
passwordpassword of the user
pwDigestedis the password provided in digested form (default: false)
Returns
returns true upon success
bool RepoManipulator::connectAndAuthenticate ( std::string &  errMsg,
const std::string &  address,
const uint32_t &  port,
const uint32_t &  maxConnections,
const std::string &  dbName,
const repo::core::model::RepoBSON credentials 
)

Connect to the given database address/port and authenticat the user

Parameters
errMsgerror message if the function returns false
addressmongo database address
portport number
maxConnectionsmaxmimum number of concurrent connections allowed to the database
dbNamedatabase name to authenticate against
credentialsuser credentials
Returns
returns true upon success
bool RepoManipulator::connectAndAuthenticateWithAdmin ( std::string &  errMsg,
const std::string &  address,
const uint32_t &  port,
const uint32_t &  maxConnections,
const std::string &  username,
const std::string &  password,
const bool &  pwDigested = false 
)

Connect to the given database address/port and authenticat the user using Admin database

Parameters
errMsgerror message if the function returns false
addressmongo database address
portport number
maxConnectionsmaxmimum number of concurrent connections allowed to the database
usernameuser name
passwordpassword of the user
pwDigestedis the password provided in digested form (default: false)
Returns
returns true upon success
uint64_t RepoManipulator::countItemsInCollection ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  collection,
std::string &  errMsg 
)

Count the number of documents within the collection

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasename of database
collectionname of collection
Returns
number of documents within the specified collection
repo::core::model::RepoBSON * RepoManipulator::createCredBSON ( const std::string &  databaseAd,
const std::string &  username,
const std::string &  password,
const bool &  pwDigested 
)

Create a bson object storing user credentials

Parameters
databaseAdmongo database address:port
usernameuser name
passwordpassword of the user
pwDigestedis the password provided in digested form (default: false)
Returns
returns true upon success
repo::core::model::RepoScene * RepoManipulator::createFederatedScene ( const std::map< repo::core::model::TransformationNode, repo::core::model::ReferenceNode > &  fedMap)

Create a federated scene with the given scene collections

Parameters
fedMapa map of reference scene and transformation from root where the scene should lie
Returns
returns a constructed scene graph with the reference.
repo::core::model::RepoScene * RepoManipulator::createMapScene ( const repo::core::model::MapNode mapNode)

Create a map scene with the given map

Parameters
mapNodethe map node to create the scene with
Returns
returns a constructed scene graph with the map.
void RepoManipulator::disconnectFromDatabase ( const std::string &  databaseAd)

Disconnects from the given database host

Parameters
databaseAddatabase address:port
bool RepoManipulator::dropCollection ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  databaseName,
const std::string &  collectionName,
std::string &  errMsg 
)

Remove a collection from the database

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasethe database the collection resides in
collectionname of the collection to drop
errMsgerror message if failed
Returns
returns true upon success
bool RepoManipulator::dropDatabase ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  databaseName,
std::string &  errMsg 
)

Remove a database from the database instance

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasethe database the collection resides in
errMsgerror message if failed
Returns
returns true upon success
std::list< std::string > RepoManipulator::fetchCollections ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database 
)

Get a list of all available collections.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasedatabase name
Returns
a list of collection names
std::list< std::string > RepoManipulator::fetchDatabases ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred 
)

Get a list of all available databases, alphabetically sorted by default.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
Returns
returns a list of database names
repo::core::model::RepoScene * RepoManipulator::fetchScene ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  collection,
const repoUUID &  uuid,
const bool &  headRevision = false,
const bool &  lightFetch = false 
)

Retrieve a RepoScene with a specific revision loaded.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasethe database the collection resides in
projectname of the project
uuidif headRevision, uuid represents the branch id, otherwise the unique id of the revision branch
headRevisiontrue if retrieving head revision
lightFetchfetches only the stash (or scene if stash failed), reduce computation and memory usage (ideal for visualisation only)
Returns
returns a pointer to a repoScene.
void RepoManipulator::fetchScene ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene 
)

Retrieve all RepoScene representations given a partially loaded scene.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
scenescene to fully load
bool RepoManipulator::generateAndCommitGLTFBuffer ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene 
)

Generate and commit a GLTF encoding for the given scene This requires the stash to have been generated already

Parameters
databaseAddatabase address:portdatabase
creduser credentials in bson form
scenethe scene to generate the gltf encoding from
Returns
returns true upon success
bool RepoManipulator::generateAndCommitSelectionTree ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene 
)

Generate and commit scene's selection tree in JSON format The generated data will be also commited to the database/project set within the scene

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
scenescene to optimise
returntrue upon success
bool RepoManipulator::generateAndCommitSRCBuffer ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene 
)

Generate and commit a SRC encoding for the given scene This requires the stash to have been generated already

Parameters
databaseAddatabase address:portdatabase
creduser credentials in bson form
scenethe scene to generate the src encoding from
Returns
returns true upon success
bool RepoManipulator::generateAndCommitStashGraph ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene 
)

Generate and commit stash graph (multipart viewing graph) The generated graph will be added into the scene provided also commited to the database/project set within the scene

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
scenescene to optimise
returntrue upon success
bool RepoManipulator::generateAndCommitWebViewBuffer ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene,
repo_web_buffers_t buffers,
const modelconvertor::WebExportType &  exType 
)

Generate and commit a exType encoding for the given scene This requires the stash to have been generated already

Parameters
databaseAddatabase address:portdatabase
creduser credentials in bson form
scenethe scene to generate the src encoding from
buffersbuffers that are geneated and commited
exTypethe type of export it is
Returns
returns true upon success
repo_web_buffers_t RepoManipulator::generateGLTFBuffer ( repo::core::model::RepoScene scene)

Generate a gltf encoding in the form of a buffer for the given scene This requires the stash to have been generated already

Parameters
scenethe scene to generate the gltf encoding from
Returns
returns a buffer in the form of a byte vector mapped to its filename
repo_web_buffers_t RepoManipulator::generateSRCBuffer ( repo::core::model::RepoScene scene)

Generate a SRC encoding in the form of a buffer for the given scene This requires the stash to have been generated already

Parameters
scenethe scene to generate the src encoding from
Returns
returns a buffer in the form of a byte vector mapped to its filename
bool RepoManipulator::generateStashGraph ( repo::core::model::RepoScene scene)

Generate a stash graph for the given scene and populate it into the given scene

Parameters
scenescene to generate stash graph for
Returns
returns true upon success
std::list< std::string > RepoManipulator::getAdminDatabaseRoles ( const std::string &  databaseAd)

Get a list of admin roles from the database

Parameters
databaseAddatabase address:portdatabase
Returns
returns a vector of roles
std::vector< repo::core::model::RepoBSON > RepoManipulator::getAllFromCollectionTailable ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  collection,
const uint64_t &  skip = 0,
const uint32_t &  limit = 0 
)

Retrieve documents from a specified collection due to limitations of the transfer protocol this might need to be called multiple times, utilising the skip index to skip the first n items.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
collectionname of collection
skipspecify how many documents to skip
limitlimits the max amount of documents to retrieve (0 = no limit)
Returns
list of RepoBSONs representing the documents
std::vector< repo::core::model::RepoBSON > RepoManipulator::getAllFromCollectionTailable ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  collection,
const std::list< std::string > &  fields,
const std::string &  sortField = std::string(),
const int &  sortOrder = -1,
const uint64_t &  skip = 0,
const uint32_t &  limit = 0 
)

Retrieve documents from a specified collection due to limitations of the transfer protocol this might need to be called multiple times, utilising the skip index to skip the first n items.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
collectionname of collection
fieldsfields to get back from the database
sortFieldfield to sort upon
sortOrder1 ascending, -1 descending
skipspecify how many documents to skip
limitlimits the max amount of documents to retrieve (0 = no limit)
Returns
list of RepoBSONs representing the documents
repo::core::model::CollectionStats RepoManipulator::getCollectionStats ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  collection,
std::string &  errMsg 
)

Get the collection statistics of the given collection

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databaseName of database
collectionName of collection
errMsgerror message when error occurs
Returns
returns a bson object with statistical info.
std::map< std::string, std::list< std::string > > RepoManipulator::getDatabasesWithProjects ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::list< std::string > &  databases 
)

Return a list of projects with the database available to the user

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databaseslist of databases to look up
Returns
returns a list of database names
std::string RepoManipulator::getNameOfAdminDatabase ( const std::string &  databaseAd) const

Get the name of the admin database note it is done this way to support different admin database names for different handlers (which may be of different database types)

Parameters
databaseAddatabase address:portdatabase
Returns
returns the name of the admin database
repo::core::model::RepoRoleSettings RepoManipulator::getRoleSettingByName ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  uniqueRoleName 
)

Get a role settings within a database

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasename of database
uniqueRoleNamename of the role to look for
std::shared_ptr< repo_partitioning_tree_t > RepoManipulator::getScenePartitioning ( const repo::core::model::RepoScene scene,
const uint32_t &  maxDepth = 8 
)

Get a hierachical spatial partitioning in form of a tree

Parameters
scenescene to partition
maxDepthmax partitioning depth
std::list< std::string > RepoManipulator::getStandardDatabaseRoles ( const std::string &  databaseAd)

Get a list of standard roles from the database

Parameters
databaseAddatabase address:portdatabase
Returns
returns a vector of roles
bool RepoManipulator::hasDatabase ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  dbName 
)

Check if the database exist in the given database address

Parameters
databaseAddatabase address
credcredentials
dbNamename of the database
Returns
returns true if found
void RepoManipulator::insertBinaryFileToDatabase ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  collection,
const std::string &  name,
const std::vector< uint8_t > &  rawData,
const std::string &  mimeType = "" 
)

Insert a binary file into the database (GridFS)

Parameters
databaseAddatabase address:portdatabase
creduser credentials in bson form
databasename of the database
collectionname of the collection (it'll be saved into *.files, *.chunks)
rawDatadata in the form of byte vector
mimeTypethe MIME type of the data (optional)
void RepoManipulator::insertRole ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const repo::core::model::RepoRole role 
)

Insert a new role into the database

Parameters
databaseAddatabase address:portdatabase
creduser credentials in bson form
rolerole info to insert
void RepoManipulator::insertUser ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const repo::core::model::RepoUser user 
)

Insert a new user into the database

Parameters
databaseAddatabase address:portdatabase
creduser credentials in bson form
useruser info to insert
repo::core::model::RepoNodeSet RepoManipulator::loadMetadataFromFile ( const std::string &  filePath,
const char &  delimiter = ',' 
)

Load metadata from a file

Parameters
filePathpath to file
delimiter
Returns
returns a pointer to Repo Scene upon success
repo::core::model::RepoScene * RepoManipulator::loadSceneFromFile ( const std::string &  filePath,
std::string &  msg,
const bool &  applyReduction = true,
const bool &  rotateModel = false,
const repo::manipulator::modelconvertor::ModelImportConfig config = nullptr 
)

Load a Repo Scene from a file

Parameters
filePathpath to file
msgerror message if it fails
applytransformation reduction optimizer (default = true)
rotateModelrotate model by 270degrees on x (default: false)
configimport config (optional)
Returns
returns a pointer to Repo Scene upon success
void RepoManipulator::reduceTransformations ( repo::core::model::RepoScene scene,
const repo::core::model::RepoScene::GraphType gType = repo::core::model::RepoScene::GraphType::DEFAULT 
)

Reduce redundant transformations from the scene to optimise the graph

Parameters
sceneRepoScene to optimize
gTypegraph type to diff (default: unoptimised)
void RepoManipulator::removeDocument ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  databaseName,
const std::string &  collectionName,
const repo::core::model::RepoBSON bson 
)

remove a document from the database NOTE: this should never be called for a RepoNode family as you should never remove a node from a scene graph like this.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasethe database the collection resides in
collectionname of the collection to drop
bsondocument to remove
bool RepoManipulator::removeProject ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  databaseName,
const std::string &  projectName,
std::string &  errMsg 
)

Remove a project from the database This removes:

  1. all collections associated with the project,
  2. the project entry within project settings
  3. all privileges assigned to any roles, related to this project
    Parameters
    databaseAdmongo database address:port
    creduser credentials in bson form
    databasename of the datbase
    nameof the project
    errMsgerror message if the operation fails
    Returns
    returns true upon success
void RepoManipulator::removeRole ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const repo::core::model::RepoRole role 
)

remove a role from the database

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
rolerole info to remove
bool RepoManipulator::removeStashGraphFromDatabase ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
repo::core::model::RepoScene scene 
)

Remove stash graph entry for this particular revision from the database

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
scenescene reference to remove stash graph from
Returns
returns true upon success
void RepoManipulator::removeUser ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const repo::core::model::RepoUser user 
)

remove a user from the database

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
useruser info to remove
void RepoManipulator::saveOriginalFiles ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const repo::core::model::RepoScene scene,
const std::string &  directory 
)

Save the files of the original model to a specified directory

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
sceneRepo Scene to save
directorydirectory to save into
void RepoManipulator::saveOriginalFiles ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  database,
const std::string &  project,
const std::string &  directory 
)

Save the files of the original model to a specified directory

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasename of database
projectname of project
directorydirectory to save into
bool RepoManipulator::saveSceneToFile ( const std::string &  filePath,
const repo::core::model::RepoScene scene 
)

Save a Repo Scene to file

Parameters
filePathpath to file
scenescene to export
Returns
returns true upon success
void RepoManipulator::updateRole ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const repo::core::model::RepoRole role 
)

Update a role on the database

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
rolerole info to modify
void RepoManipulator::updateUser ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const repo::core::model::RepoUser user 
)

Update a user on the database

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
useruser info to modify
void RepoManipulator::upsertDocument ( const std::string &  databaseAd,
const repo::core::model::RepoBSON cred,
const std::string &  databaseName,
const std::string &  collectionName,
const repo::core::model::RepoBSON bson 
)

upsert a document in the database NOTE: this should never be called for a bson from RepoNode family as you should never update a node from a scene graph like this.

Parameters
databaseAdmongo database address:port
creduser credentials in bson form
databasethe database the collection resides in
collectionname of the collection
bsondocument to update/insert

The documentation for this class was generated from the following files: