[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bricolage-general
Subject:    Re: question about Bric Widgets
From:       "David E. Wheeler" <david () kineticode ! com>
Date:       2006-08-31 16:45:24
Message-ID: 099D6FEE-2B03-4144-B4EC-D72C234FC5ED () kineticode ! com
[Download RAW message or body]

On Aug 30, 2006, at 23:19, Beaudet, David P. wrote:

> So, I built a crazy, dojo-based pop-up that allows users to enter  
> custom or recurring schedules, define blackouts and cancellations  
> for an event, and then generates some XML to represent it all.

Nice.

> I'd like to extend my 1.10.2 Bric to create a new "native" field  
> type called "schedule" which results in this widget being popped up  
> when the user hits the edit button for a Bric field of this type  
> and then consumes the generated XML and stores it as a field in the  
> Bric database.

Ooh. That's an interesting idea. Can you describe a bit more about  
how the widget works, and what kind of data needs to be stored in the  
database?

The code you need to modify is, unfortunately, some if the hairiest  
in Bricolage. UI widgets are in comp/widgets/profile/ 
displayFormElement.mc. They are arranged in a hash, where the keys  
are the widget names. See, e.g., wysiwyg in there. Some of them are  
actually implemented in separate components on comp/widgets/profile,  
which I would highly recommend. Then displayFormElement can just  
dispatch to, e.g., /widgets/profile/schedule.mc to do the actual  
rendering.

You will also need to add it to the code that generates the form  
builder interface for element types and contributor types, which is  
in comp/widgets/formBuilder/formBuilder.mc. Be sure to coordinate  
with Marshall if you can, since he's changed a lot of this stuff  
recently to support AJAXified interfaces.

There is also comp/widgets/field_type/field_type.mc, which needs  
information about how to display field type fields when you're  
editing (as opposed to creating) a new field type.

I think that's it, unless you need to store it in the database as  
something other than text.

> Can someone point me in the right direction and / or outline the  
> major steps I will need to take in order to do this? (or point me  
> in an entirely new direction for climbing the scheduling mountain  
> if anybody's already done that?).

You're the first, so far as I know. :-) I recommend that you get on  
IRC (#bricolage on irc.develooper.com) so that you can bug Marshall  
and me with questions.

> For reference, I'm trying to automate the creation of the /programs  
> section of our site.
>
> http://www.nga.gov/programs  (see calendar of events, etc.)
>
> I'd be happy to contribute this module if I end up moving forward  
> with it and once I find that it's working and stable.

Yeah, I'm definitely interested. Scheduling and calendaring stuff is  
a definite weakness in Bricolage.

> Should this be posted on the Bric devel list instead of Bric users?

Yes, I've Cc'd that list. All further email correspondence should go  
there, I think.

Thanks,

David
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic