User Name
Password
AppleNova Forums » Programmer's Nook »

The AppleNova CMS Project


Register Members List Calendar Search FAQ Posting Guidelines
The AppleNova CMS Project
Thread Tools
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2005-12-07, 16:33

OK, the votes are in and there are at least 14 people who think a CMS is a good idea and might be able to contribute. For those of you that don't know PHP or MySQL, do not worry - there is plenty to do before we even start to write any code! For those who don't think a CMS is a good idea, also do not worry - is nothing stopping us having more than one AppleNova project!

What is a CMS?
Well, basically, its a series of web pages that enable you to change the content of a website. If you have used bogging software such as Wordpress or Moveable Type, you have used a CMS. Infact, you are already using one as vBulletin can be thought of as a CMS. Not to worry too much though, we are not going to dive right in and start to reprogram these forums! We will be starting with something a bit less complicated.

The Idea
If you can imagine your average web page consisting of a set of "modules". At the top we have a "title module" which shows the main logo image and speedholes. Then perhaps a "navigation module" which shows the links, a "news" module that will show news headlines, etc.

So before we even think about how to manage a news article system, or a gallery, or a blog - we have to decide how we are going to manage the task of creating pages, and assigning these modules to specific areas of a page. Naturally, we are not going to allow any old Joe to come along and start messing with our modules are we? So all this has to be tied to an authentication system, usernames, passwords and permissions. Yummy!

The Plan
In my eyes, what we need first is to develop what I am going to call the Core API. (Or perhaps we should call it Core Nova to go with Core Audio and Core Video? ). This Core API will provide all the services needed for a module to perform its tasks. For example, a module will not have to check cookies, usernames and passwords against a database - the API will simply provide "IsAuthorized()" and "hasPermission()" services.

So here is what services I think the Core API needs to provide:-
  • Session management - remembering logged in users, and "state" between requests.
  • Authorisation - Managing usernames, passwords and permissions.
  • Pages - Creating and managing pages and which modules appear where on each page.
  • Security - This will be a tough one!
  • Output - Combining all the output for a specific page and rendering it using templates and style sheets!

What you think?

OK, I have given up keeping this sig up to date. Lets just say I'm the guy that installs every latest version as soon as its available!
  quote
atomicbartbeans
reticulating your mom
 
Join Date: Jan 2005
Send a message via AIM to atomicbartbeans  
2005-12-07, 17:22

I think it's a great idea.

Although I'm no programmer, I could sure use something like this.
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2005-12-07, 17:54

Sounds great. I'd contribute what I could. Mostly bug testing, I'd imagine.
  quote
ahdustin
New Member
 
Join Date: Nov 2005
 
2005-12-07, 18:07

Very nice, I am willing to join. 2 things. What is going to make this different than php-nuke, mambo, etc. And the other thing is that we should probably get an official list of core developers and create a wiki, for this type of discussion on the project.
  quote
rollercoaster375
Senior Member
 
Join Date: Mar 2005
Location: UIllinois (Champaign, IL)
Send a message via AIM to rollercoaster375 Send a message via MSN to rollercoaster375 Send a message via Yahoo to rollercoaster375 Send a message via Skype™ to rollercoaster375 
2005-12-07, 18:08

Heh... I'm already a lead developer in a similar project, and it sounds like this one will be extremely similar, so I'm afraid the most I'll be contributing are bug fixes.
  quote
Yontsey
*AD SPACE FOR SALE*
 
Join Date: Apr 2005
Location: Cleveland-ish, OH
 
2005-12-07, 18:27

I'll lend a hand anywhere I can even though as far as programing go I have little to no ability.
  quote
faramirtook
A for effort.
 
Join Date: Nov 2004
Location: New Jersey
 
2005-12-07, 19:07

I'll help however I can too, but I know nothing of programming that could be remotely useful.
  quote
Batman
Senior Member
 
Join Date: Jun 2005
Location: Iowa
 
2005-12-07, 20:34

Sweetness! I'm in! PHP, MySQL, CSS, and Graphic Design are my specialties.
  quote
AsLan^
Not a tame lion...
 
Join Date: May 2004
Location: Narnia
 
2005-12-07, 20:43

Quote:
Originally Posted by Gargoyle
The Plan
In my eyes, what we need first is to develop what I am going to call the Core API. (Or perhaps we should call it Core Nova to go with Core Audio and Core Video? ). This Core API will provide all the services needed for a module to perform its tasks. For example, a module will not have to check cookies, usernames and passwords against a database - the API will simply provide "IsAuthorized()" and "hasPermission()" services.

So here is what services I think the Core API needs to provide:-
  • Session management - remembering logged in users, and "state" between requests.
  • Authorisation - Managing usernames, passwords and permissions.
  • Pages - Creating and managing pages and which modules appear where on each page.
  • Security - This will be a tough one!
  • Output - Combining all the output for a specific page and rendering it using templates and style sheets!

What you think?
Do you already have an outline of the individual functions you are planning or is that what we are hashing out now ?
  quote
