Community
Participate
Working Groups
The simple metadata storage ( Bug 412995 ) feature has a design where workspaces and projects are organized in folders in a hierarchy under the user they belong to. The API to create a project in a MetaStore is createProject(String workspaceId, ProjectInfo info) Based on this API, I do not know where to create the project, as I do not know the project or workspace owner. I thought I would be smart and make the workspaceId an encoding of the userId and workspace name. This allows me to create a project by getting the user and workspace from the workspaceId and then creating a project underneath. This is really a hack and is not working sufficiently. I need both the user and workspace when I get a request to create a project. By this same argument, the updateProject API is also not working. The API is updateProject(ProjectInfo project). I have no way to figure out which user and workspace in which the project without encoding the user, workspace into the projectId. To resolve, I propose the ProjectInfo should include the user and workspace. As well the WorkspaceInfo should include the user. This will simplify the IMetaStore API since all the create, read, update and delete methods simply need to pass in a MetadataInfo.
The API for a MetadataInfo object says that the UniqueId is globally unique. As a result we depend on the workspaceId to lookup projects and in many places pass around path objects in the form /workspace/{id}/project/{id} without any user information. This is especially true in the git implementation. I am not going to be able to work around this limitation right now and will go back to encoding the user and workspace in the workspaceId.
(In reply to comment #0) > The API to create a project in a MetaStore is createProject(String > workspaceId, ProjectInfo info) I am leaving this API as is. > By this same argument, the updateProject API is also not working. > > The API is updateProject(ProjectInfo project). I have no way to figure out > which user and workspace in which the project without encoding the user, > workspace into the projectId. > > To resolve, I propose the ProjectInfo should include the user and workspace. > As well the WorkspaceInfo should include the user. This will simplify the > IMetaStore API since all the create, read, update and delete methods simply > need to pass in a MetadataInfo. I still require this change.
The IMetaData API has been changed as follows: WorkspaceInfo contains the field userId, the user that owns the workspace. ProjectInfo contains the field workspaceId, the workspace that contains the project. userId and workspaceId parameters on the createWorkspace() and createProject() methods has been removed since these parameters are no available in the MetaInfo. updateWorkspace() and updateProject() methods are unchanged since the required Id information is provided in the MetaInfo parameter. The changes are in http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=a7e1e46e357feace186ec480fc53c72597c540e8