-
Notifications
You must be signed in to change notification settings - Fork 9
/
Defaults.py
111 lines (101 loc) · 3.82 KB
/
Defaults.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
######################################################################
# global flags and constants for ZWiki
# see also plugins/*
PAGE_METATYPE = 'ZWiki Page' # meta_type of ZWikiPage objects
PAGE_PORTALTYPE = 'Wiki Page' # content type used in CMF/Plone
WIKI_ADD_MENU_NAME = 'ZWiki' # items in ZMI add menu..
PAGE_ADD_MENU_NAME = 'ZWiki Page' # (this one must match PAGE_METATYPE)
AUTO_UPGRADE = 1 # upgrade old pages when viewed
DISABLE_JAVASCRIPT = 1 # disable javascript, etc. in edits ?
PREFER_USERNAME_COOKIE = 0 # prefer cookie to authenticated name ?
MAX_NEW_LINES_DISPLAY = 200 # truncate each diff (and mailout)
MAX_OLD_LINES_DISPLAY = 20 # at this number of lines
LINK_TO_ALL_CATALOGED = 0 # link to all pages in the catalog ? unimplemented
LINK_TO_ALL_OBJECTS = 0 # link to non-wiki page objects ? unimplemented
LARGE_FILE_SIZE = 1024*1024 # images larger than this will not be inlined
LEAVE_PLACEHOLDER = 0 # leave a placeholder page when renaming ?
WIKINAME_LINKS = 1 # enable/disable various wiki link syntaxes
ISSUE_LINKS = 1 # by default
BRACKET_LINKS = 1
DOUBLE_BRACKET_LINKS = 1
DOUBLE_PARENTHESIS_LINKS = 0
BORING_PAGES = ['TestPage','SandBox'] # pages we don't want to see/hear much
IDS_TO_AVOID = ['RESPONSE','REQUEST','Epoz','epoz','URL','outline','recycle_bin']
CONDITIONAL_HTTP_GET = 0 # handle If-modified-since headers with 304 responses
CONDITIONAL_HTTP_GET_IGNORE = [ 'allow_dtml' ]
# ignore pages with these properties set to
# non-False values
# Standard metadata fields which we add to the wiki (or plone) catalog
# and expect in page brain objects. Plugins can add more of these.
#
# shouldn't these use the latest accessors, instead of direct field
# access, eg to ensure proper unicode encoding ?
# there will probably be new and exciting breakage, since our metadata
# will now contain unicode and also, because of things relying on the
# old metadata field names.
# these seem affected: creation_time, creator, last_edit_time,
# last_editor, last_log, parents.. possibly even subscriber_list
# they possibly should be: creationTime, Creator (or a new getCreator,
# since Creator is for plone and might not want to be unicode),
# lastEditTime, lastEditor, lastLog, getParents, subscriberList
# seems like a hassle.. would it be bad to add all of them, old and
# new ? - metadata can eat a lot of kb
#
PAGE_METADATA = [
'Title',
'creation_time',
'creator',
'id',
'lastEditTime',
'last_edit_time',
'lastEditor',
'last_log',
'page_type',
'parents',
'size',
'subscriber_list',
'summary',
#'links', # XXX problems for epoz/plone, not needed ?
]
#from Utils import BLATHER
def registerPageMetaData(t):
"""
Add an attribute name to the list of standard page metadata.
>>> from Products.ZWiki.Defaults import registerPageMetaData
>>> registerPageMetaData('myattribute')
"""
PAGE_METADATA.append(t)
#BLATHER('registered standard metadata field: %s'%t)
# standard catalog indexes which should be present for best performance.
# setupCatalog will install these. Included here so they are easy to find.
TEXTINDEXES = [
'Title',
'SearchableText',
]
#XXX are these correct choice of FieldIndexes vs. KeywordIndexes ?
FIELDINDEXES = [
'isBoring',
'creation_time',
'creator',
'id',
'last_edit_time',
'last_editor',
'meta_type',
'page_type',
'rating',
'voteCount',
]
KEYWORDINDEXES = [
'canonicalLinks',
#'links', # XXX problems for epoz/plone, not needed ?
'parents',
]
DATEINDEXES = [
'creationTime',
'lastEditTime',
]
PATHINDEXES = [
'path',
]
ZWIKI_SPAMPATTERNS_URL = 'http://zwiki.org/spampatterns.txt'
ZWIKI_SPAMPATTERNS_TIMEOUT = 1 # s