Interface SiteService

  • All Known Implementing Classes:
    SiteServiceImpl

    public interface SiteService
    Note: consider renaming A site in Crafter Studio is currently the name for a WEM project being managed. This service provides access to site configuration
    Author:
    russdanner
    • Method Detail

      • getAllAvailableSites

        Set<String> getAllAvailableSites()
      • countSites

        int countSites()
      • deleteSite

        boolean deleteSite​(String siteId)
        remove a site from the system
        Parameters:
        siteId - site identifier
        Returns:
        true if successfully deleted, otherwise false
      • updateLastVerifiedGitlogCommitId

        void updateLastVerifiedGitlogCommitId​(String site,
                                              String commitId)
      • updateLastSyncedGitlogCommitId

        void updateLastSyncedGitlogCommitId​(String site,
                                            String commitId)
        Update last audited gitlog commit id
        Parameters:
        site - site identifier
        commitId - commit ID
      • syncDatabaseWithRepo

        boolean syncDatabaseWithRepo​(String siteId,
                                     String fromCommitId)
                              throws ServiceLayerException
        Synchronize our internal database with the underlying repository. This is required when a user bypasses the UI and manipulates the underlying repository directly.
        Parameters:
        siteId - site to sync
        fromCommitId - commit ID to start at and sync up until current commit
        Returns:
        true if successful, false otherwise
        Throws:
        SiteNotFoundException - site not found
        ServiceLayerException
      • syncDatabaseWithRepo

        boolean syncDatabaseWithRepo​(String siteId,
                                     String fromCommitId,
                                     boolean generateAuditLog)
                              throws ServiceLayerException,
                                     UserNotFoundException
        Synchronize our internal database with the underlying repository. This is required when a user bypasses the UI and manipulates the underlying repository directly.
        Parameters:
        siteId - site to sync
        fromCommitId - commit ID to start at and sync up until current commit
        generateAuditLog - if true add operations to audit log
        Returns:
        true if successful, false otherwise
        Throws:
        SiteNotFoundException - site not found
        ServiceLayerException
        UserNotFoundException
      • getAvailableBlueprints

        SiteBlueprintTO[] getAvailableBlueprints()
        get a list of available blueprints
        Returns:
        list of blueprints
      • rebuildDatabase

        void rebuildDatabase​(String site)
        Rebuild database for site
        Parameters:
        site - site id
      • updateLastCommitId

        void updateLastCommitId​(String site,
                                String commitId)
      • exists

        boolean exists​(String site)
        Check if site already exists
        Parameters:
        site - site ID
        Returns:
        true if site exists, false otherwise
      • existsById

        boolean existsById​(String id)
        Check if site already exists
        Parameters:
        id - site ID in DB
        Returns:
        true if site exists, false otherwise
      • existsByName

        boolean existsByName​(String name)
        Check if site already exists
        Parameters:
        name - site name in DB
        Returns:
        true if site exists, false otherwise
      • isPublishingEnabled

        boolean isPublishingEnabled​(String siteId)
        Check if publishing is enabled for given site
        Parameters:
        siteId - site id
        Returns:
        true if publishing is enabled for given site, otherwise false
      • enablePublishing

        boolean enablePublishing​(String siteId,
                                 boolean enabled)
                          throws SiteNotFoundException
        Enable/Disable publishing for given site
        Parameters:
        siteId - site id
        enabled - true to enable publishing, false to disable publishing
        Returns:
        true if operation was successful, otherwise false
        Throws:
        SiteNotFoundException - site not found
      • updatePublishingStatus

        boolean updatePublishingStatus​(String siteId,
                                       String status)
                                throws SiteNotFoundException
        Update publishing status message for given site
        Parameters:
        siteId - site id
        status - status
        Returns:
        true if publishing status message is successfully updated
        Throws:
        SiteNotFoundException - site not found
      • addRemote

        boolean addRemote​(String siteId,
                          String remoteName,
                          String remoteUrl,
                          String authenticationType,
                          String remoteUsername,
                          String remotePassword,
                          String remoteToken,
                          String remotePrivateKey)
                   throws InvalidRemoteUrlException,
                          ServiceLayerException
        Add remote repository for site content repository
        Parameters:
        siteId - site identifier
        remoteName - remote name
        remoteUrl - remote url
        authenticationType - authentication type
        remoteUsername - remote username
        remotePassword - remote password
        remoteToken - remote token
        remotePrivateKey - remote private key
        Returns:
        true if operation was successful
        Throws:
        InvalidRemoteUrlException - invalid remote url
        ServiceLayerException - general service error
      • removeRemote

        boolean removeRemote​(String siteId,
                             String remoteName)
                      throws SiteNotFoundException
        Remove remote with given name for site
        Parameters:
        siteId - site identifier
        remoteName - remote name
        Returns:
        true if operation was successful
        Throws:
        SiteNotFoundException - site not found
      • getDeletedSites

        List<SiteFeed> getDeletedSites()
        Get deleted sites
        Returns:
        List of deleted sites from DB
      • getLastCommitId

        String getLastCommitId​(String siteId)
        get last commit id for site
        Parameters:
        siteId - site identifier
        Returns:
        last commit id for local studio node
      • getLastVerifiedGitlogCommitId

        String getLastVerifiedGitlogCommitId​(String siteId)
        get last verified git log commit id for site
        Parameters:
        siteId - site identifier
        Returns:
        last verified git log commit id for local studio node
      • getAllCreatedSites

        List<String> getAllCreatedSites()
        Get list of all sites with state = CREATED
        Returns:
        list of sites
      • setSiteState

        void setSiteState​(String siteId,
                          String state)
      • isPublishedRepoCreated

        boolean isPublishedRepoCreated​(String siteId)
      • setPublishedRepoCreated

        void setPublishedRepoCreated​(String siteId)
      • getLastSyncedGitlogCommitId

        String getLastSyncedGitlogCommitId​(String siteId)
        get last audited git log commit id for site
        Parameters:
        siteId - site identifier
        Returns:
        last audited git log commit id for local studio node
      • checkSiteUuid

        boolean checkSiteUuid​(String siteId,
                              String siteUuid)
        Checks if the currently existent site with the given ID also has the same siteUuid.
        Parameters:
        siteId - ID of the site to test
        siteUuid - site UUID
        Returns:
        true if the site UUID file exists and contains the same siteUUID value, false otherwise