(Providence) How to hide a relationship bundle for certain ca_objects types

An object's "publisher" is a relationship with the entities table. How can I hide this bundle placement for certain ca_objects types, like a manuscript?


<placement code="ca_publisher">
    <bundle>ca_entities</bundle>
    <settings>
        <setting name="restrict_to_relationship_types">publisher</setting>
        <setting name="label" locale="en_US">Publisher</setting>
        <setting name="label" locale="es_PR">Publicador</setting>
    </settings>
</placement>


I have considered defining a typeless pseudo-relationship element instead, as such:

<metadataElement code="publisher" datatype="Entities">
    <labels>
        <label locale="en_US">
            <name>Publisher</name>
        </label>
    </labels>
    <typeRestrictions>
        <restriction>
            <table>ca_objects</table>
            <type>published_documents</type>
        </restriction>
    </typeRestrictions>
</metadataElement>

...in order to be able to hide it for manuscripts. All example profiles use true relationships instead of typeless pseudo-relationships. Should I use the pseudo-relationship? Are there any drawbacks to using them? Is there any other way to not have a publisher on a manuscript?

Comments

  • Look at the type restriction settings for the relationship type. There are "left" and "right" values, corresponding to object and entities respectively for an object-entity relationship (table ca_objects_x_entities). You can set these such that the relationship type will only be available for the specific type or type pair.

    Entity metadata elements aren't pseudo-relationships. They're simply fields that happen to use the entity authority to define the set of valid values for the element. By contrast, when you define a relationship between two records you're actually creating a third record representing the link, one that can include almost any type of field and can be referenced uniquely and directly. With "authority" metadata elements (elements of type entity, object, collection, etc) there's no full record, just a value that happens to point to a record of the relevant type.

    If you just need a reference to an entity embedded in an object, the metadata element route is ok. If you have anything more to say about the link between object and publisher, or need to have those publisher links show up in the same contexts as other related entities a relationship should be used.

    In general, when in doubt use a relationship.

Sign In or Register to comment.