Commit 2f4a1da1 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Update property sheets with select_variable property

parent 10b7dcd8
......@@ -31,118 +31,143 @@ class Catalog():
"""
Properties that define ERP5 Catalog object.
"""
_properties = (
# Z SQL Methods
{ 'id' : 'sql_catalog_produce_reserved',
'description' : 'A method to produce new uid values in advance',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w',
'default' : '' },
{ 'id' : 'sql_catalog_clear_reserved',
'description' : 'A method to clear reserved uid values',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w',
'default' : '' },
{ 'id' : 'sql_catalog_reserve_uid',
'description' : 'A method to reserve a uid value',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w',
'default' : '' },
{ 'id' : 'sql_catalog_delete_uid',
'description' : 'A method to delete a uid value',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w',
'default' : '' },
{ 'id' : 'sql_catalog_object_list',
'description' : 'Methods to be called to catalog the list of objects',
'type' : 'multiple selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_uncatalog_object',
'description' : 'Methods to be called to uncatalog an object',
'type' : 'multiple selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_catalog_translation_list',
'description' : 'Methods to be called to catalog the list of translation objects',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_delete_translation_list',
'description' : 'Methods to be called to delete translations',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_clear_catalog',
'description' : 'The methods which should be called to clear the catalog',
'type' : 'multiple selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w',
'default' : ()},
{ 'id' : 'sql_record_object_list',
'description' : 'Method to record catalog information',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_read_recorded_object_list',
'description' : 'Method to get recorded information',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_delete_recorded_object_list',
'description' : 'Method to delete recorded information',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_search_results',
'description' : 'Main method to search the catalog',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_search_security',
'description' : 'Main method to search security',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_search_tables',
'description' : 'Tables to join in the result',
'type' : 'multiple selection',
'select_variable' : 'getTableIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_search_result_keys',
'description' : 'Keys to display in the result',
'type' : 'multiple selection',
'select_variable' : 'getResultColumnIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_count_results',
'description' : 'Main method to search the catalog',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_getitem_by_path',
'description' : 'Get a catalog brain by path',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_getitem_by_uid',
'description' : 'Get a catalog brain by uid',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_optimizer_switch',
'description': 'Method to get optimizer_switch value',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_catalog_tables',
'description' : 'Method to get the main catalog tables',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_catalog_schema',
'description' : 'Method to get the main catalog schema',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_catalog_index',
'description' : 'Method to get the main catalog index',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_unique_values',
'description' : 'Find unique disctinct values in a column',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_catalog_paths',
'description' : 'List all object paths in catalog',
'type' : 'selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id': 'sql_catalog_search_keys',
'title': 'Search Key Mappings',
......@@ -153,30 +178,36 @@ class Catalog():
{ 'id' : 'sql_catalog_keyword_search_keys',
'description' : 'Columns which should be considered as keyword search',
'type' : 'multiple selection',
'select_variable' : 'getColumnIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_catalog_datetime_search_keys',
'description' : 'Columns which should be considered as datetime search',
'type' : 'multiple selection',
'select_variable' : 'getColumnIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_catalog_full_text_search_keys',
'description' : 'Columns which should be considered as full text search',
'type' : 'multiple selection',
'select_variable' : 'getColumnIds',
'mode' : 'w' },
{ 'id' : 'sql_catalog_request_keys',
'description' : 'Columns which should be ignore in the REQUEST in order to accelerate caching',
'type' : 'multiple selection',
'select_variable' : 'getColumnIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_catalog_multivalue_keys',
'description' : 'Keys which hold multiple values',
'type' : 'multiple selection',
'select_variable' : 'getColumnIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_catalog_index_on_order_keys',
'description' : 'Columns which should be used by specifying an index when sorting on them',
'type' : 'multiple selection',
'select_variable' : 'getSortColumnIds',
'mode' : 'w',
'default' : () },
{ 'id' : 'sql_catalog_topic_search_keys',
......@@ -216,6 +247,7 @@ class Catalog():
'title': 'Table vote scripts',
'description': 'Scripts helping column mapping resolution',
'type': 'multiple selection',
'select_variable' : 'getPythonMethodIds',
'mode': 'w' },
{ 'id': 'sql_catalog_raise_error_on_uid_check',
'title': 'Raise error on UID check',
......
##############################################################################
#
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
# Sebastien Robin <seb@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
"""
ZODB Catalog tool
"""
#from Products.ERP5Catalog.CatalogTool import CatalogTool as OriginalCatalogTool
from Products.ERP5Type.Tool.BaseTool import BaseTool
class CatalogTool() :
import sys
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Core.Folder import OFS_HANDLER
from Products.ERP5Type import Permissions, _dtmldir
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.CopySupport import CopyContainer
from Products.ZSQLCatalog.ZSQLCatalog import ZCatalog
from Products.CMFCore.CatalogTool import CatalogTool as CMFCoreCatalogTool
class CatalogTool(CopyContainer, ZCatalog, CMFCoreCatalogTool, BaseTool):
"""
Properties that define CatalogTool.
ZSQL catalog tool for ERP5.
"""
id = 'portal_catalog'
title = 'Catalog Tool'
meta_type = 'Catalog Tool'
portal_type = 'Catalog Tool'
allowed_type = ('Catalog',)
_properties = (
{ 'id' : 'default_sql_catalog_id',
'description' : 'The id of the default SQL Catalog',
'type' : 'selection',
'mode' : 'w',
'default' : None},
# Hot Reindexing
{ 'id' : 'source_sql_catalog_id',
'description' : 'The id of a source SQL Catalog for hot reindexing',
'type' : 'string',
'mode' : '',
'default' : None},
{ 'id' : 'destination_sql_catalog_id',
'description' : 'The id of a destination SQL Catalog for hot reindexing',
'type' : 'string',
'mode' : '',
'default' : None},
{ 'id' : 'hot_reindexing_state',
'description' : 'The state of hot reindexing',
'type' : 'string',
'mode' : '',
'default' : None},
{ 'id' : 'archive_path',
'description' : 'The path of the archive which is create',
'type' : 'string',
'mode' : '',
'default' : None},
objectValues = BaseTool.objectValues
# Declarative Security
security = ClassSecurityInfo()
# ERP5 Catalog defaults
# Might be used later in reindexing
{ 'id' : 'default_erp5_catalog_id',
'description' : 'Default ERP5 Catalog Id',
'type' : 'selection',
'mode' : 'w',
'default' : None},
)
manage_options = ({ 'label' : 'Overview', 'action' : 'manage_overview' },
{ 'label' : 'View', 'action': ''}
)+ ZCatalog.manage_options
InitializeClass(CatalogTool)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment