Compare commits

..

628 Commits

Author SHA1 Message Date
Kevin Giszewski 7f5dbd31c9 Update lang files 2014-09-26 09:13:31 -04:00
Kevin Giszewski a2255aa037 Bump version number to v1.6 2014-09-25 14:27:52 -04:00
Kevin Giszewski 415a84f5c0 Tidy up the PR 2014-09-25 14:21:16 -04:00
doronuziel71 3a0eba401a Fixed type-o 2014-09-17 19:18:47 +03:00
doronuziel71 991d56dac1 Fixed type-o 2014-09-17 19:17:58 +03:00
doronuziel71 f704088bcb Merge remote-tracking branch 'upstream/master' 2014-09-17 18:37:00 +03:00
doronuziel71 a599215620 Introduced override default propety converter 2014-09-16 23:32:16 +03:00
Kevin Giszewski a6e76cb398 Flip-flop scope and fieldset 2014-09-16 13:55:54 -04:00
Kevin Giszewski 4fd134ac74 Expose FS (fieldsets) and Property (alias/value) for helping with creating Archetype from code 2014-09-08 10:39:13 -04:00
Kevin Giszewski 22b87c0a37 Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-09-08 10:00:28 -04:00
Kevin Giszewski d707b55362 Expose serializer for those wanting to create Archetypes from code 2014-09-08 10:00:05 -04:00
Kevin Giszewski 37a195109c Merge pull request #220 from leekelleher/feature/courier-upgrade
Courier: Fix for PropertyItemProvider reference
2014-09-04 08:52:10 -04:00
leekelleher 205919ccae Courier: Turns out that creating a new instance of PropertyItemProvider was a hack.
Replaced with getting the item-provider from the existing collection.
2014-09-04 11:05:41 +01:00
leekelleher 04e57b7d6b Bug fix with the Courier resolver 2014-09-02 16:52:41 +01:00
Kevin Giszewski 9e8cc0c556 Merge pull request #218 from leekelleher/feature/courier-upgrade
Bug fix with the Courier resolver
2014-09-02 11:52:27 -04:00
Kevin Giszewski 8fe90c3b86 Merge pull request #216 from leekelleher/feature/courier-upgrade
Courier upgrade (UaaS)
2014-09-02 08:58:20 -04:00
Kevin Giszewski 99581b0aeb Merge pull request #217 from leekelleher/develop
Housekeeping
2014-09-02 08:57:35 -04:00
leekelleher d8939c59a0 Set the project's assembly references to not "Copy Local".
As these pollute the /bin output folder during build.
2014-09-02 13:30:21 +01:00
leekelleher e49fe6ee17 Fixed the type-name for the error log messages 2014-09-02 13:27:29 +01:00
leekelleher ca52f0a216 Fixed issue with Courier serialization.
When Courier was deserializing, it was treating any nested Archetype as a `JObject`.
The newer serializer routines in Archetype core resolve the previous issue.
2014-09-02 13:24:40 +01:00
leekelleher 08d4e4b51d PersistenceManager.Default was obsoleted, replaced calls with ExecutionContext.DatabasePersistence 2014-09-02 13:20:29 +01:00
leekelleher e9c51ee96e Upgraded Courier assemblies. 2014-09-02 13:20:15 +01:00
Kevin Giszewski b5f281cae0 Prefix property aliases to avoid core css conflicts (BREAKING) 2014-08-26 10:43:37 -04:00
Kevin Giszewski 3bbb27f85e Fix error state LESS and other stuffs 2014-08-26 10:43:13 -04:00
Kevin Giszewski 247eea3477 Merge branch 'develop' 2014-08-26 10:05:18 -04:00
Kevin Giszewski 8635fa7301 Cleanup the LESS even if a little 2014-08-26 10:05:02 -04:00
Rasmus John Pedersen e49a8d947d fixed bug with custom view 2014-08-22 10:46:45 +02:00
Kevin Giszewski 3e2e43d342 Update langs and bump version number 2014-08-21 13:00:52 -04:00
Jeavon Leopold 78ba99a52e Change Archetype value conversion attempt to pass in the Source value to ConvertSourceToObject instead of the Data value 2014-08-18 17:14:17 +01:00
Kevin Giszewski 42efa1a3d4 Merge branch 'pr/200'
Conflicts:
	app/directives/archetypeproperty.js
2014-08-18 09:43:06 -04:00
Kevin Giszewski d2f4fce808 Add enable deep requests 2014-08-18 08:55:13 -04:00
Kevin Giszewski d76a5f58d4 Merge branch 'develop' 2014-08-13 11:29:12 -04:00
Kevin Giszewski f6457416cc Make sort icon black
- WS cleanup
2014-08-13 11:28:57 -04:00
Kevin Giszewski c841813a74 decouple entityResource from the function call 2014-08-13 11:15:29 -04:00
Kevin Giszewski bcc7be94e7 fix typo 2014-08-13 11:05:27 -04:00
Kevin Giszewski e200c22244 More caching 2014-08-12 19:15:08 -04:00
Kevin Giszewski 244db7f19d Add caching to $http.gets 2014-08-12 19:04:20 -04:00
Kevin Giszewski 31f3d00b76 Add label helpers 2014-08-12 17:15:16 -04:00
Kevin Giszewski 07125bae84 Add ability to pass function as template 2014-08-12 16:56:23 -04:00
kjac f2a8286f00 Fix #131 again
Simplified the validation and fixed the problem mentioned in #131 with
only the last field in a fieldset being validated.
2014-08-11 19:12:38 +02:00
Kevin Giszewski 5725c0770e Bump version number to v1.4.1 2014-08-06 09:22:08 -04:00
Kevin Giszewski 210fbb8230 Fix for #158 2014-08-06 09:20:17 -04:00
Kevin Giszewski c8e398c726 Merge pull request #195 from imulus/feature/fix193
Fix for #193
2014-08-06 08:55:47 -04:00
Kevin Giszewski bfa882fa01 Fix for #193 2014-08-06 08:55:10 -04:00
Kevin Giszewski 876aea4007 Merge branch 'pr/186' into develop 2014-08-06 08:45:55 -04:00
Jeroen Breuer 07750c7537 Run ConvertDataToSource before ConvertSourceToObject 2014-08-05 13:17:34 +02:00
Kevin Giszewski 17a1577d09 Merge branch 'master' of github.com:imulus/Archetype 2014-07-31 13:55:07 -04:00
Kevin Giszewski 987f383139 Merge pull request #184 from imulus/fix/class-conflicts
Prefix fieldset class names to help avoid conflicts
2014-07-31 13:54:58 -04:00
Kevin Giszewski dc14f11f83 Merge pull request #191 from jbreuer/patch-5
Fix 4 for #187
2014-07-31 13:54:48 -04:00
Kevin Giszewski 500f4c4dee Merge pull request #190 from jbreuer/patch-4
Fix 3 for #187
2014-07-31 13:53:41 -04:00
Kevin Giszewski a16451df1f Merge pull request #189 from jbreuer/patch-3
Fix 2 for #187
2014-07-31 13:53:34 -04:00
Kevin Giszewski 9ac7877174 Merge pull request #188 from jbreuer/patch-2
Fix 1 for #187
2014-07-31 13:53:10 -04:00
Kevin Giszewski 4d3bcb68b3 Merge branch 'pr/188' into develop 2014-07-31 13:44:43 -04:00
Kevin Giszewski 30074fe198 Merge branch 'pr/191' into pr/188 2014-07-31 13:37:01 -04:00
Kevin Giszewski 7f0bd45a9d Merge branch 'pr/190' into pr/188 2014-07-31 13:36:59 -04:00
Kevin Giszewski 6045eed5c5 Merge branch 'pr/189' into pr/188 2014-07-31 13:36:55 -04:00
Jeroen Breuer 57ffa69ff5 Added node id 2014-07-31 12:12:35 +02:00
Jeroen Breuer 6b61dc978a Added node id 2014-07-31 12:11:51 +02:00
Jeroen Breuer c20aa64af2 Added node id 2014-07-31 12:11:02 +02:00
Jeroen Breuer 25826958a3 Fix 4 for #187 2014-07-30 16:34:33 +02:00
Jeroen Breuer b5bfbb5c25 Fix 3 for #187 2014-07-30 16:33:01 +02:00
Jeroen Breuer 9afaa024c0 Fix 2 for #187 2014-07-30 16:30:42 +02:00
Jeroen Breuer c58dcd80ff Fix 1 for #187 2014-07-30 16:26:42 +02:00
Jeroen Breuer b7c16ee6ef Fix for #185 2014-07-29 16:24:14 +02:00
tomfulton 786c547e0b Prefix fieldset class names to help avoid conflicts 2014-07-24 06:35:33 -06:00
Kevin Giszewski fbf686f559 Bump Version Number to v1.4.0 2014-07-11 10:38:08 -04:00
Kevin Giszewski 42b4076700 Merge branch 'pr/174' 2014-07-11 10:19:00 -04:00
Kevin Giszewski 5feb415093 Update some dropdown css 2014-07-11 10:17:49 -04:00
Kevin Giszewski 79c85cf86b Merge branch 'master' into pr/174 2014-07-09 16:42:18 -04:00
Kevin Giszewski a0f65370c9 Few CSS tweaks 2014-07-09 16:40:29 -04:00
Kevin Giszewski 029d17c428 Merge branch 'master' of github.com:imulus/Archetype 2014-07-09 15:46:17 -04:00
Kevin Giszewski e262d7b0c9 Re-fix the 'hide label' issue
- appears to have been undone
2014-07-09 15:46:05 -04:00
kjac 44ea6c56f5 Use propertyAlias in fieldset validation
As described in #162 the umbracoPropertyAlias has been removed in favor
of a more unique propertyAlias. This propertyAlias should be used for
property identification in the validation.
2014-07-01 22:28:20 +02:00
leekelleher d7477eaf6d Moved the ArchetypePropertyModel.CreateDummyPropertyType to an extension method.
With a view to re-use in the Courier DataResolver (as it does the same function).
2014-07-01 21:46:25 +02:00
leekelleher c33649201f Separated out the extension methods into their own grouped classes.
Implements #172
2014-07-01 21:46:25 +02:00
leekelleher 3940955360 Code tidy-up; correct method naming; removed unused references 2014-07-01 21:46:24 +02:00
leekelleher 03f66a35f7 Refactored the DataResolver, as the underlying JSON value for the property had been modified (fields removed). 2014-07-01 21:46:24 +02:00
leekelleher b4b60dd89c Add the 'Archetype.Courier' project.
Includes the Courier DataResolver for Archetype.
2014-07-01 21:46:23 +02:00
leekelleher 4105912394 Code tidy-up: removed the "Models" namespace from the type name. 2014-07-01 21:46:22 +02:00
Kevin Giszewski 7b3d31f897 Merge pull request #173 from leekelleher/feature/issues/172
Separated out the extension methods into their own grouped classes
2014-07-01 11:52:43 -04:00
leekelleher 50861badf1 Moved the ArchetypePropertyModel.CreateDummyPropertyType to an extension method.
With a view to re-use in the Courier DataResolver (as it does the same function).
2014-07-01 16:49:20 +01:00
leekelleher fa682c3717 Separated out the extension methods into their own grouped classes.
Implements #172
2014-07-01 16:48:13 +01:00
Kevin Giszewski d18d1ff0b1 Merge pull request #171 from leekelleher/feature/courier-resolver
Includes Courier DataResolver project
2014-07-01 11:27:21 -04:00
leekelleher 247491187a Code tidy-up; correct method naming; removed unused references 2014-07-01 16:09:34 +01:00
leekelleher 80194786a1 Refactored the DataResolver, as the underlying JSON value for the property had been modified (fields removed). 2014-07-01 15:42:41 +01:00
Kevin Giszewski 72ee7b3d09 Merge pull request #170 from leekelleher/master
Code tidy-up: removed the "Models" namespace from the type name.
2014-07-01 10:20:18 -04:00
leekelleher 284b1d93dc Add the 'Archetype.Courier' project.
Includes the Courier DataResolver for Archetype.
2014-07-01 14:28:02 +01:00
leekelleher 7c5a3c34e2 Code tidy-up: removed the "Models" namespace from the type name. 2014-07-01 13:54:18 +01:00
Kevin Giszewski fa970750d1 Bump version number to v.1.3.1-beta 2014-06-30 11:22:34 -04:00
Kevin Giszewski aeeb3c7b40 Remove Serialization 2014-06-30 11:22:21 -04:00
Kevin Giszewski bdd3c2088c Bump version number to v1.3.0 2014-06-30 10:48:07 -04:00
Kevin Giszewski 80b41e4a5f Fix #168 2014-06-30 10:45:48 -04:00
Kevin Giszewski d60e7ba2f4 Merge branch 'master' into pr/166 2014-06-30 10:39:59 -04:00
Kevin Giszewski 4524320db2 Merge branch 'master' into pr/166 2014-06-30 09:47:10 -04:00
kjac 90ca77c9a9 Add localization to new config item 2014-06-28 12:51:36 +02:00
kjac 8332a841eb Implement #165 - enable/disable fieldsets 2014-06-28 12:42:36 +02:00
kjac d6a13b2335 Merge remote-tracking branch 'upstream/master' 2014-06-28 11:25:59 +02:00
cankoluman 987e5cf470 Issue #AR-8_line_endings: fix build 2014-06-27 14:27:48 +01:00
cankoluman f2e5b83795 Issue #AR-8_line_endings: fix line endings so we match the upstream 2014-06-27 14:16:54 +01:00
cankoluman 066e807847 Merge remote-tracking branch 'origin/dev/AR-6_legacy_nesting' into dev/AR-8_line_endings
Conflicts:
	app/Umbraco/Archetype.Tests/Serialization/UseCases/ArchetypeJsonConverterTest.cs
	app/Umbraco/Archetype.Tests/Serialization/UseCases/Complex/ArchetypeJsonConverterTest.cs
	app/Umbraco/Archetype.Tests/Serialization/UseCases/JsonTestModels.cs
	app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs
	app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
	app/Umbraco/Umbraco.Archetype/Serialization/ArchetypeJsonConverter.cs
	app/Umbraco/Umbraco.Archetype/Serialization/AsArchetypeAttribute.cs
	app/Umbraco/Umbraco.Archetype/Serialization/AsFieldsetAttribute.cs
	app/Umbraco/Umbraco.Archetype/Serialization/SerializationExtensions.cs
	config/meta.json
2014-06-27 12:47:52 +01:00
cankoluman d8378ed6bb Merge remote-tracking branch 'origin/dev/AR-1_serialization' into dev/AR-8_line_endings
Conflicts:
	app/Umbraco/Archetype.Tests/Serialization/UseCases/ArchetypeJsonConverterTest.cs
	app/Umbraco/Archetype.Tests/Serialization/UseCases/Complex/ArchetypeJsonConverterTest.cs
	app/Umbraco/Archetype.Tests/Serialization/UseCases/JsonTestModels.cs
	app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj
	app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs
	app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
	app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs
	app/Umbraco/Umbraco.Archetype/Serialization/ArchetypeJsonConverter.cs
	app/Umbraco/Umbraco.Archetype/Serialization/AsArchetypeAttribute.cs
	app/Umbraco/Umbraco.Archetype/Serialization/AsFieldsetAttribute.cs
	app/Umbraco/Umbraco.Archetype/Serialization/SerializationExtensions.cs
2014-06-27 12:42:40 +01:00
kjac 19ee2b890c Merge remote-tracking branch 'upstream/master' 2014-06-27 06:33:15 +02:00
Kevin Giszewski c953f12412 Merge branch 'pr/157' into pr/164 2014-06-26 15:58:31 -04:00
kjac 601f2c0d81 Fix issue #162 + improve nested validation highlighting
The fieldset.isValid property isn't necessarily initialized when the
view looks for it to determine fieldset validity. I've introduced a
validation method that counters this problem.
The validation method also ensures that any validation errors in nested
Archetypes are highlighted on the parent/root Archetype
2014-06-26 14:58:55 +02:00
kjac 283dd8af76 Merge remote-tracking branch 'upstream/master' 2014-06-26 14:23:40 +02:00
Tom Fulton c83942dc5c Update field labels to match new property alias scheme
Only for the first level, since focusing an Archetype isn't really a thing
2014-06-25 22:03:22 -04:00
Tom Fulton a0ff42a84f Merge branch 'master' into fix/unique-aliases
Conflicts:
	app/views/archetype.default.html
2014-06-25 21:49:24 -04:00
Tom Fulton ed97d586b4 Make property aliases even more unique
archetype-property-<umbracoPropertyAlias>-<fieldsetIndex>-<archetypePropertyAlias>-<archetypePropertyIndex>-<and so on...>
2014-06-25 21:46:46 -04:00
Kevin Giszewski 1bd09799b4 Fix for #160 2014-06-25 18:42:41 +02:00
Kevin Giszewski 0b77ddeef1 Fix 'hide property label' 2014-06-25 18:42:40 +02:00
kjac 2b2d0b4b0d Fix code formatting 2014-06-25 18:42:39 +02:00
kjac dc992293e1 Add default value overload to GetValue()
Fix issue #142
2014-06-25 18:42:39 +02:00
kjac 0bc1451a5c Fixing the unit tests
The call to DisposableTimer.DebugDuration() in
ArchetypeValueConverter.ConvertDataToSource() expects the propertyType
parameter to be not null, but the implementation of
ArchetypeValueConverter.ConvertDataToSource() allows the propertyType
parameter to be null. This breaks some of the unit tests.
I've added a null check in the call to DisposableTimer.DebugDuration()
to counter this issue.
2014-06-25 18:42:38 +02:00
Kevin Giszewski f052ed70a9 Merge pull request #161 from imulus/feature/fix-customviews
Fix for #160
2014-06-25 10:29:22 -04:00
Kevin Giszewski 0dedd7fb2d Fix for #160 2014-06-25 10:28:30 -04:00
Kevin Giszewski cb6455c34a Merge branch 'master' into develop 2014-06-25 08:35:07 -04:00
Kevin Giszewski f99ef697db Fix 'hide property label' 2014-06-25 08:34:54 -04:00
Tom Fulton aac015dc0b Refactor property aliases for uniqueness
Old: archetype-property-<umbracoPropertyAlias>-<fieldsetIndex>-<propertyIndex>
New: archetype-property-<umbracoPropertyAlias>-<archetypePropertyAlias>-<fieldsetIndex>

Basically, this adds the archetypePropertyAlias into the mix, to fix a case where you might have the same Archetype nested on a host Archetype twice  (ie box 1 links, box 2 links within the same Archetype - there was no uniqueness)

It also adds in the Property Alias in place of the Property "Index" (unintended side effect, but seems cool :))
2014-06-23 20:58:42 -04:00
Kevin Giszewski f7ef096ba6 Merge branch 'master' into develop 2014-06-20 08:41:49 -04:00
Kevin Giszewski a17e5b5372 Merge branch 'master' into develop 2014-06-20 08:27:04 -04:00
kjac 16a73e0c82 Fix code formatting 2014-06-20 11:06:33 +02:00
cankoluman a56864b731 Issue #AR-6_legacy_nesting: update version counter to match VersionInfo.cs 2014-06-20 09:59:15 +01:00
kjac 2f195dd588 Add default value overload to GetValue()
Fix issue #142
2014-06-20 10:58:21 +02:00
kjac 35309b863c Fixing the unit tests
The call to DisposableTimer.DebugDuration() in
ArchetypeValueConverter.ConvertDataToSource() expects the propertyType
parameter to be not null, but the implementation of
ArchetypeValueConverter.ConvertDataToSource() allows the propertyType
parameter to be null. This breaks some of the unit tests.
I've added a null check in the call to DisposableTimer.DebugDuration()
to counter this issue.
2014-06-20 10:56:29 +02:00
cankoluman da9085c244 Merge remote-tracking branch 'upstream/develop' into dev/AR-6_legacy_nesting
Conflicts:
	app/Umbraco/Archetype.Tests/Serialization/UseCases/ArchetypeJsonConverterTest.cs
	app/Umbraco/Archetype.Tests/Serialization/UseCases/Complex/ArchetypeJsonConverterTest.cs
	app/Umbraco/Archetype.Tests/Serialization/UseCases/JsonTestModels.cs
	app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj
	app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs
	app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
	app/Umbraco/Umbraco.Archetype/Serialization/ArchetypeJsonConverter.cs
	app/Umbraco/Umbraco.Archetype/Serialization/AsArchetypeAttribute.cs
	app/Umbraco/Umbraco.Archetype/Serialization/AsFieldsetAttribute.cs
	app/Umbraco/Umbraco.Archetype/Serialization/SerializationExtensions.cs
