com.atlassian.confluence.pages.actions
Class AbstractCreateAndEditPageAction

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.atlassian.confluence.core.ConfluenceActionSupport
          extended by com.atlassian.confluence.pages.actions.AbstractPageAction
              extended by com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
                  extended by com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
                      extended by com.atlassian.confluence.pages.actions.AbstractCreateAndEditPageAction
All Implemented Interfaces:
PageAware, com.opensymphony.xwork.Action, com.opensymphony.xwork.LocaleProvider, com.opensymphony.xwork.TextProvider, com.opensymphony.xwork.Validateable, com.opensymphony.xwork.ValidationAware, Serializable
Direct Known Subclasses:
AbstractCreatePageAction, AbstractEditPageAction

public abstract class AbstractCreateAndEditPageAction
extends AbstractTemplatePageAction

See Also:
Serialized Form

Field Summary
protected  String captchaResponse
           
protected  DraftManager draftManager
           
protected  String editPermission
           
protected  String editPermissionGroup
           
protected  String editPermissionRadio
           
static String GROUP_RADIO
           
protected  String newSpaceKey
           
protected  long parentPageId
           
protected  String parentPageSpaceKey
           
protected  String parentPageString
           
protected  String parentPageTitle
           
static String USER_PERMISSION
           
protected  String viewPermission
           
protected  String viewPermissionGroup
           
protected  String viewPermissionRadio
           
 
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
pageTemplateManager, templateId
 
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
back, content, inPreview, preview, wikiStyleRenderer, wysiwygContent
 
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
captchaManager, contentPermissionManager, expertView, incomingLinks, isXHtml, linkManager, MARKUP, pageManager, postingDay, PREVIEW, RICHTEXT, spaceManager, wysiwygConverter
 
Fields inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
CANCEL, DEVMODE, eventManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, localeManager, log, permissionManager, permitted, settingsManager, spacePermissionManager, userAccessor, webInterfaceManager
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
AbstractCreateAndEditPageAction()
           
 
Method Summary
protected  String applyEditPermissions()
           
protected  String applyViewPermissions()
           
 String doDefault()
          Default webwork action execution method.
protected static String escapeWithBackslash(String toEscape)
          Escapes each comma and backslash with a leading backslash
 String getCancelResult()
           
 String getCaptchaResponse()
           
protected abstract  String getContentType()
           
 ContentPermission getCurrentEditPermission()
           
 ContentPermission getCurrentViewPermission()
           
 Draft getDraft()
           
 String getEditPermission()
           
 String getEditPermissionGroup()
          Returns the groupname escaped with backslashes.
 String getEditPermissionRadio()
           
 List getGroups()
          returns a list of available groups that a user can assign page level permissions to.
 Boolean getLabelsShowing()
           
 String getLabelsString()
           
 Boolean getLocationShowing()
           
 String getNewSpaceKey()
           
 Page getParentPage()
           
 long getParentPageId()
           
 String getParentPageSpaceKey()
          If the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value.
 String getParentPageString()
           
 String getParentPageTitle()
           
protected  List getPermissionTypes()
           
 Boolean getRestrictionsShowing()
           
 String getTitle()
           
 String getViewPermission()
           
 String getViewPermissionGroup()
          Returns the groupname escaped with backslashes.
 String getViewPermissionRadio()
           
protected static String interpretBackslashAsEscape(String escaped)
          Treats backslashes as escape characters.
protected  boolean isPermissionModified(String type)
           
 boolean isShowDraftMessage()
           
 boolean isUseDraft()
           
 void setCaptchaResponse(String captchaResponse)
           
 void setDiscardDraft(boolean discardDraft)
           
 void setDraftManager(DraftManager draftManager)
           
 void setEditPermission(String editPermission)
           
 void setEditPermissionGroup(String editPermissionGroup)
          Expects to receive an escaped version of the group name, as that is what comes from the front end.
 void setEditPermissionRadio(String editPermissionRadio)
           
 void setLabelsShowing(Boolean labelsShowing)
           
 void setLabelsString(String labelsString)
           
 void setLocationShowing(Boolean locationShowing)
           
 void setNewSpaceKey(String newSpaceKey)
           
 void setParentPageId(long parentPageId)
           
 void setParentPageSpaceKey(String parentPageSpaceKey)
           
 void setParentPageString(String parentPageString)
           
 void setParentPageTitle(String parentPageTitle)
           
 void setRestrictionsShowing(Boolean restrictionsShowing)
           
 void setShowDraftMessage(boolean showDraftMessage)
           
 void setTitle(String title)
           
 void setUseDraft(boolean useDraft)
           
 void setViewPermission(String viewPermission)
           
 void setViewPermissionGroup(String viewPermissionGroup)
          Note, this expects to receive an escaped version of the group name, as that is what comes from the front end.
 void setViewPermissionRadio(String viewPermissionRadio)
           
 void validate()
           
 
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
getGlobalPageTemplates, getPageTemplate, getSpacePageTemplates, getTemplateId, loadTemplates, setPageTemplateManager, setTemplateId
 
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
getContent, getInPreview, getPageOrDummyPage, getWysiwygContent, getxHtmlContent, setBack, setContent, setInPreview, setPreview, setWikiStyleRenderer, setWysiwygcontent, updateXHtmlContent
 
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
extractPageTitle, extractSpaceKey, generateAncestryBreadcrumbs, getAvailableSpaces, getBeanKey, getBlogPost, getCaptchaId, getCaptchaManager, getExpertView, getHelper, getIncomingLinks, getMARKUP, getMode, getNextPost, getPage, getPageId, getPermittedChildren, getPostingDate, getPostingDay, getPostingDayOfMonth, getPostingMonth, getPostingMonthNumeric, getPostingYear, getPREVIEW, getPreviousPost, getRICHTEXT, getShowMarkup, getSpace, getSpaceKey, getSpaceManager, getSubscribableName, getSuggestedLabels, getSupportWysiwyg, getTinyUrl, getUseWysiwyg, getXhtml, hasAttachFilePermissions, hasInvalidTitleCharacters, hasPermittedChildren, hasSetPagePermissionsPermission, hasViewPagePermission, isLatestVersionRequired, isPageRequired, isPermitted, isSpaceAdmin, isViewPermissionRequired, setBreadcrumbsManager, setCaptchaId, setCaptchaManager, setConfluenceWysiwygConverter, setContentPermissionManager, setLinkManager, setMode, setPage, setPageManager, setSpaceManager, setXhtml
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addPermissionTypeTo, addToHistory, getActionName, getBootstrapManager, getDateFormatter, getDefaultResourceBundle, getEditorLanguage, getEventManager, getGlobalHelper, getGlobalSettings, getI18n, getInstalledLanguages, getLabelManager, getLanguageManager, getLanguageUserFriendly, getLocale, getLocaleString, getNiceContentType, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPreviousLoginDate, getRandom, getRemoteUser, getSession, getSpaceHelper, getText, getText, getText, getText, getTextStatic, getTextStatic, getTextStrict, getTimeZone, getUser, getUserAccessor, getUserFullName, getUserInterfaceState, getWebInterfaceManager, hasPermissionForSpace, isAnonymousUser, isCanceled, isDevMode, isEmailVisible, isExternalUserManagementEnabled, isLabelable, isPermissionCheck, isPermittedAsString, isPrintableVersion, setBootstrapManager, setCancel, setEventManager, setFormatSettingsManager, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setPermissionCheck, setPermissionManager, setPreviousLoginDate, setSettingsManager, setSpacePermissionManager, setUserAccessor, setWebInterfaceManager
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentPageTitle

protected String parentPageTitle

parentPageSpaceKey

protected String parentPageSpaceKey

parentPageId

protected long parentPageId

USER_PERMISSION

public static final String USER_PERMISSION
See Also:
Constant Field Values

GROUP_RADIO

public static final String GROUP_RADIO
See Also:
Constant Field Values

viewPermission

protected String viewPermission

editPermission

protected String editPermission

viewPermissionGroup

protected String viewPermissionGroup

viewPermissionRadio

protected String viewPermissionRadio

editPermissionGroup

protected String editPermissionGroup

editPermissionRadio

protected String editPermissionRadio

newSpaceKey

protected String newSpaceKey

parentPageString

protected String parentPageString

draftManager

protected DraftManager draftManager

captchaResponse

protected String captchaResponse
Constructor Detail

AbstractCreateAndEditPageAction

public AbstractCreateAndEditPageAction()
Method Detail

isUseDraft

public boolean isUseDraft()

setParentPageId

public void setParentPageId(long parentPageId)

getParentPageId

public long getParentPageId()

getParentPage

public Page getParentPage()

getPermissionTypes

protected List getPermissionTypes()
Overrides:
getPermissionTypes in class AbstractPageAction

validate

public void validate()
Specified by:
validate in interface com.opensymphony.xwork.Validateable
Overrides:
validate in class com.opensymphony.xwork.ActionSupport

setShowDraftMessage

public void setShowDraftMessage(boolean showDraftMessage)

getContentType

protected abstract String getContentType()

doDefault

public String doDefault()
                 throws Exception
Description copied from class: ConfluenceActionSupport
Default webwork action execution method.

Overrides:
doDefault in class ConfluenceActionSupport
Returns:
the action result
Throws:
Exception - if something goes wrong

setTitle

public void setTitle(String title)

getParentPageTitle

public String getParentPageTitle()

setParentPageTitle

public void setParentPageTitle(String parentPageTitle)

getParentPageSpaceKey

public String getParentPageSpaceKey()
If the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value. Otherwise it will return the spaceKey of the current Page.


setParentPageSpaceKey

public void setParentPageSpaceKey(String parentPageSpaceKey)

getCurrentEditPermission

public ContentPermission getCurrentEditPermission()

getCurrentViewPermission

public ContentPermission getCurrentViewPermission()

isPermissionModified

protected boolean isPermissionModified(String type)

applyViewPermissions

protected String applyViewPermissions()

applyEditPermissions

protected String applyEditPermissions()

escapeWithBackslash

protected static String escapeWithBackslash(String toEscape)
Escapes each comma and backslash with a leading backslash

Parameters:
toEscape - string to escape. If null, then null will be returned. protected so we can test it :-(

interpretBackslashAsEscape

protected static String interpretBackslashAsEscape(String escaped)
Treats backslashes as escape characters. A trailing backslash will not be removed.

Parameters:
escaped - String to escape. Null strings are left alone.

getViewPermission

public String getViewPermission()

setViewPermission

public void setViewPermission(String viewPermission)

getEditPermission

public String getEditPermission()

setEditPermission

public void setEditPermission(String editPermission)

getGroups

public List getGroups()
returns a list of available groups that a user can assign page level permissions to. a user should not be able to lock themselves out of a page. hence we only present them groups they are a member of (even though some of these groups may not have permissions to view the space)


setLabelsString

public void setLabelsString(String labelsString)

getLabelsString

public String getLabelsString()

getNewSpaceKey

public String getNewSpaceKey()

setNewSpaceKey

public void setNewSpaceKey(String newSpaceKey)

getParentPageString

public String getParentPageString()

setParentPageString

public void setParentPageString(String parentPageString)

setDraftManager

public void setDraftManager(DraftManager draftManager)

isShowDraftMessage

public boolean isShowDraftMessage()

setDiscardDraft

public void setDiscardDraft(boolean discardDraft)

setUseDraft

public void setUseDraft(boolean useDraft)

getTitle

public String getTitle()
Overrides:
getTitle in class AbstractPageAction

getDraft

public Draft getDraft()

getViewPermissionGroup

public String getViewPermissionGroup()
Returns the groupname escaped with backslashes.


setViewPermissionGroup

public void setViewPermissionGroup(String viewPermissionGroup)
Note, this expects to receive an escaped version of the group name, as that is what comes from the front end. It stores the string in unescaped form.


getViewPermissionRadio

public String getViewPermissionRadio()

setViewPermissionRadio

public void setViewPermissionRadio(String viewPermissionRadio)

getEditPermissionGroup

public String getEditPermissionGroup()
Returns the groupname escaped with backslashes.


setEditPermissionGroup

public void setEditPermissionGroup(String editPermissionGroup)
Expects to receive an escaped version of the group name, as that is what comes from the front end. It stores the string in unescaped form.


getEditPermissionRadio

public String getEditPermissionRadio()

setEditPermissionRadio

public void setEditPermissionRadio(String editPermissionRadio)

getCancelResult

public String getCancelResult()
Overrides:
getCancelResult in class ConfluenceActionSupport

getCaptchaResponse

public String getCaptchaResponse()

setCaptchaResponse

public void setCaptchaResponse(String captchaResponse)

getLocationShowing

public Boolean getLocationShowing()

setLocationShowing

public void setLocationShowing(Boolean locationShowing)

getRestrictionsShowing

public Boolean getRestrictionsShowing()

setRestrictionsShowing

public void setRestrictionsShowing(Boolean restrictionsShowing)

getLabelsShowing

public Boolean getLabelsShowing()

setLabelsShowing

public void setLabelsShowing(Boolean labelsShowing)


Confluence is developed by Atlassian.