Proposed Answer Creating a workspace using TFS JAVA SDK

  • Wednesday, August 22, 2012 2:44 PM
     
     

    Hi,

    I have a problem in creating workspaces.

    Example:

    I am using a folder in a server(lets say Testing) as local path and a folder in TFS as server path(lets say TFS/Testing) so now using this i have created a workspace and tried to work on files in that folder.
    Everything works fine for me. Now if my team mate runs the same code there is a method in SDk tpc.getVersionControlClient().getWorkspace(localPath) which will get the workspace if exists with that local path as it is server everyone will be working on same server folder so it is saying workspace already exists and i am the owner of it and my team mate cannot use it.

    Can some one please help me creating a workspace each for a user so that every user can perform his operations on the same server folder.

    Regards,
    Shirish Bhat

All Replies

  • Wednesday, August 22, 2012 5:40 PM
     
     Proposed Answer

    Hi Shirish,

    You need to use a public workspace, this type of workspace allows any valid user to use that workspace. You can specify if any other user can use the workspace(pending changes) or checkin or admin (update the name) or all permissions.

    Please let me know if this does not answer your question.

    Thanks

    Mireille

  • Friday, August 24, 2012 3:00 PM
     
     

    Hi Mireille,

    Can you just give me a code snippet to create a public workspace.

  • Saturday, August 25, 2012 11:34 AM
     
     

    Hi Mireille,

    I am trying to use a workspace which is created by my user and manually edited it in Source Control to public i want to know how to do it in a program.

    And one more thing is even though i switched it to public if i try to checkout a file with other user using this workspace it is displaying chekout by me.

    Regards,

    Shirish Bhat

  • Monday, August 27, 2012 1:48 PM
     
     

    Hi Shirish,

    Here is a blog on how to create a public workspace using the .Net TFS SDK, you can refer to it and let me know if you still need help doing this with the Java SDK.

    http://blogs.msdn.com/b/phkelley/archive/2010/02/04/improvements-to-workspaces-in-tfs-2010.aspx 

    As for using that public workspace by other users other than the owner, this is a limitation for now that all the activity will be under the name of the owner of the workspace.

    Please let know if you any other questions/issues.

    Thanks

    Mireille

  • Monday, August 27, 2012 2:14 PM
     
     

    Hi Mireille,

    Thank You for the reply... actually i am working on a system which is moving the file from unix server to TFS server. Let me explain with an example:

    User 1 is working on a file called Test in Testing folder. so now the local path(unix) is /log/Testing/Test. and server path(TFS) is /log/Testing/Test. So now the working folder is  workspace.map(/log/Testing, /log/Testing).

    SO now another user is trying to work on the same folder but on another file called software.so now the local path(unix) is /Testing/Software. and server path(TFS) is /Testing/Software. So now the working folder is  workspace.map(/log/Testing, /log/Testing).

    But here the system is throwing an exception saying the working folder /log/Testing on unix and /log/Testing on TFS is already mapped to a workspace and cannot use the same.

    So can you please tell me a way how to fix this?

  • Tuesday, August 28, 2012 1:51 PM
     
     

    Hi Shirish,

    Thanks for the explanation, now I understand the case better.

    you are getting this exception because you are trying to use the same local folder to map some server folder in two different workspaces and this is not possible. you have multiple options:

    1. If possible, you can use a different local folder for each workspace.

    2. You can create a public workspace which would be shared by all your users.

    3.which might not be pratical, when the first user is done working, you can remove the mapping and in this case when the second user tries to map to the same local folder that would not be a problem.

    Please let me know if none of those options work for your case.

    Thanks

    Mireille

  • Wednesday, August 29, 2012 7:46 AM
     
     

    Hi Mireille,

    Thank You for the reply.

    If i am trying to use the public workspace it will checkout a file only with the owner name and not the name of the person who has logged in so i am also planning to go for creating a local folder option. If you can think of any other option please let me know.

    Thank you very much

    Regards,

    Shirish Bhat.

  • Wednesday, August 29, 2012 2:38 PM
     
     

    Hi Shirish,

    I will let you know if I find any other solution.

    Please let me know if you have any issues/questions going this way.

    Thanks

    Mireille

  • Friday, September 07, 2012 10:11 PM
     
     

    Mireille,

    Could you please clarify this for us...  On the page linked below it states, "A Public workspace can be used by any valid user. Anybody can check in or administer the workspace as long as they have permissions to the underlying files. The checkins will still be attributed to the person checking them in."

    So, if DevA creates a public workspace on a unix server that all of our developers use and DevB makes a change and checks it in, will TFS show that the checkin was done by DevA or DevB?

    http://blogs.msdn.com/b/granth/archive/2009/11/08/tfs2010-public-workspaces.aspx


  • Tuesday, September 11, 2012 2:08 PM
     
     Proposed Answer

    Hi,

    When the change is pended, the user will be displayed as user DevA while when the files are checked in, the checkin will be stated as done by user DevB.

    Please let me know if you have any other questions/issues.

    Thanks

    Mireille