This repository has been archived by the owner on Jun 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from leekelleher/develop
Preparing for v0.3.0 release
- Loading branch information
Showing
26 changed files
with
423 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ _ReSharper.* | |
Thumbs.db | ||
.DS_Store | ||
*.log | ||
.vs | ||
|
||
artifacts/ | ||
src/packages/*/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
$appPluginsFolder = $project.ProjectItems | Where-Object { $_.Name -eq "App_Plugins" } | ||
$nestedContentFolder = $appPluginsFolder.ProjectItems | Where-Object { $_.Name -eq "NestedContent" } | ||
|
||
if (!$nestedContentFolder) | ||
{ | ||
$newPackageFiles = "$installPath\Content\App_Plugins\NestedContent" | ||
|
||
$projFile = Get-Item ($project.FullName) | ||
$projDirectory = $projFile.DirectoryName | ||
$projectPath = Join-Path $projDirectory -ChildPath "App_Plugins" | ||
$projectPathExists = Test-Path $projectPath | ||
|
||
if ($projectPathExists) { | ||
Write-Host "Updating Nested Content App_Plugin files using PS as they have been excluded from the project" | ||
Copy-Item $newPackageFiles $projectPath -Recurse -Force | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
docs/code-snippets/NC_RENAME_DOCTYPE_OR_PROPERTY_ALIAS.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- # Nested Content SQL scripts | ||
|
||
-- ## Renaming a DocType alias | ||
|
||
UPDATE | ||
cmsPropertyData | ||
SET | ||
dataNtext = CAST(REPLACE(CAST(dataNtext AS nvarchar(max)), '"ncContentTypeAlias":"OLD_ALIAS"', '"ncContentTypeAlias":"NEW_ALIAS"') AS ntext) | ||
WHERE | ||
dataNtext LIKE '%"ncContentTypeAlias":"OLD_ALIAS"%' | ||
; | ||
|
||
UPDATE | ||
cmsDataTypePreValues | ||
SET | ||
[value] = CAST(REPLACE(CAST([value] AS nvarchar(max)), '"ncAlias": "OLD_ALIAS"', '"ncAlias": "NEW_ALIAS"') AS ntext) | ||
WHERE | ||
[value] LIKE '%"ncAlias": "OLD_ALIAS"%' | ||
; | ||
|
||
-- ## Renaming a property alias | ||
|
||
UPDATE | ||
cmsPropertyData | ||
SET | ||
dataNtext = CAST(REPLACE(CAST(dataNtext AS nvarchar(max)), ',"OLD_ALIAS":', ',"NEW_ALIAS":') AS ntext) | ||
WHERE | ||
dataNtext LIKE '%"ncContentTypeAlias":"CONTENT_TYPE_ALIAS"%' | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 3 additions & 84 deletions
87
src/Our.Umbraco.NestedContent/Converters/NestedContentValueConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Our.Umbraco.NestedContent/Converters/SingleNestedContentValueConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using Our.Umbraco.NestedContent.Extensions; | ||
using Umbraco.Core.Logging; | ||
using Umbraco.Core.Models; | ||
using Umbraco.Core.Models.PublishedContent; | ||
using Umbraco.Core.PropertyEditors; | ||
|
||
namespace Our.Umbraco.NestedContent.Converters | ||
{ | ||
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)] | ||
[PropertyValueType(typeof(IPublishedContent))] | ||
public class SingleNestedContentValueConverter : PropertyValueConverterBase | ||
{ | ||
public override bool IsConverter(PublishedPropertyType propertyType) | ||
{ | ||
return propertyType.IsSingleNestedContentProperty(); | ||
} | ||
|
||
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview) | ||
{ | ||
try | ||
{ | ||
return propertyType.ConvertPropertyToNestedContent(source); | ||
} | ||
catch (Exception e) | ||
{ | ||
LogHelper.Error<SingleNestedContentValueConverter>("Error converting value", e); | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.