Пример #1
0
def toIndex(obj):
    plugin = PluginsHolder().getPluginType('search').getPlugin("repozer")
    if type(obj).__name__ == 'Conference':
        return plugin.getOptions()["indexConference"].getValue()
    if type(obj).__name__ == 'Contribution':
        return plugin.getOptions()["indexContribution"].getValue()
    if type(obj).__name__ == 'LocalFile':
        return plugin.getOptions()["indexMaterial"].getValue()
    return False
Пример #2
0
def toIndex(obj):
    plugin = PluginsHolder().getPluginType('search').getPlugin("repozer")
    if type(obj).__name__ == 'Conference':
        return plugin.getOptions()["indexConference"].getValue()
    if type(obj).__name__ == 'Contribution':
        return plugin.getOptions()["indexContribution"].getValue()
    if type(obj).__name__ == 'LocalFile':
        return plugin.getOptions()["indexMaterial"].getValue()
    return False
Пример #3
0
 def getUpdateInterval(self):
     """
     Returns the interval for which cached values should live before
     new data is requested from the server.
     """
     statsPlugin = PluginsHolder().getPluginType('statistics')
     return statsPlugin.getOptions()['cacheTTL'].getValue()
Пример #4
0
 def getUpdateInterval(self):
     """
     Returns the interval for which cached values should live before
     new data is requested from the server.
     """
     statsPlugin = PluginsHolder().getPluginType('statistics')
     return statsPlugin.getOptions()['cacheTTL'].getValue()
Пример #5
0
    def __init__(self, catalogName=confCatalog):
        self.catalog = {}
        self.db = db.DBMgr.getInstance().getDBConnection()
        self.ch = ConferenceHolder()

        plugin = PluginsHolder().getPluginType('search').getPlugin("repozer")
        self.iConf = plugin.getOptions()["indexConference"].getValue()
        self.iContrib = plugin.getOptions()["indexContribution"].getValue()
        self.iMat = plugin.getOptions()["indexMaterial"].getValue()

        # init all standard catalogs
        for cat in [confCatalog,contribCatalog,matCatalog]:
            if cat not in self.db.root():
                self.catalogName = cat
                self.init_catalog()        
        
        self.catalogName = catalogName

        # init customized catalog        
        if self.catalogName not in [confCatalog,contribCatalog,matCatalog] and self.catalogName not in self.db.root():
            self.init_catalog()
            
        self.catalog = self.db.root()[self.catalogName]
Пример #6
0
 def getPluginImplementation(self, obj):
     plugin = PluginsHolder().getPluginType('search').getPlugin("invenio")
     typeSearch = plugin.getOptions()["type"].getValue()
     return ("invenio", InvenioRedirectSEA if typeSearch == "redirect" else InvenioSEA)
Пример #7
0
 def getDefaultSearchEngineAgent(self):
     """
     Returns the default Search Engine Agent of the plugin
     """
     searchPlugin = PluginsHolder().getPluginType('search')
     return searchPlugin.getOptions()['defaultSearch'].getValue()
Пример #8
0
 def setDefaultSearchEngineAgent(self, value):
     """
     Sets the default Search Engine Agent of the plugin
     """
     searchPlugin = PluginsHolder().getPluginType('search')
     searchPlugin.getOptions()['defaultSearch'].setValue(value)
Пример #9
0
 def getVarFromPluginStorage(self, varName):
     """
     Retrieves varName from the options of the plugin.
     """
     plugin = PluginsHolder().getPluginType('search').getPlugin(self._id)
     return plugin.getOptions()[varName].getValue()
Пример #10
0
 def getPluginImplementation(self, obj):
     plugin = PluginsHolder().getPluginType('search').getPlugin("invenio")
     typeSearch = plugin.getOptions()["type"].getValue()
     return ("invenio",
             InvenioRedirectSEA if typeSearch == "redirect" else InvenioSEA)
Пример #11
0
 def getVarFromPluginStorage(self, varName):
     """
     Retrieves varName from the options of the plugin.
     """
     plugin = PluginsHolder().getPluginType('search').getPlugin(self._id)
     return plugin.getOptions()[varName].getValue()
Пример #12
0
 def hasCacheEnabled(self):
     """
     True if the plugin is configured for cached reporting.
     """
     statsPlugin = PluginsHolder().getPluginType('statistics')
     return statsPlugin.getOptions()['cacheEnabled'].getValue()
Пример #13
0
 def hasCacheEnabled(self):
     """
     True if the plugin is configured for cached reporting.
     """
     statsPlugin = PluginsHolder().getPluginType('statistics')
     return statsPlugin.getOptions()['cacheEnabled'].getValue()
Пример #14
0
def toIndex(obj):
    plugin = PluginsHolder().getPluginType('search').getPlugin("repozer")
    liveUpdate = plugin.getOptions()["liveUpdate"].getValue()
    return liveUpdate and type(obj).__name__ in typesToIndex and not(obj.hasAnyProtection())