Symfony as a helper for Wordpress plugin development - symfony1

I have seen several integrations between wordpress and symfony, but they are made with the goal of managins static pages content inside wordpress and symfony acting as the controller.
Wordpress plugin development api seems really basic and primitive and you have no way o code with the MVC pattern out of the box. So the big question is, what would be an starting point to create plugins in wordpress, and create admin sections in it, but using Symfony power to manage database access, form creation and validation, etc .....

I had briefly considered a similar approach for integrating Lithium with WordPress, but ran into a great deal of hurdles that made another approach seem more worthwhile: create an MVC framework that was specifically designed to work inside of WordPress.
It's not yet as full-featured as Symfony, Rails, etc, but WP MVC has similar architecture to the major MVC frameworks and should be easy to pick up if you're familiar with them. It ties in directly with existing WordPress functionality. When you create scaffolding for a resource, for example, the code that's created includes an admin controller and admin views (which look similar to WordPress's native index/add/edit views for posts), as well as the appropriate WordPress routing and a public controller and public index/show views to display the resource on the public side, within the active theme.
There's more info on it on its WordPress Plugins page, and its brief tutorial may make it seem less abstract.

Related

Integrate Umbraco in an MVC and not the other way round

I have little to no experience in Umbraco, but it has been suggested to me as I have been asked to integrate a CMS system within my existing application. I have gone through some videos how to use Umbraco and done well so far. The problem is as follows. I have an existing MVC application with custom routing but both use the same database and dll. Example: www.ngomalta.com and animalguardians.ngomalta.com
Both have same interface, but with custom routing I can load some pages on a subdomain but not in the other. I would like to implement the same 'logic' using Umbraco. That is, I want both sites to have access to umbraco but they would have different content. Please note that it may be that I would have other sub domains in the future such as tomasina.ngomalta.com, and thus I would like scalability.
I have had a look on the net and other answers. However the solutions that I found are vice versa! What I mean is, that solutions given assume that you have an Umbraco site and you want to add an MVC controller. My situation is the opposite, I have the MVC and would like to add Umbraco views. Thus I want to make Umbraco compatabile with MVC and not design an MVC solution to be compatible/integrated with Umbraco.
Currently I have implemented a class that Inherits UmbracoApplication + WebBootManagerand and which overrides the Complete function. I have also tried to use my existing custom routing class (that inherits from [RouteBase]). It looks as if they work.. but the CSS styles and javascripts are not sort of routed or I don't know. They just aren't sent to the client. hence only the HTML is sent for both Umbraco page and my existing MVC views
First of all, is my idea with Umbraco possible?
If yes, can someone guide me some site that implements Umbraco in an existing (LIVE) MVC application and not the other way round? many of the tutorials that exist always start from a blank MVC application and build on that. I don't want such tutorials. I need a tutorial, that shows how an existing MVC application with already-existing-controllers that tries to integrate Umbraco.
Thanks for reading people..
!

Concept of engine or mountable engine in Grails?

In rails there seems to be a quite popular concept of engines even for things that are not stand-alone plugins but rather tiny contained web apps running in a web application.
I know grails has plugins the supplement the main application but I am wondering if grails can have sub-applications. For example you have a main application but then want a forum sub-application that simply uses the auth & auth models from the main application so that it does not need its own.
Is there any documentation or some basic concept tutorials on the engine concept for Grails?
Essentially I want to have a small main application that deals with auth & auth and some management but get all my other features to be sub-applications like splitting out forum, news, store, blog, etc but that all rely on the auth & auth of the main application. (making for a more modular grails app)
Thanks
Grails plugins are conceptually very similar to Rails Engines. The Grails plugin system can certainly be used to create a reusable component as you describe. You can embed all kinds of functionality into a Grails plugin including domain classes, controllers, UrlMappings, and views -- most things you would put into an application can be put into a plugin and it will be merged into whatever applications use that plugin.
There is a somewhat old blog post describing this approach here. The Grails user guide also has a detailed chapter on plugins.

Backbone.js and rails Code organization

