sympmarc / SPServices

SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.
MIT License
208 stars 61 forks source link

Can this plugin work on a plain web app or does it require SP.js? #80

Open ghost opened 4 years ago

ghost commented 4 years ago

It appears this plugin is only for use on a page served up by SharePoint or a page with SharePoint JS libraries already available. In other words, is this plugin dependent upon the SP JavaScripts? I don't see that mentioned anywhere on the home page. Thanks!

sympmarc commented 4 years ago

@Katydude - I wrote most of this library before SP.js even existed. It works with the old, deprecated SOAP (asmx) Web Services.

If you are on a version of SharePoint greater than 2010, you should really be using REST rather than SOAP. What version are you in and what are you trying to accomplish?

ghost commented 4 years ago

Gotcha. That's good to know.

I wrote a large web app over the last two years that is in AngularJS and it's served up from within the SharePoint environment. This gave me access to all of the SP.js libraries and context. I only used the REST services with CAML and sometimes ODATA to talk to the server. I don't like the SOAP stuff at all.

However, I'm now attempting to port that app over to Angular 8. I spent most of the past two days discovering SharePointPlus and then coercing Angular CLI to compile it and run only to discover that this, too, is a very old library that just uses SOAP. Sigh.

So, what I now have to decide is if I want to a) stick with that, b) find something else, c) see if Microsoft's supposed SharePoint TypeScript library actually exists (they have a documentation site but no links to any actual code), or, d) pull SP.js into my app as a resource and then see if I can talk through that to the farm. I know there are going to be several interconnected .js files for this last approach and I haven't decided yet if I want to fall down that rabbit hole.

If you've faced a similar situation before I'd love to hear what you decided to do. I've built a lot of SharePoint stuff for the past ten years as well as configured several farms so this isn't my time to dance with the devil :)

Wade

On Fri, Sep 27, 2019 at 8:59 AM Marc D Anderson notifications@github.com wrote:

@Katydude https://github.com/Katydude - I wrote most of this library before SP.js even existed. It works with the old, deprecated SOAP (asmx) Web Services.

If you are on a version of SharePoint greater than 2010, you should really be using REST rather than SOAP. What version are you in and what are you trying to accomplish?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPTJFHGYNBGBXNRY363QLYGUDA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7Y7QJQ#issuecomment-535951398, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPSJHZVU7QDST5PYHJDQLYGUDANCNFSM4I2475FQ .

sympmarc commented 4 years ago

The real question here is what version of SharePoint you're working in and what you are trying to accomplish. The answers will vary accordingly.

ghost commented 4 years ago

SP 2013/2016 on prem. Basic list data fetching, updating with forms, uploading attachments, and inspecting/restarting workflows. No calendar, managed metadata, or search services interactions. Using SP for the security trimming and workflows.

On Fri, Sep 27, 2019 at 10:46 AM Marc D Anderson notifications@github.com wrote:

The real question here is what version of SharePoint you're working in and what you are trying to accomplish. The answers will vary accordingly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPTFU4DN4F7A37KND7TQLYTEZA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ZJ6DI#issuecomment-535994125, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPRTCR3YF2EI3YOYFP3QLYTEZANCNFSM4I2475FQ .

sympmarc commented 4 years ago

I would suggest looking at PnPjs rather than trying to dig into the bowels of SP.js. It's sort of like the SPServices for REST - and many other things.

ghost commented 4 years ago

Yes! This is what I was trying to find earlier. I knew there had to be a TS library out there somewhere. Thanks a bunch.

On Fri, Sep 27, 2019 at 11:06 AM Marc D Anderson notifications@github.com wrote:

I would suggest looking at PnPjs https://pnp.github.io/pnpjs/ rather than trying to dig into the bowels of SP.js. It's sort of like the SPServices for REST - and many other things.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPUOVL6MBVYNTTWSUX3QLYVRPA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ZLZIQ#issuecomment-536001698, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPRZQEGLRADYS2CU33DQLYVRPANCNFSM4I2475FQ .

ghost commented 4 years ago

Oh, wait. I think I went down this rabbit hole already. The library has server-side dependencies and will not work in a pure JS, client-side environment. I'm pretty sure this library is a non-starter. :(

On Fri, Sep 27, 2019 at 11:06 AM Marc D Anderson notifications@github.com wrote:

I would suggest looking at PnPjs https://pnp.github.io/pnpjs/ rather than trying to dig into the bowels of SP.js. It's sort of like the SPServices for REST - and many other things.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPUOVL6MBVYNTTWSUX3QLYVRPA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ZLZIQ#issuecomment-536001698, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPRZQEGLRADYS2CU33DQLYVRPANCNFSM4I2475FQ .

ghost commented 4 years ago

Good news (mostly). The Pnp/sp library largely seems to work without need of any server-side components. The only issue with this is that you do need a very pristine development environment to get it all to work. (Chrome has cost me numerous hours the past few days with all of its security blocking and the PnP library is very quirky to get configured correctly at first.)

Hopefully, this helps someone in the future. Thanks again.

On Fri, Sep 27, 2019 at 11:06 AM Marc D Anderson notifications@github.com wrote:

I would suggest looking at PnPjs https://pnp.github.io/pnpjs/ rather than trying to dig into the bowels of SP.js. It's sort of like the SPServices for REST - and many other things.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPUOVL6MBVYNTTWSUX3QLYVRPA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ZLZIQ#issuecomment-536001698, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPRZQEGLRADYS2CU33DQLYVRPANCNFSM4I2475FQ .

sympmarc commented 4 years ago

It has server side dependencies in that it helps you use the REST endpoints, but it does work with 2016.

sympmarc commented 4 years ago

I'm not sure what you mean about needing "a very pristine development environment to get it all to work". What blockers are you seeing?

ghost commented 4 years ago

There are no server-side dependencies unless you choose to install the node package. There's a combination of packages one can install that let's a completely client-side Angular app talk directly to SharePoint without going through any sort of proxy.

On Fri, Sep 27, 2019 at 4:07 PM Marc D Anderson notifications@github.com wrote:

It has server side dependencies in that it helps you use the REST endpoints, but it does work with 2016.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPX7IWSM5LUJV3QFWYTQLZYYHA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72DANA#issuecomment-536096820, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPQ64EVNHGO42DFKPYLQLZYYHANCNFSM4I2475FQ .

ghost commented 4 years ago

Probably just some stuff isolated to my local dev configuration (Chrome, CORS blocking, self-signed certs, stuff like that). Everything seems ok now that I've figured out where the json requests were failing. It was imperative that I used the sp.setup({...}) function to set up the Accept header because, by default, requests fail without it.

On Fri, Sep 27, 2019 at 4:08 PM Marc D Anderson notifications@github.com wrote:

I'm not sure what you mean about needing "a very pristine development environment to get it all to work". What blockers are you seeing?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPUHWTUDFKCWPIWLDQDQLZY53A5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72DDLQ#issuecomment-536097198, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPSKYRSXF6DKW52RYJDQLZY53ANCNFSM4I2475FQ .

sympmarc commented 4 years ago

Yeah, you have to do sp.setup. That's a cost of entry.

You can also use the SharePoint Framework (SPFx) on 2016. This would make your solution future-proof in that it's the development platform going forward.

ghost commented 4 years ago

Oh, goodness. I've already banged around for days with SharePointPlus and now PnP/sp just to do the most rudimentary thing b/c of all the Chrome nannying and the gaps in the getting started docs (no offense...it's a lot to cover...but the sp.setup thing should be front and center).

If I'm gonna chase down another one...I'm gonna need alcohol or coffee...or both!

On Fri, Sep 27, 2019 at 4:16 PM Marc D Anderson notifications@github.com wrote:

Yeah, you have to do sp.setup. That's a cost of entry.

You can also use the SharePoint Framework (SPFx) on 2016. This would make your solution future-proof in that it's the development platform going forward.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPUHIP5YRWUX3LTUYKTQLZZ25A5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72DTBI#issuecomment-536099205, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPRISG5RHMDKIBZGQZDQLZZ25ANCNFSM4I2475FQ .

sympmarc commented 4 years ago

Right on the Getting Started page. :)

ghost commented 4 years ago

Yes, that is where I eventually found it but well down the page. If it were me, I would break that page up into a few different pages because the user is pretty weary by the time they read through all of that trying to figure out which scenario applies to them.

As for SPFx, it looks very promising but very green. I will definitely keep a watch on it, though. Thanks.

On Fri, Sep 27, 2019 at 4:25 PM Marc D Anderson notifications@github.com wrote:

Right on the Getting Started page: https://pnp.github.io/pnpjs/documentation/getting-started/ :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPVIL4DEZDG6W33AT63QLZ22XA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72ED7I#issuecomment-536101373, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPWU3VYSIJ7GANWTEOTQLZ22XANCNFSM4I2475FQ .

sympmarc commented 4 years ago

SPFx has been out for at least two years now. We build complex solutions with it all the time. You should spend some time out in the community to keep up with what's been going on!

ghost commented 4 years ago

No offense but https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment is all geared around Office 365 and "client side web parts". Not what I'm looking for.

On Fri, Sep 27, 2019 at 8:00 PM Marc D Anderson notifications@github.com wrote:

SPFx has been out for at least two years now. We build complex solutions with it all the time. You should spend some time out in the community to keep up with what's been going on!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sympmarc/SPServices/issues/80?email_source=notifications&email_token=AHX3SPSC6M6DL7QQ3GSVEZ3QL2UDFA5CNFSM4I2475F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72M2TI#issuecomment-536137037, or mute the thread https://github.com/notifications/unsubscribe-auth/AHX3SPWWRMHOUFH5OL46UCDQL2UDFANCNFSM4I2475FQ .