Class ModuleEditorInterfaces


  • public class ModuleEditorInterfaces
    extends java.lang.Object
    Editor Interfaces Module.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModuleEditorInterfaces​(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)
      Create this module.
    • Constructor Detail

      • ModuleEditorInterfaces

        public ModuleEditorInterfaces​(retrofit2.Retrofit retrofit,
                                      java.util.concurrent.Executor callbackExecutor,
                                      java.lang.String spaceId,
                                      java.lang.String environmentId,
                                      boolean environmentIdConfigured)
        Create this module.
        Parameters:
        retrofit - the retrofit instance to be used to create the service.
        callbackExecutor - to tell on which thread it should run.
        spaceId - the space to be used when not given.
        environmentId - the environment to be used when not given.
        environmentIdConfigured - internal helper to see if environment was set.
    • Method Detail

      • createService

        protected com.contentful.java.cma.ServiceEditorInterfaces createService​(retrofit2.Retrofit retrofit)
      • fetchOne

        public CMAEditorInterface fetchOne​(java.lang.String contentTypeId)
        Return an editor interface by id using the configured space and environment.
        Parameters:
        contentTypeId - the contentTypeId this editor interface is valid on.
        Returns:
        the editor interface for a specific content type on a specific space.
        Throws:
        java.lang.IllegalArgumentException - if configured space id is null.
        java.lang.IllegalArgumentException - if configured environment id is null.
        java.lang.IllegalArgumentException - if content type id is null.
        See Also:
        CMAClient.Builder.setSpaceId(String), CMAClient.Builder.setEnvironmentId(String)
      • fetchOne

        public CMAEditorInterface fetchOne​(java.lang.String spaceId,
                                           java.lang.String environmentId,
                                           java.lang.String contentTypeId)
        Get the editor interface by id, using the given space and environment.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String) and CMAClient.Builder.setEnvironmentId(String).

        Parameters:
        spaceId - the id of the space this environment is part of.
        environmentId - the id of the environment this editor interface is valid on.
        contentTypeId - the contentTypeId this editor interface is valid on.
        Returns:
        the editor interface for a specific content type on a specific space.
        Throws:
        java.lang.IllegalArgumentException - if space id is null.
        java.lang.IllegalArgumentException - if environment id is null.
        java.lang.IllegalArgumentException - if content type id is null.
      • update

        public CMAEditorInterface update​(CMAEditorInterface editor)
        Update an editor interface.
        Parameters:
        editor - the editor interface to be updated on Contentful.
        Returns:
        the updated editor interface.
        Throws:
        java.lang.IllegalArgumentException - if editors spaceId is null.
        java.lang.IllegalArgumentException - if editors contentType is null.
        java.lang.IllegalArgumentException - if editors contentTypeId is null.
        java.lang.IllegalArgumentException - if editors version is not set.