<commit_before>﻿# -----------------------------------------------------------------------
# Copyright		: GSoft @2015
# Model  		: Standard Publishing CMS
# File          : Setup-SPWebs.ps1.template
# Description	: Create a SharePoint SPWebs structure
# -----------------------------------------------------------------------

Param (
        [Parameter(Mandatory=$false)]
        [switch]$IgnoreWebs=$false
)

# Check sub sites settings. We use a custom token for Standard Publishing CMS.
# In the Cross Site Publishing CMS model, root web URLs are defined directly in the token file. They are used after by the Tokens.Common.ps1 logic to get multilingual URLs. 
# I you have 200 subsites to create, this method can't be applied...
$HasSubsites = [System.Convert]::ToBoolean("[[DSP_HasSubsites]]")

# Check the web configuration in the token file
if (-not $HasSubsites)
{
    return
}

if ($IgnoreWebs -eq $true)
{
    Write-Warning "'IgnoreWebs' parameter was specified. Skipping webs creation..."
    return
}

$0 = $myInvocation.MyCommand.Definition
$CommandDirectory = [System.IO.Path]::GetDirectoryName($0)

$DefaultConfigurationFile = "[[DSP_DEFAULT_PortalWebsConfigurationFile]]"
$CustomConfigurationFile = "[[DSP_CUSTOM_PortalWebsConfigurationFile]]"

$ConfigurationFilePath = $CommandDirectory + ".\" + $DefaultConfigurationFile

if(![string]::IsNullOrEmpty($CustomConfigurationFile))
{
    $ConfigurationFilePath = $CommandDirectory + ".\" + $CustomConfigurationFile
}

[xml]$webXml = Get-Content $ConfigurationFilePath

# Creates Webs structure under the root web of the source variation branch (only one web here)
[[DSP_AuthoringSourceRootWebUrls]] | Foreach-Object {

    # Create the new SharePoint Web structure
    $Webs = Import-DSPWebStructure -InputFileName $ConfigurationFilePath -ParentUrl $_ -Overwrite:$Force
}	

# Check Multilingual settings
$IsMultilingual = [System.Convert]::ToBoolean("[[DSP_IsMultilingual]]")

if($IsMultilingual)
{
    $values = @{"Step: " = "#2.1 Setup Webs Variations"}
    New-HeaderDrawing -Values $Values<commit_msg>[Oops] went too fast, forgot to stage file<commit_after>﻿# -----------------------------------------------------------------------
# Copyright		: GSoft @2015
# Model  		: Standard Publishing CMS
# File          : Setup-SPWebs.ps1.template
# Description	: Create a SharePoint SPWebs structure
# -----------------------------------------------------------------------

Param (
        [Parameter(Mandatory=$false)]
        [switch]$IgnoreWebs=$false
)

# Check sub sites settings. We use a custom token for Standard Publishing CMS.
# In the Cross Site Publishing CMS model, root web URLs are defined directly in the token file. They are used after by the Tokens.Common.ps1 logic to get multilingual URLs. 
# I you have 200 subsites to create, this method can't be applied...
$HasSubsites = [System.Convert]::ToBoolean("[[DSP_HasSubsites]]")

# Check the web configuration in the token file
if (-not $HasSubsites)
{
    return
}

if ($IgnoreWebs -eq $true)
{
    Write-Warning "'IgnoreWebs' parameter was specified. Skipping webs creation..."
    return
}

$0 = $myInvocation.MyCommand.Definition
$CommandDirectory = [System.IO.Path]::GetDirectoryName($0)

$DefaultConfigurationFile = "[[DSP_DEFAULT_PortalWebsConfigurationFile]]"
$CustomConfigurationFile = "[[DSP_CUSTOM_PortalWebsConfigurationFile]]"

$ConfigurationFilePath = $CommandDirectory + ".\" + $DefaultConfigurationFile

if(![string]::IsNullOrEmpty($CustomConfigurationFile))
{
    $ConfigurationFilePath = $CommandDirectory + ".\" + $CustomConfigurationFile
}

[xml]$webXml = Get-Content $ConfigurationFilePath

# Creates Webs structure under the root web of the source variation branch (only one web here)
[[DSP_AuthoringSourceRootWebUrls]] | Foreach-Object {

    # Create the new SharePoint Web structure
    $Webs = Import-DSPWebStructure -InputFileName $ConfigurationFilePath -ParentUrl $_
}	

# Check Multilingual settings
$IsMultilingual = [System.Convert]::ToBoolean("[[DSP_IsMultilingual]]")

if($IsMultilingual)
{
    $values = @{"Step: " = "#2.1 Setup Webs Variations"}
    New-HeaderDrawing -Values $Values
{'fraction_non_alphanumeric': 0.17080820265379976, 'fraction_numerical': 0.006272617611580217, 'mean_word_length': 3.4012738853503186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6005155', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1117, 'n_words': 331}