Class AbstractPublicationStatusHandler<T extends Publication>

  • Type Parameters:
    T - type of publication
    All Implemented Interfaces:
    org.eclipse.debug.core.IStatusHandler

    public abstract class AbstractPublicationStatusHandler<T extends Publication>
    extends Object
    implements org.eclipse.debug.core.IStatusHandler
    Abstract status handler that handles publication requested error status.
    Handler opens publication dialog with publication wizard or existing publications selection dialog.

    Handler expects PublicationRequest as source object to handle and returns PublicationResult as result object.

    • Constructor Detail

      • AbstractPublicationStatusHandler

        public AbstractPublicationStatusHandler​(boolean describePublishedRuntime)
        Parameters:
        describePublishedRuntime - whether need to describe published 1C:Enterprise Runtime
    • Method Detail

      • handleStatus

        public Object handleStatus​(org.eclipse.core.runtime.IStatus status,
                                   Object source)
                            throws org.eclipse.core.runtime.CoreException
        Specified by:
        handleStatus in interface org.eclipse.debug.core.IStatusHandler
        Throws:
        org.eclipse.core.runtime.CoreException
      • getDisplay

        protected org.eclipse.swt.widgets.Display getDisplay()
        Get a current display. Can return null if none.
        Returns:
        a current display or null if none
      • getPublicationImage

        protected org.eclipse.swt.graphics.Image getPublicationImage​(Publication publication)
        Returns the image to use in publication selection dialog.
        Parameters:
        publication - the publication to show image for, cannot be null
        Returns:
        the image to use in publication selection dialog, never null
      • getComponent

        protected <C extends IRuntimeComponent,​E extends IRuntimeComponentExecutorPair<C,​E> getComponent​(IResolvableRuntimeInstallation resolvable,
                                                                                                                       String componentTypeId)
                                                                                                                throws org.eclipse.core.runtime.CoreException
        Returns the given 1C:Enterprise Runtime installation publish component as pair: publish executor and target installation component instance.
        Parameters:
        resolvable - the resolvable 1C:Enterprise Runtime installation, cannot be null
        componentTypeId - the 1C:Enterprise Runtime component id, cannot be null
        Returns:
        a pair: the target installation component instance and the component executor, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if target installation has no component installed
      • validate

        protected boolean validate​(T publication,
                                   IResolvableRuntimeInstallation resolvable)
                            throws org.eclipse.core.runtime.CoreException
        Returns whether the given publication is valid with the given requested resolvable 1C:Enterprise Runtime installation.

        Default implementation returns true.

        Parameters:
        publication - the publication instance to validate, cannot be null
        resolvable - the requsted resolvable 1C:Enterprise Runtime installation to check publication validity for, cannot be null
        Returns:
        whether the given publication is valid
        Throws:
        org.eclipse.core.runtime.CoreException - if validation request fails
      • findExisting

        protected abstract Collection<T> findExisting​(InfobaseReference infobase)
                                               throws org.eclipse.core.runtime.CoreException
        Find existing publications for the given infobase.
        Parameters:
        infobase - the infobase to search publications for, cannot be null
        Returns:
        a collection of matching publications, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if search fails
      • publish

        protected abstract PublicationResult publish​(InfobaseReference infobase,
                                                     IResolvableRuntimeInstallation resolvable)
                                              throws org.eclipse.core.runtime.CoreException
        Publish the given infobase with the given requested resolvable 1C:Enterprise Runtime installation.
        Parameters:
        infobase - the infobase to publish, cannot be null
        resolvable - the resolvable 1C:Enterprise Runtime installation to use, cannot be null
        Returns:
        publication result - instance of publication and publication process status, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if publishing fails
      • republish

        protected abstract PublicationResult republish​(InfobaseReference infobase,
                                                       IResolvableRuntimeInstallation resolvable,
                                                       T existing)
                                                throws org.eclipse.core.runtime.CoreException
        Re-publish the given existing publication instance with the given infobase with the given requested resolvable 1C:Enterprise Runtime installation.
        Parameters:
        infobase - the infobase to publish, cannot be null
        resolvable - the esolvable 1C:Enterprise Runtime installation to use, cannot be null
        existing - the existing publication instance that is already published, cannot be null
        Returns:
        publication result - instance of publication and publication process status, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if re-publishing fails