2014-06-20 09:35:13 +01:00
cankoluman 1d8703e211 Issue #AR-6_legacy_nesting: fix issue where legacy nested model deserialization failed after the empty fieldset fix,
- add legacy deserialization test
2014-06-18 11:04:25 +01:00
kjac 0ebf07d0f4 Merge remote-tracking branch 'upstream/master' 2014-06-18 06:25:55 +02:00
Kevin Giszewski fdcd6cc3bf Bump Version to 1.2.1 2014-06-17 16:23:48 -04:00
Kevin Giszewski 59179d0c81 Fix two-way binding 2014-06-17 16:23:38 -04:00
leekelleher 16f8d9fb2a Tidied up namespace references + various whitespace.
(I couldn't help myself; OCD! )
2014-06-17 18:45:18 +01:00
leekelleher cfffa89138 Applied singleton pattern for ArchetypeHelper. 2014-06-17 18:43:58 +01:00
kjac 2b4cc2c429 Merge remote-tracking branch 'upstream/master' 2014-06-17 18:39:34 +02:00
Kevin Giszewski 9c82018903 Merge pull request #147 from leekelleher/feature/customViewPath
Added custom view path to prevalue POCO model
2014-06-17 12:16:35 -04:00
leekelleher 386a1a58fc Set the assembly references not to "copy local"
(This seems to revert when NuGet updates references)
2014-06-17 17:00:26 +01:00
leekelleher 9aaa490eb0 Added the customViewPath property to the POCO model 2014-06-17 16:59:38 +01:00
Kevin Giszewski ec446b6800 Merge branch 'pr/137' into develop 2014-06-17 07:05:06 -04:00
cankoluman 67f21ee4d8 Merge branch 'dev/AR-1_serialization' into stable 2014-06-17 11:17:23 +01:00
cankoluman 0573d99218 Merge branch 'stable' into dev/AR-1_serialization 2014-06-17 11:16:28 +01:00
cankoluman a520d86ec4 Issue #AR-5_empty_json: Handle the case where the archetype json is empty:
{""fieldsets"": []}

Currently this throws an exception. Handle by setting returned model to null.
2014-06-17 11:13:25 +01:00
Kevin Giszewski 3c9b7692f1 Bump the version number 2014-06-16 11:54:49 -04:00
Kevin Giszewski 51223d4ac7 Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-06-16 11:35:57 -04:00
Kevin Giszewski 1d5f91964f Finish Custom Views 2014-06-16 11:35:44 -04:00
Kevin Giszewski 0accac26ee WIP for custom views 2014-06-16 11:06:59 -04:00
kjac 0048330863 Merge branch 'master' into issue131_optimized 2014-06-16 16:43:07 +02:00
kjac d07c16160a Merge remote-tracking branch 'upstream/master' 2014-06-16 16:42:25 +02:00
Kevin Giszewski 6527e66ff3 Add extensions to auto map an ArchetypeModel to a partials of named as alias 2014-06-16 10:00:17 -04:00
Kevin Giszewski 47e71067a1 Merge branch 'pr/137' into develop 2014-06-16 09:11:49 -04:00
Kevin Giszewski 969cc45e9b Merge branch 'pr/107' into develop 2014-06-16 09:10:22 -04:00
Kevin Giszewski 9ff5bfc907 Merge pull request #145 from imulus/master
Sync up dev
2014-06-14 18:27:17 -04:00
Kevin Giszewski 7cdcb940bd Merge pull request #144 from imulus/develop
Develop
2014-06-14 18:25:35 -04:00
Kevin Giszewski 75e0ac5d6d Merge pull request #139 from imulus/fix/133
Send ContentType when using ValueConverters
2014-06-14 18:22:37 -04:00
cankoluman 310771303c Merge branch 'dev/AR-1_serialization' into stable 2014-06-02 14:25:12 +01:00
Kevin Giszewski ba6921fdb9 Update README.md 2014-05-29 17:50:43 -04:00
kjac aafeebfc62 Merge remote-tracking branch 'upstream/master' 2014-05-29 11:16:01 +02:00
Tom Fulton 8624617ad4 Merge branch 'master' into fix/133 2014-05-27 15:03:02 -06:00
Tom Fulton e46e5c279f Merge pull request #136 from leekelleher/feature/issues/134
Adds null reference checks for `GetValue<T>`.
2014-05-27 15:01:57 -06:00
Tom Fulton a9dc79e4ff Ensure new HostContentType isn't persisted 2014-05-27 15:01:21 -06:00
Tom Fulton 485c6cb6a1 When using ValueConverters, pass along the Content Type - fixes #133
* Add new property HostContentType to make Properties aware of their content type
* Adjust Dummy PropertyType to include the Content Type
* Pass in Content Type from ValueConverter to Deserialization helper through new optional parameter
* Populate the property's HostContentType via RetrieveAdditionalProperties
* Make sure HostContentType isn't persisted

Notes: In some cases, the Umbraco Core looks for pt.ContentType.Alias, which didn't exist previously in our Dummy PropertyType.  This would also potentially cause an error if any PVC's do the same.

To fix we now keep track of the Content Type that the Archetype exists on (determined in the ArchetypeValueConverter), and pass this along to our Dummy PropertyType (and thus to PVCs)

Note we made the hostContentType an optional parameter as there's some cases where we won't know the content type (ie ConvertDbToEditor).  This (shouldn't?) be an issue as these cases should never have a reason to call GetValue.
2014-05-27 14:31:23 -06:00
Kevin Giszewski 8e7eda9276 Merge branch 'master' into develop 2014-05-23 16:24:10 -04:00
Kevin Giszewski 96d70bc1a9 Merge branch 'develop' into pr/137 2014-05-23 10:07:34 -04:00
Kevin Giszewski 264208dcc7 Update namespaces 2014-05-22 15:01:55 -04:00
Kevin Giszewski 077ab44dc8 Merge branch 'develop' into pr/107
Conflicts:
	app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj
	app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
2014-05-22 14:19:03 -04:00
Kevin Giszewski 7499395807 Fix WS 2014-05-22 14:17:46 -04:00
Kevin Giszewski d983b75be3 Merge branch 'pr/136' into develop 2014-05-22 14:12:28 -04:00
kjac 381875bc14 Merge branch 'master' into issue131_optimized 2014-05-22 19:40:52 +02:00
kjac 3944da57b1 Fix the validation display
Rewrite the changes from commit 4785c85 to work with validation.
2014-05-22 19:16:26 +02:00
leekelleher 0cbbd1c93e Adds null reference checks for GetValue<T>.
Fixes #134
2014-05-22 14:29:38 +01:00
kjac 1bfab0f8a3 Optimize validation routine
Only validate the property being edited, not the entire fieldset the
property belongs to.
2014-05-21 22:49:15 +02:00
cankoluman b6d2b7e1dd Merge branch 'dev/AR-4_delinter_fixes' into dev/AR-1_serialization 2014-05-21 14:23:26 +01:00
cankoluman 1179147041 Issue #AR-4-delinter_fixes: simplify replace 2014-05-21 14:22:11 +01:00
cankoluman 0cfcaa3364 Issue #AR-4-delinter_fixes: change heuristic for space removal 2014-05-21 14:15:54 +01:00
cankoluman 14777a98dc Issue #AR-4-delinter_fixes: removed buggy escaped json tests 2014-05-20 16:22:47 +01:00
cankoluman a306424162 Issue #AR-4-delinter_fixes: fix issue where escaped new lines were being removed inside value quotes 2014-05-20 15:05:44 +01:00
cankoluman d124622089 Issue #AR-4-delinter_fixes: refactor delinter 2014-05-20 13:07:18 +01:00
cankoluman d9a25d1bb3 Issue #AR-4-delinter_fixes: fix all regexes except white space 2014-05-20 12:18:48 +01:00
cankoluman cda17ac754 Issue #AR-4-delinter_fixes: update remove new line 2014-05-20 10:39:09 +01:00
cankoluman d5329935aa Issue #AR-4-delinter_fixes: fixed all test failures due to jToken navigation errors.
To Do: fix erros due to incorrect space removal
2014-05-20 09:32:01 +01:00
kjac 537abea717 Merge remote-tracking branch 'upstream/master' 2014-05-20 07:13:54 +02:00
kjac c8d9b04a57 Rewrite validation
Rewrite validation to handle
1. Validation on page load
2. Validation on nested Archetypes
3. Validation of numeric property editors (check for NaN)
2014-05-19 19:49:50 +02:00
cankoluman 1913f8bf14 Issue #AR-4-delinter_fixes: create single entry point for deserialization - 15 tests failing now 2014-05-19 16:25:20 +01:00
cankoluman 6f2eaa9859 Issue #AR-4-delinter_fixes: trying to fix delinter regex 2014-05-19 16:08:00 +01:00
cankoluman 31074ec9db Issue #AR-4-delinter_fixes: trying to sort out issue with \r\n being replaced inside values 2014-05-16 17:19:05 +01:00
Kevin Giszewski 32d0d199a3 Add/move dynamic classes for targeting of custom behavior 2014-05-16 13:44:25 +02:00
kjac 715776771a Fix deserialization of RegEx enabled properties
Fix type mismatch for RegEx (introduced in 6e50301 - my bad, sorry)
2014-05-16 13:44:24 +02:00
Kevin Giszewski 4785c85b84 Add/move dynamic classes for targeting of custom behavior 2014-05-15 17:24:34 -04:00
Kevin Giszewski 712ca3cd76 Add/move dynamic classes for targeting of custom behavior 2014-05-15 17:24:14 -04:00
cankoluman 512ecbdb05 Issue #AR-1_serialization: fixes after merge of upstream master 2014-05-15 17:02:06 +01:00
cankoluman 9a97e9102e Merge branch 'master' into dev/AR-1_serialization
Conflicts:
	app/Umbraco/Archetype.Tests/Archetype.Tests.csproj
	app/Umbraco/Umbraco.Archetype.sln
	app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj
	app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs
	app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs
2014-05-15 16:48:08 +01:00
cankoluman e9b2f4aeee Merge remote-tracking branch 'upstream/master' 2014-05-15 16:43:25 +01:00
cankoluman bdb7f247c3 Issue #AR-1_serialization: add delinter to SerializeForPersistence() 2014-05-15 16:23:48 +01:00
cankoluman 08c09a8820 Issue #AR-1_serialization: moved Delinter so serialization namespace,
- fix small issue with space detection in fieldset delinter
2014-05-15 16:13:29 +01:00
cankoluman ac84c35f67 Issue #AR-1_serialization: fix issue where property alias was incorrectly set from type alias 2014-05-15 15:06:41 +01:00
cankoluman bff8bcc562 Issue #AR-1_serialization: fix overflow issue affecting deserialization in recursively nested models 2014-05-15 14:55:12 +01:00
cankoluman 8fc209abc1 Issue #AR-1_serialization: move delinter tests into serialization tests 2014-05-15 12:42:15 +01:00
cankoluman a6a961d52a Issue #AR-1_serialization: added additional unescape model tests 2014-05-15 12:38:11 +01:00
cankoluman b289892727 Issue #AR-1_serialization: initial commit of delinter 2014-05-15 12:25:44 +01:00
Kevin Giszewski 43a7202194 Merge pull request #128 from kjac/RegEx-model-fix
Fix deserialization of RegEx enabled properties
2014-05-14 10:01:37 -04:00
cankoluman 4051734313 Issue #AR-1_serialization: got json escape test to work, added json unescape extension and tests,
To Do: migrate  test code from ArcheTypePropertyEditor if possible.
2014-05-14 12:28:37 +01:00
kjac 9a21ab0ef4 Fix deserialization of RegEx enabled properties
Fix type mismatch for RegEx (introduced in 6e50301 - my bad, sorry)
2014-05-13 22:11:53 +02:00
Kevin Giszewski 46613bbc01 Fix bug with Add button 2014-05-13 12:03:50 -04:00
Kevin Giszewski 4998acb59a Missing curlies from the conflict 2014-05-13 11:15:33 -04:00
Kevin Giszewski bc58078eec Merge branch 'develop'
Conflicts:
	app/Umbraco/Umbraco.Archetype/Extensions/Extensions.cs
	app/Umbraco/Umbraco.Archetype/Models/ArchetypeFieldsetModel.cs
	app/Umbraco/Umbraco.Archetype/Models/ArchetypePreValueProperty.cs
	app/Umbraco/Umbraco.Archetype/Models/ArchetypePropertyModel.cs
	app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs
2014-05-13 11:15:13 -04:00
Kevin Giszewski d1d95aebe7 Merge branch 'pr/126' into develop 2014-05-13 11:01:56 -04:00
cankoluman ae242feed6 Issue #AR-1_serialization: add test to try to create escaped json - this still produces unescaped json.
However,
		    internal virtual PropertyEditor GetPropertyEditor(IDataTypeDefinition dtd)
		    {
		        return dtd.Id == 0
                    ? new ArchetypePropertyEditor()
                    : PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
		    }

would produce nested json. But this spec looks incorrect.
2014-05-13 15:44:33 +01:00
cankoluman f1df0f2ad9 Issue #AR-1_serialization: add tests comparing models generated object serializer and archetype.SerializeForPersistence() pathwways.
Note: SerializeForPersistence() does not generate escaped json when used on its own.
All tests passing.
2014-05-13 10:20:12 +01:00
kjac 1c9bce8b66 Explicitly set form as dirty on row changes
Fix issue #123. Explicitly call $setDirty() on the PE form when
reordering or removing rows, thus ensuring the editor will be prompted
to discard changes if navigating away before saving.
2014-05-12 21:51:19 +02:00
kjac 8d3e3aeb0a Stop Umbraco from asking to discard changes
By calling ngModelCtrl.$setViewValue() only when there's actually a
change in the value, we keep Umbraco from prompting to discard changes
immediately after all changes have been saved (see issue #121 for more
details).
2014-05-12 21:30:08 +02:00
kjac a58c0154c9 Merge remote-tracking branch 'upstream/master' 2014-05-12 19:11:08 +02:00
Kevin Giszewski 9829ab796a Remove setDirty()
- Not sure how it made it in
2014-05-12 19:09:29 +02:00
Kevin Giszewski 75080b0e2d Rename Model Files 2014-05-12 19:09:28 +02:00
Kevin Giszewski 932f098837 Expose current form to nested Archetypes 2014-05-12 19:09:28 +02:00
kjac 6e50301da5 Issue #116: Add RegEx validation support
Add RegEx validation for the individual properties in a fieldset as
proposed in issue #116
2014-05-12 19:09:27 +02:00
kjac 448bbe26f0 Update fix for issue #121 + fix issue #123
Use the built-in dirty state to handle row changes instead of the custom
state variable introduced in the previous commit.
Additionally this solves issue #123 by setting the dirty state when rows
are removed or sorted.
2014-05-12 19:09:26 +02:00
kjac 7c3c0e041d Fix issue #121
Stop prompting the editor to save unsaved changes after saving.
2014-05-12 19:09:26 +02:00
Kevin Giszewski 3b2559c37d Update folder name in sln 2014-05-12 19:09:25 +02:00
Kevin Giszewski 2cc4fd711a Update folder name 2014-05-12 19:09:24 +02:00
Kevin Giszewski d5038a52d1 Add in DatabaseSizer
- Temp DLL to not be included in dist
2014-05-12 19:09:24 +02:00
Kevin Giszewski d4cf60d5f3 Update packages to v7.1.2
- Also last commit
2014-05-12 19:09:23 +02:00
Kevin Giszewski 09a3172c80 Merge in 2014-05-12 19:09:22 +02:00
Kevin Giszewski 2bf2e5f91a Update naming scheme 2014-05-12 19:09:22 +02:00
Kevin Giszewski d09831b547 Merge pull request #125 from imulus/develop
Develop
2014-05-12 12:54:47 -04:00
Kevin Giszewski db82bd8013 Remove setDirty()
- Not sure how it made it in
2014-05-12 12:52:24 -04:00
Kevin Giszewski 4014583ade Merge branch 'pr/124' into develop 2014-05-12 12:45:45 -04:00
Kevin Giszewski 9a0e40b489 Rename Model Files 2014-05-12 12:44:18 -04:00
Kevin Giszewski 5c60c109d5 Expose current form to nested Archetypes 2014-05-12 12:43:38 -04:00
cankoluman 475fe7c81f Issue #AR-1_serialization: fix error in IsConverter when PropertyEditorAlias is null,
- relax property token navigation so that if a nested token is not found, we return null.
2014-05-12 17:15:20 +01:00
Kevin Giszewski 7615657a18 Rename Models
- Remove .Umbraco
2014-05-12 11:40:51 -04:00
Kevin Giszewski bdb3655418 Merge branch 'develop' into pr/124 2014-05-12 10:50:41 -04:00
Kevin Giszewski 0d766c1ad9 Merge branch 'develop' into pr/122 2014-05-12 09:55:54 -04:00
kjac e2c7e9b0ef Issue #116: Add RegEx validation support
Add RegEx validation for the individual properties in a fieldset as
proposed in issue #116
2014-05-11 10:39:12 +02:00
kjac 62964dcfae Update fix for issue #121 + fix issue #123
Use the built-in dirty state to handle row changes instead of the custom
state variable introduced in the previous commit.
Additionally this solves issue #123 by setting the dirty state when rows
are removed or sorted.
2014-05-10 22:29:56 +02:00
kjac a48033874a Fix issue #121
Stop prompting the editor to save unsaved changes after saving.
2014-05-10 17:25:16 +02:00
Kevin Giszewski ecb933d13a Update folder name in sln 2014-05-09 12:06:18 -04:00
Kevin Giszewski 45ccf6e06d Update folder name 2014-05-09 12:05:43 -04:00
Kevin Giszewski b0118f4bdb Add in DatabaseSizer
- Temp DLL to not be included in dist
2014-05-09 12:04:23 -04:00
Kevin Giszewski 7fd1b69e81 Update packages to v7.1.2
- Also last commit
2014-05-09 12:03:31 -04:00
Kevin Giszewski b67e150fe1 Merge in 2014-05-09 12:02:45 -04:00
cankoluman 9b1b3d1793 Merge branch 'dev/AR-3_ienumerable_support' into dev/AR-1_serialization 2014-05-09 16:58:23 +01:00
cankoluman f1f8b7db22 Merge branch 'dev/AR-1_serialization' into dev/AR-3_ienumerable_support 2014-05-09 16:56:49 +01:00
cankoluman 475bca3c05 Merge branch 'master' into dev/AR-1_serialization 2014-05-09 16:53:51 +01:00
cankoluman 77c501f2dd Merge remote-tracking branch 'upstream/master' 2014-05-09 16:52:55 +01:00
cankoluman 5db9bb972b Issue #AR-3_IEnumerable_support: separate use case tests 2014-05-09 16:51:33 +01:00
cankoluman f931e4a31f Issue #AR-3_IEnumerable_support: fix incorrect hard-coded json, some changes to tests. 2014-05-09 16:42:30 +01:00
cankoluman bc246b947f Issue #AR-3_IEnumerable_support: add nested model regression tests 2014-05-09 15:42:58 +01:00
cankoluman ec642fa69f Issue #AR-3_IEnumerable_support: fix issue with property extraction 2014-05-09 15:27:19 +01:00
cankoluman 1ba1fa2d83 Issue #AR-3_IEnumerable_support: added compound model regression tests 2014-05-09 14:42:31 +01:00
cankoluman 7c02539751 Issue #AR-3_IEnumerable_support: re-factor regression tests 2014-05-09 13:05:04 +01:00
cankoluman bc6fff6f73 Issue #AR-3_IEnumerable_support: regression testing - fixed issue where the default fieldset name was not assigned properly during dynamic model generation 2014-05-09 11:14:39 +01:00
kjac 5b43053406 Merge remote-tracking branch 'upstream/master' 2014-05-09 07:29:11 +02:00
Kevin Giszewski 1cbc192a9d Update naming scheme 2014-05-08 17:47:24 -04:00
Kevin Giszewski 4fff98640e Remove filter as .remove is no longer an attribute 2014-05-08 13:32:55 -04:00
Kevin Giszewski 085ff2cecf Add dropdown to add button 2014-05-08 13:32:04 -04:00
Kevin Giszewski d72a000d68 Remove Toolbar
- Fix insert index issue
2014-05-08 12:58:48 -04:00
cankoluman 911a74e43e Issue #AR-3_IEnumerable_support: regression testing - fixes to [AsFieldset] handling,
- use ExpandoObject for all dynamically generated models
- add additional JToken parsers
- To Do: deal with multiple item fieldset
2014-05-08 16:56:51 +01:00
Kevin Giszewski 2fc8845851 Merge branch 'master' into pr/115 2014-05-08 11:04:06 -04:00
cankoluman 934df00281 Issue #AR-3_IEnumerable_support: start on regression tests. 2014-05-07 17:03:08 +01:00
cankoluman df8d3a8888 Issue #AR-3_IEnumerable_support: clean-up 2014-05-07 15:37:57 +01:00
leekelleher d5c6b4a324 Amended the build script to only copy the Archetype assembly. 2014-05-07 15:10:25 +01:00
leekelleher bd617162f1 Disabled "Copy Local" for 3rd-party assembly references. 2014-05-07 15:09:55 +01:00
cankoluman e341732f83 Issue #AR-3_IEnumerable_support: move complex model tests to sub-folder 2014-05-07 14:24:35 +01:00
cankoluman 6c5a5c8393 Issue #AR-3_IEnumerable_support: add missing tests 2014-05-07 14:17:14 +01:00
cankoluman 5e23d845d5 Issue #AR-3_IEnumerable_support: apply naming convention to unit tests 2014-05-07 14:11:26 +01:00
cankoluman 11befe727c Issue #AR-3_IEnumerable_support: all tests passing - but branching logic is difficult. 2014-05-07 13:01:07 +01:00
kjac 06fdfc8226 Merge remote-tracking branch 'upstream/master' 2014-05-07 08:22:21 +02:00
Kevin Giszewski d4d50cae52 Merge branch 'master' of github.com:imulus/Archetype 2014-05-06 13:00:40 -04:00
Kevin Giszewski 688ad534f2 Check for config for label template 2014-05-06 13:00:05 -04:00
cankoluman ed9ba7d41f Issue #AR-3_IEnumerable_support: add IEnumerable deserialization - tests pass.
However, some regression errors in compex model use case
2014-05-06 16:54:08 +01:00
cankoluman 1ae967e002 Issue #AR-3_IEnumerable_support: add IEnumerable serialization support - Captions serialization tests passing.
- needs cleaning up.
2014-05-06 15:01:50 +01:00
cankoluman 72303c1c83 Issue #AR-3_IEnumerable_support: fix json for simple list model - simple list model passes 2014-05-06 12:13:37 +01:00
cankoluman bc6580995a Issue #AR-3_IEnumerable_support: re-factor tests, add Enumerable tests - all failing as baseline. 2014-05-06 11:39:10 +01:00
Tom Fulton ff39bce262 Add package task that creates both packages to simplify CI
Duplicated task steps to prevent needing to build multiple times but maintaining 'full build' in the individual package tasks
2014-05-05 17:36:26 +02:00
Kevin Giszewski 481259f0b7 Add try/catch with logging to prop converters 2014-05-05 17:36:26 +02:00
Tom Fulton 059d951a21 Don't use dropdown menu when only 1 fieldset type 2014-05-04 16:39:56 -06:00
Tom Fulton 6dc5841f31 Stylize dropdown menu 2014-05-04 16:21:19 -06:00
Tom Fulton 91fc5bbd7f Fix rows not being added in correct position 2014-05-04 15:59:01 -06:00
Tom Fulton 3742147cf7 Merge branch 'master' into feature/add-dropdown
Conflicts:
	app/views/archetype.html
2014-05-04 15:58:00 -06:00
Tom Fulton 432a33eef8 Add package task that creates both packages to simplify CI
Duplicated task steps to prevent needing to build multiple times but maintaining 'full build' in the individual package tasks
2014-05-03 00:32:18 -06:00
Kevin Giszewski b7a8f5f581 Add try/catch with logging to prop converters 2014-05-02 09:20:59 -04:00
cankoluman 52ff09f089 Merge remote-tracking branch 'origin/dev/AR-2_property_value_converters' into dev/AR-1_serialization 2014-05-01 16:51:16 +01:00
cankoluman 34e65ba57e Issue #AR-1_property_value_converters: switched to using Archetype's native GetValue<T> when getting property values,
- added umbracoSettings.config to the test project: conversion of decimal numbers, e.g. '12345.34' triggers
'NormalizeNumberDecimalSeparator' which in turn requires via 'DefaultShortStringHelper' that the umbracoSettings.config file is loaded. We added this to make sure tests deserializing decimal numbers pass.
2014-05-01 16:13:19 +01:00
cankoluman 87da7e1243 Issue #AR-1_serialization: fix tests that were failing due to changes in line-end encodings. 2014-05-01 14:24:26 +01:00
cankoluman ed86255cf0 Merge branch 'master' into dev/AR-1_serialization
Conflicts:
	app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj
	app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
2014-05-01 14:17:39 +01:00
cankoluman 518f68951d Merge remote-tracking branch 'upstream/master' 2014-05-01 14:12:17 +01:00
kjac baa909d0c7 Merge remote-tracking branch 'upstream/master' 2014-04-30 18:45:07 +02:00
Kevin Giszewski 6ea44c271d Use a count on the add button rather than checking flag 2014-04-30 10:00:15 -04:00
kjac 7d4c27646f Merge remote-tracking branch 'upstream/master' 2014-04-30 08:39:04 +02:00
Tom Fulton 848d25a156 Show "remove" button when MaxFieldsets = 1 and Multiple Fieldset Types
... so the user can switch types (remove/add) when only a single row.

We check for Multiple Fieldset Types as well, because we don't want to show a "remove" button when there's only one type allowed (presumably).
2014-04-29 19:52:23 -06:00
Tom Fulton b4fc3e1cd3 Persist without formatting/whitespace 2014-04-29 18:34:25 -06:00
Tom Fulton 0547c4c07e Ensure we only save the "cleaned" model to the DB
* Extract the model cleaning logic to a method for re-use
* Call cleaning method from ConvertEditorToDb  (we were only calling on ConvertDbToString (cache))
* Update ConvertDbToEditor to route through new deserialization helper, so that it gets the "virtual" properties it needs that were lost in the cleaning
2014-04-29 18:18:14 -06:00
Kevin Giszewski 86f2f180bf Fix defaultPreValue import
- Remove MNTP hack
2014-04-29 16:23:55 -04:00
Kevin Giszewski 62a9ff05b9 Hide the Add button when multiple fieldsets enabled 2014-04-29 14:35:48 -04:00
Kevin Giszewski ce05dbb845 Remove logging 2014-04-29 14:25:34 -04:00
Kevin Giszewski 8ce8454620 Add a hack to make the MNTP multipicker work 2014-04-29 14:23:58 -04:00
Kevin Giszewski d13a5b1b86 Remove RenderModel
- Use server side converters for model cleanup
2014-04-29 12:31:02 -04:00
cankoluman a6b1abaecc Issue #AR-1_serialization: removed ArchetypeJsonConverter type argument - which is no longer needed 2014-04-29 11:47:59 +01:00
cankoluman 258b0859ab Issue #AR-1_serialization: clean up 2014-04-29 11:28:30 +01:00
cankoluman cee7d73b01 Issue #AR-1_serialization: finish tests for complex tree model use case 2014-04-29 11:23:39 +01:00
cankoluman 1e12b82742 Issue #AR-1_serialization: fix deserialization for complex models (i.e. models employing AsFiedlset hinting) 2014-04-29 10:06:22 +01:00
Tom Fulton 3b5cff8d9a Completely remove package.manifest in favor of C# declaration 2014-04-28 23:53:07 -06:00
Tom Fulton f214785cfa Merge branch 'wip/106-amend-3' into 106-update
Conflicts:
	app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs
2014-04-28 23:47:39 -06:00
Tom Fulton 61d0b67118 Merge branch '106' into 106-update
Conflicts:
	app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs
2014-04-28 23:46:51 -06:00
Tom Fulton 7a71afda0e GetValue - *always* check the PropertyValueConverters
Even if we want a string and the value is already a string, we should still hit the PropertyValueConverters for situations like the RTE's PVC, which performs parsing on the content.
2014-04-28 23:39:32 -06:00
Tom Fulton 4ad88a04e5 Misc cleanup 2014-04-28 23:37:39 -06:00
Tom Fulton 6f281080e8 Route new Convert* methods through Helper, refactor
This fixes the issue where the model sent to ConvertEditorToDb doesn't have a DataTypeGuid, thus we were unable to look up the correct PropertyEditor to run the Convert methods on.
2014-04-28 23:30:32 -06:00
cankoluman 7b5d9b4dd5 Issue #AR-1_serialization: clarify deserialization logic 2014-04-28 14:54:47 +01:00
cankoluman 766ae0a8df Issue #AR-1_serialization: removed hardcoded fieldsets[0].properties restriction 2014-04-28 14:32:34 +01:00
cankoluman 43e1855b2c Issue #AR-1_serialization: fix regression error, added AsFieldsetAttribute to help resolve ambiguous complex models, some renaming 2014-04-28 12:45:30 +01:00
kjac 00d2b693dd Merge remote-tracking branch 'upstream/master' 2014-04-28 09:52:00 +02:00
Tom Fulton bf76b80330 Make tests pass
Quick null check for PublishedPropertyType - we can't create a dummy one from a test due to some internal Umbraco dependencies, and we can't mock it as the relevant properties aren't virtual, so just adding a quick null check for now.
2014-04-28 09:41:57 +02:00
Tom Fulton 5d12f5f76c Mark helper methods internal for now 2014-04-28 09:41:57 +02:00
Tom Fulton 8deca35f24 Extract methods to retrieve metadata not stored in the model 2014-04-28 09:41:56 +02:00
Tom Fulton e628fa7af0 Move deserialization methods to a Helper class 2014-04-28 09:41:56 +02:00
Tom Fulton e2341e8bb5 Merge branch 'feature/rte-macro-fix' of github.com:mattbrailsford/Archetype into wip/106-amend-3
Conflicts:
	app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs
2014-04-27 23:07:26 -06:00
Tom Fulton 55bb2e49e5 Merge pull request #108 from imulus/pvc-refactor
Extract methods from ValueConverter for reuse
2014-04-27 22:55:15 -06:00
cankoluman cbec133186 Issue #AR-1_serialization: added serialization wrappers, and support for complex model serialization,
- see test examples
2014-04-25 17:34:56 +01:00
Tom Fulton ff4b5da163 Merge branch 'pvc-refactor' of github.com:imulus/Archetype into pvc-refactor 2014-04-24 23:12:05 -06:00
Tom Fulton ea017fa6cd Make tests pass
Quick null check for PublishedPropertyType - we can't create a dummy one from a test due to some internal Umbraco dependencies, and we can't mock it as the relevant properties aren't virtual, so just adding a quick null check for now.
2014-04-24 23:11:47 -06:00
Tom Fulton 7a29683008 Mark helper methods internal for now 2014-04-24 22:44:37 -06:00
Tom Fulton f52bbc2d0a Extract methods to retrieve metadata not stored in the model 2014-04-24 22:39:22 -06:00
Tom Fulton fa174ba15a Move deserialization methods to a Helper class 2014-04-24 22:29:58 -06:00
Tom Fulton a3a275808e Small refactorings to ConvertDataSource via @leekelleher
Manually merged in from: https://github.com/leekelleher/Archetype/blob/79bace6b882ec6bd291cc395be57336f8df26b0b/app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs
2014-04-24 22:05:52 -06:00
cankoluman 23735fdf59 Issue #AR-1_serialization: rename file 2014-04-24 17:03:30 +01:00
cankoluman 8c005b2ec9 Issue #AR-1_serialization: rename test models file 2014-04-24 16:23:28 +01:00
cankoluman bfb1cc6abc Issue #AR-1_serialization: add support for JsonIgnoreAttribute,
- re-factor names,
- move all test strings to separate class
2014-04-24 16:21:52 +01:00
cankoluman ea0d641f25 Issue #AR-1_serialization: add a numerical and date model test,
-  fix errors in deserializing nullable type values
2014-04-24 15:51:04 +01:00
cankoluman 67311836c8 Issue #AR-1_serialization: update json test input 2014-04-24 10:49:04 +01:00
cankoluman 22d596e827 Issue #AR-1_serialization: initial commit of model serializer and tests. 2014-04-24 10:43:48 +01:00
cankoluman b42306e741 Issue #AR-1_serialization: added msbuild (.NET) version, as we need this for VS < 2013,
- updated msbuild module
2014-04-24 10:20:50 +01:00
mattbrailsford 1ca8878592 Removed temp "ParseMacros" extension method
Removed package.manifest
Added C# property editor definition
Added initial code for handling data value conversions when accessing from / writing to datavabase / xml cache
2014-04-21 20:23:07 +01:00
Kevin Giszewski 5aeef0383c Bump dll version 2014-04-18 17:34:35 -04:00
Kevin Giszewski 337cd6d863 Bump the version to 1.0-beta 2014-04-18 17:33:39 -04:00
Kevin Giszewski 3160f8ce8f Use an extension to parse the RTE macros into rendered macros 2014-04-18 17:27:19 -04:00
Tom Fulton 5eed6da175 Fix clean path in build script 2014-04-15 23:40:17 -06:00
Kevin Giszewski da4383181c Bump the version number 2014-04-14 15:02:06 -04:00
Kevin Giszewski 25e8db9443 Update core refs to v7.1.1 2014-04-14 15:00:59 -04:00
Tom Fulton c6a47c0036 Merge pull request #100 from leekelleher/feature/grunt-vs-tidyup
Changed grunt "copy:dll" to take from "Release" directory
2014-04-13 22:22:53 -06:00
Kevin Giszewski 9795e26f1a Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-04-10 16:48:34 -04:00
Kevin Giszewski e144e475b7 Merge pull request #101 from BatJan/patch-1
Translation to danish
2014-04-10 16:45:50 -04:00
BatJan 9c7cb43bb9 Translation to danish
...Have fun figuring out if my danish translation is good! (Just kidding!) :)
2014-04-10 22:42:45 +02:00
leekelleher ac20b370fb Amended the build script to take the assembly from the 'Release' directory.
Disabled "Copy Local" for 3rd-party assembly references.
2014-04-09 11:54:13 +01:00
Tom Fulton 6cc91e4359 Move cache keys to Constants 2014-04-04 17:09:42 -06:00
Tom Fulton c883afc81f Merge branch 'develop' into feature/clear-cache 2014-04-04 16:06:36 -06:00
Tom Fulton 3a89c73b6d Merge branch 'develop' 2014-04-04 15:57:04 -06:00
Tom Fulton 1eb0aa68d2 Wrap method in GetCacheItem - missed from merge conflict in 3ffd03e34c 2014-04-04 00:06:33 -06:00
Tom Fulton 533f7d9f8f DRY up DataTypeId lookups/caching 2014-04-04 00:04:03 -06:00
Tom Fulton 3ffd03e34c Merge branch '91' into feature/cache
Conflicts:
	app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs

Fix conflicts and update caching to match #91
2014-04-03 22:48:29 -06:00
Tom Fulton 91dcdae780 Merge branch 'develop' 2014-04-03 22:17:59 -06:00
Tom Fulton 15a242ab9b Clear the PreValue cache when DataTypes are saved 2014-04-03 22:14:41 -06:00
Kevin Giszewski 05b98beee6 Update README.md 2014-04-03 17:47:13 -04:00
Kevin Giszewski f138ee178b Remove reference to old config file 2014-04-03 13:50:01 -04:00
Kevin Giszewski 6e52df4f88 Update core references to 7.1.0 2014-04-03 13:47:52 -04:00
Kevin Giszewski 59aa67b89f Merge branch 'develop' into feature/discover-datatypes
Conflicts:
	app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs
2014-04-03 13:46:56 -04:00
Kevin Giszewski 7ddc74d75b Fix a glitch that won't let a single fieldset be removed if multiple FS's are configured with the 'Start with Add' option 2014-04-03 12:04:45 -04:00
Kevin Giszewski b53e3529b4 Merge branch 'develop' into pr/96 2014-04-03 11:45:43 -04:00
Kevin Giszewski e2e38646d1 Merge branch 'pr/94' into develop 2014-04-03 11:44:37 -04:00
Kevin Giszewski d7432d1f95 Update the GUID, seems to not default properly at times 2014-04-03 11:44:18 -04:00
Andrey Shchekin b9a0852c4f Added a "start with Add button" option that shows "+ Add" instead of default fieldset. 2014-04-02 14:26:35 +13:00
Tom Fulton 9d1850de97 Merge pull request #95 from imulus/fix/tests
Fix Fieldset tests
2014-03-30 20:10:20 -06:00
Tom Fulton 4a319b9ed4 Extract & Wrap PropertyValueConverter method to fix tests
Unable to access PropertyValueConverterResolver.Current from a test, so wrapping in a quick check for UmbracoContext.  Probably not the best fix, but wasn't sure best way or if overkill to create an abstraction.

Also extracted the logic that finds/executes PropertyValueConverters to make testing easier.
2014-03-30 20:05:43 -06:00
Tom Fulton 96aed2c256 WIP 2014-03-29 22:52:43 -06:00
Tom Fulton ddd01b4745 Update test to match new converter behavior (null -> empty Archetype) 2014-03-29 19:20:08 -06:00
Andrey Shchekin 3521543f17 Changed data types storage to store guids instead of ids. 2014-03-28 18:11:40 +13:00
mattbrailsford 6ce31efc27 Added caching to the datatype lookup to save database hits 2014-03-26 13:57:41 +00:00
Tom Fulton 342789e692 Merge branch 'develop' 2014-03-18 22:59:26 -06:00
Tom Fulton e87e84eb5b Explain build details in README 2014-03-18 22:59:06 -06:00
Tom Fulton 96b1839c04 Merge pull request #88 from leekelleher/feature/issues/87
Adds the "Enable Collapsing?" property to the `ArchetypePreValue` model.
2014-03-18 22:55:01 -06:00
Tom Fulton 73e8712ad8 Cleanup / update Gruntfile
* Use proper grunt-umbraco-package task
* Use new structure for --target, eliminate deploy step by making `dist` configurable
* Move package files to /config/
* Cleanup watch/copy tasks, add atBegin: true
* Prevent "cleaning" non-local destinations (dangerous?)
* Cleanup full/base path config
* Whitespace, misc
2014-03-18 22:50:11 -06:00
leekelleher 0830290bf1 Adds the "Enable Collapsing?" property to the ArchetypePreValue model.
Closes #87
2014-03-18 13:03:46 +00:00
Tom Fulton e374a9f01b Cleanup Gruntfile, streamline copy tasks
grunt watch:dev -> grunt watch
2014-03-17 19:04:10 -06:00
Tom Fulton 980752340e Merge branch 'develop' 2014-03-17 18:16:49 -06:00
Tom Fulton 5092a24dca Merge pull request #81 from imulus/tweak-pvc
Simplify PropertyValueConverter
2014-03-17 18:14:47 -06:00
Tom Fulton 9203718a95 Merge pull request #84 from imulus/feature/hide-label
Add "Hide Label" option for full-width Archetypes
2014-03-17 18:13:44 -06:00
Tom Fulton 63b47c8f9d Merge pull request #85 from imulus/feature/collapse-single
Allow single rows to be collapsed
2014-03-17 18:13:24 -06:00
Tom Fulton f3fd6f3676 Merge pull request #86 from leekelleher/feature/fieldset-methods-hasvalue
Added methods `HasProperty` and `HasValue`
2014-03-17 18:12:20 -06:00
leekelleher 504a3b5c04 Added methods HasProperty and HasValue
Added methods to the `Fieldset` object for checking if a property exists and/or if it has a value.
2014-03-17 15:04:52 +00:00
Tom Fulton 363e614349 Allow single rows to be collapsed
Previously, you couldn't collapse a single row by itself, it was always expanded.  Now you can collapse it, but it's still expanded on the initial page load.
2014-03-14 22:29:00 -06:00
Tom Fulton 35ea62dff1 Add "Hide Label" option for full-width Archetypes 2014-03-14 22:02:28 -06:00
Dillon 4879230303 Merge pull request #83 from imulus/feature/style-tweaks
Fix fieldset editor control styles
2014-03-14 17:37:45 -06:00
Dillon Morton 0a65c1a843 Fix repeater button bugs 2014-03-14 17:34:16 -06:00
Tom Fulton 30d0d11af0 Fix typo in label 2014-03-13 00:40:56 -06:00
Tom Fulton bb6a2d2f96 Use PropertyEditor Resolver in favor of static mapping file 2014-03-13 00:10:31 -06:00
Tom Fulton c5eced8a44 Tighten up validation checks, add back missing code
Fixes #79 by using ===
Fix for null values
2014-03-12 18:03:18 -06:00
Tom Fulton 512edaeaf9 Make Archetype Model enumerable to simplify usage, make Fieldsets internal 2014-03-12 17:36:15 -06:00
Tom Fulton dd453fc66a PVC: Return empty Archetype instead of null when empty/errors 2014-03-12 17:13:23 -06:00
Tom Fulton cc92cd23f4 Merge pull request #80 from imulus/fix/error-highlight
Fix Umbraco's error style propagating to elements in our view
2014-03-12 16:32:48 -06:00
Tom Fulton ac36b19399 Fix Umbraco's error style propagating to elements in our view 2014-03-12 16:29:38 -06:00
Tom Fulton 2a444260a4 Merge branch 'master' into develop 2014-03-12 16:21:59 -06:00
Tom Fulton 8e71e5b66e Merge pull request #76 from imulus/feature/bug-fixes-kg
Bug fixes
2014-03-12 16:10:36 -06:00
Tom Fulton d0ffd314e9 Ignore "removed" fieldsets earlier in validation 2014-03-12 16:09:54 -06:00
Tom Fulton 9abab522e6 Merge pull request #78 from leekelleher/feature-property-helptext-tag
Property's help text tag to match Umbraco style
2014-03-12 15:36:11 -06:00
leekelleher 99861275a8 Changed the property's help-text tag
from `<em>` to `<small>` - to match Umbraco's native style.
2014-03-12 20:11:54 +00:00
Kevin Giszewski fa54294d74 Bug fixes for:
- #75
2014-03-12 08:12:22 -04:00
Kevin Giszewski 92b2615e46 Update README.md 2014-03-10 13:49:01 -04:00
Tom Fulton 898790bfa6 Fix alignment of fieldset controls in Prevalue Editor 2014-03-06 12:18:28 -07:00
Tom Fulton d37ee132bc Update adding rows to adhere to new Enable Collapsing option 2014-03-06 12:15:51 -07:00
Tom Fulton 561ef8ccd0 Revert accidental(?) background-color change from eaf766c 2014-03-06 12:13:18 -07:00
Tom Fulton 45d7db0239 Add missing dependency 2014-03-06 12:12:40 -07:00
Tom Fulton e444b728b6 Merge branch 'develop' 2014-03-06 12:05:48 -07:00
Tom Fulton 5865b47482 Merge branch 'feature/allow-collapsing' into develop
Conflicts:
	app/controllers/controller.js
2014-03-06 12:05:34 -07:00
Tom Fulton 6248837b60 Merge pull request #58 from leekelleher/feature-patch-courier-dataresolver
Added a `DataTypeGuid` property to the `Property` object.
2014-03-06 12:03:04 -07:00
Tom Fulton 37f2de0a8f Merge pull request #70 from imulus/fix/view-loading
Add hack for #53 - attempt to resolve promises manually
2014-03-06 12:00:37 -07:00
Tom Fulton be15dba68a Merge pull request #72 from imulus/feature/auto-fill-alias
Auto-fill fieldset and property aliases in Config
2014-03-06 11:59:41 -07:00
Tom Fulton e2620892f5 Merge pull request #73 from imulus/fix-firefox-sort
Add hack to workaround U4-4181 (Firefox can't click any fields)
2014-03-06 11:59:15 -07:00
leekelleher 7879ae695e Exposed the internal members to the "Archetype.Courier" (and Test) assemblies. 2014-03-04 17:38:14 +00:00
leekelleher 50ced7459a Changed the Property properties to internal setters.
Made the `DataTypeGuid` property completely `internal`.
2014-03-04 17:37:09 +00:00
leekelleher 89af319265 Merge branch 'master' into feature-patch-courier-dataresolver 2014-03-04 17:25:19 +00:00
Tom Fulton 7505de1cf1 Add hack to workaround U4-4181 (Firefox can't click any fields)
...in lieu of "proper" fix in Umbraco.
2014-03-02 19:47:21 -07:00
Tom Fulton a09c69edc1 Auto-fill fieldset and property aliases in Config
* Add new aliasIsDirty property, init for existing data
* Bind label control's keyup to populate the `alias` property (when it's not dirty) using Umbraco's helpers
* Mark alias dirty on keyup
2014-03-02 18:43:12 -07:00
Tom Fulton 03101a128e Hide carets when collapsing is disabled 2014-03-02 00:48:49 -07:00
Tom Fulton 67c118066b Merge branch 'develop' into feature/allow-collapsing
Conflicts:
	app/views/archetype.html
2014-03-02 00:41:20 -07:00
Tom Fulton f49159d2d0 Add option to make "collapsing" feature optional
* View: Prevent collapse/expand depending on config option, add class when enabled
* Config: Add option to view, set default to enabled for new datatypes
* CSS: Revert to normal cursor when collapsing disabled

* Note, this is a breaking change - you'll need set `Enable Collapsing?` to `true` on any existing Archetypes to retain the behavior.
2014-03-02 00:38:34 -07:00
Tom Fulton 840feec967 Add hack for #53 - attempt to resolve promises manually
$compile no longer unwraps promises, meaning some property editors may not fully load (their various .then() methods never get executed).  This attempts to resolve them after a delay.  Could be intermittent, but seems to work in most cases.
2014-03-01 22:45:26 -07:00
Tom Smith ffc4eaa964 Merge pull request #67 from rtsmith/master
Make entire module label clickable and change remove icon
2014-02-27 17:23:26 -07:00
Thomas Smith eaf766c2a7 Make entire module label clickable and change remove icon 2014-02-27 17:15:02 -07:00
Tom Fulton 419180c443 Merge branch 'develop' 2014-02-27 14:44:55 -07:00
Tom Fulton e97c976c7f Merge branch 'master' of github.com:imulus/Archetype
Conflicts:
	app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs
2014-02-27 14:29:51 -07:00
Tom Fulton 2d05e64e5a Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-02-27 14:25:48 -07:00
Tom Fulton 6f4d7f9e9b Bump version 2014-02-27 14:20:49 -07:00
Tom Fulton 5a24e9b016 Merge pull request #62 from imulus/versioning
Add version # to DLL on build
2014-02-27 13:41:28 -07:00
Tom Fulton 4d4e9d7de0 Quick-fix issues with NuGet package paths 2014-02-27 13:38:07 -07:00
Kevin Giszewski 1dde1ed5f0 Add version to assembly 2014-02-26 10:01:39 -05:00
Kevin Giszewski 88051ef61d Bump Version Number 2014-02-26 09:41:06 -05:00
Kevin Giszewski 10d3dd76ed Fix a situation where null were getting into the model on save. 2014-02-26 09:39:02 -05:00
Kevin Giszewski b52f153141 Merge pull request #57 from imulus/feature/api
Expose the Datatype Service GetById
2014-02-26 08:09:27 -05:00
Tom Fulton 062f28f9ca Tighten up watch/deploy tasks
* Don't trigger watch on changes to the .NET solution (except *.dll)
* Include .pdb file for dev deployments
* Fix DLL copying to wrong paths
2014-02-24 01:00:08 -07:00
Tom Fulton cd2bd8c562 Add version # to DLL on build
* Split VersionInfo from AssemblyInfo so we can ignore changes and let the build handle
* Ignore VersionInfo
* Install/configure assemblyinfo grunt task
* Ignore compiler warning about bad version number format (.NET vs SemVer)
2014-02-22 00:32:37 -07:00
Tom Fulton ed6068230e Merge pull request #59 from leekelleher/patch-vs-housekeeping
Some Visual Studio housekeeping
2014-02-21 22:53:16 -07:00
Tom Fulton 24bfef64dd Misc housekeeping 2014-02-21 22:36:27 -07:00
Tom Fulton 1d5e4eda7e Trim down data returned from API 2014-02-21 22:34:30 -07:00
leekelleher 346b8c73d4 Tidied up the AssemblyInfo with your company details, etc. 2014-02-21 18:17:59 +00:00
leekelleher 43ea29cdf2 Set the assembly references not to all "Copy Local",
so that everything isn't copied over to the /bin folders.
2014-02-21 18:14:13 +00:00
leekelleher de03a12e9c Added a DataTypeGuid property to the Property object.
This is required for Courier's DataResolver to "hot-swap" the DataTypeId (int) with it's unique Id (Guid).
2014-02-21 18:05:53 +00:00
Kevin Giszewski f05a67d9d2 Expose the Datatype Service GetById 2014-02-20 11:07:20 -05:00
Kevin Giszewski 3ac7ef34ec Merge pull request #54 from imulus/develop
Develop
2014-02-19 09:17:17 -05:00
Kevin Giszewski 518f95ce01 Merge pull request #52 from imulus/fix-ids
Fix some datatypes not working with multiple Archetypes
2014-02-19 09:16:41 -05:00
Tom Fulton 7831e476e3 Ensure property containers use unique IDs with multiple fieldsets
...by adding the current Archetype's Umbraco Property Alias to the ID string

Old: archetype-property-0-0
New: archetype-property-sliderItems-0-0

Need to DRY this up later ;)
2014-02-17 15:17:57 -07:00
Kevin Giszewski bfb883c098 Merge pull request #49 from leekelleher/feature-patch-courier-dataresolver
Tweaks to support a Courier DataResolver
2014-02-14 09:29:57 -05:00
leekelleher bbe3506747 Housekeeping: Fixed up the whitespace :bowtie:
There was a mix of tabs & spaces...
... normalized to use spaces (which was painful for me as I'm a "tabs kinda guy" 🤘
2014-02-13 17:50:07 +00:00
leekelleher 42743b1394 Fleshed out the ArchetypePreValue models.
(When Courier packages up the DataTypeDefinition - we need to serialize/deserialize the config options/JSON)
2014-02-13 17:43:52 +00:00
leekelleher 9a712acd6a Added constant for the prevalue alias.
(As we reference to this in the Courier DataResolver)
2014-02-13 17:30:28 +00:00
leekelleher 4c8bbd5d8f Added a nested try/catch.
For if the `PublishedPropertyType` value is null, we can still get an `Archetype` model returned)
2014-02-13 16:53:38 +00:00
leekelleher 9296388abe Added a constant for the PropertyEditor alias.
(So that we can reference it from the Courier DataResolver, without fear of typos)
2014-02-13 16:51:31 +00:00
leekelleher 3c5e2013a0 Added JsonProperty attributes to the properties.
(So that we can serialize/deserialize from the Courier DataResolver)
2014-02-13 16:32:03 +00:00
leekelleher aacbc06992 Changed the Property.DataTypeId property to be public, with an internal setter.
(We need to reference it within Courier's DataResolver)
2014-02-13 16:27:29 +00:00
leekelleher 220a034d2a Changed the Property.Value setter to be public. 2014-02-13 14:16:42 +00:00
Kevin Giszewski 6317b83720 Remove legacy filter 2014-02-07 17:31:18 -05:00
Kevin Giszewski 54766df143 Bump version number 2014-02-07 16:59:47 -05:00
Kevin Giszewski 0878fd5b71 Merge pull request #47 from imulus/feature/localize-directive
Feature/localize directive
2014-02-07 16:49:28 -05:00
Kevin Giszewski a4d4de6d09 Add langs and a few bug fixes 2014-02-07 16:47:05 -05:00
Kevin Giszewski c49af9821c WIP on switching to a directive based localization 2014-02-07 16:00:47 -05:00
Kevin Giszewski 574e2018fd Merge branch 'master' of github.com:imulus/Archetype 2014-02-07 12:46:29 -05:00
Kevin Giszewski 84639f82a4 Merge branch 'issue-43' into develop 2014-02-07 12:46:02 -05:00
Kevin Giszewski fe913fdba8 Merge branch 'issue-43' of github.com:imulus/Archetype into issue-43 2014-02-07 12:45:51 -05:00
Kevin Giszewski c597c712f4 Merge pull request #44 from mattbrailsford/issue-43
Fixed issue 43
2014-02-07 12:45:33 -05:00
Kevin Giszewski 6297302d61 Merge pull request #46 from mattbrailsford/issue-43
Moved GetValue method body to the Property object to allow easy conversi...
2014-02-07 12:45:02 -05:00
Kevin Giszewski fd2f6a9967 Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-02-07 12:40:26 -05:00
mattbrailsford 7e28dd87b5 Moved GetValue method body to the Property object to allow easy conversion of an untyped property without having to go via the fieldset again. 2014-02-07 12:21:36 -05:00
mattbrailsford 7d0d32b218 Moved GetValue method body to the Property object to allow easy conversion of an untyped property without having to go via the fieldset again. 2014-02-07 16:11:58 +00:00
Kevin Giszewski bf9e4d53df Expose some properties which could be useful for iterating and template decision-making 2014-02-07 09:39:57 -05:00
mattbrailsford 33f95253f9 Fixed issue 43
- Allows you to access nested complex property editor values by using the build in value converters
2014-02-07 10:59:01 +00:00
Tom Fulton 79761667cf Merge pull request #38 from imulus/tests
Test the "API" / PropertyValueConverter
2014-02-07 00:37:45 -07:00
Kevin Giszewski 7e959e9b0f Merge branch 'develop' 2014-02-05 18:13:24 -05:00
Kevin Giszewski 4848bdc5d6 Another localization refinement 2014-02-05 18:13:09 -05:00
Kevin Giszewski d645fc12de Merge branch 'develop' 2014-02-05 17:35:02 -05:00
Kevin Giszewski d5edb70e5b Handle missing locale file better 2014-02-05 17:32:14 -05:00
Kevin Giszewski 19c19c10ca Merge branch 'develop' 2014-02-05 15:08:00 -05:00
Kevin Giszewski 6f0b7a2303 Remove settings.js 2014-02-05 15:07:45 -05:00
Kevin Giszewski f842172be5 Merge branch 'develop' 2014-02-05 15:05:54 -05:00
Kevin Giszewski 6dff2518ff Merge pull request #42 from imulus/feature/localization
Implement Localization
2014-02-05 15:05:27 -05:00
Kevin Giszewski 6a2af3cc19 Remove unused userService call 2014-02-05 15:02:28 -05:00
Kevin Giszewski 79005262a0 Use User.locale in lieu of Settings.js 2014-02-05 15:00:25 -05:00
Kevin Giszewski 6c7ec07068 Implement Localization 2014-02-05 14:08:46 -05:00
Kevin Giszewski f26174725e Merge branch 'develop' 2014-02-05 09:05:43 -05:00
Kevin Giszewski 15e65f15af Merge pull request #41 from imulus/feature/alias-required
Add required and move the module the resource lives in.
2014-02-05 09:05:21 -05:00
Kevin Giszewski 4f199170ec Add required and move the module the resource lives in. 2014-02-05 09:03:26 -05:00
Tom Fulton ba45e670e3 Merge pull request #39 from imulus/bugfix/issue36
Fix Sort Issue in Dropdown
2014-02-04 19:25:07 -08:00
Kevin Giszewski 3d01149fe0 Fix Sort Issue in Dropdown 2014-02-04 19:36:53 -05:00
Tom Fulton d616b88f3e Merge branch 'develop' into tests 2014-02-03 19:51:08 -07:00
Tom Fulton 03e7b2956a Add tests for Models and ValueConverter 2014-02-03 19:50:47 -07:00
Kevin Giszewski b81775b7e1 Update README.md 2014-02-03 10:29:27 -05:00
Kevin Giszewski 96878411c0 Update README.md 2014-02-03 10:27:12 -05:00
Kevin Giszewski 2ad9127830 Update README.md 2014-02-03 10:14:43 -05:00
Kevin Giszewski c06534b069 Update README.md 2014-02-03 10:14:11 -05:00
Kevin Giszewski a8d028fcbf Merge branch 'feature/validation' into develop 2014-02-03 08:24:21 -05:00
Kevin Giszewski 18b0b7ab71 Merge branch 'feature/prevalue-fieldset-title' into develop 2014-02-03 08:24:05 -05:00
Kevin Giszewski 2d2658d8f4 Merge branch 'feature/default-fieldset-title' into develop 2014-02-03 08:22:39 -05:00
Kevin Giszewski 1c05d8e37b Fix typo 2014-02-02 23:27:36 -05:00
Kevin Giszewski 945b790121 Make error styles more subtle 2014-02-02 23:27:14 -05:00
Kevin Giszewski 34d2420c75 Refactor a few things 2014-02-02 22:58:04 -05:00
Kevin Giszewski 139c22c560 WIP 2014-02-02 16:51:32 -05:00
Tom Fulton b7ef53f27c Show property alias/type in the header in Prevalue Editor 2014-02-02 14:12:39 -07:00
Tom Fulton 56095ef8ec Shorten up the prevalue editor fields for smaller screens 2014-02-02 13:31:42 -07:00
Kevin Giszewski 9262d68070 Merge pull request #26 from imulus/feature/bugfixes
Feature/bugfixes
2014-02-02 10:12:32 -08:00
Kevin Giszewski 57af9c4130 Merge branch 'master' into develop 2014-02-02 13:11:31 -05:00
Kevin Giszewski dc32b94c15 Merge branch 'master' of github.com:imulus/Archetype 2014-02-02 13:11:18 -05:00
Kevin Giszewski 61b1053b6e Merge pull request #27 from leekelleher/feature-editor-labels
Editor Control labels wired up fields/inputs
2014-02-02 10:10:47 -08:00
Kevin Giszewski b684bad840 Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-02-02 13:07:30 -05:00
Kevin Giszewski fc47d7174f Merge branch 'develop' 2014-02-02 13:06:01 -05:00
Kevin Giszewski 901bf4dcb0 Merge branch 'master' of github.com:imulus/Archetype 2014-02-02 13:05:58 -05:00
Kevin Giszewski 17312e6382 Merge pull request #24 from leekelleher/feature-config-labels
Prevalue Editor labels wired up to fields/inputs
2014-02-02 10:05:39 -08:00
leekelleher 92e2c070f8 Wired up Archetype's labels with the fields.
Using the fieldset and property's index/position to set the alias/ID.

+ small CSS tweak
2014-02-02 17:00:22 +00:00
leekelleher 4dc21b3e18 Fixed the ids for the fieldset labels - added the index/position.
Corrected the nested repeater's `id`s with the context of the parent's index/position.
2014-02-02 15:10:28 +00:00
leekelleher b55a1a4324 Prevalue editor CSS tweaks.
General tightening up of the fields/properties.
2014-02-02 15:10:27 +00:00
Tom Fulton 062c8be5d2 Fix cursor on fieldset icons 2014-02-01 23:38:24 -07:00
Kevin Giszewski 16d1dfc586 Merge branch 'master' into develop 2014-02-01 21:08:38 -05:00
Kevin Giszewski 5311cc9323 Merge branch 'master' of github.com:imulus/Archetype 2014-02-01 21:08:07 -05:00
Kevin Giszewski 3921d1340c Merge pull request #25 from leekelleher/feature-css-tweaks-lk
Prevalue Editor - CSS tweaks.
2014-02-01 18:07:44 -08:00
Kevin Giszewski 8b96ccf3bf Merge branch 'master' of github.com:imulus/Archetype 2014-02-01 20:40:13 -05:00
Kevin Giszewski 50f4e43cf6 Fix typo in the comments 2014-02-01 20:21:55 -05:00
Kevin Giszewski 5ad2c91700 Bugfixes
- Cleanout model properties if no longer in the config
- Test for form existence on validation
2014-02-01 20:20:09 -05:00
Kevin Giszewski 1518bfd453 Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-02-01 19:55:22 -05:00
leekelleher c789485cdd Added for attributes to the labels and corresponding id attributes on the input fields.
Swapped the "Max fieldsets" input to be a "number" (HTML5) type.
2014-02-01 23:51:43 +00:00
leekelleher 61e0ef90dd Prevalue editor CSS tweaks.
General tightening up of the fields/properties.
2014-02-01 23:48:16 +00:00
Kevin Giszewski 6dc745f31d Remove dependency to $interpolate 2014-02-01 18:40:57 -05:00
Tom Fulton a1f7d94ece Default fieldset title when empty 2014-01-31 20:56:40 -07:00
Tom Fulton 6d1e9f1b9a Fix empty labels not clickable 2014-01-31 17:37:48 -07:00
Tom Fulton 7fd049f5b7 Merge branch 'develop' 2014-01-31 16:11:50 -07:00
Tom Fulton b749891832 Only clean on main task 2014-01-31 16:11:33 -07:00
Tom Fulton f7a9b519e6 Merge branch 'develop' 2014-01-31 16:06:20 -07:00
Tom Fulton 9a7131d5fc Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-01-31 16:05:45 -07:00
Tom Fulton 785199d7cf Ensure we build/clean before creating packages 2014-01-31 16:05:33 -07:00
Kevin Giszewski c374ae7f3e Merge branch 'develop' 2014-01-31 17:57:28 -05:00
Kevin Giszewski c85fd354a6 Bump Minor Version 2014-01-31 17:56:39 -05:00
Kevin Giszewski 926e12fa8f Update README.md 2014-01-31 17:36:24 -05:00
Kevin Giszewski 081fc1ad6d Update README.md 2014-01-31 17:35:17 -05:00
Kevin Giszewski 110f8fc1b2 Merge IconPicker 2014-01-31 17:31:59 -05:00
Kevin Giszewski 8077742c13 Merge pull request #21 from imulus/nuke
Remove a few edge-case features (for now?)
2014-01-31 14:14:20 -08:00
Kevin Giszewski 01a45477b8 Add Icon Picker 2014-01-31 17:10:00 -05:00
Tom Fulton 8eb005941f Remove a few edge-case features (for now?) 2014-01-31 15:05:49 -07:00
Tom Fulton 04cda8c646 Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-01-31 14:39:25 -07:00
Tom Fulton cf3b8ee30e Fix content picker styling 2014-01-31 14:39:16 -07:00
Tom Fulton 424740cdec Merge pull request #20 from imulus/feature/datatypes
Use DataTypes instead of Views
2014-01-31 13:09:37 -08:00
Tom Fulton 80bda94265 Merge pull request #17 from imulus/feature/ui-fixes
Feature/ui fixes
2014-01-31 12:16:53 -08:00
Kevin Giszewski d431f24d27 Adjust label width for nested Archetypes 2014-01-31 12:39:02 -05:00
Kevin Giszewski 2deb639d28 Add margin to the top of fs collapser 2014-01-31 10:40:01 -05:00
Kevin Giszewski 4d753d057c Remove redundant variable 2014-01-31 10:28:15 -05:00
Kevin Giszewski 57d4ac42b5 Ini the config property collapser 2014-01-31 10:25:38 -05:00
Kevin Giszewski 340ab297ee Remove Config from 'config' :) 2014-01-31 10:25:28 -05:00
Kevin Giszewski 4d4d94d0eb Remove ability to hide fieldset labels 2014-01-31 10:08:15 -05:00
Kevin Giszewski 72a53b2711 Fix issue when clicking on label
- Was not focusing the proper fieldset
2014-01-31 10:02:49 -05:00
Kevin Giszewski 852510fd70 Avoid having the fieldset default to error when added 2014-01-31 09:53:35 -05:00
Tom Fulton bc7025ec69 Send over a PropertyEditor's DefaultPreValues when building the property view
* Add static mappings for DefaultPreValues to config file (for now - should be able to pull them out)
* Merge in the DefaultPreValues to the Prevalues when building the config
2014-01-31 02:29:21 -07:00
Tom Fulton 548113a34a Update editor to work with DataTypes instead of Views
* Add helper methods for getting DataType info (ie, prevalues, property editor alias)
* Add static mapping file of PropertyEditorAlias -> View, as can't seem to find a way to expose this from Umbraco (for now)
* Load the view's config from the DataType's prevalues
2014-01-31 00:35:41 -07:00
Tom Fulton eb36f30c11 Update PrevalueEditor to use DataTypes instead of Views 2014-01-30 22:10:15 -07:00
Kevin Giszewski daff37074e Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-01-28 12:00:32 -05:00
Kevin Giszewski f27949cfbb Add a few new Core Editors 2014-01-28 11:59:39 -05:00
Tom Fulton 121cac5798 Add .Tests project, install packages 2014-01-28 00:26:11 -07:00
Tom Fulton 1fb5ab489e Merge branch 'develop' of github.com:imulus/Archetype into develop 2014-01-27 23:29:56 -07:00
Tom Fulton 3cff83af72 Quick UI update 2014-01-27 22:54:56 -07:00
Taylor Smith b78b4627db Merge branch 'master' into develop 2014-01-21 20:16:14 -07:00
Taylor Smith 0a5b3f9c37 Merge pull request #15 from leekelleher/issue-14-packages.json
Added 'repository' field to `packages.json`.
2014-01-21 17:10:12 -08:00
Kevin Giszewski b94a6048e7 Merge pull request #16 from imulus/feature/refactors
Refactor the code
2014-01-19 05:52:46 -08:00
Kevin Giszewski 12428c71a9 Use JSON.parse in favor of eval() 2014-01-19 08:51:49 -05:00
Kevin Giszewski ffc876eed2 Update comments 2014-01-19 08:14:27 -05:00
Kevin Giszewski 41c43f1b7e Remove function no longer used 2014-01-19 08:14:19 -05:00
Kevin Giszewski acc27c1976 Add missing closing tokens 2014-01-19 08:13:47 -05:00
Kevin Giszewski 41dfac827a Remove deep watch b/c we are no longer tracking real-time changes of the config/default value 2014-01-19 08:12:51 -05:00
Kevin Giszewski d5d05cef2f Rename the propertyEditorService to propertyEditorResource 2014-01-19 08:00:09 -05:00
Kevin Giszewski 4900dcc5b6 Rename getPropertyIdByAlias, convert getFieldsetByAlias to underscore notation 2014-01-17 14:16:49 -05:00
Kevin Giszewski eb2cbf7a8f Update README.md 2014-01-17 12:16:35 -05:00
Kevin Giszewski 8a42c6fdbd Update README.md 2014-01-17 12:04:03 -05:00
leekelleher 1443149264 Added 'repository' field to packages.json.
This removes npm's nag warning.
2014-01-17 16:42:13 +00:00
Kevin Giszewski 8a4f3de023 Update README.md 2014-01-17 10:49:43 -05:00
Tom Fulton 5a092daca9 Mark package versions as prelease 2014-01-17 03:22:03 -07:00
Tom Fulton e9f710ea9e Include C# solution in build/package outputs 2014-01-17 02:54:59 -07:00
Tom Fulton 9d3f4e76db Quick cleanup of packaging tasks 2014-01-17 02:20:54 -07:00
Tom Fulton 489628451b Merge branch 'develop' into feature/packaging
Conflicts:
	.gitignore
	Gruntfile.js
	package.json
2014-01-16 23:33:53 -07:00
Tom Fulton 0c4c04f84e Merge branch 'develop' into feature/nuget
Conflicts:
	.gitignore
	Gruntfile.js
	package.json
2014-01-16 23:30:38 -07:00
Kevin Giszewski d46ae5b993 Fix validation bug, rename labelExpression, change error style 2014-01-16 19:43:15 -05:00
Kevin Giszewski b73b728780 Merge pull request #13 from imulus/feature/default-value
Feature/default value
2014-01-16 12:05:03 -08:00
Kevin Giszewski deb771e456 Alter config and defaultValue
- Turn into strings and try to eval on render
2014-01-16 15:03:41 -05:00
Kevin Giszewski d80f828b29 Fix validation.requiredAliases ini error 2014-01-16 14:43:46 -05:00
Kevin Giszewski c0e867b547 Merge pull request #10 from imulus/feature/configUI
Feature/config ui
2014-01-16 11:27:01 -08:00
Kevin Giszewski bd3cb98fe3 Rename the DLL Assembly (remove Imulus) 2014-01-16 14:26:10 -05:00
Kevin Giszewski 847c42238b Remove Imulus References from Archetype except for C# and Property Alias
- Default to only one fieldset
- Move all other options to 'advanced'
2014-01-16 14:23:02 -05:00
Kevin Giszewski 77084d5ce3 Rename views.js to config.views.js 2014-01-16 14:03:39 -05:00
Kevin Giszewski 758b479f2e Merge branch 'feature/fieldset-label-expressions' into feature/configUI 2014-01-16 13:47:19 -05:00
Kevin Giszewski a8cb0613cf Rename renderItem to renderFieldset 2014-01-16 13:42:08 -05:00
Kevin Giszewski 9424230452 Convert config to underscore 2014-01-16 13:41:51 -05:00
Kevin Giszewski ab6361f4ab Complete Feature Required
- Also switch to underscore.js for controller.js
2014-01-16 12:37:01 -05:00
Tom Fulton 963447ba38 Replace fieldset label expressions with basic templates
The Label Expr. field can now be defined like this:  Person: {{firstName}} {{lastName}}

Where firstName and lastName are the property alias of a property on the current fieldset
2014-01-15 23:27:33 -07:00
Kevin Giszewski e44a448f62 Removed the hasValue propotype, caused issues on save 2014-01-15 20:23:59 -05:00
Kevin Giszewski 5b0cb2c4ba Merge branch 'feature/configUI' of github.com:imulus/Archetype into feature/configUI 2014-01-15 19:44:53 -05:00
Kevin Giszewski b07d2c03ec Add Fieldset Highlight when !isValid 2014-01-15 19:44:27 -05:00
Kevin Giszewski 22bd3429df Update README.md 2014-01-15 19:21:24 -05:00
Kevin Giszewski 8fb49fab56 Merge branch 'develop' into feature/configUI 2014-01-15 19:19:14 -05:00
Kevin Giszewski d6dcf217e6 Merge pull request #11 from imulus/feature/template-helper
Template Helpers
2014-01-15 16:18:44 -08:00
Kevin Giszewski c540f90e4a Remove Sample Model 2014-01-15 19:17:22 -05:00
Tom Fulton e5f8dc5634 Add methods to access specific properties from a Fieldset
* GetValue("alias") - gets the value as a string
* GetValue<T>("alias") - attempts to convert to the specified types using some of Umbraco's built in TypeConverter logic.  If conversion fails, returns default(T).  Note this doesn't utilize PropertyValueConverters (yet?)
* GetProperty("alias") - gets a reference to the entire property object.  Leaving this private for now, but there may be a reason to publicize someday if we add more properties to the Property object.
2014-01-15 16:17:32 -07:00
Kevin Giszewski 4548c185d9 WIP on 'Required' 2014-01-15 17:31:31 -05:00
Tom Fulton eea861bb28 Pull in Kevin's PropertyValueConverter project 2014-01-15 15:00:47 -07:00
Tom Fulton 2e0a84852b Add grunt task for creating umbraco package 2014-01-15 14:16:17 -07:00
Kevin Giszewski 67d727647a Persist (don't collapse) a config FS if it's the only one. 2014-01-15 15:42:35 -05:00
Kevin Giszewski e42d86d594 Add Collapser to Property Configs 2014-01-15 15:31:52 -05:00
Kevin Giszewski 14455ad9a2 Add propertyEditorService
- using a static json file for now (could not find any way to get a list)
2014-01-15 14:36:06 -05:00
Kevin Giszewski 2210c07358 Keep a fieldset open if it's the only one onLoad; handle toggle after insert 2014-01-14 20:09:45 -05:00
Kevin Giszewski 7b5457d51b Add Label Expression 2014-01-14 19:48:01 -05:00
Kevin Giszewski 7ba4cd8e17 Remove Old Configs, fix bugs and wire-up collapser 2014-01-14 17:30:10 -05:00
Kevin Giszewski b9c9e499e2 Fix Default Config Model Issues 2014-01-14 16:08:38 -05:00
Kevin Giszewski 410a27fb89 Add Collapser 2014-01-14 15:41:40 -05:00
Kevin Giszewski 381efc0089 Basic fieldset/property CRUD working 2014-01-14 15:12:38 -05:00
Kevin Giszewski af014fbf43 Ongoing WIP 2014-01-14 14:15:16 -05:00
Kevin Giszewski 908df13626 Begin WIP on config GUI 2014-01-14 14:15:00 -05:00
Kevin Giszewski 475f9fc62c Include extra js 2014-01-14 14:14:42 -05:00
Kevin Giszewski e670a074a2 Update README.md 2014-01-13 13:01:21 -05:00
Kevin Giszewski e3a9a7c09a Update README.md 2014-01-13 12:58:42 -05:00
Kevin Giszewski bf60a3e9ee Merge pull request #9 from imulus/feature/remove-property
Remove the 'remove' property from the model
2014-01-13 09:51:09 -08:00
Kevin Giszewski 045fe2ee5c Remove the 'remove' property from the model 2014-01-13 12:47:21 -05:00
Kevin Giszewski 6d093c9642 Updated Readme.md with Documentation 2014-01-13 12:10:33 -05:00
Tom Fulton 5d6581e988 Fix README formatting 2014-01-12 23:55:10 -07:00
Tom Fulton 831ac0ca6f Tweak build tasks
* Disable spawn for watch:dev
* Reorder tasks
* Fix hardcoded path
2014-01-12 23:51:37 -07:00
Kevin Giszewski 9fb0a995ac Merge pull request #4 from imulus/develop
Bring Master up to date
2014-01-12 11:44:50 -08:00
Kevin Giszewski 67ebc20930 Merge pull request #2 from imulus/feature/dev-tasks
Grunt Tasks for Development
2014-01-12 11:43:59 -08:00
Kevin Giszewski e8a2d81009 Get Running with the Latest Reorg of stuff 2014-01-12 14:33:09 -05:00
Kevin Giszewski e44be56fb1 Ini new changes 2014-01-12 14:05:39 -05:00
Tom Fulton 4fb4c23c7d Fix build paths 2014-01-12 04:40:41 -07:00
Tom Fulton bffdc7f644 Add build option to touch web.config automatically on deploy 2014-01-12 04:40:27 -07:00
Tom Fulton 628fa750ba Update README with new dev tasks 2014-01-12 03:36:02 -07:00
Tom Fulton 75ed6f11c9 Merge branch 'develop' into feature/dev-tasks
Conflicts:
	README.md
2014-01-12 03:33:24 -07:00
Tom Fulton dcc869a3cc Merge branch 'develop'
Conflicts:
	README.md
2014-01-12 03:32:49 -07:00
Tom Fulton 5a3a38cc68 Add deploy, watch:dev tasks to ease local development. Usage:
`grunt deploy --target D:\\Dev\\Projects\\MyUmbracoSiteRoot` copies the build to /App_Plugins/Archetype/
`grunt watch:dev --target D:\\Dev\\Projects\\MyUmbracoSiteRoot` runs a deploy automatically when a file change is detected in /app/*
2014-01-12 03:26:08 -07:00
Tom Fulton eafd2d454c Inject package version, files into nuspec on build
* Move /build/ -> /pkg/
* Add nuspec
* Refactor package:nuget workflow to create a temporary directory to build the package from - so we can store the transformed file
* Add grunt-template task to transform the nuspec
2014-01-12 02:13:05 -07:00
Tom Fulton 9a7bf3693c Add package:nuget task
* Add grunt-nuget
* Add nuspec file
* Add build task
2014-01-11 22:17:12 -07:00
Tom Fulton c2e936364e Update readme with rough build details 2014-01-10 17:55:21 -07:00
Tom Fulton 5f3fb68ca7 Update readme with rough build details 2014-01-10 17:51:54 -07:00
Tom Fulton fe1218b028 Merge branch 'master' of github.com:imulus/Archetype 2014-01-10 17:38:43 -07:00
tomfulton c4f4995c65 Initial commit 2014-01-10 16:22:14 -08:00
Tom Fulton b524121f8a Initial commit 2014-01-10 17:20:35 -07:00
92 changed files with 5364 additions and 649 deletions
+2 -1
View File
@@ -13,7 +13,7 @@ $RECYCLE.BIN/
app/less/*.css
dist/
node_modules/
pkg/tmp/
tmp/
pkg/*.nupkg
pkg/*.zip
@@ -23,6 +23,7 @@ pkg/*.zip
[Bb]in/
[Oo]bj/
[Pp]ackages/
VersionInfo.cs
*.aps
*.bak
+217
View File
@@ -0,0 +1,217 @@
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
var path = require('path')
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pkgMeta: grunt.file.readJSON('config/meta.json'),
dest: grunt.option('target') || 'dist',
basePath: path.join('<%= dest %>', 'App_Plugins', '<%= pkgMeta.name %>'),
watch: {
options: {
spawn: false,
atBegin: true
},
less: {
files: ['app/**/*.less'],
tasks: ['less:dist']
},
js: {
files: ['app/**/*.js'],
tasks: ['concat:dist']
},
html: {
files: ['app/**/*.html'],
tasks: ['copy:html']
},
dll: {
files: ['app/Umbraco/**/*.dll'],
tasks: ['copy:dll']
}
},
less: {
dist: {
options: {
paths: ["app/less", "lib/less", "vendor"],
},
files: {
'<%= basePath %>/css/archetype.css': 'app/less/archetype.less',
}
}
},
concat: {
options: {
stripBanners: false
},
dist: {
src: [
'app/controllers/controller.js',
'app/controllers/config.controller.js',
'app/directives/archetypeproperty.js',
'app/directives/archetypecustomview.js',
'app/directives/localize.js',
'app/services/localization.js',
'app/helpers/labelhelpers.js',
'app/resources/propertyeditor.js'
],
dest: '<%= basePath %>/js/archetype.js'
}
},
copy: {
html: {
cwd: 'app/views/',
src: ['archetype.html', 'archetype.default.html', 'archetype.config.html'],
dest: '<%= basePath %>/views',
expand: true
},
dll: {
cwd: 'app/Umbraco/Umbraco.Archetype/bin/Release/',
src: 'Archetype.dll',
dest: '<%= dest %>/bin/',
expand: true
},
config: {
files: [
{
cwd: 'app/langs/',
src: ['**'],
dest: '<%= basePath %>/langs',
expand: true
}
]
},
nuget: {
files: [
{
cwd: '<%= dest %>',
src: ['**/*', '!bin', '!bin/*'],
dest: 'tmp/nuget/content',
expand: true
},
{
cwd: '<%= dest %>/bin',
src: ['*.dll'],
dest: 'tmp/nuget/lib/net40',
expand: true
}
]
},
umbraco: {
cwd: '<%= dest %>',
src: '**/*',
dest: 'tmp/umbraco',
expand: true
}
},
nugetpack: {
dist: {
src: 'tmp/nuget/package.nuspec',
dest: 'pkg'
}
},
template: {
'nuspec': {
'options': {
'data': {
name: '<%= pkgMeta.name %>',
version: '<%= pkgMeta.version %>',
url: '<%= pkgMeta.url %>',
license: '<%= pkgMeta.license %>',
licenseUrl: '<%= pkgMeta.licenseUrl %>',
author: '<%= pkgMeta.author %>',
authorUrl: '<%= pkgMeta.authorUrl %>',
files: [{ path: 'tmp/nuget/**', target: 'content/App_Plugins/Archetype'}]
}
},
'files': {
'tmp/nuget/package.nuspec': ['config/package.nuspec']
}
}
},
umbracoPackage: {
options: {
name: "<%= pkgMeta.name %>",
version: '<%= pkgMeta.version %>',
url: '<%= pkgMeta.url %>',
license: '<%= pkgMeta.license %>',
licenseUrl: '<%= pkgMeta.licenseUrl %>',
author: '<%= pkgMeta.author %>',
authorUrl: '<%= pkgMeta.authorUrl %>',
manifest: 'config/package.xml',
readme: 'config/readme.txt',
sourceDir: 'tmp/umbraco',
outputDir: 'pkg',
}
},
clean: {
build: '<%= grunt.config("basePath").substring(0, 4) == "dist" ? "dist/**/*" : "null" %>',
tmp: ['tmp']
},
assemblyinfo: {
options: {
files: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj'],
filename: 'VersionInfo.cs',
info: {
version: '<%= (pkgMeta.version.indexOf("-") ? pkgMeta.version.substring(0, pkgMeta.version.indexOf("-")) : pkgMeta.version) %>',
fileVersion: '<%= pkgMeta.version %>'
}
}
},
touch: {
webconfig: {
src: ['<%= grunt.option("target") %>\\Web.config']
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
src: {
src: ['app/**/*.js', 'lib/**/*.js']
}
},
msbuild: {
options: {
stdout: true,
verbosity: 'quiet',
maxCpuCount: 4,
version: 4.0,
buildParameters: {
WarningLevel: 2,
NoWarn: 1607
}
},
dist: {
src: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj'],
options: {
projectConfiguration: 'Release',
targets: ['Clean', 'Rebuild'],
}
}
}
});
grunt.registerTask('default', ['clean', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:config', 'copy:html']);
grunt.registerTask('nuget', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'clean:tmp']);
grunt.registerTask('umbraco', ['clean:tmp', 'default', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']);
grunt.registerTask('package', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']);
};
+20
View File
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2014 Imulus
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+39
View File
@@ -0,0 +1,39 @@
Archetype
=========
![alt tag](http://imulus.github.io/Archetype/images/logo.png)
![alt tag](http://imulus.github.io/Archetype/images/example1.png)
## Installation
Install the selected <a href='https://github.com/imulus/Archetype/releases'>release</a> through the Umbraco package installer or via <a href='http://www.nuget.org/packages/Archetype/'>NuGet</a>.
## Official Docs ##
http://imulus.github.io/Archetype
Follow us on Twitter https://twitter.com/ArchetypeKit
## Contribute ##
Want to contribute to Archetype? You'll want to use Grunt (our task runner) to help you integrate with a local copy of Umbraco.
### Install Dependencies ###
*Requires Node.js to be installed and in your system path*
npm install -g grunt-cli && npm install -g grunt
npm install
### Build ###
grunt
Builds the project to `/dist/`. These files can be dropped into an Umbraco 7 site, or you can build directly to a site using:
grunt --target="D:\inetpub\mysite"
You can also watch for changes using:
grunt watch
grunt watch --target="D:\inetpub\mysite"
Add `--touch` to either command to automatically touch the web.config on a deploy
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
Binary file not shown.
+136
View File
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">false</RequireRestoreConsent>
<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
</PropertyGroup>
<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://www.nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
<PackagesConfig>packages.config</PackagesConfig>
</PropertyGroup>
<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
</Target>
<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />
<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FE8BE437-8B11-4E49-9B02-F45994E6D723}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Archetype.Courier</RootNamespace>
<AssemblyName>Archetype.Courier</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="businesslogic">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="cms">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="interfaces">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
<Reference Include="umbraco">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Core">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Courier.Core">
<HintPath>lib\Umbraco.Courier.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Courier.DataResolvers">
<HintPath>lib\Umbraco.Courier.DataResolvers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Courier.Providers">
<HintPath>lib\Umbraco.Courier.Providers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.providers">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Umbraco.Archetype\Properties\VersionInfo.cs">
<Link>Properties\VersionInfo.cs</Link>
</Compile>
<Compile Include="DataResolvers\ArchetypeDataResolver.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Archetype\Archetype.Umbraco.csproj">
<Project>{7d185d41-4228-4978-acb8-83f9a48ad94f}</Project>
<Name>Archetype.Umbraco</Name>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Archetype.Models;
using Archetype.PropertyConverters;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Courier.Core;
using Umbraco.Courier.Core.ProviderModel;
using Umbraco.Courier.DataResolvers;
using Umbraco.Courier.ItemProviders;
namespace Archetype.Courier.DataResolvers
{
public class ArchetypeDataResolver : PropertyDataResolverProvider
{
private enum Direction
{
Extracting,
Packaging
}
public override string EditorAlias
{
get
{
return Archetype.Constants.PropertyEditorAlias;
}
}
public override void ExtractingDataType(DataType item)
{
// No longer need to extract the DataType (int) Ids as Archetype now references the Guid [LK]
}
public override void ExtractingProperty(Item item, ContentProperty propertyData)
{
ReplacePropertyDataIds(item, propertyData, Direction.Extracting);
}
public override void PackagingDataType(DataType item)
{
AddDataTypeDependencies(item);
}
public override void PackagingProperty(Item item, ContentProperty propertyData)
{
ReplacePropertyDataIds(item, propertyData, Direction.Packaging);
}
private void AddDataTypeDependencies(DataType item)
{
if (item.Prevalues != null && item.Prevalues.Count > 0)
{
var prevalue = item.Prevalues[0];
if (prevalue.Alias.InvariantEquals(Archetype.Constants.PreValueAlias) && !string.IsNullOrWhiteSpace(prevalue.Value))
{
var config = JsonConvert.DeserializeObject<ArchetypePreValue>(prevalue.Value);
if (config != null && config.Fieldsets != null)
{
foreach (var property in config.Fieldsets.SelectMany(x => x.Properties))
{
item.Dependencies.Add(property.DataTypeGuid.ToString(), ProviderIDCollection.dataTypeItemProviderGuid);
}
item.Prevalues[0].Value = JsonConvert.SerializeObject(config, Formatting.None);
}
}
}
}
private void ReplacePropertyDataIds(Item item, ContentProperty propertyData, Direction direction)
{
if (propertyData != null && propertyData.Value != null)
{
var dataTypeId = ExecutionContext.DatabasePersistence.GetNodeId(propertyData.DataType, NodeObjectTypes.DataType);
var fakePropertyType = this.CreateDummyPropertyType(dataTypeId, this.EditorAlias);
var converter = new ArchetypeValueConverter();
var archetype = (ArchetypeModel)converter.ConvertDataToSource(fakePropertyType, propertyData.Value, false);
if (archetype != null)
{
// get the `PropertyItemProvider` from the collection.
var propertyItemProvider = ItemProviderCollection.Instance.GetProvider(ProviderIDCollection.propertyDataItemProviderGuid, this.ExecutionContext);
foreach (var property in archetype.Fieldsets.SelectMany(x => x.Properties))
{
if (property == null || string.IsNullOrWhiteSpace(property.PropertyEditorAlias))
continue;
// create a 'fake' item for Courier to process
var fakeItem = new ContentPropertyData()
{
ItemId = item.ItemId,
Name = string.Format("{0} [{1}: Nested {2} ({3})]", new[] { item.Name, this.EditorAlias, property.PropertyEditorAlias, property.Alias }),
Data = new List<ContentProperty>
{
new ContentProperty
{
Alias = property.Alias,
DataType = ExecutionContext.DatabasePersistence.GetUniqueId(property.DataTypeId, NodeObjectTypes.DataType),
PropertyEditorAlias = property.PropertyEditorAlias,
Value = property.Value
}
}
};
if (direction == Direction.Packaging)
{
try
{
// run the 'fake' item through Courier's data resolvers
ResolutionManager.Instance.PackagingItem(fakeItem, propertyItemProvider);
}
catch (Exception ex)
{
LogHelper.Error<ArchetypeDataResolver>(string.Concat("Error packaging data value: ", fakeItem.Name), ex);
}
// pass up the dependencies and resources
item.Dependencies.AddRange(fakeItem.Dependencies);
item.Resources.AddRange(fakeItem.Resources);
}
else if (direction == Direction.Extracting)
{
try
{
// run the 'fake' item through Courier's data resolvers
ResolutionManager.Instance.ExtractingItem(fakeItem, propertyItemProvider);
}
catch (Exception ex)
{
LogHelper.Error<ArchetypeDataResolver>(string.Concat("Error extracting data value: ", fakeItem.Name), ex);
}
}
if (fakeItem.Data != null && fakeItem.Data.Any())
{
var firstDataType = fakeItem.Data.FirstOrDefault();
if (firstDataType != null)
{
// set the resolved property data value
property.Value = firstDataType.Value;
// (if packaging) add a dependency for the property's data-type
if (direction == Direction.Packaging)
item.Dependencies.Add(firstDataType.DataType.ToString(), ProviderIDCollection.dataTypeItemProviderGuid);
}
}
}
// serialize the Archetype back to a string
propertyData.Value = archetype.SerializeForPersistence();
}
}
}
private PublishedPropertyType CreateDummyPropertyType(int dataTypeId, string propertyEditorAlias)
{
return new PublishedPropertyType(null, new PropertyType(new DataTypeDefinition(-1, propertyEditorAlias) { Id = dataTypeId }));
}
}
}
@@ -0,0 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Archetype.Courier")]
[assembly: AssemblyDescription("A set of tools to support Archetype with Umbraco Courier")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Umbrella Inc Ltd")]
[assembly: AssemblyProduct("Archetype.Courier")]
[assembly: AssemblyCopyright("Copyright \xa9 Lee Kelleher, Umbrella Inc Ltd 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("6F05C431-ABBF-4D77-9D3D-5AF6C8E318AF")]
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
<package id="ImageProcessor" version="1.8.7.0" targetFramework="net45" />
<package id="ImageProcessor.Web" version="3.2.1.0" targetFramework="net45" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
</packages>
@@ -0,0 +1,295 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Archetype.Tests</RootNamespace>
<AssemblyName>Archetype.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="AutoMapper.Net4">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="businesslogic, Version=1.0.5242.22740, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ClientDependency.Core">
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ClientDependency.Core.Mvc">
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="cms, Version=1.0.5242.22741, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="controls, Version=1.0.5242.22742, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="CookComputing.XmlRpcV2">
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Examine, Version=0.1.55.2941, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HtmlAgilityPack">
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImageProcessor, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImageProcessor.Web, Version=3.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="interfaces, Version=1.0.5242.22737, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lucene.Net">
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MiniProfiler">
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.2.1312.1622\lib\net40\Moq.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SQLCE4Umbraco, Version=1.0.5242.22741, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="TidyNet, Version=1.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco, Version=1.0.5242.22743, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Core, Version=1.0.5242.22738, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.DataLayer, Version=1.0.5242.22740, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.editorControls, Version=1.0.5242.22746, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.MacroEngines, Version=1.0.5242.22747, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.providers, Version=1.0.5242.22742, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Web.UI, Version=1.0.5242.22748, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.XmlSerializers, Version=1.0.5242.22743, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UmbracoExamine, Version=0.6.0.22741, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.60829.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Models\FieldsetTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PropertyValueConverter\PropertyValueConverterTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Data\sample-1.json" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Archetype\Archetype.Umbraco.csproj">
<Project>{7D185D41-4228-4978-ACB8-83F9A48AD94F}</Project>
<Name>Archetype.Umbraco</Name>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1 @@
{"fieldsets":[{"alias":"archUi","properties":[{"alias":"blurb","value":"A blurb here"},{"alias":"boxHeadline","value":"Box 1 Title"},{"alias":"link","value":"3175"},{"alias":"show","value":"1"}],"remove":false,"collapse":true,"isValid":true},{"alias":"archUi","properties":[{"alias":"boxHeadline","value":"Another Box"},{"alias":"blurb","value":"Some content"},{"alias":"link","value":"3175"},{"alias":"show","value":"0"}],"remove":false,"collapse":true,"isValid":true}]}
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Archetype.PropertyConverters;
using NUnit.Framework;
namespace Archetype.Tests.Models
{
[TestFixture]
public class FieldsetTests
{
private string _sampleJson;
[SetUp]
public void SetUp()
{
_sampleJson = File.ReadAllText("..\\..\\Data\\sample-1.json");
}
[Test]
public void Can_Get_Fieldset_Property_By_Alias()
{
var converter = new ArchetypeValueConverter();
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
var fieldset = result.Fieldsets.First();
var propertyValue = fieldset.GetValue("boxHeadline");
Assert.That(propertyValue == "Box 1 Title");
}
[Test]
public void Can_Get_Fieldset_Property_Default_Value_By_Alias()
{
var converter = new ArchetypeValueConverter();
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
var fieldset = result.Fieldsets.First();
var propertyValue = fieldset.GetValue<string>("noSuchProperty", "noSuchProperty default value");
Assert.That(propertyValue == "noSuchProperty default value");
}
[Test]
public void Can_Convert_Property_Value_Types()
{
var converter = new ArchetypeValueConverter();
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
var fieldset = result.Fieldsets.First();
Assert.That(fieldset.GetValue<int>("link") == 3175);
Assert.That(fieldset.GetValue<bool>("show") == true);
Assert.That(fieldset.GetValue<string>("blurb") == "A blurb here");
}
[Test]
public void Returns_String_When_No_Type_Specified()
{
var converter = new ArchetypeValueConverter();
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
var fieldset = result.Fieldsets.First();
var property = fieldset.GetValue("link");
Assert.That(property is string);
Assert.That(property == "3175");
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Archetype.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Archetype.Tests")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("de11df59-e1eb-4aae-87fd-59c33606a1f5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Archetype.PropertyConverters;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Models.PublishedContent;
namespace Archetype.Tests.PropertyValueConverter
{
[TestFixture]
public class PropertyValueConverterTests
{
private string _sampleJson;
[SetUp]
public void SetUp()
{
_sampleJson = File.ReadAllText("..\\..\\Data\\sample-1.json");
}
[Test]
[TestCase(null)]
[TestCase("")]
public void Returns_Empty_Archetype_When_Data_Is_Null_Or_Empty(object data)
{
var converter = new ArchetypeValueConverter();
var result = converter.ConvertDataToSource(null, data, false);
Assert.AreEqual(result.GetType(), typeof (Archetype.Models.ArchetypeModel));
var fieldsets = (Archetype.Models.ArchetypeModel) result;
Assert.IsTrue(fieldsets.Count() == 0);
}
[Test]
public void Returns_Empty_Archetype_When_Data_Is_Invalid_Json()
{
var data = "{ invalid";
var converter = new ArchetypeValueConverter();
var result = converter.ConvertDataToSource(null, data, false);
Assert.AreEqual(result.GetType(), typeof (Archetype.Models.ArchetypeModel));
var fieldsets = (Archetype.Models.ArchetypeModel) result;
Assert.IsTrue(fieldsets.Count() == 0);
}
[Test]
public void Can_Serialize_From_Json_Model()
{
var converter = new ArchetypeValueConverter();
var result = (Archetype.Models.ArchetypeModel)converter.ConvertDataToSource(null, _sampleJson, false);
Assert.That(result != null);
Assert.That(result.Fieldsets.Count() == 2);
}
}
}
+35
View File
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="umbracoConfiguration">
<section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" />
</sectionGroup>
</configSections>
<umbracoConfiguration>
<settings configSource="config\umbracoSettings.config" />
</umbracoConfiguration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
<package id="ImageProcessor" version="1.9.0.0" targetFramework="net45" />
<package id="ImageProcessor.Web" version="3.2.3.0" targetFramework="net45" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
<package id="Moq" version="4.2.1312.1622" targetFramework="net45" />
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
<package id="NUnit" version="2.6.3" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
</packages>
+49
View File
@@ -0,0 +1,49 @@
using System;
using Umbraco.Core;
using Umbraco.Core.Logging;
namespace DatabaseSizer
{
public class Application : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
base.ApplicationStarted(umbracoApplication, applicationContext);
ExpandPrevalueValueColumnSize();
}
protected void ExpandPrevalueValueColumnSize()
{
try
{
var dbContext = ApplicationContext.Current.DatabaseContext;
var colCount =
dbContext.Database.ExecuteScalar<int>(
"SELECT COUNT(1) FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'nvarchar' AND COLUMN_NAME = 'value' AND CHARACTER_MAXIMUM_LENGTH = 2500 AND TABLE_NAME = 'cmsDataTypePreValues'");
// Check column
if (colCount != 0)
{
using (var trans = dbContext.Database.GetTransaction())
{
// Change column
dbContext.Database.Execute("ALTER TABLE [cmsDataTypePreValues] ALTER COLUMN [value] ntext NULL;");
trans.Complete();
}
LogHelper.Debug(typeof(Application), "Successfully expanded Prevalue table Value column");
}
else
{
LogHelper.Debug(typeof(Application), "Prevalue table Value column is already expanded");
}
}
catch (Exception ex)
{
LogHelper.Error(typeof(Application), "Error expanding Prevalue table Value column", ex);
}
}
}
}
@@ -0,0 +1,250 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0114C963-C514-49C1-B7AB-DCB1825F498C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DatabaseSizer</RootNamespace>
<AssemblyName>DatabaseSizer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="AutoMapper.Net4">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="businesslogic">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ClientDependency.Core">
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ClientDependency.Core.Mvc">
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="cms">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="controls">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="CookComputing.XmlRpcV2">
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Examine">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HtmlAgilityPack">
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImageProcessor">
<HintPath>..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImageProcessor.Web">
<HintPath>..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="interfaces">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lucene.Net">
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.ApplicationBlocks.Data">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Web.Helpers">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MiniProfiler">
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SQLCE4Umbraco">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="TidyNet">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Core">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.DataLayer">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.editorControls">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.MacroEngines">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.providers">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Web.UI">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.XmlSerializers">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UmbracoExamine">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UrlRewritingNet.UrlRewriter">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Application.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DatabaseSizer.cs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DatabaseSizer.cs")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("28dc35d2-3dfb-40b4-9093-bc47c91127ea")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
<package id="ImageProcessor" version="1.9.0.0" targetFramework="net45" />
<package id="ImageProcessor.Web" version="3.2.3.0" targetFramework="net45" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
</packages>
+45
View File
@@ -0,0 +1,45 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Umbraco", "Umbraco.Archetype\Archetype.Umbraco.csproj", "{7D185D41-4228-4978-ACB8-83F9A48AD94F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D84AA4ED-85A6-484F-9E72-BE7AC9835821}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Tests", "Archetype.Tests\Archetype.Tests.csproj", "{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DatabaseSizer", "DatabaseSizer\DatabaseSizer.csproj", "{0114C963-C514-49C1-B7AB-DCB1825F498C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Courier", "Archetype.Courier\Archetype.Courier.csproj", "{FE8BE437-8B11-4E49-9B02-F45994E6D723}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D185D41-4228-4978-ACB8-83F9A48AD94F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D185D41-4228-4978-ACB8-83F9A48AD94F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D185D41-4228-4978-ACB8-83F9A48AD94F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D185D41-4228-4978-ACB8-83F9A48AD94F}.Release|Any CPU.Build.0 = Release|Any CPU
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Release|Any CPU.Build.0 = Release|Any CPU
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Release|Any CPU.Build.0 = Release|Any CPU
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,53 @@
using System.Collections.Generic;
using System;
using System.Linq;
using System.Net;
using System.Web.Http;
using AutoMapper;
using Umbraco.Core.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.Editors;
namespace Archetype.Api
{
[PluginController("ArchetypeApi")]
public class ArchetypeDataTypeController : UmbracoAuthorizedJsonController
{
public IEnumerable<object> GetAllPropertyEditors()
{
return
global::Umbraco.Core.PropertyEditors.PropertyEditorResolver.Current.PropertyEditors
.Select(x => new {defaultPreValues = x.DefaultPreValues, alias = x.Alias, view = x.ValueEditor.View});
}
public object GetAll()
{
var dataTypes = Services.DataTypeService.GetAllDataTypeDefinitions();
return dataTypes.Select(t => new { guid = t.Key, name = t.Name });
}
public object GetByGuid(Guid guid)
{
var dataType = Services.DataTypeService.GetDataTypeDefinitionById(guid);
if (dataType == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
var dataTypeDisplay = Mapper.Map<IDataTypeDefinition, DataTypeDisplay>(dataType);
return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues };
}
public object GetByGuid(Guid guid, string contentTypeAlias, string propertyTypeAlias, string archetypeAlias, int nodeId)
{
var dataType = Services.DataTypeService.GetDataTypeDefinitionById(guid);
if (dataType == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
var dataTypeDisplay = Mapper.Map<IDataTypeDefinition, DataTypeDisplay>(dataType);
return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias, nodeId = nodeId };
}
}
}
@@ -0,0 +1,263 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7D185D41-4228-4978-ACB8-83F9A48AD94F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Archetype</RootNamespace>
<AssemblyName>Archetype</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="AutoMapper.Net4">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="businesslogic">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ClientDependency.Core">
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ClientDependency.Core.Mvc">
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="cms">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="controls">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="CookComputing.XmlRpcV2">
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Examine">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HtmlAgilityPack">
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImageProcessor">
<HintPath>..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImageProcessor.Web">
<HintPath>..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="interfaces">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lucene.Net">
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.ApplicationBlocks.Data">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Web.Helpers">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MiniProfiler">
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SQLCE4Umbraco">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="TidyNet">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Core">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.DataLayer">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.editorControls">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.MacroEngines">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.providers">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Umbraco.Web.UI">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="umbraco.XmlSerializers">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UmbracoExamine">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UrlRewritingNet.UrlRewriter">
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Api\ArchetypeDataTypeController.cs" />
<Compile Include="Constants.cs" />
<Compile Include="Events\ExpireCache.cs" />
<Compile Include="Extensions\ArchetypeHelper.cs" />
<Compile Include="Extensions\HtmlHelperExtensions.cs" />
<Compile Include="Extensions\ArchetypePropertyModelExtensions.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Models\ArchetypeModel.cs" />
<Compile Include="Models\ArchetypePreValue.cs" />
<Compile Include="Models\ArchetypePreValueFieldset.cs" />
<Compile Include="Models\ArchetypePreValueProperty.cs" />
<Compile Include="Models\ArchetypeFieldsetModel.cs" />
<Compile Include="Models\ArchetypePropertyModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\VersionInfo.cs" />
<Compile Include="PropertyConverters\ArchetypeValueConverter.cs" />
<Compile Include="PropertyEditors\ArchetypePropertyEditor.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,13 @@
namespace Archetype
{
public static class Constants
{
public const string PropertyEditorAlias = "Imulus.Archetype";
public const string PreValueAlias = "archetypeConfig";
public const string CacheKey_DataTypeByGuid = "";
public const string CacheKey_PreValueFromDataTypeId = "Archetype_GetArchetypePreValueFromDataTypeId_";
}
}
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web;
namespace Archetype.Events
{
public class ExpireCache : ApplicationEventHandler
{
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
base.ApplicationStarting(umbracoApplication, applicationContext);
DataTypeService.Saved += ExpirePreValueCache;
}
void ExpirePreValueCache(IDataTypeService sender, global::Umbraco.Core.Events.SaveEventArgs<IDataTypeDefinition> e)
{
foreach (var dataType in e.SavedEntities)
{
ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(Constants.CacheKey_PreValueFromDataTypeId + dataType.Id);
ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(Constants.CacheKey_DataTypeByGuid + dataType.Key);
}
}
}
}
@@ -0,0 +1,163 @@
using System;
using System.Linq;
using Archetype.Models;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
namespace Archetype.Extensions
{
public class ArchetypeHelper
{
protected JsonSerializerSettings _jsonSettings;
protected ApplicationContext _app;
private static readonly ArchetypeHelper _instance = new ArchetypeHelper();
internal static ArchetypeHelper Instance { get { return _instance; } }
internal ArchetypeHelper()
{
var dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver();
dcr.DefaultMembersSearchFlags |= System.Reflection.BindingFlags.NonPublic;
_jsonSettings = new JsonSerializerSettings { ContractResolver = dcr };
_app = ApplicationContext.Current;
}
internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, PreValueCollection dataTypePreValues)
{
try
{
var archetype = JsonConvert.DeserializeObject<ArchetypeModel>(sourceJson, _jsonSettings);
try
{
// Get list of configured properties and their types and map them to the deserialized archetype model
var preValue = GetArchetypePreValueFromPreValuesCollection(dataTypePreValues);
RetrieveAdditionalProperties(ref archetype, preValue);
}
catch (Exception ex)
{
}
return archetype;
}
catch
{
return new ArchetypeModel();
}
}
internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, int dataTypeId, PublishedContentType hostContentType = null)
{
try
{
var archetype = JsonConvert.DeserializeObject<ArchetypeModel>(sourceJson, _jsonSettings);
try
{
// Get list of configured properties and their types and map them to the deserialized archetype model
var preValue = GetArchetypePreValueFromDataTypeId(dataTypeId);
RetrieveAdditionalProperties(ref archetype, preValue, hostContentType);
}
catch (Exception ex)
{
}
return archetype;
}
catch
{
return new ArchetypeModel();
}
}
internal bool IsPropertyValueConverterOverridden(int dataTypeId)
{
var prevalues = GetArchetypePreValueFromDataTypeId(dataTypeId);
if (prevalues == null)
return false;
return prevalues.OverrideDefaultPropertyValueConverter;
}
private ArchetypePreValue GetArchetypePreValueFromDataTypeId(int dataTypeId)
{
return _app.ApplicationCache.RuntimeCache.GetCacheItem(
Constants.CacheKey_PreValueFromDataTypeId + dataTypeId,
() =>
{
var preValues = _app.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeId);
var configJson = preValues.IsDictionaryBased
? preValues.PreValuesAsDictionary[Constants.PreValueAlias].Value
: preValues.PreValuesAsArray.First().Value;
var config = JsonConvert.DeserializeObject<ArchetypePreValue>(configJson, _jsonSettings);
RetrieveAdditionalProperties(ref config);
return config;
}) as ArchetypePreValue;
}
private ArchetypePreValue GetArchetypePreValueFromPreValuesCollection(PreValueCollection dataTypePreValues)
{
var preValueAsString = dataTypePreValues.PreValuesAsDictionary.First().Value.Value;
var preValue = JsonConvert.DeserializeObject<ArchetypePreValue>(preValueAsString, _jsonSettings);
return preValue;
}
private IDataTypeDefinition GetDataTypeByGuid(Guid guid)
{
return (IDataTypeDefinition)ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem(
Constants.CacheKey_DataTypeByGuid + guid,
() => _app.Services.DataTypeService.GetDataTypeDefinitionById(guid));
}
/// <summary>
/// Retrieves additional metadata that isn't available on the stored model of an Archetype
/// </summary>
/// <param name="archetype">The Archetype to add the additional metadata to</param>
/// <param name="preValue">The configuration of the Archetype</param>
private void RetrieveAdditionalProperties(ref ArchetypeModel archetype, ArchetypePreValue preValue, PublishedContentType hostContentType = null)
{
foreach (var fieldset in preValue.Fieldsets)
{
var fieldsetAlias = fieldset.Alias;
foreach (var fieldsetInst in archetype.Fieldsets.Where(x => x.Alias == fieldsetAlias))
{
foreach (var property in fieldset.Properties)
{
var propertyAlias = property.Alias;
foreach (var propertyInst in fieldsetInst.Properties.Where(x => x.Alias == propertyAlias))
{
propertyInst.DataTypeGuid = property.DataTypeGuid.ToString();
propertyInst.DataTypeId = GetDataTypeByGuid(property.DataTypeGuid).Id;
propertyInst.PropertyEditorAlias = property.PropertyEditorAlias;
propertyInst.HostContentType = hostContentType;
}
}
}
}
}
/// <summary>
/// Retrieves additional metadata that isn't available on the stored model of an ArchetypePreValue
/// </summary>
/// <param name="archetype">The Archetype to add the additional metadata to</param>
/// <param name="preValue">The configuration of the Archetype</param>
private void RetrieveAdditionalProperties(ref ArchetypePreValue preValue)
{
foreach (var fieldset in preValue.Fieldsets)
{
foreach (var property in fieldset.Properties)
{
property.PropertyEditorAlias = GetDataTypeByGuid(property.DataTypeGuid).PropertyEditorAlias;
}
}
}
}
}
@@ -0,0 +1,20 @@
using Archetype.Models;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
namespace Archetype.Extensions
{
public static class ArchetypePropertyModelExtensions
{
public static bool IsArchetype(this ArchetypePropertyModel prop)
{
return prop.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditorAlias);
}
internal static PublishedPropertyType CreateDummyPropertyType(this ArchetypePropertyModel prop)
{
return new PublishedPropertyType(prop.HostContentType, new PropertyType(new DataTypeDefinition(-1, prop.PropertyEditorAlias) { Id = prop.DataTypeId }));
}
}
}
@@ -0,0 +1,66 @@
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using Archetype.Models;
using Umbraco.Core.Logging;
namespace Archetype.Extensions
{
public static class HtmlHelperExtensions
{
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel)
{
return RenderPartials(htmlHelper, archetypeModel, null, null);
}
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath)
{
return RenderPartials(htmlHelper, archetypeModel, partialPath, null);
}
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, ViewDataDictionary viewDataDictionary)
{
return RenderPartials(htmlHelper, archetypeModel, null, viewDataDictionary);
}
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
{
return htmlHelper.RenderPartials(archetypeModel, partialPath, viewDataDictionary);
}
private static IHtmlString RenderPartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
{
var context = HttpContext.Current;
if (archetypeModel == null || context == null)
{
return new HtmlString("");
}
var sb = new StringBuilder();
var pathToPartials = "~/Views/Partials/Archetype/";
if (!string.IsNullOrEmpty(partialPath))
{
pathToPartials = partialPath;
}
foreach (var fieldsetModel in archetypeModel)
{
var partial = pathToPartials + fieldsetModel.Alias + ".cshtml";
if (System.IO.File.Exists(context.Server.MapPath(partial)))
{
sb.AppendLine(htmlHelper.Partial(partial, fieldsetModel, viewDataDictionary).ToString());
}
else
{
LogHelper.Info<ArchetypeModel>(string.Format("The partial for {0} could not be found. Please create a partial with that name or rename your alias.", context.Server.MapPath(partial)));
}
}
return new HtmlString(sb.ToString());
}
}
}
@@ -0,0 +1,13 @@
namespace Archetype.Extensions
{
public static class StringExtensions
{
//lifted from the core as it is marked 'internal'
public static bool DetectIsJson(this string input)
{
input = input.Trim();
return input.StartsWith("{") && input.EndsWith("}")
|| input.StartsWith("[") && input.EndsWith("]");
}
}
}
@@ -0,0 +1,87 @@
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Umbraco.Core;
namespace Archetype.Models
{
public class ArchetypeFieldsetModel
{
[JsonProperty("alias")]
public string Alias { get; set; }
[JsonProperty("disabled")]
public bool Disabled { get; set; }
[JsonProperty("properties")]
public IEnumerable<ArchetypePropertyModel> Properties;
public ArchetypeFieldsetModel()
{
Properties = new List<ArchetypePropertyModel>();
}
#region Helper Methods
public string GetValue(string propertyAlias)
{
return GetValue<string>(propertyAlias);
}
public T GetValue<T>(string propertyAlias)
{
var property = GetProperty(propertyAlias);
if (IsEmptyProperty(property))
{
return default(T);
}
return property.GetValue<T>();
}
// issue 142: support default T value supplied by caller
// this code would look nicer if the two GetValue<T>() methods had one common implementation.
// however, this would require GetValue<T>(string propertyAlias) to call the common implementation
// with a default(T) value, which could in theory result in a performance hit, if T for some reason
// is costly to instantiate.
public T GetValue<T>(string propertyAlias, T defaultValue)
{
var property = GetProperty(propertyAlias);
if (IsEmptyProperty(property))
{
return defaultValue;
}
return property.GetValue<T>();
}
private bool IsEmptyProperty(ArchetypePropertyModel property)
{
return (property == null || property.Value == null || string.IsNullOrEmpty(property.Value.ToString()));
}
public bool HasProperty(string propertyAlias)
{
return GetProperty(propertyAlias) != null;
}
public bool HasValue(string propertyAlias)
{
var property = GetProperty(propertyAlias);
if (property == null || property.Value == null)
return false;
return !string.IsNullOrEmpty(property.Value.ToString());
}
private ArchetypePropertyModel GetProperty(string propertyAlias)
{
return Properties.FirstOrDefault(p => p.Alias.InvariantEquals(propertyAlias));
}
#endregion
}
}
@@ -0,0 +1,44 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Archetype.Models
{
[JsonObject]
public class ArchetypeModel : IEnumerable<ArchetypeFieldsetModel>
{
[JsonProperty("fieldsets")]
public IEnumerable<ArchetypeFieldsetModel> Fieldsets { get; set; }
public ArchetypeModel()
{
Fieldsets = new List<ArchetypeFieldsetModel>();
}
public IEnumerator<ArchetypeFieldsetModel> GetEnumerator()
{
return this.Fieldsets.Where(f => f.Disabled == false).GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
public string SerializeForPersistence()
{
var json = JObject.Parse(JsonConvert.SerializeObject(this, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }));
var propertiesToRemove = new String[] { "propertyEditorAlias", "dataTypeId", "dataTypeGuid", "hostContentType" };
json.Descendants().OfType<JProperty>()
.Where(p => propertiesToRemove.Contains(p.Name))
.ToList()
.ForEach(x => x.Remove());
return json.ToString(Formatting.None);
}
}
}
@@ -0,0 +1,62 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Archetype.Models
{
public class ArchetypePreValue
{
[JsonProperty("showAdvancedOptions")]
public bool ShowAdvancedOptions { get; set; }
[JsonProperty("startWithAddButton")]
public bool StartWithAddButton { get; set; }
[JsonProperty("hideFieldsetToolbar")]
public bool HideFieldsetToolbar { get; set; }
[JsonProperty("enableMultipleFieldsets")]
public bool EnableMultipleFieldsets { get; set; }
[JsonProperty("enableCollapsing")]
public bool EnableCollapsing { get; set; }
[JsonProperty("enableDisabling")]
public bool EnableDisabling { get; set; }
[JsonProperty("hideFieldsetControls")]
public bool HideFieldsetControls { get; set; }
[JsonProperty("hidePropertyLabel")]
public bool HidePropertyLabel { get; set; }
[JsonProperty("maxFieldsets", NullValueHandling = NullValueHandling.Ignore)]
public int MaxFieldsets { get; set; }
[JsonProperty("fieldsets")]
public IEnumerable<ArchetypePreValueFieldset> Fieldsets { get; set; }
[JsonProperty("hidePropertyLabels")]
public bool HidePropertyLabels { get; set; }
[JsonProperty("customCssClass")]
public string CustomCssClass { get; set; }
[JsonProperty("customCssPath")]
public string CustomCssPath { get; set; }
[JsonProperty("customJsPath")]
public string CustomJsPath { get; set; }
[JsonProperty("customViewPath")]
public string CustomViewPath { get; set; }
[JsonProperty("enableDeepDatatypeRequests")]
public bool EnableDeepDatatypeRequests { get; set; }
[JsonProperty("developerMode")]
public bool DeveloperMode { get; set; }
[JsonProperty("overrideDefaultPropertyValueConverter")]
public bool OverrideDefaultPropertyValueConverter { get; set; }
}
}
@@ -0,0 +1,29 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Archetype.Models
{
public class ArchetypePreValueFieldset
{
[JsonProperty("alias")]
public string Alias { get; set; }
[JsonProperty("remove")]
public bool Remove { get; set; }
[JsonProperty("collapse")]
public bool Collapse { get; set; }
[JsonProperty("labelTemplate")]
public string LabelTemplate { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }
[JsonProperty("label")]
public string Label { get; set; }
[JsonProperty("properties")]
public IEnumerable<ArchetypePreValueProperty> Properties { get; set; }
}
}
@@ -0,0 +1,38 @@
using System;
using Newtonsoft.Json;
namespace Archetype.Models
{
public class ArchetypePreValueProperty
{
[JsonProperty("alias")]
public string Alias { get; set; }
[JsonProperty("remove")]
public bool Remove { get; set; }
[JsonProperty("collapse")]
public bool Collapse { get; set; }
[JsonProperty("label")]
public string Label { get; set; }
[JsonProperty("helpText")]
public string HelpText { get; set; }
[JsonProperty("dataTypeGuid")]
public Guid DataTypeGuid { get; set; }
[JsonProperty("propertyEditorAlias")]
public string PropertyEditorAlias { get; set; }
[JsonProperty("value")]
public string Value { get; set; }
[JsonProperty("required")]
public bool Required { get; set; }
[JsonProperty("regEx")]
public string RegEx { get; set; }
}
}
@@ -0,0 +1,92 @@
using System.Collections.Generic;
using System.Linq;
using Archetype.Extensions;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Web;
namespace Archetype.Models
{
public class ArchetypePropertyModel
{
[JsonProperty("alias")]
public string Alias { get; set; }
[JsonProperty("value")]
public object Value { get; set; }
[JsonProperty("propertyEditorAlias")]
public string PropertyEditorAlias { get; internal set; }
[JsonProperty("dataTypeId")]
public int DataTypeId { get; internal set; }
[JsonProperty("dataTypeGuid")]
internal string DataTypeGuid { get; set; }
[JsonProperty("hostContentType")]
internal PublishedContentType HostContentType { get; set; }
public T GetValue<T>()
{
// Try Umbraco's PropertyValueConverters
var converters = UmbracoContext.Current != null ? PropertyValueConvertersResolver.Current.Converters : Enumerable.Empty<IPropertyValueConverter>();
if (converters.Any())
{
var convertedAttempt = TryConvertWithPropertyValueConverters<T>(Value, converters);
if (convertedAttempt.Success)
return convertedAttempt.Result;
}
// If the value is of type T, just return it
if (Value is T)
return (T)Value;
// No PropertyValueConverters matched, so try a regular type conversion
var convertAttempt2 = Value.TryConvertTo<T>();
if (convertAttempt2.Success)
return convertAttempt2.Result;
return default(T);
}
private Attempt<T> TryConvertWithPropertyValueConverters<T>(object value, IEnumerable<IPropertyValueConverter> converters)
{
var properyType = this.CreateDummyPropertyType();
// In umbraco, there are default value converters that try to convert the
// value if all else fails. The problem is, they are also in the list of
// converters, and the means for filtering these out is internal, so
// we currently have to try ALL converters to see if they can convert
// rather than just finding the most appropreate. If the ability to filter
// out default value converters becomes public, the following logic could
// and probably should be changed.
foreach (var converter in converters.Where(x => x.IsConverter(properyType)))
{
// Convert the type using a found value converter
var value2 = converter.ConvertDataToSource(properyType, value, false);
// If the value is of type T, just return it
if (value2 is T)
return Attempt<T>.Succeed((T)value2);
// If ConvertDataToSource failed try ConvertSourceToObject.
var value3 = converter.ConvertSourceToObject(properyType, value2, false);
// If the value is of type T, just return it
if (value3 is T)
return Attempt<T>.Succeed((T)value3);
// Value is not final value type, so try a regular type conversion aswell
var convertAttempt = value2.TryConvertTo<T>();
if (convertAttempt.Success)
return Attempt<T>.Succeed(convertAttempt.Result);
}
return Attempt<T>.Fail();
}
}
}
@@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Archetype")]
[assembly: AssemblyDescription("Archetype's supporting code library for Umbraco")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Imulus")]
[assembly: AssemblyProduct("Archetype")]
[assembly: AssemblyCopyright("Copyright \xa9 Imulus 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("E37E94F9-C7BA-4B54-B7E1-64419B3DBA0B")]
[assembly: InternalsVisibleTo("Archetype.Courier")]
[assembly: InternalsVisibleTo("Archetype.Tests")]
@@ -0,0 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("1.6.0")]
[assembly: AssemblyFileVersion("1.6.0-beta")]
@@ -0,0 +1,52 @@
using System;
using Archetype.Extensions;
using Archetype.Models;
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
namespace Archetype.PropertyConverters
{
[PropertyValueType(typeof(Models.ArchetypeModel))]
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
public class ArchetypeValueConverter : PropertyValueConverterBase
{
public ServiceContext Services
{
get { return ApplicationContext.Current.Services; }
}
public override bool IsConverter(PublishedPropertyType propertyType)
{
var isArcheTypePropertyEditor = !String.IsNullOrEmpty(propertyType.PropertyEditorAlias)
&& propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditorAlias);
if (!isArcheTypePropertyEditor)
return false;
return !ArchetypeHelper.Instance.IsPropertyValueConverterOverridden(propertyType.DataTypeId);
}
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
{
var defaultValue = new ArchetypeModel();
if (source == null)
return defaultValue;
var sourceString = source.ToString();
if (!sourceString.DetectIsJson())
return defaultValue;
using (var timer = DisposableTimer.DebugDuration<ArchetypeValueConverter>(string.Format("ConvertDataToSource ({0})", propertyType != null ? propertyType.PropertyTypeAlias : "null")))
{
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(sourceString,
(propertyType != null ? propertyType.DataTypeId : -1),
(propertyType != null ? propertyType.ContentType : null));
return archetype;
}
}
}
}
@@ -0,0 +1,159 @@
using System;
using System.Collections.Generic;
using Archetype.Extensions;
using ClientDependency.Core;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Web.PropertyEditors;
namespace Archetype.PropertyEditors
{
[PropertyEditorAsset(ClientDependencyType.Javascript, "/App_Plugins/Archetype/js/archetype.js")]
[PropertyEditor(Constants.PropertyEditorAlias, "Archetype", "/App_Plugins/Archetype/views/archetype.html", ValueType = "JSON")]
public class ArchetypePropertyEditor : PropertyEditor
{
#region Pre Value Editor
protected override PreValueEditor CreatePreValueEditor()
{
return new ArchetypePreValueEditor();
}
internal class ArchetypePreValueEditor : PreValueEditor
{
[PreValueField("archetypeConfig", "Config", "/App_Plugins/Archetype/views/archetype.config.html",
Description = "(Required) Describe your Archetype.")]
public string Config { get; set; }
[PreValueField("hideLabel", "Hide Label", "boolean",
Description = "Hide the Umbraco property title and description, making the Archetype span the entire page width")]
public bool HideLabel { get; set; }
}
#endregion
#region Value Editor
protected override PropertyValueEditor CreateValueEditor()
{
return new ArchetypePropertyValueEditor(base.CreateValueEditor());
}
internal class ArchetypePropertyValueEditor : PropertyValueEditorWrapper
{
protected JsonSerializerSettings _jsonSettings;
public ArchetypePropertyValueEditor(PropertyValueEditor wrapped)
: base(wrapped) { }
public override string ConvertDbToString(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
{
if (property.Value == null || property.Value.ToString() == "")
return string.Empty;
//LogHelper.Info<ArchetypeHelper>(property.Value.ToString());
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(property.Value.ToString(), propertyType.DataTypeDefinitionId);
foreach (var fieldset in archetype.Fieldsets)
{
foreach (var propDef in fieldset.Properties)
{
try
{
var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid));
var propType = new PropertyType(dtd) { Alias = propDef.Alias };
var prop = new Property(propType, propDef.Value);
var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
propDef.Value = propEditor.ValueEditor.ConvertDbToString(prop, propType, dataTypeService);
}
catch (Exception ex)
{
LogHelper.Error<ArchetypePropertyValueEditor>(ex.Message, ex);
}
}
}
return archetype.SerializeForPersistence();
}
public override object ConvertDbToEditor(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
{
if (property.Value == null || property.Value.ToString() == "")
return string.Empty;
//LogHelper.Info<ArchetypeHelper>(property.Value.ToString());
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(property.Value.ToString(), propertyType.DataTypeDefinitionId);
foreach (var fieldset in archetype.Fieldsets)
{
foreach (var propDef in fieldset.Properties)
{
try
{
var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid));
var propType = new PropertyType(dtd) { Alias = propDef.Alias };
var prop = new Property(propType, propDef.Value);
var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
propDef.Value = propEditor.ValueEditor.ConvertDbToEditor(prop, propType, dataTypeService);
}
catch (Exception ex)
{
LogHelper.Error<ArchetypePropertyValueEditor>(ex.Message, ex);
}
}
}
return archetype;
}
public override object ConvertEditorToDb(ContentPropertyData editorValue, object currentValue)
{
if (editorValue.Value == null || editorValue.Value.ToString() == "")
return string.Empty;
//LogHelper.Info<ArchetypeHelper>(editorValue.Value.ToString());
var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(editorValue.Value.ToString(), editorValue.PreValues);
foreach (var fieldset in archetype.Fieldsets)
{
foreach (var propDef in fieldset.Properties)
{
try
{
var dtd = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid));
var preValues = ApplicationContext.Current.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dtd.Id);
var propData = new ContentPropertyData(propDef.Value, preValues, new Dictionary<string, object>());
var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
propDef.Value = propEditor.ValueEditor.ConvertEditorToDb(propData, propDef.Value);
}
catch (Exception ex)
{
LogHelper.Error<ArchetypePropertyValueEditor>(ex.Message, ex);
}
}
}
return archetype.SerializeForPersistence();
}
internal virtual PropertyEditor GetPropertyEditor(IDataTypeDefinition dtd)
{
if (dtd.Id != 0)
return PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
return dtd.PropertyEditorAlias.Equals(Constants.PropertyEditorAlias)
? new ArchetypePropertyEditor()
: (PropertyEditor)new TextboxPropertyEditor();
}
}
#endregion
}
}
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
<package id="ImageProcessor" version="1.9.0.0" targetFramework="net45" />
<package id="ImageProcessor.Web" version="3.2.3.0" targetFramework="net45" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
</packages>
+294
View File
@@ -0,0 +1,294 @@
angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource) {
//$scope.model.value = "";
//console.log($scope.model.value);
//define empty items
var newPropertyModel = '{"alias": "", "remove": false, "collapse": false, "label": "", "helpText": "", "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae", "value": ""}';
var newFieldsetModel = '{"alias": "", "remove": false, "collapse": false, "labelTemplate": "", "icon": "", "label": "", "properties": [' + newPropertyModel + ']}';
var defaultFieldsetConfigModel = JSON.parse('{"showAdvancedOptions": false, "startWithAddButton": false, "hideFieldsetToolbar": false, "enableMultipleFieldsets": false, "hideFieldsetControls": false, "hidePropertyLabel": false, "maxFieldsets": null, "enableCollapsing": true, "enableDisabling": true, "enableDeepDatatypeRequests": true, "fieldsets": [' + newFieldsetModel + ']}');
//ini the model
$scope.model.value = $scope.model.value || defaultFieldsetConfigModel;
//ini the render model
initConfigRenderModel();
//get the available datatypes
archetypePropertyEditorResource.getAllDataTypes().then(function(data) {
$scope.availableDataTypes = data;
});
//iconPicker
$scope.selectIcon = function(fieldset){
var dialog = dialogService.iconPicker({
callback: function(data){
fieldset.icon = data;
}
});
}
//config for the sorting
$scope.sortableOptions = {
axis: 'y',
cursor: "move",
handle: ".handle",
update: function (ev, ui) {
},
stop: function (ev, ui) {
}
};
//function that determines how to manage expanding/collapsing fieldsets
$scope.focusFieldset = function(fieldset){
var iniState;
if(fieldset)
{
iniState = fieldset.collapse;
}
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
if($scope.archetypeConfigRenderModel.fieldsets.length == 1 && fieldset.remove == false)
{
fieldset.collapse = false;
return;
}
if(fieldset.label)
{
fieldset.collapse = true;
}
else
{
fieldset.collapse = false;
}
});
if(iniState)
{
fieldset.collapse = !iniState;
}
}
//ini the fieldsets
$scope.focusFieldset();
//function that determines how to manage expanding/collapsing properties
$scope.focusProperty = function(properties, property){
var iniState;
if(property)
{
iniState = property.collapse;
}
_.each(properties, function(property){
if(property.label)
{
property.collapse = true;
}
else
{
property.collapse = false;
}
});
if(iniState)
{
property.collapse = !iniState;
}
}
//ini the properties
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
$scope.focusProperty(fieldset.properties);
});
//setup JSON.stringify helpers
$scope.archetypeConfigRenderModel.toString = stringify;
//encapsulate stringify (should be built into browsers, not sure of IE support)
function stringify() {
return JSON.stringify(this);
}
//watch for changes
$scope.$watch('archetypeConfigRenderModel', function (v) {
//console.log(v);
if (typeof v === 'string') {
$scope.archetypeConfigRenderModel = JSON.parse(v);
$scope.archetypeConfigRenderModel.toString = stringify;
}
});
$scope.autoPopulateAlias = function(s) {
var modelType = s.hasOwnProperty('fieldset') ? 'fieldset' : 'property';
var modelProperty = s[modelType];
if (!modelProperty.aliasIsDirty) {
modelProperty.alias = modelProperty.label.toUmbracoAlias();
}
}
$scope.markAliasDirty = function(s) {
var modelType = s.hasOwnProperty('fieldset') ? 'fieldset' : 'property';
var modelProperty = s[modelType];
if (!modelProperty.aliasIsDirty) {
modelProperty.aliasIsDirty = true;;
}
}
//helper that returns if an item can be removed
$scope.canRemoveFieldset = function ()
{
return countVisibleFieldset() > 1;
}
//helper that returns if an item can be sorted
$scope.canSortFieldset = function ()
{
return countVisibleFieldset() > 1;
}
//helper that returns if an item can be removed
$scope.canRemoveProperty = function (fieldset)
{
return countVisibleProperty(fieldset) > 1;
}
//helper that returns if an item can be sorted
$scope.canSortProperty = function (fieldset)
{
return countVisibleProperty(fieldset) > 1;
}
$scope.getDataTypeNameByGuid = function (guid) {
if ($scope.availableDataTypes == null) // Might not be initialized yet?
return "";
var dataType = _.find($scope.availableDataTypes, function(d) {
return d.guid == guid;
});
return dataType == null ? "" : dataType.name;
}
//helper to count what is visible
function countVisibleFieldset()
{
var count = 0;
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
if (fieldset.remove == false) {
count++;
}
});
return count;
}
//determines how many properties are visible
function countVisibleProperty(fieldset)
{
var count = 0;
for (var i in fieldset.properties) {
if (fieldset.properties[i].remove == false) {
count++;
}
}
return count;
}
//handles a fieldset add
$scope.addFieldsetRow = function ($index, $event) {
$scope.archetypeConfigRenderModel.fieldsets.splice($index + 1, 0, JSON.parse(newFieldsetModel));
$scope.focusFieldset();
}
//rather than splice the archetypeConfigRenderModel, we're hiding this and cleaning onFormSubmitting
$scope.removeFieldsetRow = function ($index) {
if ($scope.canRemoveFieldset()) {
if (confirm('Are you sure you want to remove this?')) {
$scope.archetypeConfigRenderModel.fieldsets[$index].remove = true;
}
}
}
//handles a property add
$scope.addPropertyRow = function (fieldset, $index) {
fieldset.properties.splice($index + 1, 0, JSON.parse(newPropertyModel));
}
//rather than splice the archetypeConfigRenderModel, we're hiding this and cleaning onFormSubmitting
$scope.removePropertyRow = function (fieldset, $index) {
if ($scope.canRemoveProperty(fieldset)) {
if (confirm('Are you sure you want to remove this?')) {
fieldset.properties[$index].remove = true;
}
}
}
//helper to ini the render model
function initConfigRenderModel()
{
$scope.archetypeConfigRenderModel = $scope.model.value;
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
fieldset.remove = false;
if (fieldset.alias.length > 0)
fieldset.aliasIsDirty = true;
if(fieldset.label)
{
fieldset.collapse = true;
}
_.each(fieldset.properties, function(fieldset){
fieldset.remove = false;
if (fieldset.alias.length > 0)
fieldset.aliasIsDirty = true;
});
});
}
//sync things up on save
$scope.$on("formSubmitting", function (ev, args) {
syncModelToRenderModel();
});
//helper to sync the model to the renderModel
function syncModelToRenderModel()
{
$scope.model.value = $scope.archetypeConfigRenderModel;
var fieldsets = [];
_.each($scope.archetypeConfigRenderModel.fieldsets, function(fieldset){
//check fieldsets
if (!fieldset.remove) {
fieldsets.push(fieldset);
var properties = [];
_.each(fieldset.properties, function(property){
if (!property.remove) {
properties.push(property);
}
});
fieldset.properties = properties;
}
});
$scope.model.value.fieldsets = fieldsets;
}
//archetype css
assetsService.loadCss("/App_Plugins/Archetype/css/archetype.css");
});
+357
View File
@@ -0,0 +1,357 @@
angular.module("umbraco").controller("Imulus.ArchetypeController", function ($scope, $http, assetsService, angularHelper, notificationsService, $timeout, entityResource) {
//$scope.model.value = "";
$scope.model.hideLabel = $scope.model.config.hideLabel == 1;
//get a reference to the current form
$scope.form = $scope.form || angularHelper.getCurrentForm($scope);
//set the config equal to our prevalue config
$scope.model.config = $scope.model.config.archetypeConfig;
//ini the model
$scope.model.value = $scope.model.value || getDefaultModel($scope.model.config);
// store the umbraco property alias to help generate unique IDs. Hopefully there's a better way to get this in the future :)
$scope.umbracoHostPropertyAlias = $scope.$parent.$parent.model.alias;
init();
//hold references to helper resources
$scope.resources = {
entityResource: entityResource
}
//helper to get $eval the labelTemplate
$scope.getFieldsetTitle = function(fieldsetConfigModel, fieldsetIndex) {
if(!fieldsetConfigModel)
return "";
var fieldset = $scope.model.value.fieldsets[fieldsetIndex];
var fieldsetConfig = $scope.getConfigFieldsetByAlias(fieldset.alias);
var template = fieldsetConfigModel.labelTemplate;
if (template.length < 1)
return fieldsetConfig.label;
var rgx = /{{(.*?)}}*/g;
var results;
var parsedTemplate = template;
while ((results = rgx.exec(template)) !== null) {
var propertyAlias = "";
//test for function
var beginIndexOf = results[1].indexOf("(");
var endIndexOf = results[1].indexOf(")");
if(beginIndexOf != -1 && endIndexOf != -1)
{
var functionName = results[1].substring(0, beginIndexOf);
propertyAlias = results[1].substring(beginIndexOf + 1, endIndexOf);
parsedTemplate = parsedTemplate.replace(results[0], executeFunctionByName(functionName, window, $scope.getPropertyValueByAlias(fieldset, propertyAlias), $scope));
}
else {
propertyAlias = results[1];
parsedTemplate = parsedTemplate.replace(results[0], $scope.getPropertyValueByAlias(fieldset, propertyAlias));
}
}
return parsedTemplate;
};
function executeFunctionByName(functionName, context) {
var args = Array.prototype.slice.call(arguments).splice(2);
var namespaces = functionName.split(".");
var func = namespaces.pop();
for(var i = 0; i < namespaces.length; i++) {
context = context[namespaces[i]];
}
if(context && context[func]) {
return context[func].apply(this, args);
}
return "";
}
//sort config
$scope.sortableOptions = {
axis: 'y',
cursor: "move",
handle: ".handle",
update: function (ev, ui) {
$scope.setDirty();
},
stop: function (ev, ui) {
}
};
//handles a fieldset add
$scope.addRow = function (fieldsetAlias, $index) {
if ($scope.canAdd())
{
if ($scope.model.config.fieldsets)
{
var newFieldset = getEmptyRenderFieldset($scope.getConfigFieldsetByAlias(fieldsetAlias));
if (typeof $index != 'undefined')
{
$scope.model.value.fieldsets.splice($index + 1, 0, newFieldset);
}
else
{
$scope.model.value.fieldsets.push(newFieldset);
}
}
$scope.setDirty();
newFieldset.collapse = $scope.model.config.enableCollapsing ? true : false;
$scope.focusFieldset(newFieldset);
}
}
$scope.removeRow = function ($index) {
if ($scope.canRemove()) {
if (confirm('Are you sure you want to remove this?')) {
$scope.setDirty();
$scope.model.value.fieldsets.splice($index, 1);
}
}
}
$scope.enableDisable = function (fieldset) {
fieldset.disabled = !fieldset.disabled;
// explicitly set the form as dirty when manipulating the enabled/disabled state of a fieldset
$scope.setDirty();
}
//helpers for determining if a user can do something
$scope.canAdd = function ()
{
if ($scope.model.config.maxFieldsets)
{
return countVisible() < $scope.model.config.maxFieldsets;
}
return true;
}
//helper that returns if an item can be removed
$scope.canRemove = function ()
{
return countVisible() > 1
|| ($scope.model.config.maxFieldsets == 1 && $scope.model.config.fieldsets.length > 1)
|| $scope.model.config.startWithAddButton;
}
//helper that returns if an item can be sorted
$scope.canSort = function ()
{
return countVisible() > 1;
}
//helper that returns if an item can be disabled
$scope.canDisable = function () {
return $scope.model.config.enableDisabling;
}
//helpers for determining if the add button should be shown
$scope.showAddButton = function () {
return $scope.model.config.startWithAddButton
&& countVisible() === 0;
///&& $scope.model.config.fieldsets.length == 1;
}
//helper, ini the render model from the server (model.value)
function init() {
$scope.model.value = removeNulls($scope.model.value);
addDefaultProperties($scope.model.value.fieldsets);
}
function addDefaultProperties(fieldsets)
{
_.each(fieldsets, function (fieldset)
{
fieldset.collapse = false;
fieldset.isValid = true;
});
}
//helper to get the correct fieldset from config
$scope.getConfigFieldsetByAlias = function(alias) {
return _.find($scope.model.config.fieldsets, function(fieldset){
return fieldset.alias == alias;
});
}
//helper to get a property by alias from a fieldset
$scope.getPropertyValueByAlias = function(fieldset, propertyAlias) {
var property = _.find(fieldset.properties, function(p) {
return p.alias == propertyAlias;
});
return (typeof property !== 'undefined') ? property.value : '';
};
$scope.isCollapsed = function(fieldset)
{
if(typeof fieldset.collapse === "undefined")
{
fieldset.collapse = true;
}
return fieldset.collapse;
}
//helper for expanding/collapsing fieldsets
$scope.focusFieldset = function(fieldset){
fixDisableSelection();
if (!$scope.model.config.enableCollapsing) {
return;
}
var iniState;
if(fieldset)
{
iniState = fieldset.collapse;
}
_.each($scope.model.value.fieldsets, function(fieldset){
fieldset.collapse = true;
});
if(!fieldset && $scope.model.value.fieldsets.length == 1)
{
$scope.model.value.fieldsets[0].collapse = false;
return;
}
if(iniState && fieldset)
{
fieldset.collapse = !iniState;
}
}
//ini the fieldset expand/collapse
$scope.focusFieldset();
//developerMode helpers
$scope.model.value.toString = stringify;
//encapsulate stringify (should be built into browsers, not sure of IE support)
function stringify() {
return JSON.stringify(this);
}
//watch for changes
$scope.$watch('model.value', function (v) {
if ($scope.model.config.developerMode) {
console.log(v);
if (typeof v === 'string') {
$scope.model.value = JSON.parse(v);
$scope.model.value.toString = stringify;
}
}
});
//helper to count what is visible
function countVisible()
{
return $scope.model.value.fieldsets.length;
}
// helper to get initial model if none was provided
function getDefaultModel(config) {
if (config.startWithAddButton)
return { fieldsets: [] };
return { fieldsets: [getEmptyRenderFieldset(config.fieldsets[0])] };
}
//helper to add an empty fieldset to the render model
function getEmptyRenderFieldset (fieldsetModel) {
return {alias: fieldsetModel.alias, collapse: false, isValid: true, properties: []};
}
//helper to ensure no nulls make it into the model
function removeNulls(model){
if(model.fieldsets){
_.each(model.fieldsets, function(fieldset, index){
if(!fieldset){
model.fieldsets.splice(index, 1);
removeNulls(model);
}
});
return model;
}
}
// Hack for U4-4281 / #61
function fixDisableSelection() {
$timeout(function() {
$('.archetypeEditor .controls')
.bind('mousedown.ui-disableSelection selectstart.ui-disableSelection', function(e) {
e.stopImmediatePropagation();
});
}, 1000);
}
//helper to lookup validity when given a fieldsetIndex and property alias
$scope.getPropertyValidity = function(fieldsetIndex, alias)
{
if($scope.model.value.fieldsets[fieldsetIndex])
{
var property = _.find($scope.model.value.fieldsets[fieldsetIndex].properties, function(property){
return property.alias == alias;
});
}
return (typeof property == 'undefined') ? true : property.isValid;
}
//helper to lookup validity when given a fieldset
$scope.getFieldsetValidity = function (fieldset) {
if (fieldset.isValid == false) {
return false;
}
// recursive validation of nested fieldsets
var nestedFieldsetsValid = true;
_.each(fieldset.properties, function (property) {
if (property != null && property.value != null && property.propertyEditorAlias == "Imulus.Archetype") {
_.each(property.value.fieldsets, function (inner) {
if ($scope.getFieldsetValidity(inner) == false) {
nestedFieldsetsValid = false;
}
});
}
});
return nestedFieldsetsValid;
}
// helper to force the current form into the dirty state
$scope.setDirty = function () {
if($scope.form) {
$scope.form.$setDirty();
}
}
//custom js
if ($scope.model.config.customJsPath) {
assetsService.loadJs($scope.model.config.customJsPath);
}
//archetype css
assetsService.loadCss("/App_Plugins/Archetype/css/archetype.css");
//custom css
if($scope.model.config.customCssPath)
{
assetsService.loadCss($scope.model.config.customCssPath);
}
});
+22
View File
@@ -0,0 +1,22 @@
angular.module("umbraco.directives").directive('archetypeCustomView', function ($compile, $http) {
var linker = function (scope, element, attrs) {
var view = "/App_plugins/Archetype/views/archetype.default.html";
if(scope.model.config.customViewPath) {
view = scope.model.config.customViewPath;
}
$http.get(view, { cache: true }).then(function(data) {
element.html(data.data).show();
$compile(element.contents())(scope);
});
}
return {
restrict: "A",
replace: true,
link: linker
}
});
+247
View File
@@ -0,0 +1,247 @@
angular.module("umbraco.directives").directive('archetypeProperty', function ($compile, $http, archetypePropertyEditorResource, umbPropEditorHelper, $timeout, $rootScope, $q, editorState) {
function getFieldsetByAlias(fieldsets, alias)
{
return _.find(fieldsets, function(fieldset){
return fieldset.alias == alias;
});
}
function getPropertyIndexByAlias(properties, alias){
for (var i in properties)
{
if (properties[i].alias == alias) {
return i;
}
}
}
function getPropertyByAlias(fieldset, alias){
return _.find(fieldset.properties, function(property){
return property.alias == alias;
});
}
//helper that returns a JS ojbect from 'value' string or the original string
function jsonOrString(value, developerMode, debugLabel){
if(value && typeof value == 'string'){
try{
if(developerMode == '1'){
console.log("Trying to parse " + debugLabel + ": " + value);
}
value = JSON.parse(value);
}
catch(exception)
{
if(developerMode == '1'){
console.log("Failed to parse " + debugLabel + ".");
}
}
}
if(value && developerMode == '1'){
console.log(debugLabel + " post-parsing: ");
console.log(value);
}
return value;
}
var linker = function (scope, element, attrs, ngModelCtrl) {
var configFieldsetModel = getFieldsetByAlias(scope.archetypeConfig.fieldsets, scope.fieldset.alias);
var view = "";
var label = configFieldsetModel.properties[scope.propertyConfigIndex].label;
var dataTypeGuid = configFieldsetModel.properties[scope.propertyConfigIndex].dataTypeGuid;
var config = null;
var alias = configFieldsetModel.properties[scope.propertyConfigIndex].alias;
var defaultValue = configFieldsetModel.properties[scope.propertyConfigIndex].value;
var propertyAlias = getUniquePropertyAlias(scope);
propertyAliasParts = [];
//try to convert the defaultValue to a JS object
defaultValue = jsonOrString(defaultValue, scope.archetypeConfig.developerMode, "defaultValue");
//grab info for the selected datatype, prepare for view
archetypePropertyEditorResource.getDataType(dataTypeGuid, scope.archetypeConfig.enableDeepDatatypeRequests, editorState.current.contentTypeAlias, scope.propertyEditorAlias, alias, editorState.current.id).then(function (data) {
//transform preValues array into object expected by propertyeditor views
var configObj = {};
_.each(data.preValues, function(p) {
configObj[p.key] = p.value;
});
config = configObj;
//determine the view to use [...] and load it
archetypePropertyEditorResource.getPropertyEditorMapping(data.selectedEditor).then(function(propertyEditor) {
var pathToView = umbPropEditorHelper.getViewPath(propertyEditor.view);
//load in the DefaultPreValues for the PropertyEditor, if any
var defaultConfigObj = {};
if (propertyEditor.hasOwnProperty('defaultPreValues') && propertyEditor.defaultPreValues != null) {
_.extend(defaultConfigObj, propertyEditor.defaultPreValues);
}
var mergedConfig = _.extend(defaultConfigObj, config);
loadView(pathToView, mergedConfig, defaultValue, alias, propertyAlias, scope, element, ngModelCtrl, propertyValueChanged);
});
});
scope.$on("formSubmitting", function (ev, args) {
// validate all fieldset properties
_.each(scope.fieldset.properties, function (property) {
validateProperty(scope.fieldset, property);
});
// set invalid state if the fieldset contains invalid properties
// we need an unique validation key per fieldset in this ngModelCtrl scope, which leaves us with a potential problem:
// if the user invalidates the last fieldset, attempts (and fails) to save and and subsequently deletes the invalid fieldset,
// the validation key will persist on ngModelCtrl and thus the form will not submit.
// to fix this problem, the controller probably needs to raise an event (in removeRow) that can be intercepted here to
// clear the validation key.
var validationKey = "validation-f" + scope.fieldsetIndex;
ngModelCtrl.$setValidity(validationKey, scope.fieldset.isValid);
});
// called when the value of any property in a fieldset changes
function propertyValueChanged(fieldset, property) {
// it's the Umbraco way to hide the invalid state when altering an invalid property, even if the new value isn't valid either
property.isValid = true;
setFieldsetValidity(fieldset);
}
// validate a property in a fieldset
function validateProperty(fieldset, property) {
var propertyConfig = getPropertyByAlias(configFieldsetModel, property.alias);
if (propertyConfig) {
// use property.value !== property.value to check for NaN values on numeric inputs
if (propertyConfig.required && (property.value == null || property.value === "" || property.value !== property.value)) {
property.isValid = false;
}
// issue 116: RegEx validate property value
// Only validate the property value if anything has been entered - RegEx is considered a supplement to "required".
if (property.isValid == true && propertyConfig.regEx && property.value) {
var regEx = new RegExp(propertyConfig.regEx);
if (regEx.test(property.value) == false) {
property.isValid = false;
}
}
}
setFieldsetValidity(fieldset);
}
function setFieldsetValidity(fieldset) {
// mark the entire fieldset as invalid if there are any invalid properties in the fieldset, otherwise mark it as valid
fieldset.isValid =
_.find(fieldset.properties, function (property) {
return property.isValid == false
}) == null;
}
}
var propertyAliasParts = [];
var getUniquePropertyAlias = function (currentScope) {
if (currentScope.hasOwnProperty('fieldsetIndex') && currentScope.hasOwnProperty('property') && currentScope.hasOwnProperty('propertyConfigIndex'))
{
var currentPropertyAlias = "f" + currentScope.fieldsetIndex + "-" + currentScope.property.alias + "-p" + currentScope.propertyConfigIndex;
propertyAliasParts.push(currentPropertyAlias);
}
else if (currentScope.hasOwnProperty('isPreValue')) // Crappy way to identify this is the umbraco property scope
{
var umbracoPropertyAlias = currentScope.$parent.$parent.property.alias; // Crappy way to get the umbraco host alias once we identify its scope
propertyAliasParts.push(umbracoPropertyAlias);
}
if (currentScope.$parent)
getUniquePropertyAlias(currentScope.$parent);
return _.unique(propertyAliasParts).reverse().join("-");
};
function loadView(view, config, defaultValue, alias, propertyAlias, scope, element, ngModelCtrl, propertyValueChanged) {
if (view)
{
$http.get(view, { cache: true }).success(function (data) {
if (data) {
if (scope.archetypeConfig.developerMode == '1')
{
console.log(scope);
}
//define the initial model and config
scope.form = scope.umbracoForm;
scope.model = {};
scope.model.config = {};
//ini the property value after test to make sure a prop exists in the renderModel
var renderModelPropertyIndex = getPropertyIndexByAlias(scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties, alias);
if (!renderModelPropertyIndex)
{
scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties.push(JSON.parse('{"alias": "' + alias + '", "value": "' + defaultValue + '"}'));
renderModelPropertyIndex = getPropertyIndexByAlias(scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties, alias);
}
scope.model.value = scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties[renderModelPropertyIndex].value;
//set the config from the prevalues
scope.model.config = config;
/*
Property Specific Hacks
Preference is to not do these, but unless we figure out core issues, this is quickest fix.
*/
//MNTP *single* hack
if(scope.model.config.maxNumber && scope.model.config.multiPicker)
{
if(scope.model.config.maxNumber == "1")
{
scope.model.config.multiPicker = "0";
}
}
//console.log(scope.model.config);
//some items need an alias
scope.model.alias = "archetype-property-" + propertyAlias;
//watch for changes since there is no two-way binding with the local model.value
scope.$watch('model.value', function (newValue, oldValue) {
scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties[renderModelPropertyIndex].value = newValue;
// notify the linker that the property value changed
propertyValueChanged(scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex], scope.archetypeRenderModel.fieldsets[scope.fieldsetIndex].properties[renderModelPropertyIndex]);
});
element.html(data).show();
$compile(element.contents())(scope);
$timeout(function() {
var def = $q.defer();
def.resolve(true);
$rootScope.$apply();
}, 500);
}
});
}
}
return {
require: "^ngModel",
restrict: "E",
replace: true,
link: linker,
scope: {
property: '=',
propertyConfigIndex: '=',
propertyEditorAlias: '=',
archetypeConfig: '=',
fieldset: '=',
fieldsetIndex: '=',
archetypeRenderModel: '=',
umbracoPropertyAlias: '=',
umbracoForm: '='
}
}
});
+21
View File
@@ -0,0 +1,21 @@
angular.module("umbraco.directives").directive('archetypeLocalize', function (archetypeLocalizationService) {
var linker = function (scope, element, attrs){
var key = scope.key;
archetypeLocalizationService.localize(key).then(function(value){
if(value){
element.html(value);
}
});
}
return {
restrict: "E",
replace: true,
link: linker,
scope: {
key: '@'
}
}
});
+41
View File
@@ -0,0 +1,41 @@
var ArchetypeLabels = (function() {
var isEntityLookupLoading = false;
var entityNameLookupCache = [];
function getEntityById(scope, id, type) {
for (var i in entityNameLookupCache) {
if (entityNameLookupCache[i].id == id) {
return entityNameLookupCache[i].value;
}
}
if (!isEntityLookupLoading) {
isEntityLookupLoading = true;
scope.resources.entityResource.getById(id, type).then(function(entity) {
entityNameLookupCache.push({id: id, value: entity.name});
isEntityLookupLoading = false;
return entity.name;
});
}
return "";
}
return {
GetFirstDocumentEntityName: function ($scope, value) {
if (value) {
var id = value.split(",")[0];
if (id) {
return getEntityById($scope, id, "Document");
}
}
return "";
}
}
})();
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Skjul fieldsets?",
"hideFieldsetControlsDescription": "Skjuler kontrollerne tilføj/fjern/sortér.",
"toggleAdvanced": "Slå avancerede muligheder til/fra",
"toggleAdvancedDescription": "Vis avancerede muligheder.",
"hidePropertyLabels": "Skjul labels på egenskaber?",
"hidePropertyLabelsDescription": "Skjuler labels på egenskaber.",
"maxFieldsets": "Maks antal fieldsets",
"maxFieldsetsDescription": "Hvor mange fieldsets er tilladt? Hvis der skrives '1' vil deaktivere kontrollerne. Som standard er det ubegrænset.",
"enableMultipleFieldsets": "Aktivér flere Fieldsets?",
"enableMultipleFieldsetsDescription": "Tillader flere typer af fieldsets i denne archetype.",
"hideFieldsetToolbar": "Skjul Fieldset værktøjslinie?",
"hideFieldsetToolbarDescription": "Skjuler den fieldset værktøjslinie der fremkommer når der findes mere end ét fieldset.",
"customWrapperClass": "Egen Wrapper Class",
"customWrapperClassDescription": "(Mulighed) Angiv din egen CSS class som tilføjes på wrapper div'en.",
"cssFile": "CSS fil",
"cssFileDescription": "(Mulighed) Tilføj en sti til din egen CSS fil der skal inkluderes på siden.",
"jsFile": "JavaScript fil",
"jsFileDescription": "(Mulighed) Tilføj en sti til din egen JavaScript fil der skal inkluderes på siden.",
"toggleDeveloperMode": "Slå udvikler muligheder til/fra.",
"toggleDeveloperModeDescription": "Aktivér på udvikler muligheder.",
"configModel": "Konfigurationsmodel",
"configModelDescription": "Vær forsigt med at redigere teksten for neden, den kontrollerer skemaet for denne archetype.",
"helpText": "Hjælpe tekst",
"defaultValue": "Standard værdi",
"dataType": "Datatype",
"required": "Påkrævet",
"regEx": "RegEx validering",
"properties": "Egenskaber",
"labelTemplate": "Label skabelon",
"select": "Vælg",
"icon": "Ikon",
"enableDisabling": "Aktivér fieldset-deaktivering?",
"enableDisablingDescription": "Tillad brugere at aktivere/deaktivere individuelle fieldsets.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+41
View File
@@ -0,0 +1,41 @@
{
"label": "Label",
"alias": "Alias",
"hideFieldsetControls": "Hide Fieldset Controls?",
"hideFieldsetControlsDescription": "Hides the fieldset add/remove/sort controls.",
"toggleAdvanced": "Toggle Advanced Options",
"toggleAdvancedDescription": "Show advanced options.",
"hidePropertyLabels": "Hide Property Labels?",
"hidePropertyLabelsDescription": "Hides the property labels.",
"maxFieldsets": "Max Fieldsets",
"maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.",
"enableMultipleFieldsets": "Enable Multiple Fieldsets?",
"enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.",
"hideFieldsetToolbar": "Hide Fieldset Toolbar?",
"hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.",
"customWrapperClass": "Custom Wrapper Class",
"customWrapperClassDescription": "(Optional) Enter a custom CSS class that will be applied to the wrapper div.",
"cssFile": "CSS File",
"cssFileDescription": "(Optional) Enter a path for a custom CSS file to be included on the page.",
"jsFile": "JS File",
"jsFileDescription": "(Optional) Enter a path for a custom JS file to be included on the page.",
"toggleDeveloperMode": "Toggle Developer Mode",
"toggleDeveloperModeDescription": "Turn on for developer options.",
"configModel": "Config Model",
"configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.",
"helpText": "Help Text",
"defaultValue": "Default Value",
"dataType": "DataType",
"required": "Required",
"regEx": "RegEx Validation",
"properties": "Properties",
"labelTemplate": "Label Template",
"select": "Select",
"icon": "Icon",
"enableDisabling": "Enable Fieldset Disabling?",
"enableDisablingDescription": "Allows fieldsets to be individually enabled/disabled.",
"deepDatatypeRequest":"Enable Deep Datatype Requests?",
"deepDatatypeRequestDescription":"Allows for easier datatype interception at the cost of caching performance.",
"overrideDefaultConverterDescription":"Check this if you wish to use your own custom property value converter.",
"overrideDefaultConverter":"Override Default Property Value Converter?"
}
+340
View File
@@ -0,0 +1,340 @@
/* TODO: clean this up */
.archetypeEditor {
width: 98%;
.dropdown-menu {
top: auto;
}
.controls-no-label {
padding: 10px;
}
a+ul.dropdown-menu {
margin-left: 25px;
}
.icon {
color: #333;
}
fieldset {
border: 1px solid #dddddd;
padding: 0;
margin-bottom: 5px;
background-color: #f1f1f1;
clear: both;
display: inline-block;
width: 100%;
.archetypeProperty {
clear: both;
overflow: visible;
margin-top: 3px;
label {
padding-left: 5px !important;
span {
color: #343434;
}
&.dimmed span {
color: #d9d9d9;
}
}
}
.archetypeFieldsetLabel {
position: relative;
width: 100%;
.label-sub {
padding: 8px 0;
display: inline-block;
&.module-label {
width: 100%;
}
}
.dropdown-menu {
position: relative;
padding: 0;
border-radius: 0;
box-shadow: none;
margin-top: -10px;
/*margin-left: -200px;*/
}
span {
font-weight: bold;
&.menu-label { font-weight: normal; }
}
label:hover {
cursor: default;
}
&.enableCollapsing:hover {
cursor: pointer;
label {
span {
text-decoration: underline;
}
&:hover {
cursor: pointer;
}
}
}
.caret {
margin: 8px 1px 0 15px;
&.caret-right {
border-bottom: 4px solid transparent;
border-top: 4px solid transparent;
border-left: 4px solid #000000;
content: "";
margin-top: 6px;
}
}
label {
margin-bottom: 0;
margin-left: 5px;
padding: 0;
span {
display: inline-block;
}
&.dimmed {
color: #d9d9d9;
}
}
.archetypeEditorControls {
float: none;
position: absolute;
right: 15px;
top: 0;
}
}
.archetypePropertyError {
margin-bottom: 5px;
padding-top: 3px;
padding-bottom: 3px;
label {
span {
color: #b94a48;
font-weight: bold;
}
}
}
.archetypeCollapser {
clear: both;
height: 100%;
padding-top: 12px;
background-color: #fff;
border-top: 1px solid silver;
border-radius: 0 0 0 5px;
overflow: hidden;
form {
margin-left:20px;
.control-label {
padding-top: 0 !important;
}
}
.archetypeFieldsetHelpText {
clear:both;
margin-bottom: 3px;
font-size: 12px;
}
}
}
.archetypeDeveloperModel
{
font-family: monospace;
width: 98%;
min-height: 100px;
margin-bottom: 10px;
border: 1px solid red;
}
.archetypeFieldsetError {
border: 1px solid #b94a48;
}
.archetypeAddButton:hover {
text-decoration: none;
.archetypeAddButtonText {
text-decoration: underline;
}
}
.multiPropertyTextbox {
margin-bottom: 3px;
}
ul {
list-style: none;
margin-left: 0;
}
.show-validation.ng-invalid .control-group.error .control-label {
span {
color: #343434;
}
}
}
.archetypeEditor, .archetypeConfig {
.archetypeEditorControls {
float: right;
i {
cursor: pointer;
&.handle {
cursor: move;
}
&.dimmed {
color: #d9d9d9;
}
}
}
}
.archetypeConfig {
margin-bottom: 20px;
ul {
list-style: none;
}
li {
background-color: #fff;
}
label {
width: 120px;
}
.archetypeEditorControls {
float: right;
}
.archetypeFieldsets {
margin-left: 0;
}
.archetypeFieldsetWrapper {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
}
.archetypeFieldsetTitle {
cursor: pointer;
overflow: hidden;
}
.archetypeFieldsetOption {
margin-bottom: 15px;
input[type=text]{
max-width: 300px;
}
}
.archetypeDeveloperModel {
font-family: monospace;
width: 88%;
margin: 5px 10px 10px;
height: 130px;
}
.archetypeOptions label{
width: 400px;
}
.archetypePropertiesWrapper {
border: 1px solid #ddd;
padding: 8px;
margin: -40px 10px 10px 140px;
max-width: 475px;
ul {
padding: 0;
margin: 0;
}
li {
padding: 10px;
margin-bottom: 10px;
background-color: #eee;
input[type=text] {
max-width: 190px;
width: auto;
}
select {
max-width: 160px;
}
}
li:last-child {
margin-bottom: 0;
}
}
.archetypeAdvancedOptions {
margin-top: 15px;
div {
margin-bottom: 10px;
}
label {
width: 400px;
}
}
.archetypeMaxFieldsets{
border: 1px solid #ddd;
width: 40px;
text-align: right;
}
.archetypePropertyTitle {
cursor: pointer;
overflow: hidden;
}
.archetypePropertyCollapser {
margin-top: 10px;
div {
margin-bottom: 10px;
}
}
.archetypeFieldsetCollapser {
margin-top: 15px;
}
.fieldsetIcon {
margin-right: 10px;
}
}
.ui-sortable-placeholder {
visibility: visible !important;
background-color: #d0e7f1 !important;
}
+36
View File
@@ -0,0 +1,36 @@
angular.module('umbraco.resources').factory('archetypePropertyEditorResource', function($q, $http, umbRequestHelper){
return {
getAllDataTypes: function() {
// Hack - grab DataTypes from Tree API, as `dataTypeService.getAll()` isn't implemented yet
return umbRequestHelper.resourcePromise(
$http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetAll", { cache: true }), 'Failed to retrieve datatypes from tree service'
);
},
getDataType: function (guid, useDeepDatatypeLookup, contentTypeAlias, propertyTypeAlias, archetypeAlias, nodeId) {
if(useDeepDatatypeLookup) {
return umbRequestHelper.resourcePromise(
$http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid + "&contentTypeAlias=" + contentTypeAlias + "&propertyTypeAlias=" + propertyTypeAlias + "&archetypeAlias=" + archetypeAlias + "&nodeId=" + nodeId), 'Failed to retrieve datatype'
);
}
else {
return umbRequestHelper.resourcePromise(
$http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid , { cache: true }), 'Failed to retrieve datatype'
);
}
},
getPropertyEditorMapping: function(alias) {
return umbRequestHelper.resourcePromise(
$http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetAllPropertyEditors", { cache: true }), 'Failed to retrieve datatype mappings'
).then(function (data) {
var result = _.find(data, function(d) {
return d.alias === alias;
});
if (result != null)
return result;
return "";
});
}
}
});
+42
View File
@@ -0,0 +1,42 @@
angular.module('umbraco.services').factory('archetypeLocalizationService', function($http, $q, userService){
var service = {
resourceFileLoaded: false,
dictionary: {},
localize: function(key) {
var deferred = $q.defer();
if(service.resourceFileLoaded){
var value = service._lookup(key);
deferred.resolve(value);
}
else{
service.initLocalizedResources().then(function(dictionary){
var value = service._lookup(key);
deferred.resolve(value);
});
}
return deferred.promise;
},
_lookup: function(key){
return service.dictionary[key];
},
initLocalizedResources:function () {
var deferred = $q.defer();
userService.getCurrentUser().then(function(user){
$http.get("/App_plugins/Archetype/langs/" + user.locale + ".js", { cache: true })
.then(function(response){
service.resourceFileLoaded = true;
service.dictionary = response.data;
return deferred.resolve(service.dictionary);
}, function(err){
return deferred.reject("Lang file missing");
});
});
return deferred.promise;
}
}
return service;
});
+153
View File
@@ -0,0 +1,153 @@
<div class="archetypeConfig" ng-controller="Imulus.ArchetypeConfigController">
<ul class="archetypeFieldsets" ui-sortable="sortableOptions" ng-model="archetypeConfigRenderModel.fieldsets">
<li ng-repeat="fieldset in archetypeConfigRenderModel.fieldsets" ng-hide="fieldset.remove">
<div class="archetypeFieldsetWrapper" >
<div class="archetypeEditorControls" ng-show="archetypeConfigRenderModel.enableMultipleFieldsets">
<i class="icon icon-add" ng-click="addFieldsetRow($index, $event)"></i>
<i class="icon icon-delete" ng-click="removeFieldsetRow($index)" ng-show="canRemoveFieldset()"></i>
<i class="icon icon-navigation handle" ng-show="canSortFieldset()"></i>
</div>
<div class="archetypeFieldsetTitle" ng-click="focusFieldset(fieldset)">{{fieldset.label}}</div>
<div class="archetypeFieldsetCollapser" ng-hide="fieldset.collapse && fieldset.label">
<div class="archetypeFieldsetOption">
<label for="archetypeFieldLabel_{{$index}}"><archetype-localize key="label">Label</archetype-localize></label>
<input type="text" id="archetypeFieldLabel_{{$index}}" ng-model="fieldset.label" on-keyup="autoPopulateAlias(this)" />
</div>
<div class="archetypeFieldsetOption">
<label for="archetypeFieldAlias_{{$index}}"><archetype-localize key="alias">Alias</archetype-localize></label>
<input type="text" id="archetypeFieldAlias_{{$index}}" ng-model="fieldset.alias" on-keyup="markAliasDirty(this)" required/>
</div>
<div class="archetypeFieldsetOption">
<label for="archetypeFieldLabelTemplate_{{$index}}"><archetype-localize key="labelTemplate">Label Template</archetype-localize></label>
<input type="text" id="archetypeFieldLabelTemplate_{{$index}}" ng-model="fieldset.labelTemplate" />
</div>
<div class="archetypeFieldsetOption" ng-show="archetypeConfigRenderModel.enableMultipleFieldsets">
<label for="archetypeFieldIcon_{{$index}}"><archetype-localize key="icon">Icon</archetype-localize></label>
<i class="fieldsetIcon icon ng-class:fieldset.icon"></i><a ng-click="selectIcon(fieldset)"><archetype-localize key="select">Select</archetype-localize></a>
</div>
<div class="archetypeFieldsetOption">
<label><archetype-localize key="properties">Properties</archetype-localize></label>
</div>
<div class="archetypePropertiesWrapper">
<ul ui-sortable="sortableOptions" ng-model="fieldset.properties">
<li ng-repeat="property in fieldset.properties" ng-hide="property.remove">
<div class="archetypeEditorControls">
<i class="icon icon-add" ng-click="addPropertyRow(fieldset, $index)"></i>
<i class="icon icon-delete" ng-click="removePropertyRow(fieldset, $index)" ng-show="canRemoveProperty(fieldset)"></i>
<i class="icon icon-navigation handle" ng-show="canSortProperty(fieldset)"></i>
</div>
<div class="archetypePropertyTitle" ng-click="focusProperty(fieldset.properties, property)">
{{property.label}} ({{property.alias}}) - <span>{{getDataTypeNameByGuid(property.dataTypeGuid)}}</span>
</div>
<div class="archetypePropertyCollapser" ng-hide="property.collapse && property.label">
<div>
<label for="archetypePropertyLabel_{{$parent.$index}}_{{$index}}"><archetype-localize key="label">Label</archetype-localize></label>
<input type="text" id="archetypePropertyLabel_{{$parent.$index}}_{{$index}}" ng-model="property.label" on-keyup="autoPopulateAlias(this)"/>
</div>
<div>
<label for="archetypePropertyAlias_{{$parent.$index}}_{{$index}}"><archetype-localize key="alias">Alias</archetype-localize></label>
<input type="text" id="archetypePropertyAlias_{{$parent.$index}}_{{$index}}" ng-model="property.alias" on-keyup="markAliasDirty(this)" required/>
</div>
<div>
<label for="archetypePropertyHelpText_{{$parent.$index}}_{{$index}}"><archetype-localize key="helpText">Help Text</archetype-localize></label>
<input type="text" id="archetypePropertyHelpText_{{$parent.$index}}_{{$index}}" ng-model="property.helpText" />
</div>
<div>
<label for="archetypePropertyDataType_{{$parent.$index}}_{{$index}}"><archetype-localize key="dataType">Datatype</archetype-localize></label>
<select id="archetypePropertyDataType_{{$parent.$index}}_{{$index}}" ng-model="property.dataTypeGuid" ng-options="datatype.guid as datatype.name for datatype in availableDataTypes | orderBy:'name'"></select>
</div>
<div>
<label for="archetypePropertyDefaultValue_{{$parent.$index}}_{{$index}}"><archetype-localize key="defaultValue">Default Value</archetype-localize></label>
<input type="text" id="archetypePropertyDefaultValue_{{$parent.$index}}_{{$index}}" ng-model="property.value" />
</div>
<div>
<label for="archetypePropertyRequired_{{$parent.$index}}_{{$index}}"><archetype-localize key="required">Required</archetype-localize></label>
<input type="checkbox" id="archetypePropertyRequired_{{$parent.$index}}_{{$index}}" ng-model="property.required" />
</div>
<div>
<label for="archetypePropertyRegEx_{{$parent.$index}}_{{$index}}"><archetype-localize key="regEx">RegEx Validation</archetype-localize></label>
<input type="text" id="archetypePropertyRegExValue_{{$parent.$index}}_{{$index}}" ng-model="property.regEx" />
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</li>
</ul>
<div class="archetypeOptions">
<div>
<label for="archetypeOptionsToggle"><archetype-localize key="toggleAdvanced">Toggle Advanced Options</archetype-localize><small><archetype-localize key="toggleAdvancedDescription">Show advanced options.</archetype-localize></small></label>
<input type="checkbox" id="archetypeOptionsToggle" ng-model="archetypeConfigRenderModel.showAdvancedOptions"/>
</div>
</div>
<div class="archetypeAdvancedOptions" ng-show="archetypeConfigRenderModel.showAdvancedOptions">
<div>
<label for="archetypeAdvancedOptionsStartWithAddButton"><archetype-localize key="startWithAddButton">Start With Add Button?</archetype-localize><small><archetype-localize key="startWithAddButtonDescription">Empty property shows an add button instead of providing a default fieldset.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsStartWithAddButton" ng-model="archetypeConfigRenderModel.startWithAddButton"/>
</div>
<div>
<label for="archetypeAdvancedOptionsHideControls"><archetype-localize key="hideFieldsetControls">Hide Fieldset Controls?</archetype-localize><small><archetype-localize key="hideFieldsetControlsDescription">Hides the fieldset add/remove/sort controls.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsHideControls" ng-model="archetypeConfigRenderModel.hideFieldsetControls"/>
</div>
<div>
<label for="archetypeAdvancedOptionsHideLabels"><archetype-localize key="hidePropertyLabels">Hide Property Labels?</archetype-localize><small><archetype-localize key="hidePropertyLabelsDescription">Hides the property labels.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsHideLabels" ng-model="archetypeConfigRenderModel.hidePropertyLabels"/>
</div>
<div>
<label for="archetypeAdvancedOptionsMaxFieldsets"><archetype-localize key="maxFieldsets">Max Fieldsets</archetype-localize><small><archetype-localize key="maxFieldsetsDescription">How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.</archetype-localize></small></label>
<input type="number" id="archetypeAdvancedOptionsMaxFieldsets" class="archetypeMaxFieldsets" ng-model="archetypeConfigRenderModel.maxFieldsets"/>
</div>
<div>
<label for="archetypeAdvancedOptionsMultipleFieldsets"><archetype-localize key="enableMultipleFieldsets">Enable Multiple Fieldsets?</archetype-localize><small><archetype-localize key="enableMultipleFieldsetsDescription">Allows multiple types of fieldsets within this archetype.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsMultipleFieldsets" ng-model="archetypeConfigRenderModel.enableMultipleFieldsets"/>
</div>
<div>
<label for="archetypeAdvancedOptionsCollapsing"><archetype-localize key="enableCollapsing">Enable Collapsing?</archetype-localize><small><archetype-localize key="enableCollapsingDescription">Enable fieldset collapsing.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsCollapsing" ng-model="archetypeConfigRenderModel.enableCollapsing"/>
</div>
<div>
<label for="archetypeAdvancedOptionsDisabling"><archetype-localize key="enableDisabling">Enable Fieldset Disabling?</archetype-localize><small><archetype-localize key="enableDisablingDescription">Allows fieldsets to be individually enabled/disabled.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsDisabling" ng-model="archetypeConfigRenderModel.enableDisabling" />
</div>
<div>
<label for="archetypeAdvancedOptionsFieldsetToolbar"><archetype-localize key="hideFieldsetToolbar">Hide Fieldset Toolbar?</archetype-localize><small><archetype-localize key="hideFieldsetToolbarDescription">Hides the fieldset toolbar that appears when more than one fieldset model appears.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsFieldsetToolbar" ng-model="archetypeConfigRenderModel.hideFieldsetToolbar"/>
</div>
<div>
<label for="archetypeAdvancedOptionsCustomClass"><archetype-localize key="customWrapperClass">Custom Wrapper Class</archetype-localize><small><archetype-localize key="customWrapperClassDescription">(Optional) Enter a custom CSS class that will be applied to the wrapper div.</archetype-localize></small></label>
<input type="text" id="archetypeAdvancedOptionsCustomClass" ng-model="archetypeConfigRenderModel.customCssClass"/>
</div>
<div>
<label for="archetypeAdvancedOptionsCustomCss"><archetype-localize key="cssFile">CSS File</archetype-localize><small><archetype-localize key="cssFileDescription">(Optional) Enter a path for a custom CSS file to be included on the page.</archetype-localize></small></label>
<input type="text" id="archetypeAdvancedOptionsCustomCss" ng-model="archetypeConfigRenderModel.customCssPath"/>
</div>
<div>
<label for="archetypeAdvancedOptionsCustomJs"><archetype-localize key="jsFile">JS File</archetype-localize><small><archetype-localize key="jsFileDescription">(Optional) Enter a path for a custom JS file to be included on the page.</archetype-localize></small></label>
<input type="text" id="archetypeAdvancedOptionsCustomJs" ng-model="archetypeConfigRenderModel.customJsPath"/>
</div>
<div>
<label for="archetypeAdvancedOptionsCustomView"><archetype-localize key="viewFile">View File</archetype-localize><small><archetype-localize key="viewFileDescription">(Optional) Enter a path for a custom view file to be used to render this Archetype.</archetype-localize></small></label>
<input type="text" id="archetypeAdvancedOptionsCustomView" ng-model="archetypeConfigRenderModel.customViewPath"/>
</div>
<div>
<label for="archetypeAdvancedOptionsDeepDatatypeRequest"><archetype-localize key="deepDatatypeRequest">Enable Deep Datatype Requests?</archetype-localize><small><archetype-localize key="deepDatatypeRequestDescription">Allows for easier datatype interception at the cost of caching performance.</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsDeepDatatypeRequest" ng-model="archetypeConfigRenderModel.enableDeepDatatypeRequests"/>
</div>
<div>
<label for="archetypeAdvancedOptionsDeveloperMode"><archetype-localize key="toggleDeveloperMode">Enable Developer Mode?</archetype-localize><small><archetype-localize key="toggleDeveloperModeDescription">Toggle Developer Mode</archetype-localize></small></label>
<input type="checkbox" id="archetypeAdvancedOptionsDeveloperMode" ng-model="archetypeConfigRenderModel.developerMode"/>
</div>
<div>
<label for="archetypeOverrideDefaultConverter"><archetype-localize key="overrideDefaultConverter">Override Default Property Value Converter?</archetype-localize><small><archetype-localize key="overrideDefaultConverterDescription">Check this if you wish to use your own custom property value converter.</archetype-localize></small></label>
<input type="checkbox" id="archetypeOverrideDefaultConverter" ng-model="archetypeConfigRenderModel.overrideDefaultPropertyValueConverter" />
</div>
<div>
<label for="archetypeAdvancedOptionsConfigModel"><archetype-localize key="configModel">Config Model</archetype-localize><small><archetype-localize key="configModelDescription">Be careful editing the text below, it controls the schema for this archetype.</archetype-localize></small></label>
<textarea class="archetypeDeveloperModel" id="archetypeAdvancedOptionsConfigModel" ng-model="archetypeConfigRenderModel"></textarea>
</div>
</div>
</div>
+63
View File
@@ -0,0 +1,63 @@
<div class="archetypeEditor ng-class:model.config.customCssClass">
<textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="model.value"></textarea>
<ul ui-sortable="sortableOptions" ng-model="model.value.fieldsets" ng-show="!showAddButton()">
<li ng-repeat="fieldset in model.value.fieldsets">
<fieldset ng-class="['archetype-fieldset-' + fieldset.alias, (getFieldsetValidity(fieldset) == false ? 'archetypeFieldsetError' : '')]" ng-init="fieldsetConfigModel = getConfigFieldsetByAlias(fieldset.alias)">
<div class="archetypeFieldsetLabel" ng-class="{enableCollapsing: model.config.enableCollapsing}">
<div ng-click="focusFieldset(fieldset)" class="label-sub module-label">
<span class="caret" ng-hide="fieldset.collapse || !model.config.enableCollapsing"></span>
<span class="caret caret-right" ng-show="fieldset.collapse && model.config.enableCollapsing"></span>
<label ng-class="{dimmed: fieldset.disabled}">
<i class="fieldsetIcon icon ng-class:fieldsetConfigModel.icon"></i>
<span ng-bind="getFieldsetTitle(fieldsetConfigModel, $index)"></span>
</label>
</div>
<div class="archetypeEditorControls label-sub" ng-hide="model.config.hideFieldsetControls">
<i class="icon icon-add dropdown-toggle" ng-show="canAdd()" data-toggle="{{ model.config.fieldsets.length > 1 ? 'dropdown' : ''}}" ng-click="model.config.fieldsets.length == 1 ? addRow(fieldset.alias, $index) : return"></i>
<ul class="dropdown-menu umb-actions">
<li ng-repeat="fieldsetModel in model.config.fieldsets" ng-click="addRow(fieldsetModel.alias, $parent.$index)">
<a>
<i class="fieldsetIcon icon ng-class:fieldsetModel.icon"></i>
<span class="menu-label">{{fieldsetModel.label}}</span>
</a>
</li>
</ul>
<i class="icon icon-remove" ng-click="removeRow($index)" ng-show="canRemove()"></i>
<i class="icon icon-power" ng-class="{dimmed: fieldset.disabled}" ng-click="enableDisable(fieldset)" ng-show="canDisable()"></i>
<i class="icon icon-navigation handle" ng-show="canSort()"></i>
</div>
</div>
<div class="archetypeCollapser animate-hide" ng-hide="model.config.enableCollapsing && isCollapsed(fieldset)">
<form class="form-inline">
<div ng-class="[('archetype-property-' + property.alias), (getPropertyValidity($parent.$index, property.alias) === false ? 'archetypePropertyError' : '')]" class="archetypeProperty control-group" ng-repeat="property in fieldsetConfigModel.properties">
<label ng-hide="model.config.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{model.alias}}-{{$parent.$index}}-{{$index}}">
<span>{{property.label}}</span>
<div class="archetypeFieldsetHelpText" ng-show="property.helpText">
<small>{{property.helpText}}</small>
</div>
</label>
<div ng-class="[(model.config.hidePropertyLabels == '1' ? 'controls-no-label' : 'controls')]">
<archetype-property class="archetypeEditor" property="property" property-editor-alias="model.alias" fieldset-index="$parent.$index" fieldset="fieldset" archetype-config="model.config" property-config-index="$index" archetype-render-model="model.value" umbraco-form="form"></archetype-property>
</div>
</div>
</form>
</div>
</fieldset>
</li>
</ul>
<div ng-show="showAddButton()">
<a data-toggle="{{ model.config.fieldsets.length > 1 ? 'dropdown' : ''}}" ng-click="model.config.fieldsets.length == 1 ? addRow(model.config.fieldsets[0].alias, 0) : return" prevent-default>
<i class="icon icon-add dropdown-toggle"></i>
<localize key="general_add" class="archetypeAddButtonText">Add</localize>
</a>
<ul class="dropdown-menu umb-actions">
<li ng-repeat="fieldsetModel in model.config.fieldsets" ng-click="addRow(fieldsetModel.alias, 0)">
<a>
<i class="fieldsetIcon icon ng-class:fieldsetModel.icon"></i>
<span class="menu-label">{{fieldsetModel.label}}</span>
</a>
</li>
</ul>
</div>
</div>
+1
View File
@@ -0,0 +1 @@
<div archetype-custom-view ng-controller="Imulus.ArchetypeController"></div>
+9
View File
@@ -0,0 +1,9 @@
{
"name": "Archetype",
"version": "1.6.0-beta",
"url": "http://github.com/imulus/archetype/",
"author": "Imulus",
"authorUrl": "http://imulus.com/",
"license": "MIT",
"licenseUrl": "http://opensource.org/licenses/MIT"
}
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Archetype</id>
<version><%= version %></version>
<title><%= name %></title>
<authors>imulus, kgiszewski, tomfulton</authors>
<owners>imulus, kgiszewski, tomfulton</owners>
<projectUrl>http://github.com/imulus/archetype</projectUrl>
<description><![CDATA[Archetype for Umbraco]]></description>
<tags>umbraco</tags>
<iconUrl>http://github.com/imulus/archetype/raw/master/assets/logo.png</iconUrl>
<licenseUrl><%= licenseUrl %></licenseUrl>
</metadata>
</package>
+39
View File
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<umbPackage>
<info>
<package>
<name><%= name %></name>
<version><%= version %></version>
<license url="<%= licenseUrl %>"><%= license %></license>
<url><%= url %></url>
<requirements>
<major>0</major>
<minor>0</minor>
<patch>0</patch>
</requirements>
</package>
<author>
<name><%= author %></name>
<website><%= authorUrl %></website>
</author>
<readme><![CDATA[<%= readmeContents %>]]></readme>
</info>
<DocumentTypes />
<Templates />
<Stylesheets />
<Macros />
<DictionaryItems />
<Languages />
<DataTypes />
<control />
<Actions />
<files>
<% files.forEach(function(file) { %>
<file>
<guid><%= file.guid %>.<%= file.ext %></guid>
<orgPath><%= file.dir %></orgPath>
<orgName><%= file.name %></orgName>
</file>
<% }); %>
</files>
</umbPackage>
View File
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

-143
View File
@@ -1,143 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="Archetype : An Umbraco 7 Property Editor Wrapper" />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<title>Archetype</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<img class="logo" src="images/logo.png" alt="logo"/>
<a id="forkme_banner" href="https://github.com/imulus/Archetype">View on GitHub</a>
<h1 id="project_title">Archetype</h1>
<h2 id="project_tagline">An Umbraco 7 Property Editor Wrapper</h2>
<section id="downloads">
<a class="zip_download_link" href="https://github.com/imulus/Archetype/zipball/master">Download this project as a .zip file</a>
<a class="tar_download_link" href="https://github.com/imulus/Archetype/tarball/master">Download this project as a tar.gz file</a>
</section>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<p>Archetype is an Umbraco 7 property editor that wraps other installed property editors. By wrapping the other properties, Archetype allows for custom and repeatable fieldset mashups.</p>
<p>Checkout some videos of Archetype in action here: <a href="http://blog.imulus.com/kevin-giszewski/umbraco-7-package-preview-archetype">http://blog.imulus.com/kevin-giszewski/umbraco-7-package-preview-archetype</a></p>
<img class="logo" style="border: 1px solid #ccc;" src="images/example1.png"/>
<h2>
<a name="installation" class="anchor" href="#installation"><span class="octicon octicon-link"></span></a>Installation</h2>
<p>Install the latest <a href="https://github.com/imulus/Archetype/releases">package</a> through the Umbraco package installer or via <a href="http://www.nuget.org/packages/Archetype/">NuGet</a>.</p>
<h2>
<a name="basic-configuration" class="anchor" href="#basic-configuration"><span class="octicon octicon-link"></span></a>Basic Configuration</h2>
<p>After installation, visit the developer section and create a new data type with Archetype as the selected property editor.</p>
<p>At this point you should now see several input boxes to set up your Archetype fieldset:</p>
<p><strong>Label</strong> - A label for your fieldset (i.e. person, car, etc)</p>
<p><strong>Alias (required)</strong> - Pick a machine safe (A-Z 0-9 _- no spaces) name for your archetype that will be used for tracking this fieldset.</p>
<p><strong>Label Template</strong></p>
<p>This template will be used in the data editor and will display when the fieldset is collapsed. Ideally you can select static text or a property alias. If you choose to use a property value, you must use the following syntax:</p>
<p><code>{{firstName}}</code> - Where firstName is the alias of a property.</p>
<p><strong>Tooltip</strong> - Appears when hovering overing over a fieldset in the data editor. This is only applicable when multiple fieldsets are enabled.</p>
<p><strong>Properties</strong> - Properties represent the actual input controls that your Archetype will encapsulate.</p>
<ul>
<li><p><em>Label</em> - A label for your property.</p></li>
<li><p><em>Alias</em> (required) - Pick a machine safe (A-Z 0-9 _- no spaces) name for your archetype that will be used for tracking this property.</p></li>
<li><p><em>Help Text</em> - Text that appears under the label to guide the user on what the input is for.</p></li>
<li><p><em>Datatype</em> - Select the preconfigured Umbraco data type.</p></li>
<li><p><em>Default Value</em> - Input either a JSON or plain text value. This value varies and is determined by the chosen view.</p></li>
<li><p><em>Required</em> - Simple required validation can be achieved by ticking this box.</p></li>
</ul><h2>
<a name="advanced-configuration" class="anchor" href="#advanced-configuration"><span class="octicon octicon-link"></span></a>Advanced Configuration</h2>
<p>Advanced options can be exposed by ticking the Toggle Advanced Options box.</p>
<p><strong>Max Fieldsets</strong> - When blank, the Archetype will allow an infinite number of repeated fieldsets. Placing an integer in this box will limit the number to the amount entered.</p>
<p><strong>Enable Multiple Fieldsets</strong> - By ticking this box, a developer may add more than one type of fieldset to the Archetype. When there are multiple fieldsets configured, a toolbar will display on the data editor to allow the editor to select the different fieldsets.</p>
<p><strong>Custom Wrapper Class</strong> - If you need to inject a custom class to your Archetype wrapper, this is the place to do it.</p>
<p><strong>CSS File</strong> - If you would like to alter the appearance of the default Archetype styles, simply include a file path to your CSS file here.</p>
<p><strong>JS File</strong> - If you would like to inject some JavaScript on the page, simply include a file path to your JS file here.</p>
<p><strong>Toggle Developer Mode</strong> - Tick this box to enable verbose debugging to the console. This also expose the data model on the data editor page which can be live edited.</p>
<p><strong>Config Model</strong> - Import/Export your Archetype between installs by copy/pasting this code. You can also live edit your Archetype config by alter these values. Caution should be used when doing so.</p>
<h2>
<a name="usage" class="anchor" href="#usage"><span class="octicon octicon-link"></span></a>Usage</h2>
<p>To use your new Archetype, simply add it to any document type.</p>
<p>To integrate your own property editor:</p>
<ol>
<li>Ensure your property editor is installed into Umbraco.</li>
<li>Edit the <code>/App_Plugins/Archetype/js/propertyEditors.views.js</code> file.</li>
<li>Add a JSON object that defines your custom property editor.</li>
</ol>
<p>How to use it on a template you ask?: <a href="https://gist.github.com/kgiszewski/8863822">Get the gist here.</a></p>
<h2>
<a name="known-issues" class="anchor" href="#known-issues"><span class="octicon octicon-link"></span></a>Known Issues</h2>
<h3>
<a name="umbraco-caching" class="anchor" href="#umbraco-caching"><span class="octicon octicon-link"></span></a>Umbraco Caching</h3>
<p>If you decide to extend this project locally, you'll want to set the <code>&lt;compilation&gt;</code> debug property in your web.config to <code>true</code>:</p>
<p><code>&lt;compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.5"&gt;</code></p>
<p>This is in order to circumvent the minification and caching of the JavaScript files.</p>
<h3>
<a name="prevalue-character-limit" class="anchor" href="#prevalue-character-limit"><span class="octicon octicon-link"></span></a>Prevalue Character Limit</h3>
<p>If you get an error during saving that says the value will be truncated in the database, it is because you config has exceeded the 2500 character limit imposed by Umbraco. You can get around this by upping the limit in your DB. Please backup your DB first.</p>
<p><a href="http://issues.umbraco.org/issue/U4-2120">http://issues.umbraco.org/issue/U4-2120</a></p>
<h3>
<a name="other-issues" class="anchor" href="#other-issues"><span class="octicon octicon-link"></span></a>Other Issues</h3>
<p>There is also a list <a href='https://github.com/imulus/Archetype/issues'>here</a>.</p>
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p class="copyright">Archetype maintained by <a href="https://github.com/imulus">imulus</a></p>
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
console.log('This would be the main JS file.');
+34
View File
@@ -0,0 +1,34 @@
{
"name": "archetype",
"version": "0.0.0",
"dependencies": {
"grunt": "~0.4.2",
"bower": "~1.2.8",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-less": "~0.8.3",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.7.2",
"grunt-cli": "~0.1.11",
"grunt-contrib-clean": "~0.5.0",
"grunt-touch": "~0.1.0",
"guid": "0.0.12",
"adm-zip": "~0.4.3",
"rimraf": "~2.2.5",
"grunt-nuget": "~0.1.1",
"grunt-template": "~0.2.2",
"fs-extra": "~0.8.1",
"grunt-msbuild": "~0.1.9",
"grunt-dotnet-assembly-info": "~1.0.9",
"load-grunt-tasks": "~0.4.0",
"grunt-umbraco-package": "0.0.5"
},
"repository": {
"type": "git",
"url": "https://github.com/imulus/Archetype.git"
},
"devDependencies": {
"grunt-msbuild": "^0.1.12"
}
}
-1
View File
@@ -1 +0,0 @@
{"name":"Archetype","tagline":"An Umbraco 7 Property Editor Wrapper","body":"Archetype is an Umbraco 7 property editor that wraps other installed property editors. By wrapping the other properties, Archetype allows for custom and repeatable fieldset mashups.\r\n\r\nCheckout some videos of Archetype in action here: http://blog.imulus.com/kevin-giszewski/umbraco-7-package-preview-archetype\r\n\r\n##Installation\r\n\r\nInstall the [package](https://github.com/imulus/Archetype/releases) through the Umbraco package installer or via [NuGet](http://www.nuget.org/packages/Archetype/).\r\n\r\n##Basic Configuration##\r\n\r\nAfter installation, visit the developer section and create a new data type with Archetype as the selected property editor.\r\n\r\nAt this point you should now see several input boxes to set up your Archetype fieldset:\r\n\r\n**Label** - A label for your fieldset (i.e. person, car, etc)\r\n\r\n**Alias (required)** - Pick a machine safe (A-Z 0-9 _- no spaces) name for your archetype that will be used for tracking this fieldset.\r\n\r\n**Label Template**\r\n\r\nThis template will be used in the data editor and will display when the fieldset is collapsed. Ideally you can select static text or a property alias. If you choose to use a property value, you must use the following syntax:\r\n\r\n`{{firstName}}` - Where firstName is the alias of a property.\r\n\r\n**Tooltip** - Appears when hovering overing over a fieldset in the data editor. This is only applicable when multiple fieldsets are enabled.\r\n\r\n**Properties** - Properties represent the actual input controls that your Archetype will encapsulate.\r\n\t\r\n* _Label_ - A label for your property.\r\n\t\r\n* _Alias_ (required) - Pick a machine safe (A-Z 0-9 _- no spaces) name for your archetype that will be used for tracking this property.\r\n\r\n* _Help Text_ - Text that appears under the label to guide the user on what the input is for.\r\n\r\n* _Datatype_ - Select the preconfigured Umbraco data type.\r\n\r\n* _Default Value_ - Input either a JSON or plain text value. This value varies and is determined by the chosen view.\r\n\r\n* _Required_ - Simple required validation can be achieved by ticking this box.\r\n\r\n## Advanced Configuration\r\n\r\nAdvanced options can be exposed by ticking the Toggle Advanced Options box.\r\n\r\n**Max Fieldsets** - When blank, the Archetype will allow an infinite number of repeated fieldsets. Placing an integer in this box will limit the number to the amount entered.\r\n\r\n**Enable Multiple Fieldsets** - By ticking this box, a developer may add more than one type of fieldset to the Archetype. When there are multiple fieldsets configured, a toolbar will display on the data editor to allow the editor to select the different fieldsets.\r\n\r\n**Custom Wrapper Class** - If you need to inject a custom class to your Archetype wrapper, this is the place to do it.\r\n\r\n**CSS File** - If you would like to alter the appearance of the default Archetype styles, simply include a file path to your CSS file here.\r\n\r\n**JS File** - If you would like to inject some JavaScript on the page, simply include a file path to your JS file here.\r\n\r\n**Toggle Developer Mode** - Tick this box to enable verbose debugging to the console. This also expose the data model on the data editor page which can be live edited.\r\n\r\n**Config Model** - Import/Export your Archetype between installs by copy/pasting this code. You can also live edit your Archetype config by alter these values. Caution should be used when doing so.\r\n\r\n## Usage\r\n\r\nTo use your new Archetype, simply add it to any document type.\r\n\r\nTo integrate your own property editor:\r\n\r\n1. Ensure your property editor is installed into Umbraco.\r\n2. Edit the `/App_Plugins/Archetype/js/propertyEditors.views.js` file.\r\n3. Add a JSON object that defines your custom property editor.\r\n\r\n## Known Issues\r\n\r\n### Umbraco Caching\r\n\r\nIf you decide to extend this project locally, you'll want to set the `<compilation>` debug property in your web.config to `true`:\r\n\r\n`<compilation defaultLanguage=\"c#\" debug=\"true\" batch=\"false\" targetFramework=\"4.5\">`\r\n\r\nThis is in order to circumvent the minification and caching of the JavaScript files.\r\n\r\n### Prevalue Character Limit\r\n\r\nIf you get an error during saving that says the value will be truncated in the database, it is because you config has exceeded the 2500 character limit imposed by Umbraco. You can get around this by upping the limit in your DB. Please backup your DB first.\r\n\r\nhttp://issues.umbraco.org/issue/U4-2120\r\n\r\n### Core Property Editors\r\nRTE - The RTE doesnt like to render on a repeatable fieldset. It also goes bonkers when you try to sort a field.","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
-70
View File
@@ -1,70 +0,0 @@
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f0f3f3; }
.highlight .c { color: #0099FF; font-style: italic } /* Comment */
.highlight .err { color: #AA0000; background-color: #FFAAAA } /* Error */
.highlight .k { color: #006699; font-weight: bold } /* Keyword */
.highlight .o { color: #555555 } /* Operator */
.highlight .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #009999 } /* Comment.Preproc */
.highlight .c1 { color: #0099FF; font-style: italic } /* Comment.Single */
.highlight .cs { color: #0099FF; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #003300; font-weight: bold } /* Generic.Heading */
.highlight .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */
.highlight .go { color: #AAAAAA } /* Generic.Output */
.highlight .gp { color: #000099; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #003300; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #99CC66 } /* Generic.Traceback */
.highlight .kc { color: #006699; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #006699; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #006699; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #006699 } /* Keyword.Pseudo */
.highlight .kr { color: #006699; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #007788; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #FF6600 } /* Literal.Number */
.highlight .s { color: #CC3300 } /* Literal.String */
.highlight .na { color: #330099 } /* Name.Attribute */
.highlight .nb { color: #336666 } /* Name.Builtin */
.highlight .nc { color: #00AA88; font-weight: bold } /* Name.Class */
.highlight .no { color: #336600 } /* Name.Constant */
.highlight .nd { color: #9999FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #CC0000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #CC00FF } /* Name.Function */
.highlight .nl { color: #9999FF } /* Name.Label */
.highlight .nn { color: #00CCFF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #330099; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #003333 } /* Name.Variable */
.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #FF6600 } /* Literal.Number.Float */
.highlight .mh { color: #FF6600 } /* Literal.Number.Hex */
.highlight .mi { color: #FF6600 } /* Literal.Number.Integer */
.highlight .mo { color: #FF6600 } /* Literal.Number.Oct */
.highlight .sb { color: #CC3300 } /* Literal.String.Backtick */
.highlight .sc { color: #CC3300 } /* Literal.String.Char */
.highlight .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #CC3300 } /* Literal.String.Double */
.highlight .se { color: #CC3300; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #CC3300 } /* Literal.String.Heredoc */
.highlight .si { color: #AA0000 } /* Literal.String.Interpol */
.highlight .sx { color: #CC3300 } /* Literal.String.Other */
.highlight .sr { color: #33AAAA } /* Literal.String.Regex */
.highlight .s1 { color: #CC3300 } /* Literal.String.Single */
.highlight .ss { color: #FFCC33 } /* Literal.String.Symbol */
.highlight .bp { color: #336666 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #003333 } /* Name.Variable.Class */
.highlight .vg { color: #003333 } /* Name.Variable.Global */
.highlight .vi { color: #003333 } /* Name.Variable.Instance */
.highlight .il { color: #FF6600 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }
-433
View File
@@ -1,433 +0,0 @@
/*******************************************************************************
Slate Theme for GitHub Pages
by Jason Costello, @jsncostello
*******************************************************************************/
@import url(pygment_trac.css);
/*******************************************************************************
MeyerWeb Reset
*******************************************************************************/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
ol, ul {
list-style: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/*******************************************************************************
Theme Styles
*******************************************************************************/
body {
box-sizing: border-box;
color:#373737;
background: #212121;
font-size: 16px;
font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
margin: 10px 0;
font-weight: 700;
color:#222222;
font-family: 'Lucida Grande', 'Calibri', Helvetica, Arial, sans-serif;
letter-spacing: -1px;
}
h1 {
font-size: 36px;
font-weight: 700;
}
h2 {
padding-bottom: 10px;
font-size: 32px;
background: url('../images/bg_hr.png') repeat-x bottom;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 21px;
}
h5 {
font-size: 18px;
}
h6 {
font-size: 16px;
}
p {
margin: 10px 0 15px 0;
}
footer p {
color: #f2f2f2;
}
a {
text-decoration: none;
color: #007edf;
text-shadow: none;
transition: color 0.5s ease;
transition: text-shadow 0.5s ease;
-webkit-transition: color 0.5s ease;
-webkit-transition: text-shadow 0.5s ease;
-moz-transition: color 0.5s ease;
-moz-transition: text-shadow 0.5s ease;
-o-transition: color 0.5s ease;
-o-transition: text-shadow 0.5s ease;
-ms-transition: color 0.5s ease;
-ms-transition: text-shadow 0.5s ease;
}
a:hover, a:focus {text-decoration: underline;}
footer a {
color: #F2F2F2;
text-decoration: underline;
}
em {
font-style: italic;
}
strong {
font-weight: bold;
}
img {
position: relative;
margin: 0 auto;
max-width: 739px;
padding: 5px;
margin: 10px 0 10px 0;
border: 1px solid #ebebeb;
box-shadow: 0 0 5px #ebebeb;
-webkit-box-shadow: 0 0 5px #ebebeb;
-moz-box-shadow: 0 0 5px #ebebeb;
-o-box-shadow: 0 0 5px #ebebeb;
-ms-box-shadow: 0 0 5px #ebebeb;
}
p img {
display: inline;
margin: 0;
padding: 0;
vertical-align: middle;
text-align: center;
border: none;
}
pre, code {
width: 100%;
color: #222;
background-color: #fff;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
font-size: 14px;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}
pre {
width: 100%;
padding: 10px;
box-shadow: 0 0 10px rgba(0,0,0,.1);
overflow: auto;
}
code {
padding: 3px;
margin: 0 3px;
box-shadow: 0 0 10px rgba(0,0,0,.1);
}
pre code {
display: block;
box-shadow: none;
}
blockquote {
color: #666;
margin-bottom: 20px;
padding: 0 0 0 20px;
border-left: 3px solid #bbb;
}
ul, ol, dl {
margin-bottom: 15px
}
ul {
list-style: inside;
padding-left: 20px;
}
ol {
list-style: decimal inside;
padding-left: 20px;
}
dl dt {
font-weight: bold;
}
dl dd {
padding-left: 20px;
font-style: italic;
}
dl p {
padding-left: 20px;
font-style: italic;
}
hr {
height: 1px;
margin-bottom: 5px;
border: none;
background: url('../images/bg_hr.png') repeat-x center;
}
table {
border: 1px solid #373737;
margin-bottom: 20px;
text-align: left;
}
th {
font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
padding: 10px;
background: #373737;
color: #fff;
}
td {
padding: 10px;
border: 1px solid #373737;
}
form {
background: #f2f2f2;
padding: 20px;
}
/*******************************************************************************
Full-Width Styles
*******************************************************************************/
.outer {
width: 100%;
}
.inner {
position: relative;
max-width: 640px;
padding: 20px 10px;
margin: 0 auto;
}
#forkme_banner {
display: block;
position: absolute;
top:0;
right: 10px;
z-index: 10;
padding: 10px 50px 10px 10px;
color: #fff;
background: url('../images/blacktocat.png') #0090ff no-repeat 95% 50%;
font-weight: 700;
box-shadow: 0 0 10px rgba(0,0,0,.5);
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
#header_wrap {
background: #212121;
background: -moz-linear-gradient(top, #373737, #212121);
background: -webkit-linear-gradient(top, #373737, #212121);
background: -ms-linear-gradient(top, #373737, #212121);
background: -o-linear-gradient(top, #373737, #212121);
background: linear-gradient(top, #373737, #212121);
height: 170px;
}
#header_wrap .inner {
padding: 50px 10px 30px 10px;
}
#project_title {
margin: 0;
color: #fff;
font-size: 42px;
font-weight: 700;
text-shadow: #111 0px 0px 10px;
}
#project_tagline {
color: #fff;
font-size: 24px;
font-weight: 300;
background: none;
text-shadow: #111 0px 0px 10px;
}
#downloads {
position: absolute;
width: 210px;
z-index: 10;
bottom: -40px;
right: 0;
height: 70px;
background: url('../images/icon_download.png') no-repeat 0% 90%;
}
.zip_download_link {
display: block;
float: right;
width: 90px;
height:70px;
text-indent: -5000px;
overflow: hidden;
background: url(../images/sprite_download.png) no-repeat bottom left;
}
.tar_download_link {
display: block;
float: right;
width: 90px;
height:70px;
text-indent: -5000px;
overflow: hidden;
background: url(../images/sprite_download.png) no-repeat bottom right;
margin-left: 10px;
}
.zip_download_link:hover {
background: url(../images/sprite_download.png) no-repeat top left;
}
.tar_download_link:hover {
background: url(../images/sprite_download.png) no-repeat top right;
}
#main_content_wrap {
background: #f2f2f2;
border-top: 1px solid #111;
border-bottom: 1px solid #111;
}
#main_content {
padding-top: 40px;
clear:both;
}
#footer_wrap {
background: #212121;
}
.logo{
float: left;
border: none;
box-shadow: none;
-webkit-box-shadow: none;
margin-right: 10px;
}
/*******************************************************************************
Small Device Styles
*******************************************************************************/
@media screen and (max-width: 480px) {
body {
font-size:14px;
}
#downloads {
display: none;
}
.inner {
min-width: 320px;
max-width: 480px;
}
#project_title {
font-size: 32px;
}
h1 {
font-size: 28px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 21px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 14px;
}
h6 {
font-size: 12px;
}
code, pre {
min-width: 320px;
max-width: 480px;
font-size: 11px;
}
}