RE: ORM Functionality and Entry/Content Creation

Zach, I’m not sure if Luis has any UML diagrams for the ContentBox domain objects or not. ContentBox uses the Hibernate ORM that is baked into CF. I’d recommend reading up on how it works.

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSD628ADC4-A5F7-4079-99E0-FD725BE9B4BD.html

Basically, in each model object, CF uses the properties declared in the component to define the properties and relationships of each Entity.

ColdBox also has some handy ORM services built on top of the native CF ORM that you can read about here:

http://wiki.coldbox.org/wiki/Extras:CFORM.cfm

Regarding the numberOfEntries property in the Author object, that is a calculated property defined by the following line:

property name=“numberOfEntries” formula=“select count(*) from cb_content as content where content.FK_authorID=authorID and content.contentType=‘entry’”;

https://github.com/Ortus-Solutions/ContentBox/blob/master/modules/contentbox/model/security/Author.cfc

As far as what your specific question is, I’m not quite sure I’m following. Can you unpack it a little more?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I think I realized that after I posted this question. The only issue is that the entries in the content table are not receiving the authorID. So when this property is called for an entry count, the return is 0. It appears that when a content item is created, entry specifically, the authorID is only inserted into the contentversion table and not the content table. modules/contentbox-admin/handlers/entries.cfc only defines ‘addNew’ for contentversion. The result is on the ‘Manage Users’ screen, no entries are listed under the author, which makes it difficult to determine if the author has entries when deleting an author.

Let me know if this helps at all.

Zach

Thanks. Maybe we can connect via connect online?

Sure, just let me know what I need to do. I’m not sure what connect online is.

Is there a way you can show me online, I can send you a Adobe Connect URL, so you can poke around and we can discuss this. How about later on today. Add me via gmail

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

That will work. I just sent an invitation via gmail.

Luis,

Let me know if you still would like to work on this with me. I am available this afternoon and evening.