Interface ContributionLocator

  • All Known Implementing Classes:
    DefaultContributionLocator

    public interface ContributionLocator

    This interface defines the locator of Contribution instances from part of ContributionIdentifier data.

    The aim is to compute from partial identifier the full ContributionIdentifier which can then be used by ApplicationService services to get a contribution instance.
    This mechanism is useful for core services which have to perform treatments on contributions (like permalink for example).

    Its important, from the point of view of performances, to use this service only in particular cases. For example, a permalink can not have the component instance identifier about a contribution identifier, otherwise a contribution moved from a component instance to another one become not valid.

    Author:
    silveryocha
    • Method Detail

      • locateByLocalIdAndType

        Optional<ContributionIdentifier> locateByLocalIdAndType​(String localId,
                                                                String type)

        Gets the full ContributionIdentifier of a Contribution from a local identifier and a type.

        A local identifier is an identifier which is unique into the context of a component.
        In a higher scope level, application level so, there is no guarantee that the local identifier could be unique.
        That is why the type is a mandatory data for the contribution location search. Indeed, a local id could not be unique at application level, but a couple localId / type has to (publication services for example).

        Parameters:
        localId - a local identifier.
        type - a type of contribution.
        Returns:
        the optional full ContributionIdentifier.