I am working on a app that has multiple types of users, each user has a separate view when they are logged in. for example a business type user will create his profile upload photos etc, create some other stuff. and then the content created by businesses is visible public on the web-app's landing page.
I am using backbone on the client side, but the whole web app isn't all backbone, the business management area is a separate part which a backbone app runs on the client side, and now I am looking to start on the public landing page, I am confused on how to make this work, should I create a new backbone app for this page, or stuff more views models and collections into the same app?
The urls of both pages differ one is like whatever.com/business and the landing page is at whatever.com
Many views and models from the business side are the same as needed on the public landing page. But I can't think of a good solution on how to organize this.
Has any one worked on something like this before. Any insights ?
Thanks
Backbone.js is a great MVC framework but there isn't a whole lot of convention around organising a large application. You need to be familiar with some good design patterns to get the most out of it or it quickly gets messy.
I was looking at AMD earlier. It looks nice:
http://backbonetutorials.com/organizing-backbone-using-modules/
THis might help too:
http://ricostacruz.com/backbone-patterns/
I also enjoyed this rule book on designing a good API. It was only $8 on my kindle!
http://www.amazon.com/REST-API-Design-Rulebook-ebook/dp/B005XE5A7Q
Edit: I recently refactored a large backbone.js application. I found it a lot easier to build if I exploited Javascript event driven architecture.
There are two excellent (pro) Railscasts on this topic, #323 Backbone on Rails Part 1 and #325 Backbone on Rails Part 2, unfortunately they are behind a paywall, but the money is worth it. Ryan uses the backbone-on-rails gem to facilitate the integration of Backbone into Rails.
It is recommendable to do the whole MVC processing either in Rails (mainly in the backend, with a bit of Ajax and without any Backbone) or in Backbone (mainly in the frontend, using Rails only as a storage engine). Selecting Backbone or similar MVC JS frameworks like ember.js is useful if your application consists mainly of Javascript or JQuery calls, or if you want to do realtime web apps and live page updates. Since it is not sure if MVC Javascript frameworks are really technically mature yet, I would recommend to stick with pure Rails if you do not trust that Backbone can handle all your requirements.
An interesting idea for a general architecture is to use a JSON API as a connection between Rails backend and JS MVC frontend, which means the backend can push the same JSON to the webpage as it does to the iOS and Android apps.

Merging Orchard CMS with custom MVC ecommerce site

I have a large custom ecommerce engine that is currently using a SQL Server database (stored procedures handling most data tasks), a WCF middle-tier (handling business logic), and an MVC front-end site (that has no knowledge of any database). Our need for a content management system is increasing rapidly and I'm trying to figure out the best way to implement one, considering our very taxed development resources.
My first thought it to simply have two websites, an Orchard CMS site and our e-commerce site. I could setup some type of request routing that would send URLs for catalog browsing and cart functions to the ecommerce site, while other URLs get handled by the Orchard site. I would have to have a couple of modules (or widgets) built within the Orchard site that would display things like the cart summary that appears in the heading of each page. This seems like the easiest method of handling this, even if it is short-term.
My other thought is to have the site completely built using Orchard. This would require porting our ecommerce logic into modules. This seems like it would be one hell of a task. All of our work is done via web services, so if a user goes to a specific category URL, the site would call a web service and pass some variables (customer ID, category, etc). The web service would return the categories, products and prices for that customer - which would then be displayed on the screen.
Lastly, an even more complex version of the last option would be to actually store the products in Orchard, so that editable fields (description, meta tags, etc) would be managed through the Orchard CMS. This would require major changes to (or absorption of) our WCF middle-tier. This seems like it would be almost impossible, but may allow better handling of more media down the road (photos, videos, MSDS sheets, product literature, etc).
What are your thoughts so far, between these three models.
You can create a simple Orchard module that is a lot like an area in an MVC project. It uses controllers and views and is easy to do if you're familiar with MVC. You don't need to integrate it very heavily with Orchard if you don't want too. Your module's content would be in a folder and Orchard would manage the rest of the site's content.
To make the pages in your module use the orchard theme from the site you just need to add the [Themed] filter to your controller.
The hello world example in the Orchard Documentation shows you how to do this.
This would be the easiest option, but there would be benefits if you decided to store the products as Orchard content items. It would be more difficult to get there, but you'd be able to take advantage of other Orchard modules and add content parts like tags, comments and reviews to your products.

ASP.NET cms and display template - 2 projects or just 1?

This is a ASP.NET MVC beginner question (I'm in phase of developing NerdDinner)... I have assignment to create ASP.NET MVC cms (with its own design) and portal (also with its own design) that will display data that's being handled by CMS. I was wondering if I will have to make two individual projects in Visual Studio or I will have to use one project and place portal section in specific folder.
I know that my question is a bit premature (according to fact that I still haven't finished tutorial) but I'm bit impatient :)
On server (commercial hosting) I would use only one hosting account... this thing with URL routing is a bit confusing to me, CMS is practically also optimized for SEO.
I would like to the structure of URL to be:
---- PORTAL ----
www.domain.com
www.domain.com/Menu1/Submenu1
www.domain.com/Menu2/Submenu1/SubSubmenu1...
etc.
---- CMS ----
www.domain.com/CMS
www.domain.com/CMS/Whatever
Thanks,
Ile
It all depends on the functionality of the portal and the MVC cms.
For starters I would have a separate solution for the Model/Data Access that way you can have as many MVC projects without duplicating your data access.
From your desired url structure I would probably have the CMS as a separate controller and sub folder. Alternatively if your using MVC 2 you could look at the areas support which will probably give you a little more flexibility.
If you want the solution to be a bit more complex/flexible you have a number of options:
If both the portal and MVC cms are going to have he same functionality and page layout you have two master pages and determine which mater page to show when returning the view. You would specify this in the routing so multiple routes would point to different controllers.
If the layout/functionality differs slightly but one controller can still manage both you could have a separate controller project and two mvc projects which only contains the views, javascript and images so both mvc solutions look at your controller solution. With this option you would probable end up setting up two websites on your domain one under the root and the other under the CMS folder (in your MVC app you will prob need to block routes to /CMS so it will be processed by your CMS app).
Finally if both differ hugely have two separate projects but keep your common data access project, as above you may need to set up two sites on your hosting package.

Resources