1. Thomas Waldmann
  2. moin-2.0
Issue #81 open

store a list of names into meta[NAME]

Thomas Waldmann
repo owner created an issue

currently, meta[NAME] has a single unicode value (the item name).

it could be changed to be a list of unicode item names.

all these names would be valid names for the item, maybe with some preference on the first one (e.g. if we need to display the name).

like for tags, searching for name_exact:foo would automatically search the list for a member "foo".

practically, this would make the following stuff possible: having "alias names" for items make same thing show up at multiple places (like hardlinks in file system) not needing redirect items if you "rename" an item (== add another name to the list) that is linked from other items or from the outside the name list could have zero elements, making the item somehow vanish from the surface (namespace, index) and be "deleted" (but still being there in storage, just not having a name, but still an itemid, revisions, etc.). the name(s) it had before can still be fetched from its parent revision.

Comments (15)

  1. Thomas Waldmann reporter

    related idea because of that name-based routing issue if you don't have a name:

    maybe we have the wrong concept here (mounting backends into the namespace as posix OSes are doing it), like

    • MainContentItem (name stored in storage: MainContentItem)
    • UserProfile/AnItemStoredIntoUserProfileBackend (name stored in storage: AnItemStoredIntoUserProfileBackend, the UserProfile/ is the mountpoint and not part of the storage name)

    if we would have different namespaces rather, which are a prefix and not part of the visible "item name", we always would know where to put stuff, like:

    • MainContentItem
    • userprofile:AnItemStoredIntoUserProfileBackend

    Note: interwiki markup is OtherWiki:OtherItem

  2. Thomas Waldmann reporter
    1. SomePage default wiki, default namespace
    2. somenamespace:SomePage default wiki, nondefault namespace
    3. MoinMoin:SomePage interwiki, default namespace
    4. MoinMoin:somenamespace:SomeOtherPage interwiki + nondefault namespace

    problem: ambiguity between 2 and 3.

    to solve, maybe we could maybe automatically detect whether it is a namespace (we know the local ns names)

  3. Thomas Waldmann reporter

    Solution idea:

    • do not do name-based routing any more (sigh, now after the code finally worked)
    • use namespaces

    Names in markup would look like this (wn is wikiname, ns is namespace, pn is pagename):

    • pn (simple, local pagelink, as in 1.9)
    • wn:pn (interwiki, as in 1.9)
    • :ns:pn (local pagelink to another namespace)
    • wn:ns:pn (interwiki link with namespace)
    • :ns1:ns11:pn (local pagelink with hierarchical namespaces)
    • wn:ns1:ns11:pn (interwiki pagelink with h. ns)

    wikiconfig:

    # map namespaces to backends
    map = {
        '': BEdefault,
        'ns1': BE1,
        'ns1:ns11': BE1, # can be also another BE
        'userprofiles': BE2,
        'files': BE3,
    }
    

    Note: we store the namespace info into revision metadata, so we can store multiple namespace's revisions into same backend.

    creating interwiki URLs with namespaces: maybe we can extend interwiki map a bit:

    WikiName http://wikiserver/
    WikiName:ns1 http://wikiserver/ns1/ # or whatever the other wiki wants
    WikiName:ns1:ns11 http://wikiserver/ns1/ns11/ # or whatever the other wiki wants
    

    Note: using this interwikimap (and our own namespace map), we can know what namespaces the remote wiki has, so by doing some lookups into the map, we can decide what's the interwiki:ns1:ns11 part and what is maybe a strange foo:bar finnish word.

  4. Thomas Waldmann reporter

    we need to be careful about this:

    [[http://server/path]]
    [[foo:bar/baz]]
    

    You see it is somehow similar and the url spec is so wide it is not helping us. We currently have a list of known protocols to solve this, but we should advise users not to create namespaces or interwikinames that can be read as a protocol (at least not one they want to support in the wiki).

  5. Thomas Waldmann reporter

    also, we need to tell users not to create pages with names that start with <somenamespacename>:

    and use validation to make sure.

    we already have a similar problem with interwiki, so this is not new.

  6. Thomas Waldmann reporter

    Ok, this issue is getting rather big, so we split it into multiple issues that should be done in this order (roughly, some stuff might be doable in parallel):

    1. add tests and implementation for new interwiki:namespace:itemname parsing / resolving, have some finnish/swedish word to test whether it works with exotic intra-word usage of colons also, also have a pagename like "TODO: whatever" and try to make sure both works
    2. implement namespace layer + configuration + tests (namespaces: '' (default), 'userprofiles'), map namespaces to backend names, backend names to backends
    3. integrate namespace layer, remove routing layer
    4. check serialization code, give backend name to serializer/unserializer
    5. check interwiki+namespace behaviour, make an extended interwiki map with namespaces
    6. add item name check to existing validation code
    7. implement meta[NAME] as a list with 1 element
    8. make sure code works if meta[NAME] list has != 1 elements (0 == deleted, >1 aliases)
    9. make a view that shows "0 name" items (using the parent revision's NAME) == trashbin
    10. offer undelete on the trashbin view
    11. change rename view to display N+2 name fields, so one can edit the name and/or add/remove names.
    12. maybe reuse the rename view for delete, telling "if you remove all names, the item will be deleted" (the user should be aware of which names he is removing to avoid accidentally breaking links)
    13. indicate len(names) > 1 somehow on the UI, maybe like "itemname+"? mouse over + would show all names?
  7. Thomas Waldmann reporter

    the issues pointed out in comment 16 can maybe be solved in 2 ways: using only the first name for hier. acl computation. using only the currently used name (see url) for hier. acl computation

  8. Log in to comment