Exemplo n.º 1
0
'''
Created on Jan 9, 2012

@package: livedesk
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Gabriel Nistor

Contains the services for livedesk.
'''

from ..plugin.registry import addService
from ally.container import support
from ..superdesk.db_superdesk import bindSuperdeskSession, bindSuperdeskValidations

# --------------------------------------------------------------------

SERVICES = 'livedesk.api.**.I*Service'

support.createEntitySetup('livedesk.impl.**.*')
support.bindToEntities('livedesk.impl.**.*Alchemy',
                       binders=bindSuperdeskSession)
support.listenToEntities(SERVICES,
                         listeners=addService(bindSuperdeskSession,
                                              bindSuperdeskValidations))
support.loadAllEntities(SERVICES)

# --------------------------------------------------------------------
Exemplo n.º 2
0
'''
Created on Jan 9, 2012

@package: livedesk
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Gabriel Nistor

Contains the services for livedesk.
'''

from ..plugin.registry import addService
from ally.container import support
from ..superdesk.db_superdesk import bindSuperdeskSession, bindSuperdeskValidations

# --------------------------------------------------------------------

API, IMPL = 'livedesk.api.**.I*Service', 'livedesk.impl.**.*'

support.createEntitySetup(API, IMPL)
support.bindToEntities(IMPL, binders=bindSuperdeskSession)
support.listenToEntities(IMPL, listeners=addService(bindSuperdeskSession, bindSuperdeskValidations))
support.loadAllEntities(API)

# --------------------------------------------------------------------
Exemplo n.º 3
0
from cdm.spec import ICDM
from cdm.support import ExtendPathCDM
from internationalization.api.po_file import IPOFileService
from internationalization.impl.po_file import POFileService
from internationalization.scanner import Scanner
from internationalization.api.json_locale import IJSONLocaleFileService
from internationalization.impl.json_locale import JSONFileService

# --------------------------------------------------------------------

SERVICES = 'internationalization.api.**.I*Service'

support.createEntitySetup('internationalization.impl.**.*')
support.createEntitySetup('internationalization.*.impl.**.*')
support.wireEntities(Scanner)
support.bindToEntities('internationalization.impl.**.*Alchemy', binders=bindInternationalizationSession)
support.listenToEntities(SERVICES, listeners=addService(bindInternationalizationValidations), beforeBinding=False)
support.loadAllEntities(SERVICES)

# --------------------------------------------------------------------

@ioc.config
def scan_localized_messages():
    '''Flag indicating that the application should be scanned for localized messages'''
    return False

# --------------------------------------------------------------------

@ioc.entity
def scanner(): return Scanner()
Exemplo n.º 4
0
from superdesk.media_archive.impl.meta_data import IMetaDataHandler, \
    MetaDataServiceAlchemy
from superdesk.media_archive.impl.query_criteria import QueryCriteriaService
import logging

# --------------------------------------------------------------------

log = logging.getLogger(__name__)

# --------------------------------------------------------------------

def addMetaDataHandler(handler):
    if not isinstance(handler, IMetaDataService): metaDataHandlers().append(handler)

support.createEntitySetup('superdesk.media_archive.core.impl.**.*')
support.bindToEntities('superdesk.media_archive.core.impl.**.*Alchemy', binders=bindSuperdeskSession)
support.listenToEntities(IMetaDataHandler, listeners=addMetaDataHandler, beforeBinding=False, module=service)
loadAllMetaDataHandlers = support.loadAllEntities(IMetaDataHandler, module=service)

# --------------------------------------------------------------------

@ioc.entity
def delivery() -> IDelivery:
    d = HTTPDelivery()
    d.serverURI = server_uri()
    d.repositoryPath = repository_path()
    return d

@ioc.entity
def contentDeliveryManager() -> ICDM:
    cdm = LocalFileSystemCDM();
