Subversion Repositories regexpline_backup

[/] [stable/] [2.3/] [docs/] [readme.txt] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 xrow
Datatype extension for eZ publish 3.6+ (License: GPL)
2
-----------------------------------------------------
3
 
4
Provides a regular expression datatype for eZ publish.
5
 
6
 
7
What is it?
8
-----------
9
For end users it will look like the standard "Text line" datatype that ships with eZ publish.
10
 
11
The biggest difference is that the input will be validated against a regular expression. This enables you to make sure the input meets certain criteria.
12
 
13
It can act like a regular "Text line" datatype by allowing all input (regexp: /.*/).
14
 
15
 
16
Features
17
--------
18
A number between square brackets denotes the version number where said feature has been introduced.
19
If no indication is present, version 1.0 contains the feature.
20
 
21
- Check user input against a regular expression (Perl-compatible)
22
- Ability to specify multiple regular expression [2.0]
23
- Use regular expression subpatterns to be able to use parts of the input in the object name pattern
24
- Ability to customise the text that will be used in the object name pattern [1.1]
25
- Ability to supply a help text for users
26
- Required checks compatible with newer eZ publish versions (drafts ignore required fields)
27
- Information collection support
28
- Attribute filtering support
29
- Ability to define preset regular expressions in an ini file
30
- Ability to select multiple presets [2.0]
31
- Ability to specify an error message per regular expression / preset [2.0]
32
- Ability to display the datatype as a single text line or as a textarea (object edit) [2.0]
33
- Ability to negate regular expressions and presets [2.1]
34
- Support for has_content in templates [2.1]
35
- Stripping of tags with possibility to disable the stripping via the ini file [2.2]
36
- Control the size of both a text line and a text area in content/edit [2.2]
37
- Error messages in case class validation fails [2.3]
38
- Contentclass import & export
39
- i18n support
40
 
41
 
42
Information
43
-----------
44
While editing a contentclass, you will be able to define how the content of a regexpline attribute will be validated.
45
 
46
You can choose two paths:
47
  1. Enter regular expressions directly in the class.
48
  2. Select one or more presets which have been defined in an INI file.
49
 
50
Path 1 is pretty straightforward. The interface will tell you what you can do. Each regular expression you enter can
51
have an error message that describes what should be done to meet the criteria. If you specify multiple regular expressions,
52
the input must match all three expressions.
53
 
54
Path 2 reads the settings from an INI file. You can define as many regular expressions provided you give each of them a
55
unique identifier. With that very same identifier, you can build and array of error messages too. This way, you can accomplish
56
the same thing as in Path 1 (custom messages per regular expression).
57
 
58
Something specific for Path 2 is if the regular expression is negated afterwards (input must NOT match the expression). The datatype
59
will then look for the error message identifier by the regular expression's unique identifier concatenated with '_negate'. This is of
60
course not needed if you take Path 1 (the regular expression will always be negated for that attribute and the error message can be
61
constructed to reflect that).
62
 
63
Any subpatterns in the regular expressions chosen for an attribute will be available for use in the object name pattern. The datatype
64
allows you to construct a custom string of these subpatterns. The custom string will then be used in real object name pattern if you
65
construct the contentclass to do so.
66
 
67
 
68
Planned Features
69
----------------
70
These features are NOT available yet, but they're coming.
71
 
72
No planned features at the time of writing
73
 
74
 
75
Requirements
76
------------
77
- A suitable eZ publish version: 3.6.x; 3.7.x has also been used during development.
78
- Knowledge of Perl Compatible Regular Expression syntax (http://www.php.net/manual/en/ref.pcre.php)
79
 
80
 
81
Installation
82
------------
83
You can always find the latest version of this extension @
84
http://pubsvn.ez.no/community/trunk/extension/regexpline
85
 
86
If you can't use SVN, you can also download the most recently released version from the Contributions section @
87
http://ez.no/community/contribs
88
 
89
- Extract or checkout the regexpline extension into the eZ publish 'extension' folder
90
- Activate the extension by means of the admin interface or by adding
91
 
92
  ActiveExtensions[]=regexpline
93
 
94
  to [ExtensionSettings] in site.ini.append(.php)
95
- Clear the template override cache to make sure eZ publish picks up the templates in the extension.
96
 
97
 
98
Bugs? Comments? Wishes?
99
-----------------------
100
- Bugs: If you report a bug, please make sure you have a minimal testcase so I can reproduce the problem.
101
  If I can't reproduce it, I can't fix it.
102
 
103
- Comments: Nothing special here :)
104
 
105
- Wishes: Please provide a clear description.
106
 
107
Direct all (fan|bug|wish)mail at: hans <dotty> melis <atty> gmail <dotty> com
108
 
109
Please note that this datatype has been developed in my spare time, and is supplied as is. I'm not responsible for any data loss or failures. YMMV!
110
 
111
 
112
Tips & Tricks
113
-------------
114
1. If you want to refer to the complete text that matched the regular expression in the object name pattern, you can use <0> as tag.
115
 
116
 
117
Copyright
118
---------
119
 
120
Regular Expression datatype for eZ publish 3.6+
121
Copyright (C) 2005-2006  Hans Melis
122
 
123
This program is free software; you can redistribute it and/or modify
124
it under the terms of the GNU General Public License as published by
125
the Free Software Foundation; either version 2 of the License, or
126
(at your option) any later version.
127
 
128
This program is distributed in the hope that it will be useful,
129
but WITHOUT ANY WARRANTY; without even the implied warranty of
130
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131
GNU General Public License for more details.
132
 
133
You should have received a copy of the GNU General Public License
134
along with this program; if not, write to the Free Software
135
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA