European Sharepoint 2013 Hosting Blog
Articles about European Sharepoint Hosting Service
Articles about European Sharepoint Hosting Service
Oct 2nd
VerticalTimeline Props
animate={ Boolean } | Enable or disable animations on elements (default: true). |
className={ String } | Add extra class name to root div element. |
layout={ String } | Choose if you want ‘1-column’ or ‘2-columns’ (default: ‘2-columns’). |
className={ String } | Add extra class name to root div element. |
contentArrowStyle={ Object } | Add extra style to content arrow div element. |
contentStyle={ Object } | Add extra style to content div element. |
date={ String } | Date of the element. |
dateClassName={ String } | Add extra class name to the element’s date. |
icon={ String } | Icon of the element. |
iconClassName={ String } | Add extra class name to the element’s icon. |
iconOnClick={ Function } | onClick handler of the element’s icon. |
onTimelineElementClick={ Function } | onClick handler of the vertical timeline element’s div. |
iconStyle={ Object } | Style of the element’s icon. |
position={ String } | Position of the element (left or right). |
style={ Object } | Add extra style to root div element. |
textClassName={ String } | Add extra class name to the text container. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
import * as React from 'react'; import { IReactTimelineProps } from './IReactTimelineProps'; import { VerticalTimeline, VerticalTimelineElement } from 'react-vertical-timeline-component'; import 'react-vertical-timeline-component/style.min.css'; import SchoolIcon from '@material-ui/icons/School'; import WorkIcon from '@material-ui/icons/Work'; import StarIcon from '@material-ui/icons/Star'; import LoyaltyIcon from '@material-ui/icons/Loyalty'; import './mystyle.css'; import * as CSS from 'csstype'; var divStyle: CSS.Properties<string | number> = { background: 'rgb(227, 227, 227)' }; export default class ReactTimeline extends React.Component<IReactTimelineProps, {}> { public render(): React.ReactElement<IReactTimelineProps> { return ( <div style={divStyle}> <VerticalTimeline> <VerticalTimelineElement className="vertical-timeline-element--work" contentStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }} contentArrowStyle={{ borderRight: '7px solid rgb(33, 150, 243)' }} date="2019 - 2020" iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }} icon={<LoyaltyIcon />} > <h3 className="vertical-timeline-element-title">Most Valuable Proffesional</h3> <h4 className="vertical-timeline-element-subtitle">MVP</h4> <p> 1St time awarded as a C#Corner MVP </p> </VerticalTimelineElement> <VerticalTimelineElement className="vertical-timeline-element--work" date="2019 - Till Date" iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }} icon={<WorkIcon />} > <h3 className="vertical-timeline-element-title">Software Engineer,Smartek21</h3> <h4 className="vertical-timeline-element-subtitle">SharePoint Developer</h4> <p> SharePoint Online ,Onpremise,M365 Development </p> </VerticalTimelineElement> <VerticalTimelineElement className="vertical-timeline-element--work" date="2016 - 2019" iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }} icon={<WorkIcon />} > <h3 className="vertical-timeline-element-title">Junior Software Engineer,Zylog Systems</h3> <h4 className="vertical-timeline-element-subtitle">SharePoint Developer</h4> <p> SharePoint Online ,Onpremise,M365 Development </p> </VerticalTimelineElement> <VerticalTimelineElement className="vertical-timeline-element--education" date="2012 - 2014" iconStyle={{ background: 'rgb(233, 30, 99)', color: '#fff' }} icon={<SchoolIcon />} > <h3 className="vertical-timeline-element-title">Master of Engineering</h3> <h4 className="vertical-timeline-element-subtitle">M.E.</h4> <p> Computer and Communication </p> </VerticalTimelineElement> <VerticalTimelineElement className="vertical-timeline-element--education" date="2009 - 2012" iconStyle={{ background: 'rgb(233, 30, 99)', color: '#fff' }} icon={<SchoolIcon />} > <h3 className="vertical-timeline-element-title">Bachelor of Engineering</h3> <h4 className="vertical-timeline-element-subtitle">B.E.</h4> <p> Computer Science and Engineering </p> </VerticalTimelineElement> <VerticalTimelineElement className="vertical-timeline-element--education" date="2007 - 2009" iconStyle={{ background: 'rgb(233, 30, 99)', color: '#fff' }} icon={<SchoolIcon />} > <h3 className="vertical-timeline-element-title">Diploma in Computer Engineering</h3> <h4 className="vertical-timeline-element-subtitle">Diploma Degree</h4> <p> Computer Technology </p> </VerticalTimelineElement> <VerticalTimelineElement iconStyle={{ background: 'rgb(16, 204, 82)', color: '#fff' }} icon={<StarIcon />} /> </VerticalTimeline> </div> ); } } |
in mystyle.css,
1 2 3 4 5 6 7 8 9 |
.vertical-timeline::before { content: ""; position: absolute; top: 0px; left: 18px; height: 100%; width: 4px; background:black!important; } |
Output:
Sep 24th
1 |
$var.DisplayLevel = ‘OnDemand’; |
1 2 3 |
$var = Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings; $var.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off $var.Update() |
1 2 3 4 5 6 |
using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; SPDeveloperDashboardSettings settings = SPWebService.ContentService.DeveloperDashboardSettings; settings.DisplayLevel = SPDeveloperDashboardLevel.On; settings.TraceEnabled = true; settings.Update(); |
1 |
<Sharepoint:DeveloperDashboardLauncher ID="DeveloperDashboardLauncher" NavigateUrl="javascript:ToggleDeveloperDashboard()" runat="server" ImageUrl="/_layouts/images/fgimg.png" Text="<%$Resources:wss,multipages_launchdevdashalt_text%>" OffsetX=0 OffsetY=222 Height=16 Width=16 /> |
1 |
<SharePoint:DeveloperDashboard runat="server" /> |
Sep 17th
Aug 31st
Hi guys, let’s explore some amazing ways to completely migrate a nested folder structure with lots of different files which is from your local path to a SP online library using PnP PowerShell.
Here is the script to run on Windows ISE Powershell:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
#Function to Copy Multiple Files with Folder structure to SharePoint Online Document Library Function Migrate - PnPFolderToSPO() { param( [Parameter(Mandatory = $true)][string] $SiteURL, [Parameter(Mandatory = $true)][string] $SourceFolderPath, [Parameter(Mandatory = $true)][string] $LibraryName, [Parameter(Mandatory = $true)][string] $LogFile) Try { Add - content $Logfile - value "`n---------------------- File Upload Script Started: $(Get-date -format 'dd/MM/yyy hh:mm:ss tt')-------------------" #Connect to PnP Online Connect - PnPOnline - Url $SiteURL - UseWebLogin #Get the Target Folder to Upload $Web = Get - PnPWeb $List = Get - PnPList $LibraryName - Includes RootFolder $TargetFolder = $List.RootFolder $TargetFolderSiteRelativeURL = $TargetFolder.ServerRelativeURL.Replace($Web.ServerRelativeUrl, "") #Get All Items from the Source $Source = Get - ChildItem - Path $SourceFolderPath - Recurse $SourceItems = $Source | Select FullName, PSIsContainer, @ { Label = 'TargetItemURL'; Expression = { $_.FullName.Replace($SourceFolderPath, $TargetFolderSiteRelativeURL).Replace("\"," / ")}} Add - content $Logfile - value "Number of Items Found in the Source: $($SourceItems.Count)" #Upload Source Items from Fileshare to Target SharePoint Online document library $Counter = 1 $SourceItems | ForEach - Object { #Calculate Target Folder URL $TargetFolderURL = (Split - Path $_.TargetItemURL - Parent).Replace("\"," / ") $ItemName = Split - Path $_.FullName - leaf #Replace Invalid Characters $ItemName = [RegEx]::Replace($ItemName, "[{0}]" - f([RegEx]::Escape([String] '\"*:<>?/\|')), '_') #Display Progress bar $Status = "uploading '" + $ItemName + "' to " + $TargetFolderURL + " ($($Counter) of $($SourceItems.Count))" Write - Progress - Activity "Uploading ..." - Status $Status - PercentComplete(($Counter / $SourceItems.Count) * 100) If($_.PSIsContainer) { #Ensure Folder $Folder = Resolve - PnPFolder - SiteRelativePath($TargetFolderURL + "/" + $ItemName) Write - host "Ensured Folder '$($ItemName)' to Folder $TargetFolderURL" Add - content $Logfile - value "Ensured Folder '$($ItemName)' to Folder $TargetFolderURL" } Else { #Upload File $File = Add - PnPFile - Path $_.FullName - Folder $TargetFolderURL Write - host "Uploaded File '$($_.FullName)' to Folder $TargetFolderURL" Add - content $Logfile - value "Uploaded File '$($_.FullName)' to Folder $TargetFolderURL" } $Counter++ } } Catch { Write - host - f Red "Error:" $_.Exception.Message Add - content $Logfile - value "Error:$($_.Exception.Message)" } Finally { Add - content $Logfile - value "---------------------- File upload Script Completed: $(Get-date -format 'dd/MM/yyy hh:mm:ss tt')-----------------" } } #Call the Function to Upload a Folder to SharePoint Online Migrate - PnPFolderToSPO - SiteURL "https://samplesharenet.sharepoint.com/sites/classictest" - SourceFolderPath "C:\Users\Bharat\Documents\Bharat\General Works for Internal Requirements" - LibraryName "PnPCopytoLib" - LogFile "C:\Users\Bharat\PnPTest\Migration-LOG.log" |
Just enter your own respective details which are highlighted in the above script.
When it starts running, enter your Site Admin/Global Admin Tenant details to start the processing.
You can see the Uploading in Progress on your Windows Powershell ISE Interface. Just wait until it gets finished!
This script copies the contents of a folder to the SharePoint Online document library. It overwrites any existing file in the target SharePoint Online library. It creates a folder if it doesn’t exist on the target site already. We can also use this script to migrate files and folders from network file share to SharePoint Online document library!
Creative Idea
You can have the above script triggered through a Flow/Azure Flow[Logic Apps] to have an automated Copying and include Removal in the Source to establish an Automated Archival Process for your Business needs.
Aug 24th
1 2 3 4 |
if ((Get - PSSnapin - Name Microsoft.SharePoint.PowerShell - ErrorAction SilentlyContinue) - eq $null) { Write - Host "Loading SharePoint PowerShell" Add - PSSnapin Microsoft.SharePoint.PowerShell } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$SPWebApp = Get - SPWebApplication $WebApp - EA SilentlyContinue if ($SPWebApp - eq $null) { Write - Error "$WebApp url is not a valid!" } else { $allsites = $SPWebApp.Sites foreach($site in $allsites) { try { $allwebs = $site.AllWebs foreach($web in $allwebs) { try { if ([Microsoft.SharePoint.Publishing.PublishingWeb]::IsPublishingWeb($web)) { $pubpages = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web) $allpages = $pubpages.GetPublishingPages() foreach($page in $allpages) { GetCEWPFunction - url $page.Url } } } catch {} finally { $web.Dispose() } } } catch {} finally { $site.Dispose() } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
GetCEWPFunction - url $page.Url } } $lists = $web.GetListsOfType("DocumentLibrary") | ? { $_.IsCatalog - eq $false } foreach($list in $lists) { $allviews = $list.Views foreach($view in $allviews) { GetCEWPFunction - url $view.Url } $allforms = $list.Forms foreach($form in $allforms) { GetCEWPFunction - url $form.Url } } } catch {} finally { $web.Dispose() } } } catch {} finally { $site.Dispose() } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
function GetCEWPFunction([string] $url) { $manager = $web.GetLimitedWebPartManager($url, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) $allwebParts = $manager.WebParts if ($allwebParts.Count - ne 0) { foreach($webPart in $allwebParts) { if ($webPart.GetType() - eq[Microsoft.SharePoint.WebPartPages.ContentEditorWebPart]) { if ($webPart.ContentLink.Length - gt 0) { $file = $web.GetFile($webPart.ContentLink) $data = $file.OpenBinary() $encode = New - Object System.Text.ASCIIEncoding $contents = $encode.GetString($data) if ($contents.ToLower().Contains("<script>")) { Write - Output "$($web.Url)/$url (CONTENTLINK)" } break } if ($webPart.Content.InnerText.Contains("<script>")) { Write - Output "$($web.Url)/$url (HTML)" } } } } } |
Aug 13th
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';.app { .top { height: 60 px; text - align: center; line - height: 2.5; font - weight: bold; display: flex; align - items: center; justify - content: center; background - color: $ms - color - themePrimary; color: $ms - color - white; }.bottom { height: 40 px; text - align: center; line - height: 2.5; font - weight: bold; display: flex; align - items: center; justify - content: center; background - color: $ms - color - themePrimary; color: $ms - color - white; } }.topnav { overflow: hidden; background - color: black; }.topnav a { float: left; color: #f2f2f2; text - align: center; padding: 14 px 16 px; text - decoration: none; font - size: 17 px; }.topnav a: hover { background - color: #ddd; color: black; }.topnav a.active { background - color: #4CAF50; color: white; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
import { override } from '@microsoft/decorators'; import { Log } from '@microsoft/sp-core-library'; import { BaseApplicationCustomizer, PlaceholderContent, PlaceholderName } from '@microsoft/sp-application-base'; import { Dialog } from '@microsoft/sp-dialog'; import * as strings from 'Ext2ApplicationCustomizerStrings'; import styles from './AppCustomizer.module.scss'; import { escape } from '@microsoft/sp-lodash-subset'; const LOG_SOURCE: string = 'Ext2ApplicationCustomizer'; export interface IExt2ApplicationCustomizerProperties { Top: string; Bottom: string; } /** A Custom Action which can be run during execution of a Client Side Application */ export default class Ext2ApplicationCustomizer extends BaseApplicationCustomizer < IExt2ApplicationCustomizerProperties > { private _bottomPlaceholder: PlaceholderContent | undefined; @override public onInit(): Promise < void > { this.context.placeholderProvider.changedEvent.add(this, this._renderPlaceHolders); return Promise.resolve(); } private _renderPlaceHolders(): void { const topPlaceholder = this.context.placeholderProvider.tryCreateContent(PlaceholderName.Top, { onDispose: this.onDispose }); if (!topPlaceholder) { console.error("The expected placeholder (Top) was not found."); return; } if (topPlaceholder.domElement) { topPlaceholder.domElement.innerHTML = ` <div class = "${styles.topnav}"> <a class = "${styles.active}" href = "https://dronzer.sharepoint.com/sites/Barcelona/SitePages/Home.aspx">Home</a> <a href = "https://dronzer.sharepoint.com/sites/Liverpool">News</a> <a href = "https://dronzer.sharepoint.com/sites/chelsea">About us</a> <a href = "https://dronzer.sharepoint.com/sites/mancity">Find Mentor</a> </div> <span class = "${styles.top}">Hello! ${escape(this.context.pageContext.user.displayName)}</span> `; } // Handling the bottom placeholder if (!this._bottomPlaceholder) { this._bottomPlaceholder = this.context.placeholderProvider.tryCreateContent(PlaceholderName.Bottom, { onDispose: this._onDispose }); // The extension should not assume that the expected placeholder is available. if (!this._bottomPlaceholder) { console.error("The expected placeholder (Bottom) was not found."); return; } if (this.properties) { let bottomString: string = this.properties.Bottom; if (!bottomString) { bottomString = "(Bottom property was not defined.)"; } if (this._bottomPlaceholder.domElement) { this._bottomPlaceholder.domElement.innerHTML = ` <div class="${styles.app}"> <div class="${styles.bottom}"> <i aria-hidden="true"></i> ${escape( bottomString )} </div> </div>` } } } } private _onDispose(): void { console.log('[HelloWorldApplicationCustomizer._onDispose] Disposed custom top and bottom placeholders.'); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
{ "$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json", "port": 4321, "https": true, "serveConfigurations": { "default": { "pageUrl": "enter the site url", "customActions": { "716b612c-e184-4ccc-a24e-604a7c837821": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "Top": "DRONZER10", "Bottom": "Nilanjan Mukherjee" } } } }, "ext2": { "pageUrl": "enter the site url", "customActions": { "716b612c-e184-4ccc-a24e-604a7c837821": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "Top": "DRONZER10", "Bottom": "Nilanjan Mukherjee" } } } } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
{ "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "ext-2-client-side-solution", "id": "8e90fd7b-a799-4834-82c6-d55b530af66c", "version": "4.0.0.0", "includeClientSideAssets": true, "isDomainIsolated": false, "developer": { "name": "", "websiteUrl": "", "privacyUrl": "", "termsOfUseUrl": "", "mpnId": "" }, "features": [{ "title": "Application Extension - Deployment of custom action.", "description": "Deploys a custom action with ClientSideComponentId association", "id": "e53cf4f6-9ca9-4060-8f09-bca3286ecf18", "version": "1.0.0.0", "assets": { "elementManifests": ["elements.xml"] } }] }, "paths": { "zippedPackage": "solution/ext-2.sppkg" } } |
1 2 3 4 5 6 7 8 9 |
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Title="Ext2" Location="ClientSideExtension.ApplicationCustomizer" ClientSideComponentId="716b612c-e184-4ccc-a24e-604a7c837821" ClientSideComponentProperties="{"Top":"DRONZER10","Bottom":"Nilanjan Mukherjee"}"></CustomAction> </Elements> |
1 2 |
gulp bundle --ship gulp package-solution --ship |
Under the SharePoint folder find the ext-2.sppkg file. Here you can right click and then click on reveal in file explorer.