Batman
Senior Member
 
Join Date: Jun 2005
Location: Iowa
 
2005-12-07, 20:50

Quote:
Originally Posted by Gargoyle
---snip---
What is a CMS?
Well, basically, its a series of web pages that enable you to change the content of a website. If you have used bogging software such as Wordpress or Moveable Type, you have used a CMS. Infact, you are already using one as vBulletin can be thought of as a CMS. Not to worry too much though, we are not going to dive right in and start to reprogram these forums! We will be starting with something a bit less complicated.
---snip---
Hopefully our CMS won't be bogging the user down
  quote
Ryan
Veteran Member
 
Join Date: May 2004
Location: Promise Land of Trustafarians
 
2005-12-10, 18:43

I can help with HTML and CSS. I know just enough PHP to edit config files, so I'm no help there.
  quote
ShadowOfGed
Travels via TARDIS
 
Join Date: Aug 2005
Location: Earthsea
 
2005-12-10, 21:15

Quote:
Originally Posted by Gargoyle
So here is what services I think the Core API needs to provide:-
  • Session management - remembering logged in users, and "state" between requests.
  • Authorisation - Managing usernames, passwords and permissions.
  • Pages - Creating and managing pages and which modules appear where on each page.
  • Security - This will be a tough one!
  • Output - Combining all the output for a specific page and rendering it using templates and style sheets!

What do you think?
Edit and emphasis mine.

I was thinking more about an object-oriented approach, where individual object need not know about the intricacies of security.

The reason I brought up aspects was because they would be useful to perform security checks before entering function calls to object to do various things. Obviously the system would be designed around having objects to store data, and views and controllers to manipulate them. The APIs on the views and controllers would be such that another aspect could wrap the function calls and know exactly what the user is trying to do, and run any necessary security checks first.

This way, neither our modules nor third-party modules need to write (possibly insecure) security checks into their code, and it provides the option of having security disabled, if anyone were ever to be that brazen and/or stupid.

Since PHP doesn't support true aspects, the only way to do this is to require that operations in the view and controller classes expliclty make calls before entering, and before exiting. I already have fleshed out some PHP for this, with a database on the back, so code can dynamically register callbacks that way.

OK, so here's a brief outline of some of the specs I hashed out for my project that never quite got going. We can take what we want, and leave what we don't.

Content:
  • Each object maps to a specific module which will handle its data. There will be view and controller classes to handle display and modification, etc.
  • Objects will be organized in many-to-many relationships, because there are legitimate cases where you'd want one object to appear in multiple places, such as assigning categories to a news story.
  • Several different methods to that organization: objects can simply be children, as in news story comments, they can be conatined, as an image in an article, or they can be attached, as we have attachments here.
  • All objects will have timestamps for: creation time, modification time, and an arbitrary "time" field, which may be set by individual modules as they see fit.
  • Objects can have properties; think of properties as a kind of resource fork (as I understand them), where addon modules can add information to another module's object without knowing anything about the specific datastructure thereof.
  • Objects can be marked as "locked" to prevent deletion of critical objects.

Properties:
  • Need to be carefully distinguished from object data, security permissions would be a property, that need to apply to any kind of object. Post content belongs in a table, as it should always be tied to a specific object.
  • Are organized into the following tiers:
    • Hard-coded defaults
    • System defaults
    • Type- or module-specific (terms are essentially interchangeable)
    • Object-specific
    • User-specific
  • Are resolved in the following manner, for maximum flexibility:
    1. Look in the scope for user preferences.
    2. Look in the scope for this object and anscestors in the current path. Since a many-to-many relationship may have multiple paths down to a single object, these are resolved up through the current stack, to always have a known path.
    3. Look in the scope for this object's type and the types of parent objects. Same path rules apply as above.
    4. Look at the system defaults scope.
    5. Look at hard-coded defaults.
  • Properties may be inherited from parent objects, so (for example) security restrictions don't have to be manually duplicated for each new object.
    • Inheritable: Let child objects inherit a given property.
    • InheritForce: Force child objects to inherit a given property, even if that object already has one by the same name defined.
    • InheritCancel: Do not allow inheritance to be forced on this object. (For rare exceptions.)
  • Properties will have a value, which is always a string literal. It may be converted later to an integer in PHP if needed. If the property is set to NULL in the database, this is interpreted to mean that the system-wide default should be applied here.

Modules:
  • Each object type maps to a module.
  • Can be enabled an disabled, to reveal/hide associated content, among other uses, surely.
  • Can't practically be deleted without destroying all associated data. This could use some work.
  • Can be marked as "system" to prevent someone from accidentally pulling a stupid and disabling it.

Hooks/Aspects:
  • Code will execute a "hook" callback at appropriate integration points in the code. At a basic level, when placed at the beginning and end of functions, this allows aspects to be wrapped around a function.
  • Tracked in the database, for lack of anything better.
  • Are weighted, to make sure hooks are always called in a consistent, predictable order.

