chrishasz / spgo

SPGo: A Lightweight, Open Source, SharePoint IDE for Visual Studio Code
https://www.chrishasz.com/spgo
MIT License
60 stars 11 forks source link

Populate workspace from multiple subsites in a site collection - question #84

Closed ianoel230982 closed 4 years ago

ianoel230982 commented 5 years ago

Hi,

I have a use case where i am trying populate my local directory with files from folder in multiple subsites within the same site collection but it isn't working. I'm unsure if my remote folder setup is wrong or whether or not this is not something i can do with SPGo. If someone could provide some advice that would be great. My environment is SP 2013 on prem. Example set up below.

{
    "sourceDirectory": "src",
    "sharePointSiteUrl": "http://site-url/sites/root-site/subsite",
    "publishingScope": "SaveOnly",
    "authenticationType": "NTLM",
    "remoteFolders": [
        "/Web/**/*.*",         <--this folder is in subsite
        "/sub-subsite/Web/**/*.*"  <-- this folder is in a sub site of the subsite above
    ]
}

Thanks in advance :-)

chrishasz commented 5 years ago

Hello @ianoel230982, thanks for logging an issue. If I understand your question correctly, it looks like you are trying to load content from multiple different SharePoint Webs within a single VSCode/SPGo workspace. At this time, SPGo does not support loading content from multiple SubSites in a single workspace.

Can you give me a little more context on how you are using multiple sites/subsites and what you are looking to accomplish (shared branding, assets, or ??), and I'll see if there is a need for a new feature or something I can build into SPGo.

ianoel230982 commented 5 years ago

Hi, thanks for getting back to me. You're right in your understanding that i'm trying to load content from multiple webs/sub webs in one single workspace.

In this instance my particular use case is mainly for shared assets (mostly js and css files) in the root web and then a number of sub webs that link up to the shared assets. If i load my site into vscode without using spgo i can see the different sub webs as folders in the file explorer, i can open those sub webs and access the files normally.

It would be good, for me at least :-), if spgo could access the files in the subwebs when i set my remote folders in the config file.

I can give you more details regarding this specific instance if you need it, however it isn't something i always do and more often than not we just use the one web and wouldn't need to access files from other webs/subwebs.

Thanks for taking the time to read my question :-)

p.s. - is it possible, when working with my sharepoint files locally, using spgo, that if i create a file in my local folder, it can then create that file on the sharepoint site if it doesn't already exist?

SPWizard01 commented 5 years ago

more on that one, i guess its not possible to have configuration in subfolders?

i.e.: i want to map folder A to /sites/rootweb/doclibrary then folder B(which is on same level with folder A) with a /sites/rootweb/subweb/anotherlib

chrishasz commented 5 years ago

@SPWizard01 that is correct, currently SPGo only supports mapping to a single site at a time.

This is a popular feature request, so I'll see what I can do to address this in a future build.

BrianDeJesus commented 4 years ago

Hello,

Are there any updates on this enhancement? Thanks!

chrishasz commented 4 years ago

Hello @BrianDeJesus - I have a pretty good architecture for this worked out and I've started implementation.

Good news is that the architecture changes will lay the groundwork for supporting multiple workspaces at once.

The plan is to have this released by the end of the Month, but I will post updates as I get closer.

chrishasz commented 4 years ago

Update: I just released SPGo 1.5.0 which supports Multi-root Workspaces. This was the core change that was needed for me to build support for working with subsites. I will release that as SPGo 1.5.1 hopefully before the end of the year.

Thanks for your patience on this.

BrianDeJesus commented 4 years ago

Thanks @chrishasz I truly appreciate what you are doing with this.

chrishasz commented 4 years ago

@BrianDeJesus, @SPWizard01, @ianoel230982 - I just released SPGo 1.5.1 to the VSCode Marketplace, which supports populating from, and working with, multiple sub sites.

To get started, add the following node to your SPGo.json file:

"subSites": [{
        "sharePointSiteUrl" : "https://xxx.sharepoint.com/sites/spgo/subsite",
        "remoteFolders": [
            "/SiteAssets/**/*"
        ]
    },{
        "sharePointSiteUrl" : "https://xxx.sharepoint.com/sites/spgo/subsite2",
        "remoteFolders": [
            "/SiteAssets/**/*"
        ]
    }]

*you can see this is an array, so you can configure as many subsites as you want.

Once the configuration is ready, use the Populate Workspace command to pull files down from the server. From there, you can work with them as normal.

The documentation is lacking right now, but I wanted to get the release out as it contained a few bug fixes for multi-root workspaces. I will be updating the documentation in the coming days to be more complete.

Feel free to reach out with any questions

chrishasz commented 4 years ago

@BrianDeJesus, @SPWizard01, @ianoel230982 have you had a chance to test this out yet?

I've updated the [documentation]{https://www.chrishasz.com/spgo/advanced/working-with-subsites} for this feature as well. Please let me know if there are any questions about usage or if you are experiencing any issues.

If everything is good, I'll close this issue.

ianoel230982 commented 4 years ago

Hi, i haven't had chance to use this yet. I've had some other issues with VS code that means i'm currently using a custom version of the software that they created for me. Until they've fixed a bug i raised i can't use VS code within my work environment. Reason i'm telling you this is that i tried to download the new version of the extension you published but it isn't compatible with the custom version i'm using unfortunately. If there's anything you can recommend to helpme use this that'd be great :-)

chrishasz commented 4 years ago

@ianoel230982 I would need to understand the differences between your custom copy of VSCode and the standard release before I could suggest how to fix.

Did the Code team give you a timeline on when your fixes would be available in the standard release?

ianoel230982 commented 4 years ago

@chrishasz I've just commented on the issue asking for an update on it, last time i had contact in August they said it may be a while before it gets revisited. Unfortunately i don't know the internals of what they've done to my custom copy, but here is a link to the issue in case the title helps in any way. If not i'll let you know as soon as i get the chance to try the changes. I'm sure if they've been tested and working for other users you could probably close this for now. If i have any issues when i do test it i'll let you know :-) https://github.com/microsoft/vscode/issues/73393

ianoel230982 commented 4 years ago

@chrishasz finally got round to checking this out, seems to work great. Thanks for taking the time to implement it, much appreciated.

I have a couple of quick questions if you would be so kind to answer them, slightly off topic and will raise another issue if required.

  1. When i define my remote folders, is it possible to request specific files only, say i have 30 files in my folder in the site i'm working on, but only want to work on 2, i tried this but it didn't get the files "remoteFolders": [ "/folder/filename.aspx", "/folder/js/filename.js ],

  2. When i synchronize/populate the local folder, is it possible to identify any files that are already checked out in the folder tree ? I see that if i try to check out a file that is checked out by someone else already that i get a message advising this, however a nice visual aid in the file tree would be really useful. Something maybe like changing the file icon (sharepoint adds a little green mark to a checked out file), or perhaps appending some text to the file name or something else of your choosing?

Thanks again :-)

chrishasz commented 4 years ago

Hello @ianoel230982

Good to hear this update worked for you. Thanks for suggesting both of these features. Option 1 is pretty straight-forward, so I will add this to the next feature release.

Regarding options 2: this is something I've wanted native support from VSCode for a while and it turns out it is not that easy. In order to implement this, I would need to create a new left-nav tab for SPGo to capture this information. Would this UX work for you?

ianoel230982 commented 4 years ago

Hi,

Re. Option 1 - Great thanks. Re. Option 2 - Yes, that sounds good and i'm sure that would be great. You wouldn't believe the amount of times my colleagues swear at the screen when they made a change to a file and realise they've not checked it out. It is very funny :-)

Thanks for your help.

chrishasz commented 4 years ago

@ianoel230982 I just released SPGo 1.6.1 to the VSCode marketplace which adds support for individual files in the remoteFolders config property.

The second option I will work on for a future release.

chrishasz commented 4 years ago

I'm going to close this issue for now and create a new issue/feature for creating the custom Treeview for displaying file status.

As a note, every time a new file is selected, I do output the file status to the VSCode output window and the info bar at the bottom of the screen.