from common.utils import doSearch, setConstants, loginfo
from common.appconfig import loadConfiguration, loadFields, getParms
from common import cspace
from cspace_django_site import settings
from os import path

# read common config file
common = 'common'
prmz = loadConfiguration(common)
print 'Configuration for %s successfully read' % common

searchConfig = cspace.getConfig(path.join(settings.BASE_PARENT_DIR, 'config'), 'imagebrowser')
prmz.FIELDDEFINITIONS = searchConfig.get('imagebrowser', 'FIELDDEFINITIONS')

# add in the the field definitions...
prmz = loadFields(prmz.FIELDDEFINITIONS, prmz)

# override these two values if they were set above
prmz.MAXRESULTS = int(searchConfig.get('imagebrowser', 'MAXRESULTS'))
prmz.TITLE = searchConfig.get('imagebrowser', 'TITLE')

# Get an instance of a logger, log some startup info
logger = logging.getLogger(__name__)
logger.info('%s :: %s :: %s' % ('imagebrowser startup', '-', '-'))


# @login_required()
def images(request):

    context = setConstants({}, prmz)
示例#2
0
from os import path
from .models import AdditionalInfo

config = cspace.getConfig(path.join(settings.BASE_DIR, 'config'), 'curator')

# read common config file
common = 'common'
prmz = loadConfiguration(common)
loginfo('curator', 'Configuration for %s successfully read' % common, {}, {})

searchConfig = cspace.getConfig(path.join(settings.BASE_DIR, 'config'),
                                'curator')
prmz.FIELDDEFINITIONS = searchConfig.get('curator', 'FIELDDEFINITIONS')

# add in the the field definitions...
prmz = loadFields(prmz.FIELDDEFINITIONS, prmz)

# override a couple parameters for this app
prmz.MAXRESULTS = int(searchConfig.get('curator', 'MAXRESULTS'))
prmz.TITLE = searchConfig.get('curator', 'TITLE')

loginfo('curator', 'Configuration for %s successfully read' % 'curator', {},
        {})

# Get an instance of a logger, log some startup info
logger = logging.getLogger(__name__)
logger.info('%s :: %s :: %s' % ('curator startup', '-', '%s | %s' %
                                (prmz.SOLRSERVER, prmz.IMAGESERVER)))


def random_sample(choices, bins, label, number_of_items):
示例#3
0
# from common.utils import CSVPREFIX, CSVEXTENSION
from common.appconfig import loadFields, loadConfiguration
from common import cspace  # we use the config file reading function
from .models import AdditionalInfo

from cspace_django_site import settings

# read common config file
prmz = loadConfiguration('common')
#loginfo('internal','%s :: %s :: %s' % ('internal portal startup', '-', '%s | %s | %s' % (prmz.SOLRSERVER, prmz.IMAGESERVER, prmz.BMAPPERSERVER)), {}, {})

# on startup, setup this webapp layout...
config = cspace.getConfig(path.join(settings.BASE_DIR, 'config'), 'internal')
fielddefinitions = config.get('search', 'FIELDDEFINITIONS')
prmz = loadFields(fielddefinitions, prmz)


def direct(request):
    return redirect('search/')


