| 1 |
|
# $Id$ |
| 2 |
from Products.Archetypes.public import * |
from Products.Archetypes.public import * |
| 3 |
from Products.Archetypes.TemplateMixin import TemplateMixin |
from Products.Archetypes.TemplateMixin import TemplateMixin |
| 4 |
from Products.Archetypes.SQLStorage import PostgreSQLStorage |
from Products.Archetypes.SQLStorage import PostgreSQLStorage |
| 5 |
|
|
| 6 |
from Products.PACDefault.config import * |
from Products.PACDefault.config import * |
| 7 |
|
|
| 8 |
# It is currently based on the Folder schema in order to allow action-specific # parameters. |
# Note: We are basing this on Folders so images and extra documents can be |
| 9 |
# Q: What parameters might there be and do they need to be |
# stored with the action. |
|
# seperate from this Archetype? |
|
|
|
|
| 10 |
schema = BaseFolderSchema + Schema(( |
schema = BaseFolderSchema + Schema(( |
| 11 |
|
|
| 12 |
################################### |
################################### |
| 13 |
# default |
# default |
| 14 |
|
StringField('title', |
| 15 |
|
required=1, |
| 16 |
|
searchable=1, |
| 17 |
|
default='', |
| 18 |
|
accessor='Title', |
| 19 |
|
widget=StringWidget(label_msgid="label_title", |
| 20 |
|
description_msgid="help_title", |
| 21 |
|
i18n_domain="plone"), |
| 22 |
|
), |
| 23 |
|
|
| 24 |
TextField("summary", |
TextField("summary", |
| 25 |
required=1, |
required=1, |
| 26 |
searchable=1, |
searchable=1, |
| 29 |
'text/html'), |
'text/html'), |
| 30 |
widget=RichWidget(label="Action Summary"), |
widget=RichWidget(label="Action Summary"), |
| 31 |
storage=PostgreSQLStorage(), |
storage=PostgreSQLStorage(), |
|
schemata="default", |
|
| 32 |
), |
), |
| 33 |
################################### |
################################### |
| 34 |
|
|
| 45 |
schemata="scope", |
schemata="scope", |
| 46 |
), |
), |
| 47 |
|
|
| 48 |
LinesField('us_state', |
LinesField('usState', |
| 49 |
widget=MultiSelectionWidget(label='Participating US States', |
widget=MultiSelectionWidget(label='Participating US States', |
| 50 |
description="If the Uninted States is one of the countries, select the states that will be involved in this action"), |
description="If the Uninted States is one of the countries, select the states that will be involved in this action"), |
| 51 |
vocabulary='getUSStates', |
vocabulary='getUSStates', |
| 52 |
storage=PostgreSQLStorage(), |
storage=PostgreSQLStorage(), |
| 53 |
schemata="scope", |
schemata="scope", |
| 54 |
), |
), |
| 55 |
LinesField('political_party', |
LinesField('politicalParty', |
| 56 |
widget=MultiSelectionWidget(label='Political party', |
widget=MultiSelectionWidget(label='Political party', |
| 57 |
description="To restrict this action to a perticular political party, select it here."), |
description="To restrict this action to a perticular political party, select it here."), |
| 58 |
vocabulary='getPoliticalParties', |
vocabulary='getPoliticalParties', |
| 63 |
|
|
| 64 |
################################### |
################################### |
| 65 |
# actions |
# actions |
| 66 |
LinesField('allowed_actions', |
LinesField('allowedActions', |
| 67 |
widget=MultiSelectionWidget(label='Allowed Actions', |
widget=MultiSelectionWidget(label='Allowed Actions', |
| 68 |
description="What actions should the users be allowed to participate in."), |
description="What actions should the users be allowed to participate in."), |
| 69 |
vocabulary='getAvailableActions', |
vocabulary='getAvailableActions', |
| 71 |
schemata="actions", |
schemata="actions", |
| 72 |
), |
), |
| 73 |
################################### |
################################### |
|
|
|
| 74 |
)) |
)) |
| 75 |
|
|
| 76 |
class PublicAction(BaseFolder): |
class PublicAction(BaseFolder): |
| 116 |
result.add(item[0], item[1]) |
result.add(item[0], item[1]) |
| 117 |
|
|
| 118 |
return result |
return result |
|
|
|
| 119 |
def getPoliticalParties(self): |
def getPoliticalParties(self): |
| 120 |
result = DisplayList() |
result = DisplayList() |
| 121 |
try: |
try: |