Author: jmorliaguet Date: Tue Jul 4 10:14:17 2006 New Revision: 3608 Modified: cpsskins/branches/paris-sprint-2006/browser/tree/slot.py cpsskins/branches/paris-sprint-2006/elements/configure.zcml cpsskins/branches/paris-sprint-2006/elements/interfaces.py cpsskins/branches/paris-sprint-2006/elements/slot.py
Log: - rem oved the 'perspective' option from slot which complicates things Modified: cpsskins/branches/paris-sprint-2006/browser/tree/slot.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/browser/tree/slot.py (original) +++ cpsskins/branches/paris-sprint-2006/browser/tree/slot.py Tue Jul 4 10:14:17 2006 @@ -50,9 +50,6 @@ request = self.request relations = getRelationStorage(context) - if context.perspective == u'': - perspective = None - if perspective is None: portlets = relations.getSeconds(predicate=hasPortlet, first=context) else: @@ -84,17 +81,11 @@ if not IPortlet.providedBy(content): raise TypeError("Only portlet can be added into slots") - slot_perspective = context.perspective - if slot_perspective == u'': - perspective = None - elif slot_perspective != u'.': - perspective = slot_perspective - else: - negotiation = getMultiAdapter((context, request), INegotiation, - name='negotiation') - # FIXME: hardcoded negotiation strategy - negotiation.strategy = u'content-author' - perspective = negotiation.getPerspective() + negotiation = getMultiAdapter((context, request), INegotiation, + name='negotiation') + # FIXME: hardcoded negotiation strategy + negotiation.strategy = u'content-author' + perspective = negotiation.getPerspective() # a slot is not a container, it is a collection of references to # portlets that are physically stored in a portlet folder. Modified: cpsskins/branches/paris-sprint-2006/elements/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/elements/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/elements/configure.zcml Tue Jul 4 10:14:17 2006 @@ -283,12 +283,6 @@ factory=".slot.Relatable" /> - <utility - provides="zope.schema.interfaces.IVocabularyFactory" - component=".slot.PerspectivesVocabulary" - name="Slot perspectives" - /> - <interface interface=".interfaces.ISlot" type="cpsskins.setup.interfaces.IResourceType" Modified: cpsskins/branches/paris-sprint-2006/elements/interfaces.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/elements/interfaces.py (original) +++ cpsskins/branches/paris-sprint-2006/elements/interfaces.py Tue Jul 4 10:14:17 2006 @@ -146,12 +146,6 @@ title=_(u"Slot's description"), required=False) - perspective = Choice( - title=_(u"Perspective"), - description=_(u"The perspective used to add and look up portlets"), - vocabulary='Slot perspectives', - required=False) - def __str__(): """Returns the slot's name.""" Modified: cpsskins/branches/paris-sprint-2006/elements/slot.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/elements/slot.py (original) +++ cpsskins/branches/paris-sprint-2006/elements/slot.py Tue Jul 4 10:14:17 2006 @@ -46,12 +46,11 @@ """ implements(ISlot) - def __init__(self, title=u'', name=u'', description=u'', perspective=u''): + def __init__(self, title=u'', name=u'', description=u''): super(Slot, self).__init__() self.title = title self.name = name self.description = description - self.perspective = perspective def __str__(self): return self.name @@ -108,11 +107,3 @@ SlotFactory = Factory(Slot) -def PerspectivesVocabulary(context): - """A vocabulary that contains the list of perspective choices - """ - perspectives = [(_(u'Ignore perspectives'), u''), - (_(u'Use perspectives'), u'.')] - return SimpleVocabulary.fromItems(perspectives) - -alsoProvides(PerspectivesVocabulary, IVocabularyFactory) -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins