Commit Graph

1116 Commits

Author SHA1 Message Date
hartvig
b5c78d397d Updates to fetching extension methods in a more stable way in DynamicNodeList 2011-02-18 13:02:20 -01:00
hartvig
7df518155d Clean up of merging 2011-02-18 10:09:20 -01:00
hartvig
90f5c4ce9a Merge initial merge of Agraths improvements (might break compilation atm) 2011-02-18 09:38:19 -01:00
agrath@gmail.com
cc23fdbd8e Added .Random implementation from the blog post so it's internal to 4.6.2 2011-02-17 20:57:12 -13:00
agrath@gmail.com
3a30c285fe Updated .OrderBy implementation to support OrderBy,OrderByDescending,ThenBy,ThenByDescending properly on DynamicNodeList
Usage is: @foreach(var item in home.ChildItems.OrderBy("catCount, colour desc"))
If you use the simple form of home.ChildItems.OrderBy("catCount") it will use a simpler/faster implementation
2011-02-17 19:07:22 -13:00
agrath@gmail.com
d9f420d45a Added .OrderBy method to DynamicNodeList
Only supports single pass, ascending currently, so no ThenBy implementation or Descending variants
The original query parser supports OrderBy("catCount, name desc") by nesting Expression.Call
Current implementation for DynamicNodeList supports OrderBy("catCount") only
2011-02-17 14:52:05 -13:00
agrath@gmail.com
300c975284 Moved caching of property data type from DynamicNode to a static method in ContentType
Simplified SQL query used for property type lookup
Added cache clearing for propertyType cache when ContentType.ClearCache is called
Improves performance of new razor property lookups - most improvement on large sets
2011-02-17 14:23:20 -13:00
hartvig
f8b5e5e89d Merge of DougMs patches 2011-02-17 17:19:06 -01:00
hartvig
d57bc67121 Merge of Sebastiaans patches 2011-02-17 16:56:22 -01:00
hartvig
71aa8a20af Merge of ElijahGs brilliant razor implementation 2011-02-17 16:52:15 -01:00
hartvig
ef50f7d38c Merge more of sgays patches 2011-02-17 16:07:22 -01:00
hartvig
2e6341b945 Merge sgay patches 2011-02-17 13:42:28 -01:00
Elijah
e277e4cadb Dynamic keyword is back for Parameters/Dictionary 2011-02-16 22:53:11 -10:00
Elijah
35cfee3f85 inline @inherts not required, fix 2011-02-16 21:42:45 -10:00
Elijah
3a76e9caae Supports default @inherits directive umbraco.MacroEngines.DynamicNodeContext 2011-02-16 21:29:35 -10:00
Elijah
2def8a520a .razor ext added as a Build Provider 2011-02-16 18:42:14 -10:00
Elijah
45fefda660 editMacro.aspx - adds sub directory slash/now shows "Browse scripting files on server..." 2011-02-16 18:40:40 -10:00
matt
8dac6662a5 Updated DMU with latest changes
Changed DMU version number to 2.1.0 to allow for additional work on original DMU project if needed
2011-02-16 18:48:03 +00:00
Elijah
68ce71685d Updated config added factoryType 2011-02-16 01:49:31 -11:00
Elijah
ce83c8a1b9 Added SupportedUIExtensions to IMacroEngine 2011-02-16 01:48:40 -11:00
Elijah
3d5ed109af .razor proxy .cshtml file ext- #unbreakingcode 2011-02-16 01:32:04 -11:00
PerPloug
fa4483f08c /base issue with virtual directories fixes: 30042 2011-02-16 08:27:41 -01:00
Elijah
8a1c8475b8 Update Interfaces BaseContext 2011-02-13 22:54:51 -11:00
Elijah
7f57fde279 Seperated Parameter & Culture Dict
Fixed inline auto inherit directive
2011-02-13 22:54:14 -11:00
agrath@gmail.com
b20d1bfd4c Added support for string Comparisons e.g. @Model.Children.Where("menuType = \"Top Menu\") and support for And/Or @Model.Children.Where("menuType == \"Top Menu\ || menuType == \"Bottom Menu\"") 2011-02-07 17:28:59 -13:00
agrath@gmail.com
070a03e827 Fixed DynamicNodeList extension method invocation finding the wrong method when the method being checked was defined on a class that implemented no interfaces
Caused user-loaded extension methods on DynamicNodeList to be pretty unreliable (would work sometimes, sometimes wouldn't find method - particularly after an iisreset)
2011-02-07 15:29:44 -13:00
agrath@gmail.com
313d67ed94 Added reference to datalayer (to get SqlHelper) from DynamicNode 2011-02-07 14:11:03 -13:00
agrath@gmail.com
e7ebcb29bc Broke string properties with new typecasting stuff by returning false instead of true if the typecasting failed (e.g. it was actually a string)
Changed this to a return true

Replaced some API calls via Document & Property (database level, not nodefactory) with a single SQL scalar where I was getting the control type (to determine if "0"/"1" should actually be "true"/"false")
Should perform a lot better now
2011-02-07 14:10:38 -13:00
agrath@gmail.com
e5c3c8869a Upgraded DynamicNode to do some type inferrence from the IProperty type .Value which is a string
Already had support for YesNoType (where the string value is 1 or 0) being converted/parsed to boolean
Added some TryParse calls to int and decimal respecitvely so that if a IProperty.Value is a valid decimal or int it will be returned from DynamicNode.TryGetMember as such
This enables the .Where operator to have the correct type after property retrieval so that some numerical comparisons will work

Added support for >, >=, <, <= and %[mod] to .Where
@Model.Children.Where("catCount > 1")
@Model.Children.Where("catCount % 2 == 0")
2011-02-07 13:12:34 -13:00
agrath@gmail.com
878f6fc812 Added support for some more Func<> types in my Where implementation
Refactored GenerateEqual into a Factory method HandleDynamicNodeLambdas that takes an ExpressionType
Implemented Expression.NotEqual
@Model.Children.Where("shouldBeVisible != true") => children that are hidden
2011-02-07 10:23:40 -13:00
agrath@gmail.com
6d0be45acf Changed some type comparisons where I determine if the LambdaExpression is Func<DynamicNode,object> to handle simple equality operations:
e.g. @Model.Children.Where("shouldBeVisible == true")
Also changed internal where implementation to handle Func<DynamicNode,bool> as well as Func<DynamicNode,object>
Both left & right side as lambda expressions should work (though I haven't tested this yet)
e.g. @Model.Children.Where("property1 == property2")
Only == (Expression.Equals) is supported currently due to the extra code required to invoke the lambda when generating the final comparison expression
2011-02-07 08:56:59 -13:00
agrath@gmail.com
649a98daf4 Added missing DynamicQueryable and DynamicQueryableBinders class files for previous commit 2011-02-06 19:53:07 -13:00
agrath@gmail.com
bcf735f4f8 Added support for DynamicLinq in place of Lambda syntax. The short version is you can't use a Lambda with a DynamicNode
e.g. @Model.Children.Where(node=>node.shouldBeVisible)
To solve this, I used the DynamicQueryable class from the Linq samples which has a parser that can take a string then modified the internals a bit so
that if your object is a DynamicObject, an additional expression tree is generated which calls the TryGetMember on it
The end result is that you can now do this [I have Random(this DynamicNodeList nodes, int max) in my bin folder]
@Model.Children.Where("shouldBeVisible").Random(2) => two nodes, randomly picked, from the ones that should be visible
*Only* Where is implemented here currently, I'll add support by OrderBy and ThenBy after I've tested some more complex scenarios.
I need to fix a small issue with my DynamicLoading of extensions - under some scenarios the class doesn't get found and i'm not sure why.
2011-02-06 19:52:05 -13:00
matt
ba3c7fd680 Added a wmode parameter to DMU badge to prevent it displaying on top of the lock modal popup 2011-02-06 14:49:26 +00:00
matt
043f0e03b2 Merge 2011-02-05 12:46:28 +00:00
matt
03f8aac4e5 Added DMU Flex source
Changed all TheOutfield namesspaces to Umbraco
Added DMU dasboards
Removed ZipUpload dashboards
Added air mimetype to web.config
2011-02-05 12:21:04 +00:00
agrath@gmail.com
eba7c9d550 Overloads for DynamicMedia and DynamicNode constructors that take object and string respectively
New DynamicNode .MediaById (because @Model is DynamicNode) to find a media item by id, e.g. if you are using it with @Model.Parameters.imageId
Overloads for MediaById and NodeById that take object and string to match constructors
2011-02-02 15:51:51 -13:00
agrath@gmail.com
5a5ccfea98 Changed reflection of assemblies to all assemblies in bin folder via BuildManager instead of currently loaded assemblies 2011-02-02 13:05:10 -13:00
agrath@gmail.com
799d718881 Refactored my implementation of IEnumerables being returned from .Children etc to return a new type called DynamicNodeList instead of a DynamicNode (singular) containing a nested list.
This makes the code cleaner and also allows for the .Items (underlying initialization data for DynamicNodeList) to be exposed when you have an instance and hide all of the singular properties etc (Url, Name) that are on DynamicNode - they're not applicable for a List.
Rewrote the reflection code for calling methods on DynamicNodeList to allow mix-ins (e.g. external dlls) to have an extension method defined for DynamicNodeList (e.g. Random(nodeCount))
Lambda syntax still doesn't work (e.g. Children.Where(item=>item.shouldBeVisible)) however methods that don't take lamdas (Take, Random[external], Skip, ElementAt, First, etc) work
2011-02-02 11:52:09 -13:00
sgay
0b5ce63c3a fix #29949 - do not hide errors when loading xslt ext 2011-02-01 13:18:22 -01:00
sgay
39a34954ce fix #29989 - refactor TypeFinder and TypeResolver 2011-02-01 13:17:49 -01:00
agrath@gmail.com
83d88e70a5 Fixed an issue with boolean casting in razor file for if shorthand when properties didn't have value 2011-01-31 08:37:44 -13:00
sebastiaan
d165b75456 Workitem: 29976 - Additional fix, sometimes the niceUrl does NOT start with a slash, in which case you wouldn´t want to strip the first character 2011-01-31 15:02:24 -01:00
sebastiaan
e07dfd49a1 Workitem: 29976 - Additional fix in wording, the word for ´login´ in Dutch is not ´aanmelden´ (which means: ´to register´), but ´inloggen´. 2011-01-31 10:35:58 -01:00
sebastiaan
2b11cab075 Fixes 29976
NiceUrlFetch now uses the new niceUrlJuno function. The result of niceUrlJuno does not include a leading slash. The old NiceUrl (used in the presentation of the URL) does include one, leading to wrong URLs.
2011-01-31 08:43:38 -01:00
matt
a5527769f3 Forgot to save project file before commiting 2011-01-30 17:50:37 +00:00
matt
4b8cc30c3f Added Desktop Media Uploader factories, HttpHandler and initial Dashboard control.
Need to finish dashboard control, swap with ZipUpload and test.
2011-01-30 17:39:20 +00:00
Elijah
5cc819407c *Breaking Change* Removed Parameter & Culture Dictionaries - results in easier to read razor 2011-01-29 03:24:12 -10:00
agrath@gmail.com
26bf18766b Fixed a bad check in my patch for booleans that wasn't installation-portable by making it check the DataTypeDefinition instead of ContentTypeId.
Added a cache for the propertyType lookup (within a single DynamicNode instance) in case the razor logic needs to check the same boolean multiple times within a node.
Should improve performance if working with large trees & repeatedly checking a boolean value
2011-01-28 14:36:13 -13:00
sebastiaan
28d5a81403 Workitem 26949 - Fixed: Login field doesn't fit Dutch translation 2011-01-28 13:35:07 -01:00