Discussion:
[CalendarX-users] Display Subject and Description on Month View
Marcos Daniel Petry
2006-07-13 19:20:30 UTC
Permalink
Hi,

I've created a Product with Archetypes, with these fields

nome
local
sol_servico
data_inicio
data_fim
tipo_evento

I declared the methods start() and end() to returns the fields
"data_inicio"and "data_fim" for display the values in the Calendar, and it's
woks!

but, in month view, when put the mouse over the event, appears a box with
Subject and Description and I don't know how to put the values "local: and
"tipo_evento" in this box

plz help me with this problem!

thanks

Petry

*PS.: Sorry for my English, it's not very well! :-)
+lupa+
2006-07-13 19:31:36 UTC
Permalink
Hello Marcos,

Try declaring methods getSubject() and getDescription() to return the
fields "local" and "tipo_evento". That's my first guess, without looking
at any code. Those are the default Archetypes handlers for these
attributes, and should work the same way that start() and end() do for you
now.

Oh, and the subject field (your "local" attribute, I presume) should be a
lines field, so that users can have more than one subject to choose from.

Congratulations on your early success, and keep us informed as to your next
successes.
+lupa+
Post by Marcos Daniel Petry
Hi,
I've created a Product with Archetypes, with these fields
nome
local
sol_servico
data_inicio
data_fim
tipo_evento
I declared the methods start() and end() to returns the fields
"data_inicio"and "data_fim" for display the values in the Calendar, and
it's woks!
but, in month view, when put the mouse over the event, appears a box with
Subject and Description and I don't know how to put the values "local: and
"tipo_evento" in this box
plz help me with this problem!
thanks
Petry
*PS.: Sorry for my English, it's not very well! :-)
Marcos Daniel Petry
2006-07-14 00:42:07 UTC
Permalink
Hi lupa!