There's a lot more I could discuss about this; I want the central code to be nothing more than a framework on which nearly anything could be built. The heart of the CMS would actually be the core modules we produce to go with this framework, but if someone wanted, they could rip those out and use it for something else.

I think there are some powerful ideas here, but some are very demanding on database resources, so it either needs optimization or a better language—which is why I mentioned python before, since aspects can be done natively in Python, incurring no extra DB overhead, which is likely a huge problem with my PHP methods for now.

I do HTML, CSS, and all that. But I have a lot more fun doing systems programming. Feedback on this model would be great!


Apparently I call the cops when I see people litter.
  quote
rollercoaster375
Senior Member
 
Join Date: Mar 2005
Location: UIllinois (Champaign, IL)
Send a message via AIM to rollercoaster375 Send a message via MSN to rollercoaster375 Send a message via Yahoo to rollercoaster375 Send a message via Skype™ to rollercoaster375 
2005-12-10, 21:57

First decision for you: PHP4, or PHP5? PHP5 has great object features (I know from experience, it's been pleasant so far developing a Blog system with it), but also a low install base.
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2005-12-11, 06:12

Ged, every time I read one of your posts I am left completely confused!
  quote
ShadowOfGed
Travels via TARDIS
 
Join Date: Aug 2005
Location: Earthsea
 
2005-12-12, 12:23

Quote:
Originally Posted by Gargoyle
Ged, every time I read one of your posts I am left completely confused!


It's what happens when I try to put out a ton of information all at once. I guess it's all too much jargon; it makes sense in my head, but I have this terrible tendency of confusing other people when I try to put it in words.

I'll see what I can do at home to tidy up my ideas and put them in a more presentable format. Maybe it'd be an excuse to try my hand at Keynote.

Apparently I call the cops when I see people litter.

Last edited by ShadowOfGed : 2005-12-12 at 12:24. Reason: Fhqwgads
  quote
ShadowOfGed
Travels via TARDIS
 
Join Date: Aug 2005
Location: Earthsea
 
2005-12-14, 16:17

OK, so I threw together a base class to let us do some stuff. Here's a preliminary link to the source, just so you can peruse it.

http://dev.ged.dynodns.net/CNBase.phps

Take a look, see if it makes any sense. I'm not finished with it, but it's a start.

Apparently I call the cops when I see people litter.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2005-12-14, 17:33

Quote:
Originally Posted by rollercoaster375
First decision for you: PHP4, or PHP5?
If it's ever going to be used here, PHP4.
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2005-12-15, 06:05

Ged, I understand what your trying to do, but it's way too complicated. Perhaps something like this could be used in the future, but not for this version.
  quote
ShadowOfGed
Travels via TARDIS
 
Join Date: Aug 2005
Location: Earthsea
 
2005-12-15, 15:16

Quote:
Originally Posted by Gargoyle
Ged, I understand what your trying to do, but it's way too complicated. Perhaps something like this could be used in the future, but not for this version.
Really? It doesn't seem like stacking modules on top of that would be difficult at all; that class is the most complex part of the entire setup.

Past that, you just create your object normally, a la:

Code:
class CNForum extends CNBase { } class CNForum_Impl extends CNBase_Impl { public $myVar; function CNConstruct() { parent::CNConstruct(); } function CNDestruct() { parent::CNDestruct(); } function doSomethingElse() { // Some code goes here } function create() { $this->doSomethingElse(); // Calls doSomethingElse(), but no hooks are run $this->realObj->doSomethingElse(); // This allows hooks to be executed. $testA = $this->myVar; // Getter hooks ignored $testB = $this->realObj->myVar; // Run getter hooks $this->myVar = $testB; // Setter hooks ignored $this->realObj->myVar = $testA; // Run setter hooks } }
I thought it was nice because that single class allows this behavior to work seamlessly, with hardly any extra effort on the behalf of module developers. Is there some complexity I'm missing, or did I just not explain it well enough in the first place?

But that'd be a working example. Does that change your comments at all?

Apparently I call the cops when I see people litter.
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2005-12-15, 18:11

Well, what I have already done is create a "base" set of classes that make up the "system". This system is responsible for loading the developed modules and calling specific methods in each module so that they can do their work.

So this already has a "master" controller type situation.

Both rely on the module code being checked for maximum security and we still need a controller like the one I have already started to write so I don't see the point in adding this extra level of complexity.

OK, I have given up keeping this sig up to date. Lets just say I'm the guy that installs every latest version as soon as its available!
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
An applenova members project ? AsLan^ Programmer's Nook 57 2005-12-01 13:40
What is "aspect-oriented programming" and why should I care? ast3r3x Programmer's Nook 25 2005-12-01 13:14
AppleNova Chat - RFN! murbot Speculation and Rumors 46 2005-01-11 12:35
New Apple User: Project Management Tool? abilstein Apple Products 3 2005-01-05 23:31
Love the tri-color AppleNova logo Escher Feedback 11 2004-07-05 15:49


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 10:59.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova