Commit Graph

64 Commits

Author SHA1 Message Date
Shannon Deminick
a734a0cff7 Fixes unit tests for Umbraco_Route_User_Defined_Controller_Action 2013-01-30 05:37:32 +06:00
Shannon Deminick
d796b2afc1 Fixes: #U4-1170 - template with hyphen or dash 2013-01-29 21:19:16 +06:00
Shannon Deminick
5e9f4559b6 Fixes: #U4-1536 2013-01-29 07:49:14 +06:00
Shannon Deminick
82c2560822 Ensures all resolvers are sealed. Changes CacheRefreshersResolver, DataTypesResolver, MacroFieldEditorsResolver, PackageActionsResolver, ActionsResolver
to all be lazy resolvers as they are not needed instantly on app startup (not needed by the front-end) This will
make app startup a lot quicker. Fixes ActionsResolver to not use the PluginManager to resolve the types when it
is instantiating them since these are passed in the ctor. Updates all unit tests to use lazy delegate for these resolvers
and they are all passing.
2013-01-23 18:40:40 +03:00
Shannon Deminick
987e48733a Merge 2013-01-23 01:39:25 +03:00
pcw@pcw-PC.shout.local
dec5e8ad6c Fixed EncryptWithMachineKey to handle values longer than FormsAuthentication.Encrypt max length limit
http://issues.umbraco.org/issue/U4-1455
2013-01-15 20:07:07 +00:00
Shannon Deminick
716d3e95f1 Imported patches from 6.0 for #U4-1453, #U4-1454 2013-01-15 00:58:11 +03:00
Shannon Deminick
c0b5525dd7 Removed 'Boot' method from WebBootManager as it was never supposed to be there in the first place.
Removed test code from 'SurfaceController'.
Added comments to IApplicationEventHandler.
2013-01-18 02:31:51 +03:00
Shannon Deminick
2a90e93a6f Updated partial view macro engine to support storing the files in the App_Plugins/[packagename]/Views/MacroPartials
so they can be stored with a package and not pollute the main file system.
2012-12-07 07:04:11 +05:00
Shannon Deminick
8024610364 Fixes up some logging API issues. Fixed up tracing in the macro class. Added support for Partial View macro rendering in the macro class. 2012-12-04 11:08:02 +05:00
Shannon Deminick
fb61c55fa7 Started on PartialViewMacros 2012-12-04 03:26:04 +05:00
Shannon Deminick
4cb03ab36c Fixes issue with ChildActions when inherting from UmbracoViewPage<T> and using the @Umbraco helper. 2012-11-16 10:08:12 +05:00
Shannon Deminick
8be97295dc Added new method to RenderMvcController for easier return of the current template when hijacking routes.
Added better error checking for media handling in MVC.
2012-11-16 00:38:03 +05:00
Shannon Deminick
9554c6a1c6 Fixes #U4-1174 - allows MVC views to render when using RenderTemplate. Added new UmbracoHelper method RenderTemplate. Cleaned up some code and
ensuring that the string writers are disposed. Moved TemplateRenderer to a better namespace.
2012-11-14 10:47:40 +05:00
Shannon Deminick
7df9921441 Fixes: #U4-1142, Changed ctor for RenderModel so people can actually create one to pass in to their views if they want.
Changed the way that UmbracoTemplatePage works in that if you pass in an IPublishedContent model instead of a RenderModel,
it will be generated for you without a YSOD. Changed the UmbracoHelper ctor so that it can be passed a custom IPublishedContent model
so that it's context is of that model and not the one routed to. Added Umbraco.Web.Mvc to the imported namespaces for Views.
2012-11-05 11:27:28 +06:00
Shannon Deminick
0db6c2cc11 Fixed issue that locally declared SurfaceControllers are routed through 'umbraco' area, this should not have been the case.
Created new CacheHelper which replaces the old Cache class and is accessible via the UmbracoContext.
Added new CachedPartial extension method to be able to cache the output of your partials (also by page and by member)
Added mew CacheHelperApplicationEventListener in order to automatically clear the partials cache when content is published, media or members is saved.
2012-10-31 11:36:22 +06:00
Shannon Deminick
c3795d7e5a Added some code comments and did a check for redirects (returns null if this is the case) 2012-10-30 06:49:36 +06:00
Stephan
be3f95610b U4-1081 - treat missing template at 404 2012-10-29 12:35:39 -01:00
Shannon Deminick
07f8f79620 Fixes: #U4-1077, found an bug with both our code and Microsoft's code in that if you RemapPath with an incorrect URL which contains
2 '?' the internals of ASP.net actually force a secondary internal request which causes BeginRequest to fire but doesn't follow the normal
chain of the module. It was a bug with our code having two query strings, however its pretty strange behavior on their part!
Have removed UmbracoContext.ClientUrl since it is not necessary to have. Have renamed UmbracoContext.UmbracoUrl = CleanedUmbracoUrl and UmbracoContext.RequextUrl = OriginalRequestUrl
Have moved the route processing logic to a static method on PublishedContentRequest which auto assigns the request back to the UmbracoContext, plus this is a cleaner
way to do the processing, including allowing us to unit test this one aspect.
Lastly, we are now rewriting the path back to the original URL in the RenderRouteHandler so that in MVC controllers the HttpContext.Request actually
reflects the URL that the client requested, not the rewritten URL (we do this in webforms too)
2012-10-26 02:55:57 +05:00
Shannon Deminick
e3f9375fd2 changes template creator to use new UmbracoTemplatePage class instead of RenderViewPage 2012-10-24 11:10:27 +05:00
Shannon Deminick
d4d4272b1b Moved RenderModel to Models namespace. Created new base UmbracoViewPage to use for umbraco partial views, etc... and renamed
RenderViewPage to UmbracoTemplatePage which now inherits from UmbracoViewPage. Added NiceUrl and NiceUrlWithDomain as extension
methods to IPublishedContent.
2012-10-24 09:59:23 +05:00
Shannon Deminick
7d8524dd55 Added additional namespace imports for MVC views in the views web.config. 2012-10-18 06:55:41 +05:00
Shannon Deminick
83c53333c6 Removed GetDictionaryValue from RenderViewPage, this can be accessed through the @Umbraco property. 2012-10-10 20:45:51 +05:00
Shannon Deminick
f04db8c52c Converted umbracoPage.master to have the correct codebehind structure. Added base2 as a default lib in umbracoPage.
Converted EditView to use propery JS class so that we can now better support the editor for the new buttons (i.e. insert macro, etc...)
2012-10-09 20:17:27 +05:00
Shannon Deminick
82bb410f4f Changed @Model.CurrentContent to @Model.Content, updated some ext methods for IPublishedContent. 2012-10-08 21:55:03 +05:00
Shannon Deminick
261a6af60a Fixes issue when xml file is corrupt and no doc type is registered, the mvc controller factory throws an exception. 2012-10-04 21:06:32 +05:00
Shannon Deminick
54e5140d6a Added more extension methods to our strongly typed IPublishedContent object and IEnumerable<IPublishedContent> to match all of the available methods
that are on the DynamicPublishedContent object. Added more unit tests for all of these classes.
Moved some of the Dynamic objects into the web project which simplifies things quite a bit as some of these classes require access to the biz logic layer.
Now we have intellisense for all of the nice magical methods that were on DynamicPublishedContent on our strongly typed object!
2012-10-04 03:26:56 +05:00
Shannon Deminick
c0102f1c71 Refactored the traversal, ishelper, etc... methods to be extension methods on IPublishedContent so now all of these methods are available on the Typed object not just the dynamic object which makes a whole lot more sense... and you can have intellisense.
Updated DynamicPublishedContent's methods to just proxy calls to the new extension methods so that all of the logic is contained in one place.
Added new GetRootDocuments to the IPublishedContentStore since we need this in order to get the root list of documents for many of these methods.
Fixed an issue with the DynamicNode to IPublishedContent converter.
Fixed many of the failing unit tests.
2012-10-04 01:31:08 +05:00
Shannon Deminick
2753dbe5b4 ensures enctype attribute is added in BeginUmbracoForm.
Adds CurrentCulture to RenderModel
2012-10-02 21:19:21 +05:00
Shannon Deminick
ffd14c839b After talks with morten and stephane, this renames
DocumentRequest -> PublishedContentRequest
2012-10-02 01:40:19 +05:00
Shannon Deminick
4f011e0390 Some naming tweaks to fix up from previous commit. 2012-10-02 01:36:42 +05:00
Shannon Deminick
053df24640 After talks with morten and stephane, this renames
IDocument -> IPublishedContent
DynamicDocument -> DynamicPublishedContent
2012-10-02 01:35:39 +05:00
Shannon Deminick
45c335702d Updated view engine to look only in App_Plugins/ not App_Plugins/Packages/.
Updated view engine to automatically create the required razor web.config in the packages
Views folder if it is not there already.
2012-10-01 23:43:47 +05:00
Shannon Deminick
bc04d4f8da Added PluginViewEngine for App_Plugins 2012-10-01 23:22:23 +05:00
Shannon Deminick
1aebce7ad6 makes SystemDirectories and SystemFiles public.
moves ResolveUrlsFromTextString to TemplateUtilities class and obsoletes other ones.
Fixes an issue if content cache is stored in codegen folder and not in med trust.
Updates the XmlDocument (IDocumentProperty) to always return a value with parsed {localLink} and resolved Urls and cache them so the parsing only happens once.
2012-09-29 11:11:48 +07:00
Shannon Deminick
11fd6553e9 Ensures that localLinks are parsed when rendering fields and macros using UmbracoHelper.
Added additional ControllerExtensions to render views as strings.
2012-09-29 08:49:21 +07:00
Shannon Deminick
8fb159ddc2 Changes IThumbnailProvider to exist under Umbraco.Core.Media instead of just Umbraco.Core.
Moves many of the MVC extension methods into the Umbraco.Web.Mvc namespace and tidies up a few other
class's namespaces
2012-09-29 08:07:00 +07:00
Shannon Deminick
f7f83bc057 Changed IPublishedContentStore and IPublishedMediaStore back to internal as we don't need to expose these yet. Instead have added
an UmbracoHelper property to the PluginController class which will expose any methods needed by devs to retreive media or content.
Have updated UmbracoHelper with loads of new helpful methods and moved the Wrap methods to HtmlHelper extensions because this is purely to
do with rendering html (have written unit tests for it too).
Updated some 'library' methods to proxy calls to UmbracoHelper so we only have to maintain one set of code.
Added a convenience property to UmbracoContext to return the current NiceUrlProvider so you don't have to go through the RoutingContext to get it.
2012-09-27 08:30:35 +07:00
Shannon Deminick
53a3ad24e6 comments out test surface controllers for now 2012-09-26 13:44:23 +07:00
Shannon Deminick
5ece0b5af0 Surface controllers now auto-routing, both locally declared and plugin types (which require a [PluginController] attribute and an Area Name assigned).
BeginUmbracoForm working for both local and plugin SurfaceControllers. SurfaceController class now inherits from PluginController which exposes all things a dev would
need including making IPublishedContentStore and IPublishedMediaStore public which can be accessed simply by properties on the controller.
Updated web.config for views to include Umbraco.Web namespace for all of our helper methods.
BeginUmbracoForm now has many more overrides for which you can specify a type or a generic type (we no longer require GUIDs :)
2012-09-26 13:42:03 +07:00
Shannon Deminick
332b42aa49 Changed how surface controllers are routed: because we don't load plugins in via App_Plugins/[PackageName] like we did in v5 which meant that we can autoroute all plugin controllers with their own areas, in v4 we have to do something different.
Instead (because we still want areas), we have an attribute called PluginControllerAttribute which allows a dev to assign an area name as a string. A package developer should always ensure that all of their plugin controllers are assigned to the same
area. This also lets us get rid of the GUID id part of the plugin (hopefully we can leave it out, just need to run some tests). Since we have areas, package devs can then put their views into
their own folders and not clutter up the local devs ~/Views folder. Perhaps we use App_Plugins/[PackageName] for the views like we did in v5 but need to ask on the mail list. Otherwise it will be the standard MVC:
~/Areas/[AreaName]/Views which will still also clutter up the local devs view folder if they are using Areas.
2012-09-26 11:04:07 +07:00
Shannon Deminick
7b7e3b82f1 Started adding tests for surface controller routing. They are working but not quite correctly yet. 2012-09-25 13:33:47 +07:00
Shannon Deminick
0b7f04ab37 Added all code to support auto-routing surface controllers and started implementing the code for
BeginUmbracoForm.
2012-09-25 13:09:59 +07:00
Shannon Deminick
083b18139a Adds code to RenderViewEngine to ensure the /Views folder exists and also that the razor web.config file exists there too.
I've also added this web.config file to the sln so it should output in the build by default though it will still be created automatically if
its not there.
2012-09-25 11:20:05 +07:00
Shannon Deminick
ae4cb00bbc Got Wrap methods on UmbracoHelper, deprecated old classes in the macroEngines project that Wrap utilizes and proxies
all calles in RazorLibraryCore for Wrap to UmbracoHelper. Fixed up the HtmlTagWrapper classes so they have immutable properties and replaced
public fields with Properties.
2012-09-20 13:16:38 +07:00
Shannon Deminick
fd166389c4 Changed the MVC view class to expose the UmbracoHelper as just @Umbraco instead of @UmbracoHelper, this
follows the same naming conventions as MVC with HtmlHelper is exposed just as @Html, plus it is less to type
2012-09-20 12:47:37 +07:00
Shannon Deminick
1c040912f6 Exposes the IDocument property as CurrentDocument on the Model for MVC pages. 2012-09-13 12:28:08 +07:00
Shannon Deminick
5e9d791523 Moved the DocumentNotFoundHandler to diff namespace, created new NoTemplateHandler and updated the engine
to route to it when no template is selected and when there are no hijacked routes.
2012-09-07 08:28:18 +07:00
Shannon Deminick
c3747d70ce Added ObjectExtensionsTests, Added functionality for MVC to render any macro types (i.e. razor and xslt, etc..)
Adds UmbracoHelper as a property to the RenderViewPage for MVC. Tested rendering Xslt and Razor macros with and
without parameters and works well.
Next we need to get the RTE rendering with macros embedded in MVC.
2012-09-03 07:54:09 +07:00
Shannon Deminick
b511ae3a1a Created new LookupByIdQuery ILookup which is now the first thing that is looked up. Have cleaned up
all of the default.aspx stuff so that no routing logic takes place there, all routing logic now takes
place entirely in the module.
2012-08-30 08:26:01 +07:00