mirror of https://github.com/apache/archiva.git
finish footer with version copyrightRange
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1236636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7b50ea96e2
commit
538e2f2417
|
@ -523,10 +523,6 @@
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
</resource>
|
</resource>
|
||||||
<resource>
|
|
||||||
<directory>src/main/filtered-resources</directory>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
#
|
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
# or more contributor license agreements. See the NOTICE file
|
|
||||||
# distributed with this work for additional information
|
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
|
||||||
# to you under the Apache License, Version 2.0 (the
|
|
||||||
# "License"); you may not use this file except in compliance
|
|
||||||
# with the License. You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing,
|
|
||||||
# software distributed under the License is distributed on an
|
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
# KIND, either express or implied. See the License for the
|
|
||||||
# specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
user.agent=Apache Archiva/${project.version}
|
|
||||||
archiva.version=${project.version}
|
|
||||||
archiva.buildNumber=${buildNumber}
|
|
||||||
archiva.timestamp=${timestamp}
|
|
|
@ -18,9 +18,12 @@ package org.apache.archiva.webapp.ui.services.api;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.archiva.web.runtime.ArchivaRuntimeInfo;
|
||||||
import org.apache.archiva.webapp.ui.services.model.ApplicationRuntimeInfo;
|
import org.apache.archiva.webapp.ui.services.model.ApplicationRuntimeInfo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Olivier Lamy
|
* @author Olivier Lamy
|
||||||
*/
|
*/
|
||||||
|
@ -28,9 +31,22 @@ import org.springframework.stereotype.Service;
|
||||||
public class DefaultRuntimeInfoService
|
public class DefaultRuntimeInfoService
|
||||||
implements RuntimeInfoService
|
implements RuntimeInfoService
|
||||||
{
|
{
|
||||||
public ApplicationRuntimeInfo archivaRuntimeInfo()
|
|
||||||
|
private ArchivaRuntimeInfo archivaRuntimeInfo;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public DefaultRuntimeInfoService( ArchivaRuntimeInfo archivaRuntimeInfo )
|
||||||
{
|
{
|
||||||
ApplicationRuntimeInfo archivaRuntimeInfo = new ApplicationRuntimeInfo();
|
this.archivaRuntimeInfo = archivaRuntimeInfo;
|
||||||
return archivaRuntimeInfo;
|
}
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public ApplicationRuntimeInfo getApplicationRuntimeInfo()
|
||||||
|
{
|
||||||
|
ApplicationRuntimeInfo applicationRuntimeInfo = new ApplicationRuntimeInfo();
|
||||||
|
applicationRuntimeInfo.setBuildNumber( this.archivaRuntimeInfo.getBuildNumber() );
|
||||||
|
applicationRuntimeInfo.setTimestamp( this.archivaRuntimeInfo.getTimestamp() );
|
||||||
|
applicationRuntimeInfo.setVersion( this.archivaRuntimeInfo.getVersion() );
|
||||||
|
return applicationRuntimeInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,5 +37,5 @@ public interface RuntimeInfoService
|
||||||
@GET
|
@GET
|
||||||
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
|
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
|
||||||
@RedbackAuthorization( noRestriction = true )
|
@RedbackAuthorization( noRestriction = true )
|
||||||
ApplicationRuntimeInfo archivaRuntimeInfo();
|
ApplicationRuntimeInfo getApplicationRuntimeInfo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.archiva.webapp.ui.services.model;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Olivier Lamy
|
* @author Olivier Lamy
|
||||||
|
@ -31,11 +32,22 @@ public class ApplicationRuntimeInfo
|
||||||
|
|
||||||
private boolean javascriptLog = false;
|
private boolean javascriptLog = false;
|
||||||
|
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
private String buildNumber;
|
||||||
|
|
||||||
|
private long timestamp;
|
||||||
|
|
||||||
|
private String copyrightRange;
|
||||||
|
|
||||||
|
|
||||||
public ApplicationRuntimeInfo()
|
public ApplicationRuntimeInfo()
|
||||||
{
|
{
|
||||||
this.devMode = Boolean.getBoolean( "archiva.devMode" );
|
this.devMode = Boolean.getBoolean( "archiva.devMode" );
|
||||||
|
|
||||||
this.javascriptLog = Boolean.getBoolean( "archiva.javascriptLog" );
|
this.javascriptLog = Boolean.getBoolean( "archiva.javascriptLog" );
|
||||||
|
|
||||||
|
this.copyrightRange = "2005 - " + Calendar.getInstance().get( Calendar.YEAR );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDevMode()
|
public boolean isDevMode()
|
||||||
|
@ -58,6 +70,46 @@ public class ApplicationRuntimeInfo
|
||||||
this.javascriptLog = javascriptLog;
|
this.javascriptLog = javascriptLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getVersion()
|
||||||
|
{
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion( String version )
|
||||||
|
{
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuildNumber()
|
||||||
|
{
|
||||||
|
return buildNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuildNumber( String buildNumber )
|
||||||
|
{
|
||||||
|
this.buildNumber = buildNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTimestamp()
|
||||||
|
{
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimestamp( long timestamp )
|
||||||
|
{
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCopyrightRange()
|
||||||
|
{
|
||||||
|
return copyrightRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCopyrightRange( String copyrightRange )
|
||||||
|
{
|
||||||
|
this.copyrightRange = copyrightRange;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -65,6 +117,10 @@ public class ApplicationRuntimeInfo
|
||||||
sb.append( "ApplicationRuntimeInfo" );
|
sb.append( "ApplicationRuntimeInfo" );
|
||||||
sb.append( "{devMode=" ).append( devMode );
|
sb.append( "{devMode=" ).append( devMode );
|
||||||
sb.append( ", javascriptLog=" ).append( javascriptLog );
|
sb.append( ", javascriptLog=" ).append( javascriptLog );
|
||||||
|
sb.append( ", version='" ).append( version ).append( '\'' );
|
||||||
|
sb.append( ", buildNumber='" ).append( buildNumber ).append( '\'' );
|
||||||
|
sb.append( ", timestamp=" ).append( timestamp );
|
||||||
|
sb.append( ", copyrightRange='" ).append( copyrightRange ).append( '\'' );
|
||||||
sb.append( '}' );
|
sb.append( '}' );
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ $.ajax(
|
||||||
success:function(data){
|
success:function(data){
|
||||||
window.archivaDevMode=data.applicationRuntimeInfo.devMode;
|
window.archivaDevMode=data.applicationRuntimeInfo.devMode;
|
||||||
window.archivaJavascriptLog=data.applicationRuntimeInfo.javascriptLog;
|
window.archivaJavascriptLog=data.applicationRuntimeInfo.javascriptLog;
|
||||||
|
window.archivaRuntimeInfo=data.applicationRuntimeInfo;
|
||||||
require.config({
|
require.config({
|
||||||
baseUrl: "js/"
|
baseUrl: "js/"
|
||||||
});
|
});
|
||||||
|
|
|
@ -172,7 +172,7 @@ $(function() {
|
||||||
hideElementWithKarma();
|
hideElementWithKarma();
|
||||||
checkSecurityLinks();
|
checkSecurityLinks();
|
||||||
checkCreateAdminLink();
|
checkCreateAdminLink();
|
||||||
$('#footer-content').html($('#footer-tmpl').tmpl());
|
$('#footer-content').html($('#footer-tmpl').tmpl(window.archivaRuntimeInfo));
|
||||||
}
|
}
|
||||||
startArchivaApplication();
|
startArchivaApplication();
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue