Ejemplo n.º 1
0
def initialize(context):
    """ """
    from constants import PERMISSION_ADD_SITE, PERMISSION_ADD_FOLDER
    from naaya.content.base import discover
    import NySite
    import NyFolder
    #register classes
    context.registerClass(
        NySite.NySite,
        permission=PERMISSION_ADD_SITE,
        constructors=(
            NySite.manage_addNySite_html,
            NySite.manage_addNySite,
        ),
        icon='www/Site.gif',
    )
    context.registerClass(NyFolder.NyFolder,
                          permission=PERMISSION_ADD_FOLDER,
                          constructors=(
                              NyFolder.manage_addNyFolder_html,
                              NyFolder.folder_add_html,
                              NyFolder.addNyFolder,
                          ),
                          icon='www/NyFolder.png')

    #initialize NaayaContent
    discover.initialize(context)

    from Products.NaayaCore.LayoutTool.DiskFile import allow_path
    allow_path('Products.Naaya:skel/layout/')
Ejemplo n.º 2
0
def initialize(context):
    """ """
    from constants import PERMISSION_ADD_SITE, PERMISSION_ADD_FOLDER
    from naaya.content.base import discover
    import NySite
    import NyFolder
    #register classes
    context.registerClass(
        NySite.NySite,
        permission = PERMISSION_ADD_SITE,
        constructors = (
                NySite.manage_addNySite_html,
                NySite.manage_addNySite,
                ),
        icon = 'www/Site.gif',
        )
    context.registerClass(
        NyFolder.NyFolder,
        permission = PERMISSION_ADD_FOLDER,
        constructors = (
                NyFolder.manage_addNyFolder_html,
                NyFolder.folder_add_html,
                NyFolder.addNyFolder,
                ),
        icon = 'www/NyFolder.png'
        )

    #initialize NaayaContent
    discover.initialize(context)

    from Products.NaayaCore.LayoutTool.DiskFile import allow_path
    allow_path('Products.Naaya:skel/layout/')
Ejemplo n.º 3
0
def initialize(context):
    """ """

    #register classes
    context.registerClass(CHMSite.CHMSite,
                          permission=PERMISSION_ADD_CHMSITE,
                          constructors=(
                              CHMSite.manage_addCHMSite_html,
                              CHMSite.manage_addCHMSite,
                          ),
                          icon='www/Site.gif')

    from Products.NaayaCore.LayoutTool.DiskFile import allow_path
    allow_path('Products.CHM2:skel/layout/')
    allow_path('Products.CHM2:skel-chm3/layout/')
Ejemplo n.º 4
0
def initialize(context):
    """ """

    #register classes
    context.registerClass(
        EnviroWindowsSite.EnviroWindowsSite,
        permission=PERMISSION_ADD_EWSITE,
        constructors=(
            EnviroWindowsSite.manage_addEnviroWindowsSite_html,
            EnviroWindowsSite.manage_addEnviroWindowsSite,
        ),
        icon='www/Site.gif')

    from Products.NaayaCore.LayoutTool.DiskFile import allow_path
    allow_path('Products.EnviroWindows:skel/layout/envirowindows')
Ejemplo n.º 5
0
def initialize(context):
    """ """

    #register classes
    context.registerClass(
        EnviroWindowsSite.EnviroWindowsSite,
        permission = PERMISSION_ADD_EWSITE,
        constructors = (
                EnviroWindowsSite.manage_addEnviroWindowsSite_html,
                EnviroWindowsSite.manage_addEnviroWindowsSite,
                ),
        icon = 'www/Site.gif'
        )

    from Products.NaayaCore.LayoutTool.DiskFile import allow_path
    allow_path('Products.EnviroWindows:skel/layout/envirowindows')
Ejemplo n.º 6
0
def initialize(context):
    """ """

    #register classes
    context.registerClass(
        CHMSite.CHMSite,
        permission = PERMISSION_ADD_CHMSITE,
        constructors = (
                CHMSite.manage_addCHMSite_html,
                CHMSite.manage_addCHMSite,
                ),
        icon = 'www/Site.gif'
        )

    from Products.NaayaCore.LayoutTool.DiskFile import allow_path
    allow_path('Products.CHM2:skel/layout/')
    allow_path('Products.CHM2:skel-chm3/layout/')
Ejemplo n.º 7
0
from Products.NaayaCore.LayoutTool.DiskFile import allow_path
allow_path('naaya.groupware:skel/layout/groupware')
ENABLE_XLS_DOWNLOAD = getConfiguration().environment.get(
    'ALLEARTER_ENABLE_XLS_DOWNLOAD', '')


manage_add_html = PageTemplateFile('zpt/manage_add', globals())
def manage_add_search(self, id, REQUEST=None):
    """ Create new AlleArterSearch object from ZMI.
    """
    ob = AlleArterSearch(id)
    self._setObject(id, ob)
    if REQUEST is not None:
        return self.manage_main(self, REQUEST, update_menu=1)
    return ob

from Products.NaayaCore.LayoutTool.DiskFile import allow_path
allow_path('Products.AlleArterSearch:www/css/')

QUERY_TERMS = ['Artsgruppe',
        'Rige',
        'Raekke',
        'Klasse',
        'Orden',
        'Familie',
        ]

FILTER_BY = ['Den_danske_rodliste',
        'Fredede_arter',
        'EF-habitatdirektivet',
        'EF-fuglebeskyttelsesdirektivet',
        'Bern-konventionen',
        'Bonn-konventionen',
Ejemplo n.º 9
0
def get_skin_files_path(self):
    ftool = self.getFormsTool()
    refferer = self.REQUEST.URL0.split('/')[-1]
    custom_forms = getattr(ftool, 'custom_forms', ())

    if isCustom(refferer, custom_forms):
        custom_skin = getattr(ftool, 'custom_skin', '')
        custom_skin_id, custom_schema = custom_skin.split('.')
        custom_skin = self._getOb(custom_skin_id)
        return '%s/%s' % (custom_skin.absolute_url(), custom_schema)
    return '%s/%s' % (self.get_current_skin().absolute_url(), self.getCurrentSkinSchemeId())

def get_current_skin(self):
    ftool = self.getFormsTool()
    refferer = self.REQUEST.URL0.split('/')[-1]
    custom_forms = getattr(ftool, 'custom_forms', ())

    if isCustom(refferer, custom_forms):
        custom_skin = getattr(ftool, 'custom_skin', '')
        custom_skin_id = custom_skin.split('.')[0]
        return self._getOb(custom_skin_id)
    return self._getOb(self.getCurrentSkinId())


LayoutTool.get_skin_files_path = get_skin_files_path
LayoutTool.get_current_skin = get_current_skin

from Products.NaayaCore.LayoutTool.DiskFile import allow_path
allow_path('Products.CHM2BE:skel')
from Products.NaayaCore.GeoMapTool.managers.kml_gen import kml_generator

from MySQLConnector import MySQLConnector

manage_add_html = PageTemplateFile('zpt/manage_add', globals())
def manage_add_search(self, id, REQUEST=None):
    """ Create new PyDigirSearch object from ZMI.
    """
    ob = PyDigirSearch(id)
    self._setObject(id, ob)
    if REQUEST is not None:
        return self.manage_main(self, REQUEST, update_menu=1)
    return ob

from Products.NaayaCore.LayoutTool.DiskFile import allow_path
allow_path('Products.PyDigirSearch:www/css/')

QUERY_TERMS = {
    'InstitutionCode': 'equals',
    'CollectionCode': 'equals',
    'BasisOfRecord': 'equals',
    'Family': 'equals',
    'Genus': 'like',
    'Species': 'like',
    'Country': 'like',
    'Locality': 'like',
    }


class PyDigirSearch(SimpleItem):
    """
Ejemplo n.º 11
0
from Products.NaayaCore.LayoutTool.DiskFile import allow_path
from naaya.core.zope2util import force_to_unicode
from naaya.core.StaticServe import StaticServeFromFolder
from _mysql_exceptions import OperationalError
from MySQLConnector import MySQLConnector
import queries
import utils

TARGET_DIR = os.path.join(CLIENT_HOME, '..', 'country_profile')
try:
    os.mkdir(TARGET_DIR)
except OSError:  #Directory exists
    pass

allow_path('Products.PyDigirSearch:www/css/')

manage_add_html = PageTemplateFile('zpt/manage_add', globals())


def manage_add_object(self, id, REQUEST=None):
    """ Create new CountryProfile object from ZMI"""

    ob = CountryProfile(id)
    self._setObject(id, ob)
    if REQUEST is not None:
        return self.manage_main(self, REQUEST, update_menu=1)
    return ob


class CountryProfile(SimpleItem):