Discussion:
[CalendarX-users] adding custom event-ish type
John DeStefano
2008-07-02 16:38:22 UTC
Permalink
Hi,

I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event" function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.

Thank you,
~John
Lupa Zurven
2008-07-02 17:37:57 UTC
Permalink
Hi John,
Do you mean "Add New Event" (rather than "Add Event")? I think
you do, this is what is called in the code which you found in
CalendarXFolder.py.
Fortunately for you ALL the text snippets such as this one are
found tucked away in the i18n folder. If you find the calendarx-en.po
file (assuming you're working with an English language version of
CalendarX for your site), and search if for "Add Event", you'll find
that the requisite i18n attribute is called "label_sublinks_addevent".
Simply change this to read "Add New WidgetyCreationOfMine" instead of
"Add New Event", save the file, restart your Zope instance (in order
to refresh all the i18n dictionaries) and you should be set to go. If
that's not enough, you might need to change the calendarx.po file as
well (it is a duplicate of the calendarx-en.po file, and i'm not sure
which one gets read first... best to just edit them both). And if
you feel dedicated, you can probably fairly easily edit some of the
other PO files so that your CalendarX instance will translate smoothly
for your international visitors.

Cheers, let us all know if it works for you.
+lupa+

On Wed, Jul 2, 2008 at 12:38 PM, John DeStefano
Post by John DeStefano
Hi,
I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event" function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.
Thank you,
~John
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
CalendarX-users mailing list
https://lists.sourceforge.net/lists/listinfo/calendarx-users
John DeStefano
2008-07-02 18:38:15 UTC
Permalink
Hi Lupa,

Thanks so much for your help. So far, these are the pieces I've found
that I think I'd need to customize:

- in skins/CalendarX/CX_props_macros.pt:
tal:define="image here/calLinkOpaque.gif" >Add a New Event here, eh?</a>
(change 'Event' to 'MyCustomType')

- in i18n/calendarx-en.po and calendarx.po:
# Add New Event
msgid "label_sublinks_addevent"
msgstr "Add New Event"
(change 'Event'/'event' to 'MyCustomType')
...
# "Events" label in the weekbyday and day views.
msgid "heading_events"
msgstr "Events"
(change 'Events'/'events' to 'MyCustomType')

- After adding a CalendarX object, in the calendar settings:
-Add event link properties:
* Show Add Event Link? <- enable
* Create Object On Click Command <- add value:
createObject?type_name=MyCustomType


Please let me know if something else comes to mind. I'm not
completely finished and I'm still working on this, but I feel as if
I'm getting somewhere ....

Thank you,
~John
Post by Lupa Zurven
Hi John,
Do you mean "Add New Event" (rather than "Add Event")? I think
you do, this is what is called in the code which you found in
CalendarXFolder.py.
Fortunately for you ALL the text snippets such as this one are
found tucked away in the i18n folder. If you find the calendarx-en.po
file (assuming you're working with an English language version of
CalendarX for your site), and search if for "Add Event", you'll find
that the requisite i18n attribute is called "label_sublinks_addevent".
Simply change this to read "Add New WidgetyCreationOfMine" instead of
"Add New Event", save the file, restart your Zope instance (in order
to refresh all the i18n dictionaries) and you should be set to go. If
that's not enough, you might need to change the calendarx.po file as
well (it is a duplicate of the calendarx-en.po file, and i'm not sure
which one gets read first... best to just edit them both). And if
you feel dedicated, you can probably fairly easily edit some of the
other PO files so that your CalendarX instance will translate smoothly
for your international visitors.
Cheers, let us all know if it works for you.
+lupa+
On Wed, Jul 2, 2008 at 12:38 PM, John DeStefano
Post by John DeStefano
Hi,
I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event"
function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.
Thank you,
~John
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic
lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
CalendarX-users mailing list
https://lists.sourceforge.net/lists/listinfo/calendarx-users
Lupa Zurven
2008-07-02 19:25:02 UTC
Permalink
Hi John,

1. You don't need to change the first one (the "Add a New Event here,
eh?" text) ... that one never gets seen (it is dummy text) because it
is covered by the tal:i18nattribute and replaced by the i18n
mechanism.

2. Correct.

3. Also correct.

4. Yep, I think that's exactly right.