your suggestion don't work's :-(

here's the class of my Archetype


__author__ = """Marcos Daniel Petry <***@ucs.br>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.UCSEventosCate.config import *

from Products.UCSEventosCate.vocabularios import *

schema = Schema((

StringField(
name='local',
widget=SelectionWidget(
format="select",
label="Local do Evento",
label_msgid='UCSEventosCate_label_local',
i18n_domain='UCSEventosCate',
),
vocabulary=lista_locais
),

StringField(
name='solicitacao_servico',
widget=StringWidget(
label="Solicitação de Serviço",
label_msgid='UCSEventosCate_label_solicitacao_servico',
i18n_domain='UCSEventosCate',
)
),

DateTimeField(
name='data_inicio',
widget=CalendarWidget(
label="Início do eevento",
label_msgid='UCSEventosCate_label_data_inicio',
i18n_domain='UCSEventosCate',
),
required=1
),

DateTimeField(
name='data_fim',
widget=CalendarWidget(
label="Fim do Evento",
label_msgid='UCSEventosCate_label_data_fim',
i18n_domain='UCSEventosCate',
),
required=1
),

StringField(
name='tipoEvento',
widget=SelectionWidget(
format="select",
label="Tipo do Evento",
label_msgid='UCSEventosCate_label_tipoEvento',
i18n_domain='UCSEventosCate',
),
required=1,
vocabulary=lista_tipos_eventos
),

StringField(
name='responsavel',
widget=StringWidget(
label="Responsável",
label_msgid='UCSEventosCate_label_responsavel',
i18n_domain='UCSEventosCate',
)
),

),
)

EventoDipa_schema = BaseSchema.copy() + \
schema.copy()

class EventoDipa(BaseContent):
"""
"""
security = ClassSecurityInfo()
__implements__ = (getattr(BaseContent,'__implements__',()),)

archetype_name = 'EventoDipa'

meta_type = 'EventoDipa'
portal_type = 'EventoDipa'
allowed_content_types = []
filter_content_types = 0
global_allow = 0
#content_icon = 'EventoDipa.gif'
immediate_view = 'base_view'
default_view = 'base_view'
suppl_views = ()
typeDescription = "EventoDipa"
typeDescMsgId = 'description_edit_eventodipa'

_at_rename_after_creation = True

schema = EventoDipa_schema

security.declarePublic('start')
def start(self):
"""
"""
return self.getData_inicio()

security.declarePublic('end')
def end(self):
"""
"""
return self.getData_fim()

security.declarePublic('Subject')
def Subject(self):
"""
"""
return self.getLocal()

security.declarePublic('Description')
def Description(self):
"""
"""
return self.getTipoEvento()


is it correct?
Post by +lupa+
Hello Marcos,
Try declaring methods getSubject() and getDescription() to return the
fields "local" and "tipo_evento". That's my first guess, without looking
at any code. Those are the default Archetypes handlers for these
attributes, and should work the same way that start() and end() do for you
now.
Oh, and the subject field (your "local" attribute, I presume) should be a
lines field, so that users can have more than one subject to choose from.
Congratulations on your early success, and keep us informed as to your next
successes.
+lupa+
Post by Marcos Daniel Petry
Hi,
I've created a Product with Archetypes, with these fields
nome
local
sol_servico
data_inicio
data_fim
tipo_evento
I declared the methods start() and end() to returns the fields
"data_inicio"and "data_fim" for display the values in the Calendar, and
it's woks!
but, in month view, when put the mouse over the event, appears a box with
Subject and Description and I don't know how to put the values "local: and
"tipo_evento" in this box
plz help me with this problem!
thanks
Petry
*PS.: Sorry for my English, it's not very well! :-)
+lupa+
2006-07-14 01:12:06 UTC
Permalink
Hi Petry,
I'm not sure of the correct answer... I'm not an Archetypes guru at
all. But Archetypes does allow you to declare an accessor in the schema,
like this:

LinesField(local,
widget = MultiSelectionWidget(
label = 'Local do Evento',
i18n_domain = 'UCSEventosCate',
label_msgid = 'UCSEventosCate_label_local',
),
accessor ='Subject',
vocabulary = 'lista_locais',
default = (),
),

Also, I'm changing this to a LinesField and MultiSelectionWidget, so you
would need to make sure those are imported properly.

Similarly, add this line:

accessor='Description',

to your tipoEvento field.

Now you shouldn't need the Subject and Description declarations at
all. These two fields are special cases, since for these you are
overriding the Dublin Core, which has its own Subject and Description
accessors.

Keep trying, good luck, let us know!
+lupa+
Post by Marcos Daniel Petry
Hi lupa!
your suggestion don't work's :-(
here's the class of my Archetype
__docformat__ = 'plaintext'
from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.UCSEventosCate.config import *
from Products.UCSEventosCate.vocabularios import *
schema = Schema((
StringField(
name='local',
widget=SelectionWidget(
format="select",
label="Local do Evento",
label_msgid='UCSEventosCate_label_local',
i18n_domain='UCSEventosCate',
),
vocabulary=lista_locais
),
StringField(
name='solicitacao_servico',
widget=StringWidget(
label="Solicitação de Serviço",
label_msgid='UCSEventosCate_label_solicitacao_servico',
i18n_domain='UCSEventosCate',
)
),
DateTimeField(
name='data_inicio',
widget=CalendarWidget(
label="Início do eevento",
label_msgid='UCSEventosCate_label_data_inicio',
i18n_domain='UCSEventosCate',
),
required=1
),
DateTimeField(
name='data_fim',
widget=CalendarWidget(
label="Fim do Evento",
label_msgid='UCSEventosCate_label_data_fim',
i18n_domain='UCSEventosCate',
),
required=1
),
StringField(
name='tipoEvento',
widget=SelectionWidget(
format="select",
label="Tipo do Evento",
label_msgid='UCSEventosCate_label_tipoEvento',
i18n_domain='UCSEventosCate',
),
required=1,
vocabulary=lista_tipos_eventos
),
StringField(
name='responsavel',
widget=StringWidget(
label="Responsável",
label_msgid='UCSEventosCate_label_responsavel',
i18n_domain='UCSEventosCate',
)
),
),
)
EventoDipa_schema = BaseSchema.copy() + \
schema.copy()
"""
"""
security = ClassSecurityInfo()
__implements__ = (getattr(BaseContent,'__implements__',()),)
archetype_name = 'EventoDipa'
meta_type = 'EventoDipa'
portal_type = 'EventoDipa'
allowed_content_types = []
filter_content_types = 0
global_allow = 0
#content_icon = 'EventoDipa.gif'
immediate_view = 'base_view'
default_view = 'base_view'
suppl_views = ()
typeDescription = "EventoDipa"
typeDescMsgId = 'description_edit_eventodipa'
_at_rename_after_creation = True
schema = EventoDipa_schema
security.declarePublic('start')
"""
"""
return self.getData_inicio()
security.declarePublic('end')
"""
"""
return self.getData_fim()
security.declarePublic('Subject')
"""
"""
return self.getLocal()
security.declarePublic('Description')
"""
"""
return self.getTipoEvento()
is it correct?
Post by +lupa+
Hello Marcos,
Try declaring methods getSubject() and getDescription() to return the
fields "local" and "tipo_evento". That's my first guess, without looking
at any code. Those are the default Archetypes handlers for these
attributes, and should work the same way that start() and end() do for you
now.
Oh, and the subject field (your "local" attribute, I presume) should be a
lines field, so that users can have more than one subject to choose from.
Congratulations on your early success, and keep us informed as to your next
successes.
+lupa+
Post by Marcos Daniel Petry
Hi,
I've created a Product with Archetypes, with these fields
nome
local
sol_servico
data_inicio
data_fim
tipo_evento
I declared the methods start() and end() to returns the fields
"data_inicio"and "data_fim" for display the values in the Calendar, and
it's woks!
but, in month view, when put the mouse over the event, appears a box with
Subject and Description and I don't know how to put the values "local: and
"tipo_evento" in this box
plz help me with this problem!
thanks
Petry
*PS.: Sorry for my English, it's not very well! :-)
galen pewtherer
2006-07-13 19:31:54 UTC
Permalink
petry,
take a look at this
http://sourceforge.net/mailarchive/forum.php?thread_id=9346933&forum_id=43556
it should tell you exactly what to do.

regards,

-galen
Post by Marcos Daniel Petry
Hi,
I've created a Product with Archetypes, with these fields
nome
local
sol_servico
data_inicio
data_fim
tipo_evento
I declared the methods start() and end() to returns the fields
"data_inicio"and "data_fim" for display the values in the Calendar, and it's
woks!
but, in month view, when put the mouse over the event, appears a box with
Subject and Description and I don't know how to put the values "local: and
"tipo_evento" in this box
plz help me with this problem!
thanks
Petry
*PS.: Sorry for my English, it's not very well! :-)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
CalendarX-users mailing list
https://lists.sourceforge.net/lists/listinfo/calendarx-users
--
-galen
Loading...