Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleconfluence/pages/viewpreviousversions.vm
#* @vtlvariable name="actionallVersions" type="comjava.util.List<com.atlassian.confluence.pagescore.actions.ViewPreviousVersionsActionVersionHistorySummary>" *#
#* @vtlvariable name="allVersionsshowActions" type="java.util.List<com.atlassian.confluence.core.VersionHistorySummary>boolean" *#
#* @vtlvariable name="contributorisOfflineCollabEditingMode" type="com.atlassian.user.Userboolean" *#
#* #macro(contributorAvatarAndName $contributor)
    #if ($contributor && $contributor != "")
        #set ($userProfilePicture = $userAccessor.getUserProfilePicture($contributor))
@vtlvariable name="revertPermitted" type="boolean" *#
#* @vtlvariable name="removeHistoricalVersionPermitted" type="boolean" *#
#* @vtlvariable name="page" type="com.atlassian.confluence.pages.AbstractPage" *#

<html>
    <head>
       <a class="page-history-contributor-link" <title>$i18n.getText("title.view.previous.versions")#if($page.title) - $page.title#end</title>
    </head>

    <content data-username="$contributor.name"
           #if (!$userProfilePicture.isAnonymousPicture())href="$req.contextPath/display/~$contributor.name"#end
        >
            <img class="page-history-contributor-profile-pic" src="$userProfilePicture.uriReference"/>
            <span class="page-history-contributor-name">$contributor.getFullName()</span>
        </a>
    #else
    <a class="page-history-contributor-link">
        <img class="page-history-contributor-profile-pic" src="$staticResourceUrlPrefix/images/icons/profilepics/anonymous.svg"/>
        <span class="page-history-contributor-name">$action.getText("user.icon.anonymous.title")</span>
    </a>
    #end
#end

#macro(additionalContributorsDialog $additionalContributors $page)
    #if ($additionalContributors.size() > 0)
    <button class="aui-button additional-contributors-button" aria-controls="additional-contributors-$page.id" data-aui-trigger="true">$additionalContributors.size()</button>
    <span class="aui-button aui-button-link additional-contributors-button" aria-controls="additional-contributors-$page.id" data-aui-trigger="true">
        #if($additionalContributors.size() == 1)
            $action.getText("view.previous.versions.additional.contributors.one")
        #else
            $action.getText("view.previous.versions.additional.contributors", $additionalContributors.size())
        #end
    </span>
    <aui-inline-dialog id="additional-contributors-$page.id"
                       alignment="top left"
                       responds-to="toggle"
                       aria-hidden="true">
        <div class="page-history-additional-contributors-dialog-content">
            #foreach ( $additionalContributor in $additionalContributors)
                <div class="additional-contributor-row">
                    #if ($additionalContributor && $additionalContributor != "")
                        #set ($userProfilePicture = $userAccessor.getUserProfilePicture($additionalContributor))
                        <a class="page-history-additional-contributor-link"
                           data-username="$additionalContributor.name"
                           href="$req.contextPath/display/~$additionalContributor.name">
                            <img class="page-history-additional-contributor-profile-pic" src="$userProfilePicture.uriReference"/>
                            <span class="page-history-additional-contributor-name">$additionalContributor.fullName</span>
                        </a>
                    #else
                        <a class="page-history-additional-contributor-link">
                            <img class="page-history-additional-contributor-profile-pic" src="$staticResourceUrlPrefix/images/icons/profilepics/anonymous.svg"/>
                            <span class="page-history-additional-contributor-name">$action.getText("user.icon.anonymous.title")</span>
                        </a>
                    #end
                </div>
            #end
        </div>
    </aui-inline-dialog>
    #end
#end

<html>
    <head>
        <title>$action.getText("title.view.previous.versions")#if($page.title) - $page.title#end</title>
    </head>

    <content tag="title-text-span">$action.getText("title.view.previous.versions")</content>

    #applyDecorator("root")
        #decoratorParam("helper" $action.helper)
        #decoratorParam("mode" "view-information")
        #decoratorParam("calendar-width" "200px")
        #decoratorParam("context" "$action.page.type")

        #if ($action.remoteUser != $null)

        #requireResource("confluence.web.resources:page-history")
        <form name="diff" method="GET" action="diffpagesbyversion.action" class="aui">

            <input type="submit" class="aui-button" value="$action.getText('compare.selected')">
            <input type="hidden" name="pageId" value="$action.pageId">

            <style>
            .tableview td {white-space:nowrap; vertical-align:top;}
            </style>

            <table id="page-history-container" width="100%" cellspacing="0" class="aui tableview">
                <thead>
                    <tr>
                        <th>&nbsp;</th>
                        <th>$action.getText("heading.version.number")</th>
                        <th>$action.getText("heading.version.date")</th>
                        <th>$action.getText("heading.contributors")</th>
                        <th>$action.getText("heading.comment")</th>
                        <th>$action.getText("heading.actions")</th>
                    </tr>
                </thead>
                <tbody>
                    #foreach( $pageVersion in $allVersions )
                        <tr id="rowForVersion$pageVersion.version">
                            <td width="%1"><input type="checkbox" name="selectedPageVersions" value="$pageVersion.version" #if ($action.isSelectedVersion($pageVersion.version)) checked #end></td>
                            ## Version
                            <td align="left">
                                #if ($velocityCount == 1)
                                    <strong>
                                        <a href="viewpage.action?pageId=$page.id">$action.getText("current.version")</a>
                                        (v. $page.version)
                                    </strong>
                                #else
                                    <a class="view-historical-version-trigger" href="viewpage.action?pageId=${pageVersion.id}">v. $pageVersion.version</a>
                                #end
                            </td>
                            ## Last modification date
                            <td align="middle" #if($velocityCount == 1)  style="font-weight: bold;" #end>
                                $dateFormatter.formatDateTime( $pageVersion.lastModificationDate )
                            </td>
                            ## Contributors
                            <td class="contributors" style="white-space: normal;">
                                #if ($darkFeatures.isDarkFeatureEnabled("collaborative-audit-log"))
                                    #set ($additionalContributors = [])
                                    #set ($maxContributors = 12)
                                    #set ($contributors = $pageVersion.getContributorSet())
                                    #foreach( $contributor in $contributors )
                                        #if ($contributors.size() > $maxContributors && $velocityCount > $maxContributors)
                                            #set ($dummy = $additionalContributors.add($contributor))
                                        #else
                                            #contributorAvatarAndName($contributor)
                                        #end
                                    #end
                                    #additionalContributorsDialog($additionalContributors $pageVersion)
                                #else
                                    <strong>#userLink ($pageVersion.lastModifier)</strong>
                                #end
                            </td>
                            ## Version comment
                            <td>
                                #if ($pageVersion.versionCommentAvailable)
                                    <span class="change-comment">$pageVersion.renderedVersionComment</span>
                                #end
                            </td>
                            ## Actions
                            #if ($velocityCount == 1)
                                <td>&nbsp;</td> ## No operations can be performed on the latest version
                            #else
                                <td align="middle">
                                    #if ($action.isRevertPermitted())
                                        #if ($pageVersion.version > 0)
                                            <a class="restore-historical-version-trigger" href="revertpagebacktoversion.action?pageId=$page.id&version=${pageVersion.version}">$action.getText("restore.this.version")</a>
                                        #end
                                    #end
                                    #if ($action.isRemoveHistoricalVersionPermitted())
                                        &nbsp;&nbsp;<a class="remove-historical-version-trigger" data-pageid="$pageVersion.id" data-version="$pageVersion.version" href="#">$action.getText("remove.name")</a>
                                    #end
                                </td>
                            #end
                        </tr>
                    #end
                </tbody>
            </table>
        </form>
        <form id="remove-historical-version-form" name="removehistoricalversion" method="POST" action="removehistoricalversion.action" class="hidden">
            #form_xsrfToken()
    tag="title-text-span">$i18n.getText("title.view.previous.versions")</content>

    #applyDecorator("root")
        #decoratorParam("helper" $helper)
        #decoratorParam("mode" "view-information")
       <input id=#decoratorParam("remove-historical-version-pageid" type="hidden" name="pageId" value="" />calendar-width" "200px")
        #decoratorParam("context" "$page.type")

     <input id="remove-historical-version-content-type" type="hidden" name="contentType" value="$action.page.type" /> #if ($action.remoteUser != $null)

         </form>#parse ("/pages/includes/previous-versions-table.vm")
        <p><a href="${req.contextPath}/pages/viewinfo.action?pageId=${page.id}" class="aui-button aui-button-link">$action>$i18n.getText('return.to.page.info')</a></p>
        #else
           <ul>Unfortunately, as an anonymous user you do not have permission to view page history. For further information please contact your Confluence Administrator.</ul>
        #end
    #end
</html>





Code Block
languagebash
titlebin/setenv.sh
# See the CATALINA_OPTS below for tuning the JVM arguments used to start Confluence.

echo "If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide"

# set the location of the pid file
if [ -z "$CATALINA_PID" ] ; then
    if [ -n "$CATALINA_BASE" ] ; then
        CATALINA_PID="$CATALINA_BASE"/work/catalina.pid
    elif [ -n "$CATALINA_HOME" ] ; then
        CATALINA_PID="$CATALINA_HOME"/work/catalina.pid
    fi
fi
export CATALINA_PID

PRGDIR=`dirname "$0"`
if [ -z "$CATALINA_BASE" ]; then
  if [ -z "$CATALINA_HOME" ]; then
    LOGBASE=$PRGDIR
    LOGTAIL=..
  else
    LOGBASE=$CATALINA_HOME
    LOGTAIL=.
  fi
else
  LOGBASE=$CATALINA_BASE
  LOGTAIL=.
fi

PUSHED_DIR=`pwd`
cd $LOGBASE
cd $LOGTAIL
LOGBASEABS=`pwd`
cd $PUSHED_DIR

echo ""
echo "Server startup logs are located in $LOGBASEABS/logs/catalina.out"
# IMPORTANT NOTE: Only set JAVA_HOME or JRE_HOME above this line
# Get standard Java environment variables
if $os400; then
  # -r will Only work on the os400 if the files are:
  # 1. owned by the user
  # 2. owned by the PRIMARY group of the user
  # this will not work if the user belongs in secondary groups
  . "$CATALINA_HOME"/bin/setjre.sh
else
  if [ -r "$CATALINA_HOME"/bin/setjre.sh ]; then
    . "$CATALINA_HOME"/bin/setjre.sh
  else
    echo "Cannot find $CATALINA_HOME/bin/setjre.sh"
    echo "This file is needed to run this program"
    exit 1
  fi
fi

echo "---------------------------------------------------------------------------"
echo "Using Java: $JRE_HOME/bin/java"
CONFLUENCE_CONTEXT_PATH=`$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/confluence-context-path-extractor.jar $CATALINA_HOME`
export CONFLUENCE_CONTEXT_PATH
$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/synchrony-proxy-watchdog.jar $CATALINA_HOME
echo "---------------------------------------------------------------------------"

# Set the JVM arguments used to start Confluence. For a description of the options, see
# http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
CATALINA_OPTS="-XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution ${CATALINA_OPTS}"
CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
CATALINA_OPTS="-XX:G1ReservePercent=20 ${CATALINA_OPTS}"
CATALINA_OPTS="-Djava.awt.headless=true ${CATALINA_OPTS}"
CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}"
CATALINA_OPTS="-Xms2048m -Xmx2048m -XX:+UseG1GC ${CATALINA_OPTS}"
CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}"
CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}"
CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}"
CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}"
CATALINA_OPTS="-XX:ReservedCodeCacheSize=256m -XX:+UseCodeCacheFlushing ${CATALINA_OPTS}"


export CATALINA_OPTS

...