Good work ferreting it all out!
+lupa+
Post by John DeStefano
Hi Lupa,
Thanks so much for your help. So far, these are the pieces I've found that
tal:define="image here/calLinkOpaque.gif" >Add a New Event here, eh?</a>
(change 'Event' to 'MyCustomType')
# Add New Event
msgid "label_sublinks_addevent"
msgstr "Add New Event"
(change 'Event'/'event' to 'MyCustomType')
...
# "Events" label in the weekbyday and day views.
msgid "heading_events"
msgstr "Events"
(change 'Events'/'events' to 'MyCustomType')
* Show Add Event Link? <- enable
createObject?type_name=MyCustomType
Please let me know if something else comes to mind. I'm not completely
finished and I'm still working on this, but I feel as if I'm getting
somewhere ....
Thank you,
~John
Post by Lupa Zurven
Hi John,
Do you mean "Add New Event" (rather than "Add Event")? I think
you do, this is what is called in the code which you found in
CalendarXFolder.py.
Fortunately for you ALL the text snippets such as this one are
found tucked away in the i18n folder. If you find the calendarx-en.po
file (assuming you're working with an English language version of
CalendarX for your site), and search if for "Add Event", you'll find
that the requisite i18n attribute is called "label_sublinks_addevent".
Simply change this to read "Add New WidgetyCreationOfMine" instead of
"Add New Event", save the file, restart your Zope instance (in order
to refresh all the i18n dictionaries) and you should be set to go. If
that's not enough, you might need to change the calendarx.po file as
well (it is a duplicate of the calendarx-en.po file, and i'm not sure
which one gets read first... best to just edit them both). And if
you feel dedicated, you can probably fairly easily edit some of the
other PO files so that your CalendarX instance will translate smoothly
for your international visitors.
Cheers, let us all know if it works for you.
+lupa+
On Wed, Jul 2, 2008 at 12:38 PM, John DeStefano
Post by John DeStefano
Hi,
I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event" function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.
Thank you,
~John
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
CalendarX-users mailing list
https://lists.sourceforge.net/lists/listinfo/calendarx-users
John DeStefano
2008-07-02 19:29:34 UTC
Permalink
Hi Lupa,
Post by Lupa Zurven
Hi John,
1. You don't need to change the first one (the "Add a New Event here,
eh?" text) ... that one never gets seen (it is dummy text) because it
is covered by the tal:i18nattribute and replaced by the i18n
mechanism.
Actually ... I only knew to change that one because I saw it in my
calendar view! Believe it or not, it was there, and I grep-ed for the
containing file and changed it. So now my calendar displays "Add a
New MyCustomType." Maybe something's wrong then with my own i18n
stuff? Not sure.
Post by Lupa Zurven
2. Correct.
3. Also correct.
4. Yep, I think that's exactly right.
Good work ferreting it all out!
+lupa+
Again: thank you!
~John
Post by Lupa Zurven
Post by John DeStefano
Hi Lupa,
Thanks so much for your help. So far, these are the pieces I've found that
tal:define="image here/calLinkOpaque.gif" >Add a New Event here, eh?
</a>
(change 'Event' to 'MyCustomType')
# Add New Event
msgid "label_sublinks_addevent"
msgstr "Add New Event"
(change 'Event'/'event' to 'MyCustomType')
...
# "Events" label in the weekbyday and day views.
msgid "heading_events"
msgstr "Events"
(change 'Events'/'events' to 'MyCustomType')
* Show Add Event Link? <- enable
createObject?type_name=MyCustomType
Please let me know if something else comes to mind. I'm not
completely
finished and I'm still working on this, but I feel as if I'm getting
somewhere ....
Thank you,
~John
Post by Lupa Zurven
Hi John,
Do you mean "Add New Event" (rather than "Add Event")? I think
you do, this is what is called in the code which you found in
CalendarXFolder.py.
Fortunately for you ALL the text snippets such as this one are
found tucked away in the i18n folder. If you find the calendarx-
en.po
file (assuming you're working with an English language version of
CalendarX for your site), and search if for "Add Event", you'll find
that the requisite i18n attribute is called
"label_sublinks_addevent".
Simply change this to read "Add New WidgetyCreationOfMine" instead of
"Add New Event", save the file, restart your Zope instance (in order
to refresh all the i18n dictionaries) and you should be set to go. If
that's not enough, you might need to change the calendarx.po file as
well (it is a duplicate of the calendarx-en.po file, and i'm not sure
which one gets read first... best to just edit them both). And if
you feel dedicated, you can probably fairly easily edit some of the
other PO files so that your CalendarX instance will translate smoothly
for your international visitors.
Cheers, let us all know if it works for you.
+lupa+
On Wed, Jul 2, 2008 at 12:38 PM, John DeStefano
Post by John DeStefano
Hi,
I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event" function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.
Thank you,
~John
Lupa Zurven
2008-07-02 20:00:13 UTC
Permalink
Argh, John, yes, that means your i18n is not working properly...
perhaps just for CalendarX (in which case it is my problem) or for
your whole Plone site. You could test that by changing your browser
language default to French or something and try your site.

If it is only CalendarX that is problematic... please upgrade to the
very latest (using svn at the plone collective... see directions at
the plone.org/products/calendarx page) and try again. I know that
i18n works on the svn version (which I am calling 0.9.1).

(I really need to make a new release of the tarball, though, don't I?)

+lupa+
Post by John DeStefano
Hi Lupa,
Post by Lupa Zurven
Hi John,
1. You don't need to change the first one (the "Add a New Event here,
eh?" text) ... that one never gets seen (it is dummy text) because it
is covered by the tal:i18nattribute and replaced by the i18n
mechanism.
Actually ... I only knew to change that one because I saw it in my calendar
view! Believe it or not, it was there, and I grep-ed for the containing
file and changed it. So now my calendar displays "Add a New MyCustomType."
Maybe something's wrong then with my own i18n stuff? Not sure.
Post by Lupa Zurven
2. Correct.
3. Also correct.
4. Yep, I think that's exactly right.
Good work ferreting it all out!
+lupa+
Again: thank you!
~John
Post by Lupa Zurven
Post by John DeStefano
Hi Lupa,
Thanks so much for your help. So far, these are the pieces I've found that
tal:define="image here/calLinkOpaque.gif" >Add a New Event here, eh?</a>
(change 'Event' to 'MyCustomType')
# Add New Event
msgid "label_sublinks_addevent"
msgstr "Add New Event"
(change 'Event'/'event' to 'MyCustomType')
...
# "Events" label in the weekbyday and day views.
msgid "heading_events"
msgstr "Events"
(change 'Events'/'events' to 'MyCustomType')
* Show Add Event Link? <- enable
createObject?type_name=MyCustomType
Please let me know if something else comes to mind. I'm not completely
finished and I'm still working on this, but I feel as if I'm getting
somewhere ....
Thank you,
~John
Post by Lupa Zurven
Hi John,
Do you mean "Add New Event" (rather than "Add Event")? I think
you do, this is what is called in the code which you found in
CalendarXFolder.py.
Fortunately for you ALL the text snippets such as this one are
found tucked away in the i18n folder. If you find the calendarx-en.po
file (assuming you're working with an English language version of
CalendarX for your site), and search if for "Add Event", you'll find
that the requisite i18n attribute is called "label_sublinks_addevent".
Simply change this to read "Add New WidgetyCreationOfMine" instead of
"Add New Event", save the file, restart your Zope instance (in order
to refresh all the i18n dictionaries) and you should be set to go. If
that's not enough, you might need to change the calendarx.po file as
well (it is a duplicate of the calendarx-en.po file, and i'm not sure
which one gets read first... best to just edit them both). And if
you feel dedicated, you can probably fairly easily edit some of the
other PO files so that your CalendarX instance will translate smoothly
for your international visitors.
Cheers, let us all know if it works for you.
+lupa+
On Wed, Jul 2, 2008 at 12:38 PM, John DeStefano
Post by John DeStefano
Hi,
I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event" function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.
Thank you,
~John
John DeStefano
2008-07-02 21:07:10 UTC
Permalink
Thanks, Lupa. Yes: a tarball would be nice! ;)

Also wondering, if you happen to know:
- How do I get my MyCustomType content type allowed to be created in a
CalendarX calendar "folder"? Just tried to create one and got
"ValueError: Disallowed subobject type: MyCustomType". Is this done
in the preferences for the specific CalendarX object?
- Is it possible to set CalendarX as the default view for an existing
folder? or because it's folder-ish itself, it needs its to be in its
own folder? I ask because I've created a folder-ish type of my own,
for the sole purpose of holding only the event-ish type objects.
- What's the "type" for a CalendarX calendar (so I can add it to
allowed_content_types for my folder-ish type)?