Exemplo n.º 5
0
from ally.container import support, ioc
from ally.internationalization import NC_
from cdm.spec import ICDM
from distribution.container import app
from livedesk.core.spec import IBlogCollaboratorGroupCleanupService
from livedesk.impl.blog_collaborator import CollaboratorSpecification
from sched import scheduler
from threading import Thread
import time

# --------------------------------------------------------------------

SERVICES = 'livedesk.api.**.I*Service'

support.createEntitySetup('livedesk.impl.**.*')
support.bindToEntities('livedesk.impl.**.*Alchemy', IBlogCollaboratorGroupCleanupService, binders=bindSuperdeskSession)
support.listenToEntities(SERVICES, listeners=addService(bindSuperdeskSession, bindSuperdeskValidations))
support.loadAllEntities(SERVICES)

# --------------------------------------------------------------------

@ioc.entity
def blogThemeCDM() -> ICDM: return contentDeliveryManager()

# --------------------------------------------------------------------

@ioc.entity
def collaboratorSpecification() -> CollaboratorSpecification:
    b = CollaboratorSpecification()
    b.collaborator_types = [NC_('collaborator type', 'Collaborator'), NC_('collaborator type', 'Administrator')]
    return b
Exemplo n.º 6
0
import logging

# --------------------------------------------------------------------

log = logging.getLogger(__name__)

# --------------------------------------------------------------------


def addMetaDataHandler(handler):
    if not isinstance(handler, IMetaDataService):
        metaDataHandlers().append(handler)


support.createEntitySetup('superdesk.media_archive.core.impl.**.*')
support.bindToEntities('superdesk.media_archive.core.impl.**.*Alchemy',
                       binders=bindSuperdeskSession)
support.listenToEntities(IMetaDataHandler,
                         listeners=addMetaDataHandler,
                         beforeBinding=False,
                         module=service)
loadAllMetaDataHandlers = support.loadAllEntities(IMetaDataHandler,
                                                  module=service)

# --------------------------------------------------------------------


@ioc.entity
def delivery() -> IDelivery:
    d = HTTPDelivery()
    d.serverURI = server_uri()
    d.repositoryPath = repository_path()
Exemplo n.º 7
0
from cdm.spec import ICDM
from cdm.support import ExtendPathCDM
from internationalization.api.po_file import IPOFileService
from internationalization.core.impl.po_file_manager import POFileManager
from internationalization.core.spec import IPOFileManager
from internationalization.impl.po_file import POFileService
from internationalization.scanner import Scanner
from internationalization.api.json_locale import IJSONLocaleFileService
from internationalization.impl.json_locale import JSONFileService

# --------------------------------------------------------------------

API, IMPL = 'internationalization.api.**.I*Service', 'internationalization.impl.**.*'

support.createEntitySetup(API, IMPL)
support.bindToEntities(IMPL, binders=bindInternationalizationSession)
support.listenToEntities(IMPL, listeners=addService(bindInternationalizationSession, bindInternationalizationValidations))
support.wireEntities(Scanner, POFileManager, POFileService)
support.loadAllEntities(API)

# --------------------------------------------------------------------

@ioc.config
def scan_localized_messages():
    '''Flag indicating that the application should be scanned for localized messages'''
    return False

# --------------------------------------------------------------------

@ioc.entity
def scanner(): return Scanner()
Exemplo n.º 8
0
'''
Created on Jan 9, 2012

@package: livedesk
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Gabriel Nistor

Contains the services for livedesk.
'''

from ..plugin.registry import addService
from ally.container import support
from ..superdesk.db_superdesk import bindSuperdeskSession, bindSuperdeskValidations

# --------------------------------------------------------------------

SERVICES = 'livedesk.api.**.I*Service'

support.createEntitySetup('livedesk.impl.**.*')
support.bindToEntities('livedesk.impl.**.*Alchemy', binders=bindSuperdeskSession)
support.listenToEntities(SERVICES, listeners=addService(bindSuperdeskSession, bindSuperdeskValidations))
support.loadAllEntities(SERVICES)

# --------------------------------------------------------------------