Using PnP/CSOM to customise New SharePoint OOTB Document Libraries - sharepoint-online

Hoping someone could possibly help please.
Quite new to the PnP framework, but I have a template up and running, but I'm drawing a blank on customising the OOTB document library with our own custom content types and site columns. I’ve managed to do it for the initial provisioning process using PnP, but the bit I’m currently struggling with is when a user creates a new document library from either the 'addanapp.aspx' page or through a Modern Page, since that doesn’t use our content types or site columns, that just creates a default SPO Document Library.
I’ve been reading about the ECM Document Library core, List Definitions, Event Receivers and CSOM to achieve what I’m looking to do, but not sure where I should be starting.
Ideally, the outcome I'm looking to achieve is I want any new document library a user creates from a Modern Team Site to use only our custom content types and site columns, not the default OOTB ones.
Any help gratefully received, thanks.

Have you checked the demo ECM.DocumentLibraries?
Here is the general explanation video.
You need familiar with SharePoint add-in(app) first guideline here.

Related

SharePoint 2013 Document Organization

I'm trying to find a better way to organize a huge mass of documents on SharePoint 2013. I've done a lot of searching and I thought that Enterprise Metadata would be my solution but I have yet to find a good way to harness it. I fell like there must be a solution to what I need built into to SharePoint already.
I want to give each document a "tag" or Enterprise Metadata Keyword and then have a document library that only displays files that are associated with a specific keyword. Any ideas?
Thanks!
I'd suggest some built-in SharePoint document library features to consider to start with, before looking at any third-party offerings.
For a document library, (via the settings for the document library), you can enable Metadata Navigation Settings - this can allow a user to filter list items based on metadata fields. This may offer something along the lines of what you described. I'd advise caution for large lists though.
Another option would be to look at creating or amending views for the library - the options are found on the Library tab of the ribbon. You can setup some filtering or aggregration for the view.
There is also the option, if appropriate to make certain views only available at specific locations within the document library - set via the per-location view settings

Sharepoint Workflow: Where to store configuration settings?

I am currently writing a Sharepoint Workflow that is activated when a user saves an Excel file to a Library. Now I need to process this file and store certain information to a certain list.
Whats the best way to store configuration settings like the name of the output list, names of the Excel columns that the Workflow needs to process, etc?
I understand that there seem to be a lot of different possible solutions like web config, Properties, etc. But since I am totally new to Sharepoint, I cannot properly assess these methods. Which one is the easiest for me to use?
Thank you.
Edit: A Visual Studio Workflow, written in C#
This article is a good starting point Six Ways to to store settings in SharePoint but personally I would be following the MSDN SharePoint Guidance Library which uses the Property Bag storage for their implementation of a hierarchical Configuration Manager which allows you to do things like a farm wide setting but overridden for certain site collections/sites/lists etc.

SharePoint -how to show List data on a custom web part/ web user control?

I am trying every option to show List data on a web part and web user control, but I am not finding any code examples on this. What namespace should I import?
I am using WSS 3.0 and I will later upgrade to MOSS 2007. I am aware of the SmartPart project and I can use it in my environment.
Thank you very much for your help.
You should first look at the Data View Web Part (DVWP) to see if that will fit your needs. With some XLST/JavaScript you can get very creative with this.
Data View Web Part Basics
Otherwise you need to understand two things :-
Creating a Basic web part
This is for VS2010/SharePoint 2010 but you will find similar walkthroughs for other versions such as :-
http://www.codeguru.com/csharp/.net/net_asp/webforms/article.php/c12293/
http://channel9.msdn.com/posts/kmcgrath/Creating-a-Web-Part-for-SharePoint-by-Using-a-Designer/
http://www.codeproject.com/KB/sharepoint/Generic_Webparts.aspx
Accessing SharePoint List data
Then once you've got your basic web part you need to know how to use the object model to open a list and iterate through the items in a list to display the data in whatever funky way you want.
Accessing list items

How do modify a form on a sharepoint site?

I have a task that I need to perform for a friend as a favor, to modify some forms on a MOSS/Sharepoint site to add some javascript to each form for some SEO tracking purposes.
I've had a little bit of exposure to Sharepoint, but it is mostly by using the Sharepoint Designer 2007 tool.
I am able to navigate to the site, and I can see the content in Sharepoint Designer. However, I am not able to see the forms, and I'm a bit stuck.
Here is an example of a form that I need to modify:
http://www.MY_SITE_GOES_HERE.com/forms/covg_order.aspx
I've read a little online, but I'm stuck. I don't know if these are infopath forms or what. I just need to modify the forms.
Is there a simple answer to this problem? Or a good resource to get up to speed quickly for this task?
I'm not a sharepoint expert, so thank you in advance for answering a simple question.
While hardly the simplest approach, but since this is a developer site, I would recommend creating a DelegateControl to add to your site. Using DelegateControls has several benefits, for example:
the ability to selectively activate and deactivate the controls through features
no need to modify any out-of-the-box files which would break supportability
ability to output different content on a page-by-page basis
You can opt to use one of the DelegateControls of the default master pages if you need to deploy to an existing site based on one of the default site definitions. The AdditionalPageHead is a favorite among developers, as it allows multiple overrides to be active at the same time.
If you want to create your own master pages you can add DelegateControls as you like.
If you want to learn more about DelegateControls you can check out the first issue of Understanding SharePoint Journal (Disclaimer: I wrote that issue). Also, check out the MSDN article on How to customize a Delegate Control.
.b
you can also check PowerForms which is a silverlight webpart that fully customizes sharepoint forms. You can add business logic in forms using custom assemblies and a lot other advanced tasks. Give it a try, i think it will solve a lot of problems.
http://www.bpc.gr/powerforms
You have a couple of options here:
If you need to add a unique code, like Google analytics you should probably deploy your code to the master page.
In case you need to customize forms for lists you will have to do it with SharePoint designer. In that case you will find EditItem.aspx and NewItem.aspx with SharePoint Designer pages or any other custom page. Open SPD, locate your list, expand it, look for Forms subfolder and you will find all the forms there.
Microsoft Office SharePoint Designer is now free, as of 1-Apr-2009. It's a good tool, not only for modifying individual pages, but for entire sites.

Sharepoint: Best way to display lists of non-Sharepoint content with "compatible" UI?

I've built a web part for Sharepoint that retrieves data from an external service. I'd like to display the items in a way that's UI-compatible with Sharepoint (fits in with its surroundings.)
I'm aware of the "DataFormWebPart" but was unable to get one working properly. It requires a valid DataSource and I was unable to build one from the results of a web service call... Part of the problem is that my web service wrappers don't expose the XML return info, rather I have a bunch of deserialized objects. There doesn't seem to be an easy way to turn actual objects into a datasource, or populate a "generic" datasource from object data.
I could use an SPGridView to get the same UI, but the grid control doesn't have much in the way of smarts -and- it forces every field into its own column. I'd prefer to render each list item as a single cell with complex rendering (for instance the way that StackOverflow shows its lists of questions.) I'd also like to get as much of the Sharepoint-standard UI as possible, such as the sorting, filtering, and paging controls.
So, first: Has anyone here written a Sharepoint control that does this, and if so do you have sample code to share? If not: am I overlooking some useful control, whether MS-supplied or available in an external library?
Thanks!
Steve
Sharepoint: Best way to display lists
of non-Sharepoint content with
“compatible” UI?
Take a look at the built in sharepoint web controls:
Microsoft.SharePoint.WebControls Namespace
It contains all the controls used in sharepoint. I'd tell you more, but the documentation is very thorough.
Problem with SharePoint is that there are a bunch of different ways to do this. If your data is not changing too often and is not overly large it may be worth considering entering it into a list for display.
If you have the Enterprise licence it may be worth getting your data into the BDC and using it there.
you may have to convert the objects into xml or use the serialised objects with the XML webpart for display. This still has the issue of custom rendering using XSLT.
Here's a great article that explains how to configure BDC connections to web services using the BDC Definition Editor:
Creating a Web Service Connection by Using the Business Data Catalog Definition Editor
http://msdn.microsoft.com/en-us/library/bb737887.aspx
The best way to do this IMO is to make a Web Part. As a Web Part the UI will be automatically rendered to be the same as the theme the site is using (unless you override it) and it will be able to be placed anywhere by anyone with admin privileges.
Tutorial on making a Web Part
Tutorial on packaging and deploying a Web Part
Example Web Part Source Code
You could create a custom web part and use an SPGridView. You say you don't like it, because it forces every field into its own column, but that's not true. You can create a template (ITemplate) for every column and fully customize what's shown inside it, just like you would using a normal ASP.Net GridView. Using this approach I've added the little "New" images right next to a list item's Title, just like SharePoint does itself.

Resources