# -*- coding: utf-8 -*- # Copyright (c) 2004-2013 Infrae. All rights reserved. # See also LICENSE.txt from Products.SilvaNews.installer import install from silva.core import conf as silvaconf silvaconf.extension_name("SilvaNews") silvaconf.extension_title("Silva Obsolete News Network") silvaconf.extension_depends(["Silva", "SilvaDocument", "SilvaExternalSources"]) # Specify import path for old classes (for upgrade) CLASS_CHANGES = { 'Products.SilvaNews.silvaxmlattribute SilvaXMLAttribute': 'OFS.SimpleItem SimpleItem', 'Products.SilvaNews.PlainAgendaItem PlainAgendaItem': 'Products.SilvaNews.AgendaItem AgendaItem', 'Products.SilvaNews.PlainAgendaItem PlainAgendaItemVersion': 'Products.SilvaNews.AgendaItem AgendaItemVersion', 'Products.SilvaNews.PlainArticle PlainArticle': 'Products.SilvaNews.NewsItem NewsItem', 'Products.SilvaNews.PlainArticle PlainArticleVersion': 'Products.SilvaNews.NewsItem NewsItemVersion', 'Products.SilvaNews.indexing IntegerRangesIndex': 'silva.app.news.indexing IntegerRangesIndex', 'Products.SilvaNews.InlineViewer InlineViewer': 'Products.SilvaExternalSources.CodeSource CodeSource', 'Products.SilvaNews.AgendaItem AgendaItemOccurrence': 'silva.app.news.AgendaItem.content AgendaItemOccurrence', 'Products.SilvaNews.AgendaViewer AgendaViewer':
# -*- coding: utf-8 -*- # Copyright (c) 2002-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf from Products.SilvaDocument import install silvaconf.extension_name('SilvaDocument') silvaconf.extension_title('Silva Obsolete Document') silvaconf.extension_depends(["Silva", "SilvaExternalSources"]) # add some scheme to urlparse import urllib.parse SCHEME_HTTP_LIKE_CAPABILITIES = [ 'uses_relative', 'uses_netloc', 'uses_params', 'uses_query', 'uses_fragment', ] EXTRA_SCHEMES = [ ('itms', SCHEME_HTTP_LIKE_CAPABILITIES), ('webcal', SCHEME_HTTP_LIKE_CAPABILITIES), ('tel', SCHEME_HTTP_LIKE_CAPABILITIES), ] def add_scheme(scheme, capabilities): for capability in capabilities:
# -*- coding: utf-8 -*- # Copyright (c) 2002-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf from Products.SilvaDocument import install silvaconf.extension_name('SilvaDocument') silvaconf.extension_title('Silva Obsolete Document') silvaconf.extension_depends(["Silva", "SilvaExternalSources"]) # add some scheme to urlparse import urlparse SCHEME_HTTP_LIKE_CAPABILITIES = [ 'uses_relative', 'uses_netloc', 'uses_params', 'uses_query', 'uses_fragment', ] EXTRA_SCHEMES = [ ('itms', SCHEME_HTTP_LIKE_CAPABILITIES), ('webcal', SCHEME_HTTP_LIKE_CAPABILITIES), ('tel', SCHEME_HTTP_LIKE_CAPABILITIES), ] def add_scheme(scheme, capabilities):
# -*- coding: utf-8 -*- # Copyright (c) 2012-2013 Infrae. All rights reserved. # See also LICENSE.txt """ Author: kapil thangavelu <*****@*****.**> """ from silva.core import conf as silvaconf silvaconf.extension_name('SilvaMetadata') silvaconf.extension_title('Silva Metadata') silvaconf.extension_system()
# -*- coding: utf-8 -*- # Copyright (c) 2012 Infrae. All rights reserved. # See also LICENSE.txt from zope.interface import Interface from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller silvaconf.extension_name("silva.app.sitemap") silvaconf.extension_title("Silva Sitemaps") silvaconf.extension_depends(['Silva']) class SilvaSitemapInstaller(DefaultInstaller): """ Silva sitemap installer """ service_name = 'service_sitemap' def install_custom(self, root): if self.service_name not in root.objectIds(): factory = root.manage_addProduct['silva.app.sitemap'] factory.manage_addSitemapService(self.service_name) class IExtension(Interface): """silva.app.sitemap extension """
# -*- coding: utf-8 -*- # Copyright (c) 2006-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from zope.interface import Interface silvaconf.extension_name("SilvaPoll") silvaconf.extension_title("Silva Poll") silvaconf.extension_depends(["SilvaExternalSources"]) class IExtension(Interface): """Silva Forum extension. """ class SilvaPollInstaller(DefaultInstaller): def install_custom(self, root): if 'service_polls' not in root.objectIds(): factory = root.manage_addProduct['SilvaPoll'] factory.manage_addServicePolls() install = SilvaPollInstaller('SilvaPoll', IExtension)
# -*- coding: utf-8 -*- # Copyright (c) 2006-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core.conf.installer import DefaultInstaller from silva.core import conf as silvaconf from zope.interface import Interface from zope.component import getUtility, queryUtility from Products.SilvaFind.interfaces import IFindService from silva.core.services.interfaces import ICatalogService silvaconf.extension_name('SilvaFind') silvaconf.extension_title('Silva Find') silvaconf.extension_default() class IExtension(Interface): """Silva Find extension. """ class SilvaFindInstaller(DefaultInstaller): def install_custom(self, root): if queryUtility(IFindService) is None: factory = root.manage_addProduct['SilvaFind'] factory.manage_addFindService() catalog = getUtility(ICatalogService)
# -*- coding: utf-8 -*- # Copyright (c) 2008-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.pas.base.plugins import cookie, cascading from silva.core import conf as silvaconf from Products.PluggableAuthService.PluggableAuthService import \ registerMultiPlugin from AccessControl.Permissions import manage_users as ManageUsers registerMultiPlugin(cookie.SilvaCookieAuthHelper.meta_type) registerMultiPlugin(cascading.SilvaCascadingPASPlugin.meta_type) silvaconf.extension_name('silva.pas.base') silvaconf.extension_title('Silva Pluggable Auth Support') silvaconf.extension_system() def initialize(context): context.registerClass( cookie.SilvaCookieAuthHelper, permission=ManageUsers, constructors= (cookie.manage_addSilvaCookieAuthHelperForm, cookie.manage_addSilvaCookieAuthHelper), visibility=None, icon="www/cookie.png") context.registerClass( cascading.SilvaCascadingPASPlugin, permission=ManageUsers,
# -*- coding: utf-8 -*- # Copyright (c) 2011-2013 Infrae. All rights reserved. # See also LICENSE.txt import AccessControl from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from silva.core.editor.interfaces import ICKEditorService from zope.interface import Interface from zope.component import getUtility, queryUtility silvaconf.extension_name("silva.app.mediacontent") silvaconf.extension_title("Silva Media Content") silvaconf.extension_depends(["Silva"]) class IMediaContentExtension(Interface): """Silva media content types. """ class MediaContentInstaller(DefaultInstaller): def install_custom(self, root): if queryUtility(ICKEditorService) is None: factory = root.manage_addProduct['silva.core.editor'] factory.manage_addCKEditorService() declare = getUtility(ICKEditorService).declare_configuration declare('Silva Media Content')
# -*- coding: utf-8 -*- # Copyright (c) 2012 Infrae. All rights reserved. # See also LICENSE.txt # package from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from zope.interface import Interface silvaconf.extension_name("SilvaSecurityOverview") silvaconf.extension_title("Silva Security Overview") class Installer(DefaultInstaller): """Installer for the Security overview extension. Override install, uninstall to add more actions. """ service_id = "service_securityoverview" def install_custom(self, root): if self.service_id not in root.objectIds(): factory = root.manage_addProduct["silva.security.overview"] factory.manage_addSecurityOverviewService(self.service_id) def uninstall_custom(self, root): if self.service_id in root.objectIds(): root.manage_delObjects([self.service_id])
# Package from Products.Silva.Root import Root from silva.core import conf as silvaconf from silva.core.interfaces import IExtensionInstaller from zope.interface import implements silvaconf.extension_name("smitheme.phoenix") silvaconf.extension_title("SMI Theme Phoenix") silvaconf.extension_depends(["Silva"]) PHOENIX_SKIN = 'smitheme.phoenix.skin.ISMIPhoenixSkin' class Installer(object): implements(IExtensionInstaller) def install(self, root): root._smi_skin = PHOENIX_SKIN def uninstall(self, root): root._smi_skin = Root._smi_skin def is_installed(self, root): return root._smi_skin == PHOENIX_SKIN install = Installer()
# -*- coding: utf-8 -*- # Copyright (c) 2007-2013 Infrae. All rights reserved. # See also LICENSE.txt # See also LICENSES.txt from Products.Silva.install import add_helper, pt_add_helper from five import grok from silva.app.subscriptions.interfaces import ISubscriptionService from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller, roleinfo from zope import component from zope.interface import Interface from zope.lifecycleevent.interfaces import IObjectCreatedEvent silvaconf.extension_name('SilvaForum') silvaconf.extension_title('Silva Forum') class IExtension(Interface): """Silva Forum extension. """ class SilvaForumInstaller(DefaultInstaller): not_globally_addables = ['Silva Forum Topic', 'Silva Forum Comment'] default_permissions = {'Silva Forum': roleinfo.EDITOR_ROLES} metadata = {('Silva Forum Topic', 'Silva Forum Comment'): ('silva-content', 'silva-extra', 'silvaforum-item'), ('Silva Forum',): ('silva-content', 'silva-extra', 'silva-layout'), ('Silva Forum', 'Silva Forum Topic'): ('silvaforum-forum',)}
# Copyright (c) 2004-2010 Infrae. All rights reserved. # See also LICENSE.txt # $Id$ from zope.interface import Interface from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller silvaconf.extension_name('SilvaSoftwarePackage') silvaconf.extension_title('Silva Software Package') silvaconf.extension_depends('SilvaDocument') class SilvaSoftwarePackageInstaller(DefaultInstaller): not_globally_addables = ['Silva Software Release', 'Silva Software Package', 'Silva Software Group', 'Silva Software Remote Group', 'Silva Software Activity Aggregator', 'Silva Software Activity'] class IExtension(Interface): pass install = SilvaSoftwarePackageInstaller( 'SilvaSoftwarePackage', IExtension) CLASS_CHANGES = {
# See also LICENSE.txt from Persistence import Persistent from five import grok from zope.interface import Interface from zope.component import queryUtility, getUtility from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from silva.core.contentlayout.interfaces import IContentLayoutService from silva.core.contentlayout.interfaces import IDesignLookup from silva.core.editor.interfaces import ICKEditorService from silva.core.interfaces import IContainerPolicy silvaconf.extension_name("silva.app.page") silvaconf.extension_title(u"Silva Page") silvaconf.extension_depends( ["Silva", "silva.core.contentlayout", "silva.app.news"]) class PagePolicy(Persistent): grok.implements(IContainerPolicy) def createDefaultDocument(self, container, title): factory = container.manage_addProduct['silva.app.page'] factory.manage_addPage('index', title) page = container._getOb('index') service = getUtility(IDesignLookup)
# -*- coding: utf-8 -*- # Copyright (c) 2004-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.app.news.installer import install from silva.core import conf as silvaconf silvaconf.extension_name("silva.app.news") silvaconf.extension_title("Silva News Network") silvaconf.extension_depends(["Silva", "silva.app.document", "SilvaExternalSources"]) def initialize(context): from silva.app.news import indexing context.registerClass( indexing.IntegerRangesIndex, permission = 'Add Pluggable Index', constructors = (indexing.manage_addIntegerRangesIndexForm, indexing.manage_addIntegerRangesIndex), visibility=None)
# -*- coding: utf-8 -*- # Copyright (c) 2002-2013 Infrae. All rights reserved. # See also LICENSE.txt import logging from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from zope.interface import Interface silvaconf.extension_name('SilvaExternalSources') silvaconf.extension_title('Silva External Sources') silvaconf.extension_depends(["Silva", "silva.core.editor"]) silvaconf.extension_default() logger = logging.getLogger('silva.externalsources') class IExtension(Interface): """Silva External Sources extension. """ class ExternalSourcesInstaller(DefaultInstaller): """Silva External Sources installer """ def install_custom(self, root): installed_ids = root.objectIds() if 'service_codesources' not in installed_ids: factory = root.manage_addProduct['SilvaExternalSources'] factory.manage_addCodeSourceService()
# -*- coding: utf-8 -*- # Copyright (c) 2009 Infrae. All rights reserved. # See also LICENSE.txt # $Id$ from zope.interface import Interface from silva.core.conf.installer import DefaultInstaller from silva.core import conf as silvaconf silvaconf.extension_name('silva.pageactions.mailpdf') silvaconf.extension_title('Send that page by mail') class IExtension(Interface): """Extension to send mail. """ METADATA = {('Silva Root', 'Silva Publication',): ('mail-pageactions',)} class MailInstaller(DefaultInstaller): def install_custom(self, root): self.configure_metadata(root, METADATA, globals()) def uninstall_custom(self, root): self.unconfigure_metadata(root, METADATA) install = MailInstaller('silva.pageactions.mailpdf', IExtension)
# Copyright (c) 2003 ETH ID-TIM. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf silvaconf.extension_name('SilvaPhotoGallery') silvaconf.extension_title('Silva PhotoGallery') silvaconf.extension_depends(["Silva", "SilvaExternalSources"]) silvaconf.extension_system()
# Copyright (c) 2004-2010 Infrae. All rights reserved. # See also LICENSE.txt # $Id$ from zope.interface import Interface from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller silvaconf.extension_name('SilvaSoftwarePackage') silvaconf.extension_title('Silva Software Package') silvaconf.extension_depends('SilvaDocument') class SilvaSoftwarePackageInstaller(DefaultInstaller): not_globally_addables = [ 'Silva Software Release', 'Silva Software Package', 'Silva Software Group', 'Silva Software Remote Group', 'Silva Software Activity Aggregator', 'Silva Software Activity' ] class IExtension(Interface): pass install = SilvaSoftwarePackageInstaller('SilvaSoftwarePackage', IExtension) CLASS_CHANGES = { 'Products.SilvaSoftwarePackage ISilvaSoftwarePackageExtension': 'Products.SilvaSoftwarePackage IExtension', 'Products.Silva3PSP.Silva3PExtensionPage Silva3PExtensionPage':
# -*- coding: utf-8 -*- # Copyright (c) 2010-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf silvaconf.extension_name('silva.core.references') silvaconf.extension_title('Silva Core References') silvaconf.extension_system() # Use our own KeyReference implementation. CLASS_CHANGES = { 'five.intid.keyreference KeyReferenceToPersistent': 'silva.core.references.keyreference KeyReferenceToIItem', 'silva.core.references.interfaces IDeleteSourceOnTargetDeletion': 'zope.interface Interface', }
# Copyright (c) 2009-2013 Infrae. All rights reserved. # See also LICENSE.txt from Persistence import Persistent from five import grok from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from silva.core.editor.interfaces import ICKEditorService from silva.core.interfaces import IContainerPolicy, IPublicationWorkflow from silva.core.interfaces.events import IInstalledExtensionEvent from zope.component import queryUtility, getUtility from zope.interface import Interface silvaconf.extension_name("silva.app.document") silvaconf.extension_title("Silva Document") silvaconf.extension_depends(["Silva", "silva.core.editor"]) silvaconf.extension_default() class DocumentPolicy(Persistent): grok.implements(IContainerPolicy) def createDefaultDocument(self, container, title): factory = container.manage_addProduct['silva.app.document'] factory.manage_addDocument('index', title) class IExtension(Interface): """Silva new style Document Extension.
# -*- coding: utf-8 -*- # Copyright (c) 2009-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf silvaconf.extension_name("silva.core.editor") silvaconf.extension_title(u"Silva Core Editor") silvaconf.extension_system() class CKEditorExtension(object): base = '++static++/silva.core.editor' plugins = { 'silvautils': 'plugins/silvautils', 'silvalink': 'plugins/silvalink', 'silvaimage': 'plugins/silvaimage', 'silvaanchor': 'plugins/silvaanchor', 'silvasave': 'plugins/silvasave', 'silvaformat': 'plugins/silvaformat', 'silvatablestyles': 'plugins/silvatablestyles', 'silvadialog': 'plugins/silvadialog', } skins = { 'silva': {'title': 'Silva default', 'path': 'skins/silva'} } extension = CKEditorExtension()
# -*- coding: utf-8 -*- # Copyright (c) 2011-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf silvaconf.extension_name("silva.ui") silvaconf.extension_title(u"Silva UI") silvaconf.extension_system()
# -*- coding: utf-8 -*- # Copyright (c) 2009-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf silvaconf.extension_name('silva.core.services') silvaconf.extension_title('Silva Core Services') silvaconf.extension_system() from .catalog import CatalogingTask
# -*- coding: utf-8 -*- # Copyright (c) 2004-2013 Infrae. All rights reserved. # See also LICENSE.txt from Products.SilvaNews.installer import install from silva.core import conf as silvaconf silvaconf.extension_name("SilvaNews") silvaconf.extension_title("Silva Obsolete News Network") silvaconf.extension_depends(["Silva", "SilvaDocument", "SilvaExternalSources"]) # Specify import path for old classes (for upgrade) CLASS_CHANGES = { 'Products.SilvaNews.silvaxmlattribute SilvaXMLAttribute': 'OFS.SimpleItem SimpleItem', 'Products.SilvaNews.PlainAgendaItem PlainAgendaItem': 'Products.SilvaNews.AgendaItem AgendaItem', 'Products.SilvaNews.PlainAgendaItem PlainAgendaItemVersion': 'Products.SilvaNews.AgendaItem AgendaItemVersion', 'Products.SilvaNews.PlainArticle PlainArticle': 'Products.SilvaNews.NewsItem NewsItem', 'Products.SilvaNews.PlainArticle PlainArticleVersion': 'Products.SilvaNews.NewsItem NewsItemVersion', 'Products.SilvaNews.indexing IntegerRangesIndex': 'silva.app.news.indexing IntegerRangesIndex', 'Products.SilvaNews.InlineViewer InlineViewer':
# -*- coding: utf-8 -*- # Copyright (c) 2012-2013 Infrae. All rights reserved. # See also LICENSE.txt # this is package. from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from zope.interface import Interface silvaconf.extension_name("silva.app.forest") silvaconf.extension_title("Silva Forest") silvaconf.extension_depends(['Silva']) class IExtension(Interface): """Silva Forest virtual hosting. """ class ForestInstaller(DefaultInstaller): """Install the service. """ def install_custom(self, root): if 'service_forest' not in root.objectIds(): factory = root.manage_addProduct['silva.app.forest'] factory.manage_addForestService() install = ForestInstaller("silva.app.forest", IExtension)
# -*- coding: utf-8 -*- # Copyright (c) 2007-2013 Infrae. All rights reserved. # See also LICENSE.txt # See also LICENSES.txt from Products.Silva.install import add_helper, pt_add_helper from five import grok from silva.app.subscriptions.interfaces import ISubscriptionService from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller, roleinfo from zope import component from zope.interface import Interface from zope.lifecycleevent.interfaces import IObjectCreatedEvent silvaconf.extension_name('SilvaForum') silvaconf.extension_title('Silva Forum') class IExtension(Interface): """Silva Forum extension. """ class SilvaForumInstaller(DefaultInstaller): not_globally_addables = ['Silva Forum Topic', 'Silva Forum Comment'] default_permissions = {'Silva Forum': roleinfo.EDITOR_ROLES} metadata = { ('Silva Forum Topic', 'Silva Forum Comment'): ('silva-content', 'silva-extra', 'silvaforum-item'), ('Silva Forum', ): ('silva-content', 'silva-extra', 'silva-layout'), ('Silva Forum', 'Silva Forum Topic'): ('silvaforum-forum', )
# -*- coding: utf-8 -*- # Copyright (c) 2008-2013 Infrae. All rights reserved. # See also LICENSE.txt from AccessControl.Permissions import manage_users as ManageUsers from silva.core import conf as silvaconf import install silvaconf.extension_name("silva.pas.openid") silvaconf.extension_title("Silva OpenID Support") silvaconf.extension_depends(["Silva", 'silva.pas.base']) def initialize(context): from .plugins import oid context.registerClass(oid.OpenIdPlugin, permission=ManageUsers, constructors= (oid.manage_addOpenIDPluginForm, oid.manage_addOpenIDPlugin), visibility=None, icon="www/openid.png")
# -*- coding: utf-8 -*- # Copyright (c) 2012-2013 Infrae. All rights reserved. # See also LICENSE.txt # package from Products.Silva import roleinfo from silva.core import conf as silvaconf from silva.core.conf.installer import SystemExtensionInstaller from zope.component import queryUtility silvaconf.extension_name("silva.core.contentlayout") silvaconf.extension_title("Silva Content Layout") silvaconf.extension_system() class ContentLayoutInstaller(SystemExtensionInstaller): default_permissions = { 'Silva Page Model': roleinfo.CHIEF_ROLES, 'Silva Page Model Version': roleinfo.CHIEF_ROLES} def is_installed(self, root, extension): return queryUtility(IContentLayoutService) is not None install = ContentLayoutInstaller() from .blocks import Block, BlockView, BlockController from .interfaces import IContentLayoutService from .designs.design import Design from .slots import restrictions
# -*- coding: utf-8 -*- # Copyright (c) 2002-2013 Infrae. All rights reserved. # See also LICENSE.txt #### Hack of the day: don't f**k up your all DB if an interface is broken. from OFS.Uninstalled import BrokenClass BrokenClass.__iro__ = tuple() #### End of hack of the day # register this extension from silva.core import conf as silvaconf silvaconf.extension_name('Silva') silvaconf.extension_title('Silva Core') silvaconf.extension_depends([]) try: from Products.MaildropHost import MaildropHost MAILDROPHOST_AVAILABLE = True except ImportError: MAILDROPHOST_AVAILABLE = False MAILHOST_ID = 'service_mailhost'
# -*- coding: utf-8 -*- # Copyright (c) 2012-2013 Infrae. All rights reserved. # See also LICENSE.txt from zope.interface import Interface from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller SERVICE_NAME = 'service_shorturls' SHORT_URL_PREFIX = '$' silvaconf.extension_name("silva.app.shorturl") silvaconf.extension_title("Silva Short URL") silvaconf.extension_depends(['Silva']) class SilvaShortURLInstaller(DefaultInstaller): """ Silva shorturl installer """ service_name = SERVICE_NAME def install_custom(self, root): installed_ids = root.objectIds() if SERVICE_NAME not in installed_ids: factory = root.manage_addProduct['silva.app.shorturl'] factory.manage_addShortURLService(SERVICE_NAME) resolver_name = SERVICE_NAME + '_resolver' if resolver_name not in installed_ids: factory = root.manage_addProduct['silva.app.shorturl']
from Products.Silva.Root import Root from silva.core import conf as silvaconf from silva.core.interfaces import IExtensionInstaller from zope.interface import implements silvaconf.extension_name("smitheme.industrial") silvaconf.extension_title("SMI Theme Industrial") silvaconf.extension_depends(["Silva"]) SKIN = 'smitheme.industrial.skin.ISMIIndustrialSkin' class Installer(object): implements(IExtensionInstaller) def install(self, root, extension): root._smi_skin = SKIN def uninstall(self, root, extension): root._smi_skin = Root._smi_skin def is_installed(self, root, extension): return root._smi_skin == SKIN install = Installer()
# -*- coding: utf-8 -*- # Copyright (c) 2010-2013 Infrae. All rights reserved. # See also LICENSE.txt from zope.interface import Interface from silva.core.conf.installer import DefaultInstaller from silva.core import conf as silvaconf silvaconf.extension_name("silva.app.redirectlink") silvaconf.extension_title("Silva Permanent Redirect Link") class IExtension(Interface): """Silva Permanent Redirect Link Extension. """ class RedirectLinkInstaller(DefaultInstaller): def install_custom(self, root): # You can't add this content by hand. root.add_silva_addable_forbidden('Silva Permanent Redirect Link') install = RedirectLinkInstaller("silva.app.redirectlink", IExtension)
# -*- coding: utf-8 -*- # Copyright (c) 2006-2013 Infrae. All rights reserved. # See also LICENSE.txt from silva.core.conf.installer import DefaultInstaller from silva.core import conf as silvaconf from zope.interface import Interface from zope.component import getUtility, queryUtility from Products.SilvaFind.interfaces import IFindService from silva.core.services.interfaces import ICatalogService silvaconf.extension_name('SilvaFind') silvaconf.extension_title('Silva Find') silvaconf.extension_default() class IExtension(Interface): """Silva Find extension. """ class SilvaFindInstaller(DefaultInstaller): def install_custom(self, root): if queryUtility(IFindService) is None: factory = root.manage_addProduct['SilvaFind'] factory.manage_addFindService() catalog = getUtility(ICatalogService) indexes = set(catalog.indexes()) for field in getUtility(IFindService).getSearchSchema().getFields():
# -*- coding: utf-8 -*- # Copyright (c) 2008-2012 Infrae. All rights reserved. # See also LICENSE.txt from silva.core import conf as silvaconf from silva.core.conf.installer import DefaultInstaller from zope.interface import Interface silvaconf.extension_name('silva.security.addables') silvaconf.extension_title('Silva Security Addables') class Installer(DefaultInstaller): service_id = 'service_addablespermissions' def install_custom(self, root): if self.service_id not in root.objectIds(): factory = root.manage_addProduct['silva.security.addables'] factory.manage_addAddablesPermissionsService(self.service_id) def uninstall_custom(self, root): if self.service_id in root.objectIds(): root.manage_delObjects([self.service_id]) class IExtension(Interface): """Marker interface for our extension. """ install = Installer("silva.security.addables", IExtension)