custom node types and namespaces
(MAGNOLIA-1364)
|
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Sub-task | Priority: | Major |
| Reporter: | Oliver Lietz | Assignee: | Oliver Lietz |
| Resolution: | Outdated | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Date of First Response: |
| Comments |
| Comment by Oliver Lietz [ 03/May/07 ] |
|
The controlType name is used to generate names and ids for HTML and JavaScript. When using custom node types and namespaces, the prefix is separated by a colon from the node/property name (e.g. jcr:mimeType). This leads to illegal names/ids. broken:
|
| Comment by Oliver Lietz [ 15/Jun/07 ] |
|
(from dev-list@) This method is not 100% save. Think we have similar property names:
A better solution would be to hex-encode the names. It's saver but leads to I have to review the JS and check if they make use of the property name to |
| Comment by Oliver Lietz [ 15/Jun/07 ] |
|
There is indeed JS which makes use of the property name (id/name) to construct the id/names of HTML elements for accessing them. This forces us to use a bi-directional en-/decoding of the ids/names. hexencoding/hexdecoding looks best for that purpose. HTML: use StringUtils.hexencode(string) for ids and names JS: use StringUtils.hexencode(string) when constructing function names or paramter values when they are (final) HTML ids/names DON'T use hexencode for parameter values in JS functions when it's the pure id/name, the JS has to encode the id/name itself when it's used for accessing HTML elements |
| Comment by Philipp Bracher [ 22/Jun/07 ] |
|
I don't like this hexencoding of former readable strings. What is about to url encode the srtings (only special characters are encoded)? |
| Comment by Oliver Lietz [ 22/Jun/07 ] |
|
> What is about to url encode the srtings (only special characters are encoded)? Doesn't work for several reasons:
There are lots of cases where ids/names are prefixed or suffixed, e.g. btn_ or _fileNameExtension - only the id/name should be encoded and the prefix/suffix should be let as is. |
| Comment by Oliver Lietz [ 23/Jun/07 ] |
|
make it more consistent and separate all prefixes and suffixes from id/name with _ (underscore) |
| Comment by Oliver Lietz [ 23/Jun/07 ] |
|
we can use the universal title attribute for human readable (unencoded) names |
| Comment by Oliver Lietz [ 25/Jun/07 ] |
|
| Comment by Oliver Lietz [ 01/Jul/07 ] |
|
| Comment by Oliver Lietz [ 12/Jul/07 ] |
|
> - replace getElementById with getElementsByName when used for grouped elements (e.g. button sets) reviewed: name attribute is deprecated, see |
| Comment by Oliver Lietz [ 01/Aug/07 ] |
|
> There are lots of cases where ids/names are prefixed or suffixed, e.g. btn_ or _fileNameExtension - only the id/name should be makes encoding/decoding to complex, hence complete id has to be encoded > we can use the universal title attribute for human readable (unencoded) names ugly hack and normally human readable id is not needed |
| Comment by Magnolia International [ 11/Mar/10 ] |
|
the "custom-experimental" branch referred to in this issue was moved to http://svn.magnolia-cms.com/svn/community/graveyard/namespace-and-cnd-support-experiment/ |
| Comment by Magnolia International [ 11/Mar/10 ] |
|
The work in this branch is outdated; with 5.0, this issue will not be present and/or be fixed in a different way. |