DisplayWecpofUI() missing - mdriven

I tried the example in the CapableObjects document "Doing MVC with CapableObjects – a white paper in 4 parts" (http://www.new.capableobjects.com/xdownloads/Doing%20MVC%20with%20CapableObjects.pdf).
Most of it worked as described, but when I came to part 3 I could not modify the file Edit.cshtml. "#Html.DisplayWecpofUI()" causes an error.
EDIT: I searched for „DisplayWecpofUI“ in the Object Explorer... it doesn’t exist...
What am I missing here?

Wecpof enclosed the whole application including the main menu. This has subsequently been redesigned and is now part of the MDriven Turnkey product offering.
With MDriven Turnkey you provide model at the minimum. The Viewmodels in the model may be tagged as MVC or angular. You can inject your own model based code into turnkey with codedress, and styles and fashion with css and view overrides.

Related

Delphi: How to structure multi-device application with native controls?

or "How to decouple UI from business logic in Delphi?"
Each target platform has its own set of native firemonkey controls (Windows=VCL, MacOS=TMS mCL, Android=D.P.F, iOS=TMS iCL and D.P.F). The new FireUI (multi-device form designer) is a great solution for styled components, but not for native components because it still requires the same component on the master pane to support all platforms. As you cannot mix them on the same form, it completely breaks the whole idea with Delphi.
A lot of developers would say that Delphi is the broken approach, see "Why FireMonkey is so fundamentally wrong in every aspect". However, the premise for this question is NOT to argue against Delphi, but to get the best results out of what it does offer.
The conclusion is then that for each form in your application you have to make a separate form for each target platform. This leads to these questions:
Challenge 1: How to include different form files in your project depending on your target platform?
Solution 1: include all of them, i.e. MainForm_IOS.pas, MainForm_Android.pas, MainForm_Win, MainForm_OSX.pas, and then use compiler directives inside the files, so only the content of one of the files is active. Disadvantage: a large application can have many forms (we have around 40), so we are talking about a large number of included files.
Solution 2: Do not include them in the project, but instead just place them in seperate folders. Then you can add the matching folder to the search path for each target platform. Disadvantage: They will not show up in the Project Manager, so it will slow down the workflow every time you need to find a file.
Solution 3: Create a project for each target platform. Disadvantage: Every time you add new units or change common project settings you have to (remember to) apply it to all projects.
Update: As suggested in the Malcom Groves video, placing all the business logic in a package will remove the disadvantage from Solution 3. So I consider solution 3 as the best approach.
Challenge 2: How to connect the different device forms to the (same) business logic?
Possible solution: Create a "Helper" class that contains all the code you would normally have in the form unit.
Update: This "Helper class" is actually what the MVVM calls a ViewModel. What I need seem to be a MVVM framework that can support the databinding. I have made another question about that.
Any input and suggestions about best practice are welcome.
For challenge 1:
You can conditionally link in your FireMonkey form resources depending on the compile target:
{$R *.Windows.fmx MSWINDOWS}
{$R *.Macintosh.fmx _MACOS}
etc.
This is excatly what the XE7 Multiview designer does, but I see nothing against using this mechanism to link whole form files conditionally in to your executable. Of course you might also want to ifdef the corresponding units in your project file.
For challenge 2: Just use some form of Model View Controler logic. So your platform dependant forms will talk to a platform independant controler.

Is my thinking about mvvm right?

I'm having a little bit of a hard time getting into mvvm. I'm writing a simple app, Notebook. I have one viewmodel, it's name is actually ViewModel. It has an ObservableCollection of Notes inside and methods to save and load those from Isolated Storage. My only Model is Note.cs, it implements INotifyPropertyChanged and I'm of course RaisingPropertyChanged.
I've also got two view, both of them are user controls. One to display list of notes and one to edit the one chosen from the list.
My questions are:
Where do I create an instance of my vievmodel?
How should I implement going from the page with list of notes to the page with detailed view after choosing one Note to edit? At the
moment I'm saving the index of Note in App.xaml.cs, going to the next page and setting
the DetailedView DataContext to the right Note in OnNavigatedTo, but
I don't think it's actually the perfect solution.
Where should I save my Notes? I guess Application_Closing in App.xaml.cs is the right place to do it, but I'd have to have my viewmodel as a global object there, is this the right approach?
Additional question:
I have to add possibility to group notes. I guess that class Group with dictionary (GroupName, howManyNotes) is going to be allright since I don't have to be able to for example write all notes from selected group. Do you think there's a better approach I should think about?
Thanks for respones,
Michał.
I would suggest you take a look at Calibrun.Micro which is a great framework for MVVM. You can get some sample from the CodePlex.
I have used that in a bunch of Project, and will give you flexibility in case if your project grows in size.
Google for Caliburn.Micro sample and you will find a number of sample for all technologies like WPF, Silverlight, Windows Store, Windows Mobile.
Caliburn.Micro CodePlex

Zend Framework 2 CMS file structure

I'm trying to build a simple content management system based on the Zend Framework 2. The problem is that I don't know how should the folders structure be like.
Until now I have to solutions in mind:
A. Building a general "Admin" module that has multiple controllers like Login Controller, Pages Controller, Posts Controller, each of this controller with his own actions.
B. Building an module for each component, like: Pages Module that has an adminController an an frontendController.
I'm sure that none of the above solution is the corect one, but couldn't find any solid solution or books to provide one. I've taken a look at gotCMS but noticed that this one i.e, saves all the data like layout views in the database, and this is not a solution.
Though it's a very first alpha solution, I work on ensemble which is what I'd rather call a content management framework.
Ensemble's admin runs on ZfcAdmin. So you can drop in a Blog module which just has a admin controller under ZfcAdmin's route. But you can also manage pages (like texts) with a navigational page structure. All content parts (text, blog, etc) are separate modules.
So I'd suggest you take a look at the sample application and you can check out our blog as well, which just hooks in into ensemble. I know currently the documentation is scarce, but if we reach kinda beta stability we will focus more on docs.
The main benefits for "your system B" is you can drop in modules when needed. They all provide their own config, controllers, models and views. It's easy to install them from a developers perspective (load in composer, enable in application config) and you can easily override any view with your own ones.
TL;DR: choose structure B and have a look at Ensemble.
/edit: seeing you comment on Sam's answer: yes you have to do that. In ensemble, you specify a route config for the frontend and create your admin routes as child routes of ZfcAdmin. For both the frontend as the backend you have separate controllers.
There is no right or wrong when it comes to building something new. Personally I'd go with B. I wouldn't even name the Controllers like you did (I'd break them down a lot more, like NewsAddController, NewsEditController, NewsDetailsController, etc...). Then I'd have an AdminModule that would simply display a new Layout with a specific "AdminNavigation". This AdminNavigation can be filled via the other Modules (i.e. NewsModule would inject it's own administrative Routes into the AdminNavigation via module.config.php)

What separates a content management system from just a bunch of web pages?

I have a website that has related pages. They have links that point back and forth to one another but I have no integrated system, nor do I know what that would mean.
What is the minimum code that a group of web pages must have to be considered a Content Management System (CMS). Is it that all the settings are in the database and the pages are generated somehow? Is there some small snippet that all my pages could share that makes them a CMS, database or not?
Thanks. I was also hoping not to have to study a giant CMS to see what makes it a CMS . After maybe a basic understanding I would know what I was looking for.
edit: here's why I ask about code. Whenever I have looked at a CMS, and maybe they aren't all the same, I saw that to develop a module you always had to inherit from certain classes and had some necessary code. I didn't know if there was some magic model that I just don't get that all cms makers understand.
edit: perhaps my question is more about being extendable or pluggable. What would a minimum look like? Is it possible to show that here?
edit: how about this? Is something a CMS if it is not extendable and/or pluggable?
I think this is really impossible to say. We all manage content. The "system" is just whatever mechanism you use to do so(dragging and dropping in Explorer or committing content changes via a SQL query). To say there is a minimum amount of code needed really isn't indicative. What is indicative is how often you find yourself making mistakes and how easy it is for a given user of a given skill level and knowledge to execute the functions in the designed system. That tells you the quality/degree of what you have in place being worthy of being called a "CMS."
Simply put a CMS is an application that allows the user to publish and edit existing web content.
In response to the edit:
A "good" CMS allows of extensibility. By using inheritence you can extend the functionality of a CMS outside of the core components provided. That's the magic.
About Extensibility:
Depending on the language/framework you want to build your CMS with, you can load pages or controls(ASP.NET) using command built into the framework. Typically what is being done is a parent class/interface is being defined that forces an module that is to be developed to follow some given standards:
Public MustInherit Class CMSModule
'Here you will define properties and functions that need to be global to all modules being developed to extend your CMS.
public property ModuleName as string
End Class
public class PlugInFooCMSPage
inherits CMSModule
end class
Then it's just a matter of simply loading a module dynamically in whatever construct a given language/framework provides.
Ultimately, a CMS is a system that lets you manage content, so it needs an user interface that is dedicated to letting you easily create, edit and delete pages on your website.
However, it's fairly usual to expect from a CMS to provide a browser-based WYSIWYG page editor, file uploading, image resizing, url rewriting, page categories and tags, user accounts (editor, moderator, administrator), and some kind of templae system.
Without dragging you into a theoretical explanation of what a CMS is and what it's not, perhaps some tutorials on the building methodology of a CMS will help you better understand.
http://css-tricks.com/php-for-beginners-building-your-first-simple-cms/
http://www.intranetjournal.com/php-cms/
A Content Management System is a System that Manages Content. :)
So if you got many pages that share the same layout, you can create a system that stores the content into a database and when a page is requested, it gets that content, merges it with a template that contains the page header, menu, etc.. and outputs the result.
The basis idea is that you don't want to copy HTML pages, and have to edit hundreds of them when you want to change your layout.
Such a system can be very complex, featuring wysiwyg editors, toolbars, version control, multiple user publishing and much more, but it could be as simple as a single page behind a standard loging, that contains only an input field for the title and a textarea in which you type the html content.

Useful Silverlight class library with reference to .NET class library

I'd like to develope simple set of controls to display many sort of data and be useful in normal silverlight application and can be used in ASP.NET MVC2 application. Right now i have no idea how to link those tehnologies, but this isn't my concern right now - i just heard it is possible and i'll find out how to do that...
Right now i'd like to know how can i use my Model's classes in such SIlverlight class library. I've generated POCO classes in EF4.0 for ASP.NET MVC2 application. Everything works great, but now i'd like to use some of those classes - create silverlight's controls, some ViewModel classes and fill my controls with data passed from my Model, used in ASP.MVC's app, through ViewModel.
Everything should be tested in any simple silverlight's app and at the end i'd like to be able use this class library in silverlight app and in ASP.MVC 2 website...
Silverlight it's own runtime and in general you cannot mix normal .NET assemblies and Silverlight assemblies.
However, one option is to share the source code by linking the same source file to two projects that compile to the different runtimes.
Another option is to use WCF RIA Services where Visual Studio will code generate your model classes in the Silverlight project and there are also options for sharing code between tiers. You will also get a service to operate on the objects from Silverlight. The service can be built on top of EF4.0 with very little code.
Finally, Silverlight 4 and .NET 4 are in some cases able to share assemblies if certain criteria are met. See Stack Overflow question named Silverlight 4 Assembly Sharing Problem.
What you need to do is use shared code.
you do this by adding an existing file to a project. In the add file dialog there is a arrow on the button that exposes the add as link option.
the point of this is that you cna have 2 projects which target the different CLR's but contain the same code and namespace references ... you can leverage these to have code that works on both versions of the CLR very simply.
Its really quite powerful. I have one set of tests that can target both versions.
Of course you are limited to the set of common functionality but that is implicitly part of your requirements anyway.
You cna even pass the objects over a service and have them deserialise nicley into the other CLR. Kinda suprising how well you can use the symetry
I am currently using this for aproject and am achieving what you want and after a few hours of playing with really suprisingly painless.
regards