How to modify/extend core features without touching core code

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/5/2009 1:01:30 PM
Gravatar
Total Posts 6
If at first you don't succeed... it's likely that you missed something minor. Like an '=' that should have been an '=='. I always do that!

How to modify/extend core features without touching core code

I am in the initial stages of assessing mojoPortal for use in a new project. There are several core features that we may need to alter, but for obvious reasons I do not want to actually change the mojo core.

I'll give you an example. The current behavior in mp when a page is deleted, is that its deleted. Gonzo. Never coming back. What we require is more of a recycle bin, where deleted items can still be seen in the PageTree (in red italic font or something) and then can be restored.

I have only just begun looking into the mojo src, and first of all I'd like to say that I love the N-tier OO design. But, how is it possible for me to extend/modify behavior such as this without touching core code.

I noticed that you provide events for things like user's logging in or creating pages. How hard is it to add these events? It might be a start if there were a page/content deleted event. This way I could move the item to a my_recycleBin table before it gets deleted.

Of course then I have to modify the way the PageTree retrieves a list of pages.

Is my only recourse to create my own custom PageTree? Can I hide core Admin pages?

Thanks.


8/5/2009 1:25:08 PM
Gravatar
Total Posts 18439

Re: How to modify/extend core features without touching core code

Hi Mike,

The way to get changes into the core is to work with me. I am amenable to changes in the core that everyone will benefit from. I've seen this kind of functionality in other CMS systems and I agree it would be nice to be able to recover deleted stuff. Currently we do have that for users where its configurable in the site settings whether users really get deleted or flagged as deleted. Given the various kinds of data that we want to be able to recover, I don't think we want a  central table for the recycle bin, but probably rather more of the same scheme on all the various tables where would would implement an isdeleted flag and filter it out from main content using this flag. So anything in any table that is flagged as isdeleted would basically mean its in the recycle bin. Emptying the recycle bin could be disabled completely in web.config or locked down by roles but there should be functionality where its possible to empty it by deleting the items flagged as isdeleted. Each table or feature hat needed to support this would proboably have to implement some provider or interface that enables browsing the stuff in the recycle bin and or restoring it depending on roles permissions.

If you or your company would be interested in sponsoring me to implement some of these things I could make it a priority and we could specify the details more. If you want to do the work yourself and can commit the changes back into the project under our contributer agreement that is also feasible but somewhat subject to my availability to review and integrate your changes. Before any core changes can be committed to trunk I have to implement the all the data layers so the build doesn't break under any of the supported dbs. 

So its really a case by case basis, if I agree the functionality you want in the core shhould go there we can work together, if not I can try to propose ways of doing it externally or consider making some changes that make it easier to do in external projects. In this particular case yes I think it should go into the core, its desireable to the community at large.

Best,

Joe

8/5/2009 1:45:49 PM
Gravatar
Total Posts 6
If at first you don't succeed... it's likely that you missed something minor. Like an '=' that should have been an '=='. I always do that!

Re: How to modify/extend core features without touching core code

Thanks for your speedy reply Joe!

I would love to be able to work this feature into the core. I'm pretty sure my boss would not be in favor of sponsoring you (although I would be). He is more of the mindset that we should make the changes to the core ourselves and put it in our own SVN respository. I've explained to him that this would disconnect us from future updates to mp, but he doesn't seem to think that's an issue.

Regardless, I will make the proposal to him and see what he says. And by "sponsoring" I'm sure you are refering to more compensation that just buying you a few beers?

Also, I agree that adding an IsDeleted field to each table is the better way to go, I was merely suggesting a way I could add the feature without altering the core schema.

Cheers!

8/5/2009 2:06:42 PM
Gravatar
Total Posts 18439

Re: How to modify/extend core features without touching core code

Yes, I do mean more than a few beers, if the requirements could be specified clearly and agreed upon I could propose a fixed bid at which I would undertake it, but without a real sponsorship I need to focus on things that are going to bring in revenue. Sponsorshhip is basically a consulting engagement where I build what you need into mojoPortal and those changes become part of the project and open source. 

I hope you can change your boss's mind. I mean you can fork the code and cut yourself off from upgrades but then I will come out with some great new functionality that you will want or there will emerge some bug or security issue that gets fixed and you will have to either fix it yourself or try to backport the fix from my repository to yours. I'm a very good developer and I'm working on mojoPortal full time, its doubtful to me that anyone will maintain a fork better than I maintain mojoPortal. I think short sightedness costs more in the long run if its an important project. It will be more expensive in the long run to have to keep porting changes from my repository to yours.

Best,

Joe

8/5/2009 2:15:44 PM
Gravatar
Total Posts 6
If at first you don't succeed... it's likely that you missed something minor. Like an '=' that should have been an '=='. I always do that!

Re: How to modify/extend core features without touching core code

Joe I couldn't agree more. I will see what I can do. Believe me, I'm working on it.

8/6/2009 7:31:13 PM
Gravatar
Total Posts 218

Re: How to modify/extend core features without touching core code

It would be kind of cool if there was a way that multiple people could pool some money together to have Joe/team build specific, requested features for mojoPortal. For example, while I may not have the resources to have Joe build a specific module just for me if a handful of us all had a similar need we could all contribute together and it might be affordable.

I wouldn't then mind if the custom work was integrated into the portal either, I figure the better the CMS the more people will use it and will stay supported. Maybe give the initial cash contributers some kind of benefit, I don't know what though. Joe may eventually get to our wish list items, but he's trying to make a living too. So if 5-10 of us put some cash together this might be one way to help everyone out.

The trick would be to have an official process and system for organizing sponsors together, pricing the job and spliting/collecting the funds. It could be as simple as static page with module ideas. You list in detail the module features and the estimated costs. Then people email you and you update the number of interested parties so people can see what the cost breakdown would be based on the current number of sponsors. After an agreeable amount of sponsors is put together you get started.

Or maybe too complex :)  But just a thought. As a lot of us are freelancers or part of small teams I'm guessing we individually don't have a lot of money to pay for custom module development.

8/7/2009 8:14:07 AM
Gravatar
Total Posts 18439

Re: How to modify/extend core features without touching core code

Hi Eric,

This is exactly why Fund Raiser Pro will be my next add on product. It kills 2 birds with one stone in that it gives me another product to sell which I desparately need to get more revenue coming in but it also gives me something I can use to better encourage and manage donations. I will be able to put a fund raiser instance on a page configured to raise money to implement a specific feature and then people could pool resoruces to prvide the needed funds to make the feature a sponsored hiogh priority.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.