Skip to content

Commit

Permalink
now works with content-type for configuration :)
Browse files Browse the repository at this point in the history
  • Loading branch information
iJungleboy committed Dec 15, 2017
1 parent 99292c2 commit b4aa659
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_":{"V":1},"ContentType":{"Id":"d98db323-7c33-4f2a-b173-ef91c0875124","Name":"|Config ToSic.SexyContent.DataSources.DnnFormAndList","Scope":"System","Description":"Configuration for the Form and List Data Source","Attributes":[{"Name":"Title","Type":"String","IsTitle":true,"Metadata":[{"Id":40448,"Version":1,"Guid":"eb7cacd2-6da7-42cf-a38c-3c1e0b6f4457","Type":{"Name":"@All","Id":"@All"},"Attributes":{"String":{"DefaultValue":{"*":"FnL DataSource Configuration"},"Name":{"*":"Title"},"Notes":{"*":"<p>Just a title for you to give this configuration a name.</p>"}},"Boolean":{"Required":{"*":true},"VisibleInEditUI":{"*":true}}},"Owner":"dnn:userid=1"}]},{"Name":"Notes","Type":"String","IsTitle":false,"Metadata":[{"Id":43374,"Version":2,"Guid":"8898809b-f758-46b0-9e60-5dc543100107","Type":{"Name":"@All","Id":"@All"},"Attributes":{"String":{"CustomJavaScript":{"*":""},"DefaultValue":{"*":""},"InputType":{"*":"string-default"},"Name":{"*":"Notes"},"Notes":{"*":"<p>just some notes if you want them...</p>"},"ValidationRegExJavaScript":{"*":""}},"Boolean":{"Disabled":{"*":false},"Required":{"*":false},"VisibleInEditUI":{"*":true}}},"Owner":"dnn:userid=1"},{"Id":43375,"Version":1,"Guid":"97e0be58-3513-4e0d-89b9-27bb90c6db4d","Type":{"Name":"@string-default","Id":"@string-default"},"Attributes":{"Number":{"RowCount":{"*":3.0}}},"Owner":"dnn:userid=1"}]},{"Name":"ModuleId","Type":"String","IsTitle":false,"Metadata":[{"Id":40449,"Version":1,"Guid":"f7093be0-ebc7-4759-aa90-d54808ba0fe2","Type":{"Name":"@All","Id":"@All"},"Attributes":{"String":{"DefaultValue":{"*":""},"Name":{"*":"FnL Module Id"},"Notes":{"*":"<p>The ID of the Form and List Module in DNN. The Data will be retrieved from that specific module.&nbsp;</p>"}},"Boolean":{"Required":{"*":true},"VisibleInEditUI":{"*":true}}},"Owner":"dnn:userid=1"}]},{"Name":"TitleFieldName","Type":"String","IsTitle":false,"Metadata":[{"Id":40450,"Version":1,"Guid":"48ff65ea-ba00-4243-87c5-9132f24cd593","Type":{"Name":"@All","Id":"@All"},"Attributes":{"String":{"DefaultValue":{"*":""},"Name":{"*":"Title Field Name"},"Notes":{"*":"<span>The column in Form and List which should become the title of the resulting content-items. If you leave this blank, the system will just pick the first column as title.&nbsp;</span>"}},"Boolean":{"Required":{"*":false},"VisibleInEditUI":{"*":true}}},"Owner":"dnn:userid=1"}]},{"Name":"ContentTypeName","Type":"String","IsTitle":false,"Metadata":[{"Id":40451,"Version":1,"Guid":"fef1a456-4e74-4299-8a1b-792da607a5ec","Type":{"Name":"@All","Id":"@All"},"Attributes":{"String":{"DefaultValue":{"*":""},"Name":{"*":"Content Type Name"},"Notes":{"*":"<p>This is the internal name for the resulting Content-Type. Usually not important, if you leave it blank a default value (usually FnL) is used.&nbsp;</p>"}},"Boolean":{"Required":{"*":false},"VisibleInEditUI":{"*":true}}},"Owner":"dnn:userid=1"}]}],"Metadata":[{"Id":43373,"Version":1,"Guid":"ac8e7948-52fa-4f9f-abc6-f3527ac58186","Type":{"Name":"ContentType","Id":"ContentType"},"Attributes":{"String":{"Description":{"*":"Configuration for the Form and List Data Source"},"EditInstructions":{"*":"<p>This data-source lets you access FnL (UDT) data and process / show it in 2sxc. Here is the <a href=\"https://github.com/2sic/dnn-datasource-form-and-list/wiki\" target=\"_blank\" rel=\"noopener\">wiki</a> if you need it (still work in progress...)</p>"},"Label":{"*":"|Config ToSic.SexyContent.DataSources.DnnFormAndList"},"Notes":{"*":""}},"Hyperlink":{"Icon":{"*":""},"Link":{"*":""}}},"Owner":"dnn:userid=1","For":{"Target":"ContentType","String":"d98db323-7c33-4f2a-b173-ef91c0875124"}}]}}
2 changes: 2 additions & 0 deletions ToSic.Dnn.DataSources.FnL/BuildScripts/ModulePackage.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<!--in VS 2012 we exclude the packages folder -->
<ItemGroup>
<InstallInclude Include="**\*.ascx" Exclude="packages\**" />
<!-- this is the only important addition to get the types to work... -->
<InstallInclude Include="**\*.json" Exclude="packages\**" />
<InstallInclude Include="**\*.asmx" Exclude="packages\**" />
<InstallInclude Include="**\*.css" Exclude="packages\**" />
<InstallInclude Include="**\*.html" Exclude="packages\**" />
Expand Down
7 changes: 4 additions & 3 deletions ToSic.Dnn.DataSources.FnL/DnnFormAndList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ namespace ToSic.Dnn.DataSources
/// <summary>
/// Delivers UDT-data (now known as Form and List) to the templating engine
/// </summary>
[VisualQuery(GlobalName = "ToSic.Dnn.DataSources.DnnFormAndList",
[VisualQuery(GlobalName = "0a0924a5-ca2f-4db5-8fc7-1a21fdbb2fbb",
PreviousNames = new []{
"Environment.Dnn7.DataSources.DnnFormAndList, ToSic.SexyContent",
"ToSic.SexyContent.DataSources.DnnFormAndList, ToSic.SexyContent" },
Type = DataSourceType.Source,
DynamicOut = true,
ExpectsDataOfType = "|Config ToSic.SexyContent.DataSources.DnnFormAndList")] // todo: create new/own
DynamicOut = false,
ExpectsDataOfType = "d98db323-7c33-4f2a-b173-ef91c0875124",
HelpLink = "https://github.com/2sic/dnn-datasource-form-and-list/wiki")]