Thank you!
~John
Post by Lupa Zurven
Argh, John, yes, that means your i18n is not working properly...
perhaps just for CalendarX (in which case it is my problem) or for
your whole Plone site. You could test that by changing your browser
language default to French or something and try your site.
If it is only CalendarX that is problematic... please upgrade to the
very latest (using svn at the plone collective... see directions at
the plone.org/products/calendarx page) and try again. I know that
i18n works on the svn version (which I am calling 0.9.1).
(I really need to make a new release of the tarball, though, don't I?)
+lupa+
Post by John DeStefano
Hi Lupa,
Post by Lupa Zurven
Hi John,
1. You don't need to change the first one (the "Add a New Event here,
eh?" text) ... that one never gets seen (it is dummy text) because it
is covered by the tal:i18nattribute and replaced by the i18n
mechanism.
Actually ... I only knew to change that one because I saw it in my calendar
view! Believe it or not, it was there, and I grep-ed for the
containing
file and changed it. So now my calendar displays "Add a New
MyCustomType."
Maybe something's wrong then with my own i18n stuff? Not sure.
Post by Lupa Zurven
2. Correct.
3. Also correct.
4. Yep, I think that's exactly right.
Good work ferreting it all out!
+lupa+
Again: thank you!
~John
Post by Lupa Zurven
Post by John DeStefano
Hi Lupa,
Thanks so much for your help. So far, these are the pieces I've found
that
tal:define="image here/calLinkOpaque.gif" >Add a New Event here, eh?</a>
(change 'Event' to 'MyCustomType')
# Add New Event
msgid "label_sublinks_addevent"
msgstr "Add New Event"
(change 'Event'/'event' to 'MyCustomType')
...
# "Events" label in the weekbyday and day views.
msgid "heading_events"
msgstr "Events"
(change 'Events'/'events' to 'MyCustomType')
* Show Add Event Link? <- enable
createObject?type_name=MyCustomType
Please let me know if something else comes to mind. I'm not completely
finished and I'm still working on this, but I feel as if I'm getting
somewhere ....
Thank you,
~John
Post by Lupa Zurven
Hi John,
Do you mean "Add New Event" (rather than "Add Event")? I think
you do, this is what is called in the code which you found in
CalendarXFolder.py.
Fortunately for you ALL the text snippets such as this one are
found tucked away in the i18n folder. If you find the calendarx-
en.po
file (assuming you're working with an English language version of
CalendarX for your site), and search if for "Add Event", you'll find
that the requisite i18n attribute is called
"label_sublinks_addevent".
Simply change this to read "Add New WidgetyCreationOfMine"
instead of
"Add New Event", save the file, restart your Zope instance (in order
to refresh all the i18n dictionaries) and you should be set to go. If
that's not enough, you might need to change the calendarx.po file as
well (it is a duplicate of the calendarx-en.po file, and i'm not sure
which one gets read first... best to just edit them both). And if
you feel dedicated, you can probably fairly easily edit some of the
other PO files so that your CalendarX instance will translate smoothly
for your international visitors.
Cheers, let us all know if it works for you.
+lupa+
On Wed, Jul 2, 2008 at 12:38 PM, John DeStefano
Post by John DeStefano
Hi,
I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event" function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.
Thank you,
~John
Lupa Zurven
2008-07-02 21:19:18 UTC
Permalink
1. I personally never keep Events inside CalendarX itself, although
it is folderish. It was particularly bad practice in 0.6.x series...
and I'm not sure I know how it is in the 0.9.x series. I'd just say
avoid it if you can... create folders specifically for your
MyCustomTypes and keep them there.

2. No, to the first question. But really, it depends what you mean.
Yes, you definitely can set the CalendarX settings so that it ONLY
reads from the specific folder of eventish types you wish, and no
others.

3. It is a CalendarX type, I think. Look in the portal_types area in
your ZMI at the CalendarX type and see what the different names are
(portal type, meta type, etc., i forget them all off hand). But
that's the place to see how it is set up and what type of type you are
probably looking for.

It's beer:thirty, I'm outa here.
+lupa+
Post by John DeStefano
Thanks, Lupa. Yes: a tarball would be nice! ;)
- How do I get my MyCustomType content type allowed to be created in a
Disallowed subobject type: MyCustomType". Is this done in the preferences
for the specific CalendarX object?
- Is it possible to set CalendarX as the default view for an existing
folder? or because it's folder-ish itself, it needs its to be in its own
folder? I ask because I've created a folder-ish type of my own, for the
sole purpose of holding only the event-ish type objects.
- What's the "type" for a CalendarX calendar (so I can add it to
allowed_content_types for my folder-ish type)?
Thank you!
~John
Post by Lupa Zurven
Argh, John, yes, that means your i18n is not working properly...
perhaps just for CalendarX (in which case it is my problem) or for
your whole Plone site. You could test that by changing your browser
language default to French or something and try your site.
If it is only CalendarX that is problematic... please upgrade to the
very latest (using svn at the plone collective... see directions at
the plone.org/products/calendarx page) and try again. I know that
i18n works on the svn version (which I am calling 0.9.1).
(I really need to make a new release of the tarball, though, don't I?)
+lupa+
Post by John DeStefano
Hi Lupa,
Post by Lupa Zurven
Hi John,
1. You don't need to change the first one (the "Add a New Event here,
eh?" text) ... that one never gets seen (it is dummy text) because it
is covered by the tal:i18nattribute and replaced by the i18n
mechanism.
Actually ... I only knew to change that one because I saw it in my calendar
view! Believe it or not, it was there, and I grep-ed for the containing
file and changed it. So now my calendar displays "Add a New
MyCustomType."
Maybe something's wrong then with my own i18n stuff? Not sure.
Post by Lupa Zurven
2. Correct.
3. Also correct.
4. Yep, I think that's exactly right.
Good work ferreting it all out!
+lupa+
Again: thank you!
~John
Post by Lupa Zurven
On Wed, Jul 2, 2008 at 2:38 PM, John DeStefano
Post by John DeStefano
Hi Lupa,
Thanks so much for your help. So far, these are the pieces I've found that
tal:define="image here/calLinkOpaque.gif" >Add a New Event here, eh?</a>
(change 'Event' to 'MyCustomType')
# Add New Event
msgid "label_sublinks_addevent"
msgstr "Add New Event"
(change 'Event'/'event' to 'MyCustomType')
...
# "Events" label in the weekbyday and day views.
msgid "heading_events"
msgstr "Events"
(change 'Events'/'events' to 'MyCustomType')
* Show Add Event Link? <- enable
createObject?type_name=MyCustomType
Please let me know if something else comes to mind. I'm not completely
finished and I'm still working on this, but I feel as if I'm getting
somewhere ....
Thank you,
~John
Post by Lupa Zurven
Hi John,
Do you mean "Add New Event" (rather than "Add Event")? I think
you do, this is what is called in the code which you found in
CalendarXFolder.py.
Fortunately for you ALL the text snippets such as this one are
found tucked away in the i18n folder. If you find the calendarx-en.po
file (assuming you're working with an English language version of
CalendarX for your site), and search if for "Add Event", you'll find
that the requisite i18n attribute is called "label_sublinks_addevent".
Simply change this to read "Add New WidgetyCreationOfMine" instead of
"Add New Event", save the file, restart your Zope instance (in order
to refresh all the i18n dictionaries) and you should be set to go. If
that's not enough, you might need to change the calendarx.po file as
well (it is a duplicate of the calendarx-en.po file, and i'm not sure
which one gets read first... best to just edit them both). And if
you feel dedicated, you can probably fairly easily edit some of the
other PO files so that your CalendarX instance will translate smoothly
for your international visitors.
Cheers, let us all know if it works for you.
+lupa+
On Wed, Jul 2, 2008 at 12:38 PM, John DeStefano
Post by John DeStefano
Hi,
I've created a custom object type using the Event schema, which allows
CalendarX to display existing objects of this type. I would like to
know whether it's possible to change the existing "Add Event" function
of CalendarX to "Add MyCustomType"? A quick search through the code
led me to CX_props_addeventlink in CalendarXFolder.py, but I don't
know what to make of the code there or how to customize it to do what
I want. Someone mentioned that there used to be a file called skins/
CX_props_addeventlink.props, but I don't see this file in v0.9.0.
Thank you,
~John
Loading...