@login_required()
def search(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': request.GET}
        context = doSearch(context, prmz, request)

    else:
        context = setConstants({}, prmz, request)
示例#4
0
def loadNewFields(request, fieldfile, prmx):
    loadFields(fieldfile + '.csv', prmx)

    context = setConstants({}, prmx, request)
    loginfo('internal', 'loaded fields', context, request)
    return render(request, 'search.html', context)
示例#5
0
from common.utils import writeCsv, doSearch, setupGoogleMap, setupBMapper, computeStats, setupCSV, setup4Print, setDisplayType, setConstants, loginfo
# from common.utils import CSVPREFIX, CSVEXTENSION
from common.appconfig import loadFields, loadConfiguration
from common import cspace  # we use the config file reading function
from .models import AdditionalInfo

from cspace_django_site import settings

# read common config file
prmz = loadConfiguration('common')
print 'Configuration for common successfully read'

# on startup, setup this webapp layout...
config = cspace.getConfig(path.join(settings.BASE_PARENT_DIR, 'config'), 'internal')
fielddefinitions = config.get('search', 'FIELDDEFINITIONS')
prmz = loadFields(fielddefinitions, prmz)

# Get an instance of a logger, log some startup info
logger = logging.getLogger(__name__)
logger.info('%s :: %s :: %s' % ('internal portal startup', '-', '%s | %s | %s' % (prmz.SOLRSERVER, prmz.IMAGESERVER, prmz.BMAPPERSERVER)))


def direct(request):
    return redirect('search/')


@login_required()
def search(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': dict(request.GET.iteritems())}
        context = doSearch(context, prmz)
示例#6
0
def loadNewFields(request, fieldfile, prmz):
    loadFields(fieldfile + '.csv', prmz)

    context = setConstants({}, prmz)
    loginfo(logger, 'loaded fields', context, request)
    return render(request, 'search.html', context)
示例#7
0
def loadNewFields(request, fieldfile, prmz):
    loadFields(fieldfile + '.csv', prmz)

    context = setConstants({}, prmz)
    loginfo(logger, 'loaded fields', context, request)
    return render(request, 'ucjeps_searchmedia.html', context)
def loadNewFields(request, fieldfile, prmx):
    loadFields(fieldfile + ".csv", prmx)

    context = setConstants({}, prmx, request)
    loginfo(logger, "loaded fields", context, request)
    return render(request, "search.html", context)
示例#9
0
def loadNewFields(request, fieldfile, prmz):
    loadFields(fieldfile + '.csv', prmz)

    context = setConstants({}, prmz, request)
    loginfo(logger, 'loaded fields', context, request)
    return render(request, 'adhocreports.html', context)
示例#10
0
# from common.utils import CSVPREFIX, CSVEXTENSION
from common.appconfig import loadFields, loadConfiguration
from common import cspace  # we use the config file reading function
from .models import AdditionalInfo

from cspace_django_site import settings

# read common config file
adhocprmz = loadConfiguration('common')
print 'Configuration for common successfully read'

# on startup, setup this webapp layout...
config = cspace.getConfig(path.join(settings.BASE_PARENT_DIR, 'config'),
                          'adhocreports')
fielddefinitions = config.get('search', 'FIELDDEFINITIONS')
adhocprmz = loadFields(fielddefinitions, adhocprmz)
# nb: we override the app title here with the one configured for ad hoc reports
adhocprmz.TITLE = config.get('search', 'TITLE')

# Get an instance of a logger, log some startup info
logger = logging.getLogger(__name__)
logger.info(
    '%s :: %s :: %s' %
    ('ad hoc reports startup', '-', '%s | %s | %s' %
     (adhocprmz.SOLRSERVER, adhocprmz.IMAGESERVER, adhocprmz.BMAPPERSERVER)))


def direct(request):
    return redirect('search/')

# from common.utils import CSVPREFIX, CSVEXTENSION
from common.appconfig import loadFields, loadConfiguration
from common import cspace  # we use the config file reading function
from .models import AdditionalInfo

from cspace_django_site import settings

# read common config file
adhocprmz = loadConfiguration('common')
print 'Configuration for common successfully read'

# on startup, setup this webapp layout...
config = cspace.getConfig(path.join(settings.BASE_PARENT_DIR, 'config'), 'adhocreports')
fielddefinitions = config.get('search', 'FIELDDEFINITIONS')
adhocprmz = loadFields(fielddefinitions, adhocprmz)
# nb: we override the app title here with the one configured for ad hoc reports
adhocprmz.TITLE = config.get('search', 'TITLE')

# Get an instance of a logger, log some startup info
logger = logging.getLogger(__name__)
logger.info('%s :: %s :: %s' % ('ad hoc reports startup', '-', '%s | %s | %s' % (adhocprmz.SOLRSERVER, adhocprmz.IMAGESERVER, adhocprmz.BMAPPERSERVER)))


def direct(request):
    return redirect('search/')


def search(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': dict(request.GET.iteritems())}