public sealed class DnnFormAndList : ExternalDataDataSource
{
Expand Down
24 changes: 24 additions & 0 deletions ToSic.Dnn.DataSources.FnL/RegisterContentTypeForConfigUi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.Web;
using ToSic.Eav.Repositories;

namespace ToSic.Dnn.DataSources
{
/// <summary>
/// This class simply tell the EAV / 2sxc that there is another folder
/// which contains content-types to load from...
/// </summary>
public class RegisterContentTypeForConfigUi: RepositoryInfoOfFolder
{
/// <summary>
/// Empty constructor, so it can be used from reflection
/// </summary>
public RegisterContentTypeForConfigUi() : base(true, true, null) { }

public override List<string> RootPaths => new List<string>
{
HttpContext.Current.Server.MapPath("~/desktopmodules/ToSic.Dnn.DataSources.FnL/.data")
};

}
}
7 changes: 6 additions & 1 deletion ToSic.Dnn.DataSources.FnL/ToSic.Dnn.DataSources.FnL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ToSic.Dnn.DataSourcesToSic.Dnn.DataSources.FnL</RootNamespace>
<RootNamespace>ToSic.Dnn.DataSources</RootNamespace>
<AssemblyName>ToSic.Dnn.DataSources.FnL</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<UseIISExpress>false</UseIISExpress>
Expand Down Expand Up @@ -80,6 +80,7 @@
<ItemGroup>
<Compile Include="DnnFormAndList.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RegisterContentTypeForConfigUi.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="License.txt" />
Expand All @@ -102,6 +103,10 @@
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include=".data\contenttypes\System.d98db323-7c33-4f2a-b173-ef91c0875124.json" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
88 changes: 87 additions & 1 deletion ToSic.Dnn.DataSources.FnL/ToSic.Dnn.DataSources.FnL.dnn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="ToSic.Dnn.DataSources.FnL" type="Module" version="01.00.00">
<friendlyName>ToSic.Dnn.DataSources.FnL</friendlyName>
<friendlyName>FormAndList DataSource for Dnn/2sxc/EAV</friendlyName>
<description>2sic.com ToSic.Dnn.DataSources.FnL module</description>
<iconFile>~/Images/icon_extensions_32px.png</iconFile>
<owner>
Expand All @@ -18,6 +18,92 @@
</dependencies>

<components>
<!--<component type="Script">
<scripts>
<basePath>DesktopModules\ToSic.Dnn.DataSources.FnL</basePath>
<script type="Install">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>01.00.00.SqlDataProvider</name>
<version>01.00.00</version>
</script>
<script type="UnInstall">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>Uninstall.SqlDataProvider</name>
<version>01.00.00</version>
</script>
</scripts>
</component>
-->

<component type="ResourceFile">
<resourceFiles>
<basePath>DesktopModules/ToSic.Dnn.DataSources.FnL</basePath>
<resourceFile>
<name>Resources.zip</name>
</resourceFile>
</resourceFiles>
</component>

<!--<component type="Module">
<desktopModule>
<moduleName>ToSic.Dnn.DataSources.FnL</moduleName>
<foldername>ToSic.Dnn.DataSources.FnL</foldername>
<businessControllerClass>ToSic.Dnn.DataSourcesToSic.Dnn.DataSources.FnL.Components.FeatureController, ToSic.Dnn.DataSources.FnL</businessControllerClass>
<supportedFeatures>
<supportedFeature>IPortable</supportedFeature>
<supportedFeature>ISearchable</supportedFeature>
<supportedFeature>IUpgradeable</supportedFeature>
</supportedFeatures>
<moduleDefinitions>
<moduleDefinition>
<friendlyName>ToSic.Dnn.DataSources.FnL</friendlyName>
<defaultCacheTime>0</defaultCacheTime>
<moduleControls>
<moduleControl>
<controlKey />
<controlSrc>DesktopModules/ToSic.Dnn.DataSources.FnL/View.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle />
<controlType>View</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
<moduleControl>
<controlKey>Edit</controlKey>
<controlSrc>DesktopModules/ToSic.Dnn.DataSources.FnL/Edit.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>Edit Content</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
<supportsPopUps>True</supportsPopUps>
</moduleControl>
<moduleControl>
<controlKey>Settings</controlKey>
<controlSrc>DesktopModules/ToSic.Dnn.DataSources.FnL/Settings.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>ToSic.Dnn.DataSources.FnL Settings</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
</moduleControls>
</moduleDefinition>
</moduleDefinitions>
</desktopModule>
<eventMessage>
<processorType>DotNetNuke.Entities.Modules.EventMessageProcessor, DotNetNuke</processorType>
<processorCommand>UpgradeModule</processorCommand>
<attributes>
<businessControllerClass>ToSic.Dnn.DataSourcesToSic.Dnn.DataSources.FnL.Components.FeatureController, ToSic.Dnn.DataSources.FnL</businessControllerClass>
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
<upgradeVersionsList>01.00.00</upgradeVersionsList>
</attributes>
</eventMessage>
</component>-->
<component type="Assembly">
<assemblies>
<assembly>
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit b4aa659

Please sign in to comment.