In a collaborative modelling environment, there is expected to be multiple users accessing, creating and editing objects (nodes and properties) within a given Komodo Repository.
In our initial Web UI, Data Service Builder, we are partitioning the repository to give each user a "workspace" for their particular Data Services and Sources (i.e. VDBs).
This document is intended to facilitate discussion around the design, management and use cases for a user's workspace.
- User wants to create 2 or more parallel Data Services for different purposes
- User 1 is OK with both DS's in a list
- User 2 wants to managed each DS in it's own "project" or category 
HIgh Level Structure
/tko:users (currently called /tko:workspace)
/tko:system (currently called /tko:environment)
User Area Detail (two options below)
Organized by Project option:
- Users will be able to create and manage projects. 
- Each project is organized by artifact type.
- Artifacts of the same type within the same project must have unique names.
- Artifacts of the same type can have the same name if they exist in different projects.
- Overridden preferences and validations will be stored directly under the user.
- Saved searches are stored directly under the user node. 
- Projects must have unique names.
- No other nodes besides project nodes can be created directly under the user node.
- Properties can be created on the user node. 
/MyVdb (reference to /vdb:virtualDatabase/MyVdb)
... (references to other data service artifacts)
... (other artifact grouping nodes) 
... (other projects)
... (other user areas)
Organized by Artifact option:
- Projects don't exist.
- /tko:users is currently called /tko:workspace
- Artifact names must be unique within an artifact type. 
- Overridden preferences and validations will be stored directly under the user. 
- Saved searches are stored directly under the user node.
- No other nodes can be created directly under the user node.
- Properties can be created on the user node.
/MyVdb (reference to /vdb:virtualDatabase/MyVdb)
... (other references to data service artifacts)
... (other artifact grouping nodes)
... (other user areas)
Library Area Detail
- Artifacts are versioned and access controlled.
- Each artifact has a title and description to facilitate them being found in searches.
... (other connections)
... (other data services)
... (other DDL files)
... (other driver files)
... (other user resource files)
... (other UDF files)
... (other models)
... (other VDBs)
System Area Detail
- /tko:system is currently called tko:environment
- Default preferences are stored here.
- Default validation rules are stored here.
- Built-in searches are stored here.
- the Teiid cache is stored here.
- known Teiid servers are stored here.
- hidden from the user
- tko:validateAutomatically = true
- tko:showOdataLinks = true
- tko:tabularDisplayMode = 'LIST'
... (other default preferences)
/tko:validationRules (globally defined validation rules)
- tko:severity = 'WARNING'
... (nodes and properties defining the validation rule)
... (other default validation rules)
... (other built-in searches)
- The need to step away from the catalogue-paradigm was one of the drivers early-on for moving away from Eclipse and a return seems a retrograde step.
- What purpose does the 'project' node server, other than to logically split the artefacts?
- It is possible that nodes can have the same names but it should be entirely possible to simply stop the user from doing this. Inviting the user to add an artefact with a slightly different name seems a much more straight-forward solution;
- The creation of a project would have to be included in dsb, eg. summaries would only show artefacts in specific projects or show all artefacts in all projects, creation of a new artefact would require an extra step of asking the user which project it should be added to unless an open-close-active-project paradigm was implemented;
- Users will not be aware of this structure since the application determines the layout of objects in the user interface. Thus, should a change to the repository be made, a property on each node indicating the display-name perhaps may be a far safer and less disruptive solution;
- Dependencies on tko:workspace include
- The search framework stores its searches under tko:workspace/searches. These saved-searches are shared to all users and logically makes no sense to store them under tko:users. Moving them though means changes will be required to the core-search, rest-server-side and parts of dsb (not used atm);
- Each instance of WorkspaceManager is linked to the tko:workspace node since it is in itself a relational object. Should the WorkspaceManager be renamed as well?
- With the changing of name, irrespective of what to call it, the WorkspaceManager will be effected, especially due to its getFromWorkspace() method. This is widely used in a number of use-cases included import-export;
- The security framework that determines whether users can read/write nodes in any repository location, ie. RepositoryImpl.provision() relies on the current workspace layout and, although would probably work with the rename, require checking that its tests still pass;
- Dependencies on tko:environment include
- Teiid servers group - the collection of teiid instance configurations added by any users, including the default running instance that's part of the same jboss;
- Teiid cache group - the collection of cached teiids which convert the contents of live teiid instances into repository nodes;
- Validation group - the collection of validation rules used to determine the validity of any artefacts;
 The premise of saved-searches is that they are shareable between users and therefore exist at the same level as the user homes rather than hidden inside each user home. After all, storing them in the latter implies that userA would probably end up storing the same search as userB since neither can see the other's.
 In the same manner as saved-searches, the validation rules are shareable artefacts and duplication should be discouraged rather than encouraged. More importantly, the rules governing the validity of objects should be consistent across the repository and not subject to be turned on/off at the whim of the user. The implication of such an implementation would mean an artefact looking fine for one user but when added to the library, exported for another user or even deployed could be the artefact is in fact invalid.
- A logical structuring of nodes can be achieved at the application-level using the node types so what purpose would structuring them at the repository-level serve?
- Is the structure mandated? In Designer, the creation of a new project added folders inviting the user to logically separate their artefacts. However, such a structure was not mandated leaving the user free to add artefacts anywhere from the project-level down. If mandated then that would present a number of issues to ensure correct nodes were added to the correct folder. If not mandated then the purpose of doing this in the first place seems questionable.
- The 'sns' property is added to most node types in most cnd files. It appears that this is required but has the implication of indexing same-name-siblings, ie. blah, blah;
- It might be possible to embrace sns and rather than returning the 'first' node found, return all nodes with a specific name or search for the single node with a specific name AND index. This would then allow same-name nodes at the same level;
- Stopping same-name-siblings can be achieved at the relational or application levels of the stack. For example, the teiid cache only ever allows a single cached-teiid node for each teiid instance. This is done at the relational-level using code-checks.