Open Source Content Management Framework

MgdSchema dependent objects

  1. MgdSchema dependent objects

    Thu January 08 2009 12:24:24 UTC
    Hi!

    Take a look at this ticket:
    http://trac.midgard-project.org/ticket/541

    First requirement is already fixed in Ragnaroek.
    The latter one makes me think about adding new MgdSchema methods.

    To make it internally in core, I need to create new core functions which
    check:

    * object has children
    * object has attachemnts
    * object has parameters

    What about adding such methods to public API?

    * bool has_children(void);

    Returns true if object has children objects.
    Basically this function will check every class children objects, even
    of the same type.
    And will return false if any of child class' object (in tree) exists.

    * bool has_attachments(void);

    Returns true if object has attachments. Blob existance check will not
    be done.

    * bool has_parameters(void);

    Returns true of object has parameters.

    Of course, base delete and purge methods will use all those methods
    internally to keep data safe.

    And the questions are:

    * Do we have use cases to provide such API on higher level?
    * Should we look for dependent objects during delete or purge? Or both?

    Piotras
    _______________________________________________
    dev mailing list
    dev@lists.midgard-project.org
    http://lists.midgard-project.org/mailman/listinfo/dev
    •  Reply
  2. Re: MgdSchema dependent objects

    Thu January 08 2009 12:28:39 UTC

    Hi,

    • Do we have use cases to provide such API on higher level?

    Yes, I think it would make life easier in places like replicator and Asgard navigation.

    • Should we look for dependent objects during delete or purge? Or both?

    I think so, yes.

    At least in Vinland trying to delete an object that has undeleted dependents should raise an exception. For Ragnaroek that is probably too big API change.

    /Henri

    •  Reply
  3. Re: [midgard-dev] MgdSchema dependent objects

    Thu January 08 2009 12:34:23 UTC
    Henri Bergius writes:
    > Hi,
    >
    >> * Do we have use cases to provide such API on higher level?
    >
    > Yes, I think it would make life easier in places like replicator and Asgard navigation.

    OK. those methods should be optimized for perfromance, so could be
    faster then QB's count.
    And bindings implementation is trivial once we have those in core.

    >> * Should we look for dependent objects during delete or purge? Or both?
    >
    > I think so, yes.

    Yes both? Or only one of them? :)
    I was thinking that would be safe to ignore check during purge once
    object is marked as deleted.
    But on the other hand consistency is much more important than purge
    performance.

    > At least in Vinland trying to delete an object that has undeleted dependents should raise an exception. For Ragnaroek that is probably too big API change.

    Yes, this is only vinland thing. In Ragnaroek we can workaround it on
    PHP level if needed.

    Piotras
    _______________________________________________
    dev mailing list
    dev@lists.midgard-project.org
    http://lists.midgard-project.org/mailman/listinfo/dev
    •  Reply
  4. Re: [midgard-dev] MgdSchema dependent objects

    Thu January 08 2009 12:39:40 UTC
    On Thu, 08 Jan 2009 13:34:23 +0100, Piotr Pokora <piotrek.pokora@gmail.com>
    wrote:

    > But on the other hand consistency is much more important than purge
    > performance.

    +2

    Solt
    _______________________________________________
    dev mailing list
    dev@lists.midgard-project.org
    http://lists.midgard-project.org/mailman/listinfo/dev
    •  Reply
Designed by Nemein, hosted by Kafit