com.hlcl.rql.hip.as
Class PublishPagePolicies

java.lang.Object
  extended by com.hlcl.rql.hip.as.PublishPagePolicies

public class PublishPagePolicies
extends java.lang.Object

Author:
lejafr This class encapsulate rules for the publishing of hip.hlcl.com pages. It acts as an helper class the script publishPage.jsp.

Constructor Summary
PublishPagePolicies(Page startPage)
          Construct a policies helper object.
 
Method Summary
 java.lang.String convertPageStageToServerName(java.lang.String stageName)
          Converts the given stage name (like DEVE, TEST, PROD) into a domain name for the gui.
 PublishingJob createPagePublishingJob(java.lang.String targetStage, boolean withFollowingPages, boolean withRelatedPages)
          Returns the publishing job for page and page config; configured with project- and language variants.
 void forceDebug()
          Ändert den debug level auf DEBUG.
 java.lang.String getDebugLevel()
          Returns the debug level string
 java.lang.String getJobFirstLanguageVariantGuid()
          Returns the only one language variant (=English) GUID.
 java.lang.String[] getJobLanguageVariantGuids()
          Returns all language variant GUIDs of the publishing job.
 java.lang.String getJobProjectVariantGuids(java.lang.String targetStage, java.lang.String separator)
          Returns a separated string with all project variant GUIDs for the given stage.
 java.util.List<ProjectVariant> getJobProjectVariants(java.lang.String targetStage)
          Returns a list of all project variants for the given stage.
 java.lang.String[] getLanguageVariantGuidsPageNeedsToBePublished()
          Returns the main language variant (=English) GUID.
 java.util.List<java.lang.String> getPagePossibleStagesForUserAndPage()
          Returns an ordered list (in fact a set) with all stage names (WORK,DEVE,TEST,PROD,ARCHIVE=first part of pv name)
 java.util.List<ProjectVariant> getPageProjectVariantsUserCanAndPageNeedsToBePublished()
          Returns a list of all project variants the connected user can publish and the start page needs to be published (no mail).
 java.util.List<PublishingTarget> getPublishingTargets()
          Returns the publishing targets, cached.
 Page getStartPage()
          Returns the start page.
 boolean isBlockPage()
          Returns true, if the start page is a block or other page (_row).
 boolean isDebug()
          Returns true, if debug information should be displayed.
 boolean isPhysicalPage()
          Returns true, if the start page is a physical page.
 boolean isPublishFollowing()
          Returns true, if the start page has to be published with following pages, for HIP always false.
 boolean isPublishFollowingEnabled()
          Returns true, if published with following pages checkbox is enabled or not.
 boolean isPublishRelated()
          Returns true, if the start page has to be published with related pages, for HIP always true.
 boolean isPublishRelatedEnabled()
          Returns true, if published with related pages checkbox is enabled or not, for hip always false.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublishPagePolicies

public PublishPagePolicies(Page startPage)
                    throws RQLException
Construct a policies helper object.

Throws:
RQLException
Method Detail

convertPageStageToServerName

public java.lang.String convertPageStageToServerName(java.lang.String stageName)
                                              throws RQLException
Converts the given stage name (like DEVE, TEST, PROD) into a domain name for the gui.

Assume that the publishing target names consists of 3 parts separated by _ in form: stageName_domainName_serverName.

Throws:
RQLException

createPagePublishingJob

public PublishingJob createPagePublishingJob(java.lang.String targetStage,
                                             boolean withFollowingPages,
                                             boolean withRelatedPages)
                                      throws RQLException
Returns the publishing job for page and page config; configured with project- and language variants.

Throws:
RQLException

forceDebug

public void forceDebug()
                throws RQLException
Ändert den debug level auf DEBUG.

Throws:
RQLException

getDebugLevel

public java.lang.String getDebugLevel()
                               throws RQLException
Returns the debug level string

Throws:
RQLException

getJobFirstLanguageVariantGuid

public java.lang.String getJobFirstLanguageVariantGuid()
                                                throws RQLException
Returns the only one language variant (=English) GUID.

Throws:
RQLException

getJobLanguageVariantGuids

public java.lang.String[] getJobLanguageVariantGuids()
                                              throws RQLException
Returns all language variant GUIDs of the publishing job.

Throws:
RQLException

getJobProjectVariantGuids

public java.lang.String getJobProjectVariantGuids(java.lang.String targetStage,
                                                  java.lang.String separator)
                                           throws RQLException
Returns a separated string with all project variant GUIDs for the given stage.

Parameter targetStage has to be one of getPagePossibleStagesForUserAndPage().

Throws:
RQLException

getJobProjectVariants

public java.util.List<ProjectVariant> getJobProjectVariants(java.lang.String targetStage)
                                                     throws RQLException
Returns a list of all project variants for the given stage.

Parameter targetStage has to be one of getPagePossibleStagesForUserAndPage().

Throws:
RQLException

getLanguageVariantGuidsPageNeedsToBePublished

public java.lang.String[] getLanguageVariantGuidsPageNeedsToBePublished()
                                                                 throws RQLException
Returns the main language variant (=English) GUID.

Throws:
RQLException

getPagePossibleStagesForUserAndPage

public java.util.List<java.lang.String> getPagePossibleStagesForUserAndPage()
                                                                     throws RQLException
Returns an ordered list (in fact a set) with all stage names (WORK,DEVE,TEST,PROD,ARCHIVE=first part of pv name)

the user can publish the given start page.

Assumes, that the stage name is at the beginning of the project variant name!

Throws:
RQLException

getPageProjectVariantsUserCanAndPageNeedsToBePublished

public java.util.List<ProjectVariant> getPageProjectVariantsUserCanAndPageNeedsToBePublished()
                                                                                      throws RQLException
Returns a list of all project variants the connected user can publish and the start page needs to be published (no mail).

Throws:
RQLException

getPublishingTargets

public java.util.List<PublishingTarget> getPublishingTargets()
                                                      throws RQLException
Returns the publishing targets, cached.

Throws:
RQLException

getStartPage

public Page getStartPage()
                  throws RQLException
Returns the start page.

Throws:
RQLException

isBlockPage

public boolean isBlockPage()
                    throws RQLException
Returns true, if the start page is a block or other page (_row).

Throws:
RQLException
See Also:
isPhysicalPage()

isDebug

public boolean isDebug()
                throws RQLException
Returns true, if debug information should be displayed.

Throws:
RQLException

isPhysicalPage

public boolean isPhysicalPage()
                       throws RQLException
Returns true, if the start page is a physical page.

Throws:
RQLException
See Also:
isBlockPage()

isPublishFollowing

public boolean isPublishFollowing()
                           throws RQLException
Returns true, if the start page has to be published with following pages, for HIP always false.

Throws:
RQLException

isPublishFollowingEnabled

public boolean isPublishFollowingEnabled()
                                  throws RQLException
Returns true, if published with following pages checkbox is enabled or not.

True only for physical pages and users in special group.

Throws:
RQLException

isPublishRelated

public boolean isPublishRelated()
                         throws RQLException
Returns true, if the start page has to be published with related pages, for HIP always true.

Throws:
RQLException

isPublishRelatedEnabled

public boolean isPublishRelatedEnabled()
                                throws RQLException
Returns true, if published with related pages checkbox is enabled or not, for hip always false.

Throws:
RQLException