コード例 #1
0
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, render_to_response

from common.utils import doSearch, setConstants, loginfo
from common.appconfig import loadConfiguration, loadFields, getParms
from common import cspace  # we use the config file reading function
from cspace_django_site import settings
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', {},
        {})
コード例 #2
0
import re
import time
import logging

from django.contrib.auth.decorators import login_required
from django.shortcuts import render, render_to_response

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', '-', '-'))
コード例 #3
0
from django.shortcuts import render, render_to_response, redirect
from django.template.loader import render_to_string
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib import messages
from django import forms
from cspace_django_site.main import cspace_django_site
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/')
コード例 #4
0
# [{"value": "1-200"}, {"value": "1-20000"}, {"value": "1-200000"}, ...  {"value": "1-200025"}, {"s": "object"}]

from django.http import HttpResponse
from os import path
from common import cspace  # we use the config file reading function
from cspace_django_site import settings
from common.appconfig import getParms, loadConfiguration

import solr

searchConfig = cspace.getConfig(path.join(settings.BASE_DIR, 'config'),
                                'suggestsolr')
FIELDEFINITIONS = searchConfig.get('solr', 'FIELDDEFINITIONS')

# read this app's config file
prmz = loadConfiguration('common')
prmz = getParms(path.join(settings.BASE_DIR, 'config/' + FIELDEFINITIONS),
                prmz)

# create a connection to a solr server
s = solr.SolrConnection(url='%s/%s' % (prmz.SOLRSERVER, prmz.SOLRCORE))

import sys, json, re


def solrtransaction(q, elementID):

    #elapsedtime = time.time()

    try:
コード例 #5
0
    computeStats,
    setupCSV,
    setup4Print,
    setup4PDF,
)
from common.utils import 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))
)