From: Brett Porter Date: Thu, 7 Dec 2006 16:48:29 +0000 (+0000) Subject: adding the company logo logic X-Git-Tag: archiva-0.9-alpha-1~236 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8df7d7485ae38bbeecd0b81d42e36193df2fac86;p=archiva.git adding the company logo logic git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@483543 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/configuration/DefaultConfiguredRepositoryFactory.java b/archiva-core/src/main/java/org/apache/maven/archiva/configuration/DefaultConfiguredRepositoryFactory.java index 51ba2d703..d7b16fa9d 100644 --- a/archiva-core/src/main/java/org/apache/maven/archiva/configuration/DefaultConfiguredRepositoryFactory.java +++ b/archiva-core/src/main/java/org/apache/maven/archiva/configuration/DefaultConfiguredRepositoryFactory.java @@ -16,12 +16,12 @@ package org.apache.maven.archiva.configuration; * limitations under the License. */ +import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.proxy.ProxiedArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.commons.lang.StringUtils; import java.io.File; import java.util.ArrayList; diff --git a/archiva-webapp/pom.xml b/archiva-webapp/pom.xml index 6962926ca..0ad8580ac 100644 --- a/archiva-webapp/pom.xml +++ b/archiva-webapp/pom.xml @@ -48,23 +48,31 @@ jstl 1.1.2 - + org.apache.maven.wagon wagon-http-lightweight diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractConfiguredAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractConfiguredAction.java new file mode 100644 index 000000000..2870fff4b --- /dev/null +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractConfiguredAction.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.web.action; + +/* + * 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. + */ + +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ConfigurationStore; +import org.apache.maven.archiva.configuration.ConfigurationStoreException; +import org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +public abstract class AbstractConfiguredAction + extends PlexusActionSupport +{ + /** + * @plexus.requirement + */ + private ConfiguredRepositoryFactory repositoryFactory; + + /** + * @plexus.requirement + */ + private ConfigurationStore configurationStore; + + protected ArtifactRepository createLocalRepository() + throws ConfigurationStoreException + { + Configuration configuration = configurationStore.getConfigurationFromStore(); + + return repositoryFactory.createLocalRepository( configuration ); + } +} diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java new file mode 100644 index 000000000..3d7418443 --- /dev/null +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java @@ -0,0 +1,105 @@ +package org.apache.maven.archiva.web.action.admin; + +/* + * 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. + */ + +import com.opensymphony.xwork.ModelDriven; +import com.opensymphony.xwork.Preparable; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.apache.maven.archiva.web.action.AbstractConfiguredAction; +import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; +import org.apache.maven.model.Model; +import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.shared.app.company.CompanyPomHandler; +import org.apache.maven.shared.app.configuration.Configuration; +import org.apache.maven.shared.app.configuration.ConfigurationChangeException; +import org.apache.maven.shared.app.configuration.ConfigurationStore; +import org.apache.maven.shared.app.configuration.ConfigurationStoreException; +import org.apache.maven.shared.app.configuration.InvalidConfigurationException; +import org.codehaus.plexus.security.rbac.Resource; +import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; +import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; +import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; + +import java.io.IOException; + +/** + * @author Brett Porter + * @version $Id: ConfigurationAction.java 480950 2006-11-30 14:58:35Z evenisse $ + * @plexus.component role="com.opensymphony.xwork.Action" + * role-hint="configureAppearance" + */ +public class ConfigureAppearanceAction + extends AbstractConfiguredAction + implements ModelDriven, SecureAction, Preparable +{ + /** + * @plexus.requirement + */ + private ConfigurationStore appConfigurationStore; + + /** + * The configuration. + */ + private Configuration configuration; + + private Model companyModel; + + /** + * @plexus.requirement + */ + private CompanyPomHandler companyPomHandler; + + public String execute() + throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException + { + appConfigurationStore.storeConfiguration( configuration ); + + return SUCCESS; + } + + public Object getModel() + { + return configuration; + } + + public void prepare() + throws ConfigurationStoreException, ProjectBuildingException, ArtifactMetadataRetrievalException, + org.apache.maven.archiva.configuration.ConfigurationStoreException + { + configuration = appConfigurationStore.getConfigurationFromStore(); + + companyModel = companyPomHandler.getCompanyPomModel( configuration.getCompanyPom(), createLocalRepository() ); + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public Model getCompanyModel() + { + return companyModel; + } +} diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java new file mode 100644 index 000000000..4d10f269a --- /dev/null +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java @@ -0,0 +1,128 @@ +package org.apache.maven.archiva.web.action.admin; + +/* + * 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. + */ + +import com.opensymphony.xwork.ModelDriven; +import com.opensymphony.xwork.Preparable; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.apache.maven.archiva.web.action.AbstractConfiguredAction; +import org.apache.maven.artifact.installer.ArtifactInstallationException; +import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; +import org.apache.maven.model.Model; +import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.shared.app.company.CompanyPomHandler; +import org.apache.maven.shared.app.configuration.CompanyPom; +import org.apache.maven.shared.app.configuration.Configuration; +import org.apache.maven.shared.app.configuration.ConfigurationChangeException; +import org.apache.maven.shared.app.configuration.ConfigurationStore; +import org.apache.maven.shared.app.configuration.ConfigurationStoreException; +import org.apache.maven.shared.app.configuration.InvalidConfigurationException; +import org.codehaus.plexus.security.rbac.Resource; +import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; +import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; +import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; + +import java.io.IOException; + +/** + * @author Brett Porter + * @version $Id: ConfigurationAction.java 480950 2006-11-30 14:58:35Z evenisse $ + * @plexus.component role="com.opensymphony.xwork.Action" + * role-hint="editPom" + */ +public class EditPomAction + extends AbstractConfiguredAction + implements ModelDriven, SecureAction, Preparable +{ + /** + * @plexus.requirement + */ + private ConfigurationStore appConfigurationStore; + + /** + * The configuration. + */ + private Configuration configuration; + + /** + * @plexus.requirement + */ + private CompanyPomHandler companyPomHandler; + + private Model companyModel; + + public String execute() + throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException, + ArtifactInstallationException, org.apache.maven.archiva.configuration.ConfigurationStoreException + { + // TODO: hack for passed in String[] + String[] logo = (String[]) companyModel.getProperties().get( "organization.logo" ); + if ( logo != null ) + { + companyModel.getProperties().put( "organization.logo", logo[0] ); + } + + companyPomHandler.save( companyModel, createLocalRepository() ); + + return SUCCESS; + } + + public Object getModel() + { + return companyModel; + } + + public void prepare() + throws ConfigurationStoreException, ProjectBuildingException, ArtifactMetadataRetrievalException, + org.apache.maven.archiva.configuration.ConfigurationStoreException + { + configuration = appConfigurationStore.getConfigurationFromStore(); + + CompanyPom companyPom = configuration.getCompanyPom(); + companyModel = companyPomHandler.getCompanyPomModel( companyPom, createLocalRepository() ); + + if ( companyModel == null ) + { + companyModel = new Model(); + companyModel.setModelVersion( "4.0.0" ); + + if ( companyPom != null ) + { + companyModel.setGroupId( companyPom.getGroupId() ); + companyModel.setArtifactId( companyPom.getArtifactId() ); + } + } + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public Model getCompanyModel() + { + return companyModel; + } +} \ No newline at end of file diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java new file mode 100644 index 000000000..c5ecfcda4 --- /dev/null +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java @@ -0,0 +1,85 @@ +package org.apache.maven.archiva.web.action.component; + +/* + * 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. + */ + +import org.apache.maven.archiva.web.action.AbstractConfiguredAction; +import org.apache.maven.model.Model; +import org.apache.maven.shared.app.company.CompanyPomHandler; +import org.apache.maven.shared.app.configuration.ConfigurationStore; + +/** + * Stores the company information for displaying on the page. + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="companyInfo" + */ +public class CompanyInfoAction + extends AbstractConfiguredAction +{ + private String companyLogo; + + private String companyUrl; + + private String companyName; + + /** + * @plexus.requirement + */ + private CompanyPomHandler handler; + + /** + * @plexus.requirement + */ + private ConfigurationStore appConfigurationStore; + + public String execute() + throws Exception + { + Model model = handler.getCompanyPomModel( appConfigurationStore.getConfigurationFromStore().getCompanyPom(), + createLocalRepository() ); + + if ( model != null ) + { + if ( model.getOrganization() != null ) + { + companyName = model.getOrganization().getName(); + companyUrl = model.getOrganization().getUrl(); + } + + companyLogo = model.getProperties().getProperty( "organization.logo" ); + } + + return SUCCESS; + } + + public String getCompanyLogo() + { + return companyLogo; + } + + public String getCompanyUrl() + { + return companyUrl; + } + + public String getCompanyName() + { + return companyName; + } +} \ No newline at end of file diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance-validation.xml b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance-validation.xml new file mode 100644 index 000000000..0628a0dcc --- /dev/null +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance-validation.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance.properties b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance.properties new file mode 100644 index 000000000..bfcaf5bcf --- /dev/null +++ b/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance.properties @@ -0,0 +1,21 @@ +# +# 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. +# + +appearance.groupId.required = You must define a group identifier. +appearance.artifactId.required = You must define an artifact identifier. \ No newline at end of file diff --git a/archiva-webapp/src/main/resources/xwork.xml b/archiva-webapp/src/main/resources/xwork.xml index b996394c3..3e487716b 100644 --- a/archiva-webapp/src/main/resources/xwork.xml +++ b/archiva-webapp/src/main/resources/xwork.xml @@ -78,7 +78,7 @@ index Account Locked - index + index index @@ -186,6 +186,12 @@ + + + /WEB-INF/jsp/components/companyLogo.jsp + + + @@ -287,6 +293,34 @@ /admin/reports.action?reportGroup=${reportGroup}&repositoryId=${repositoryId}&filter=${filter} /admin/reports.action?reportGroup=${reportGroup}&repositoryId=${repositoryId}&filter=${filter} + + + /WEB-INF/jsp/admin/appearance.jsp + + + + /WEB-INF/jsp/admin/editAppearance.jsp + + + + /WEB-INF/jsp/admin/editAppearance.jsp + + configureAppearance + /admin + + + + + /WEB-INF/jsp/admin/editPom.jsp + + + + /WEB-INF/jsp/admin/editPom.jsp + + configureAppearance + /admin + + diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp new file mode 100644 index 000000000..9cd84c286 --- /dev/null +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp @@ -0,0 +1,96 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + Configure Appearance + + + + +

Appearance

+ +
+ Edit +
+

Company Details

+ +

+ The logo in the top right of the screen is controlled by your selected 'company POM'. +

+ + + + +

+ You have not yet specified a company POM. Select a Company POM +

+
+ + +

+ Your selected company POM is below. If you would like to change the organization name, url or logo, you can + edit the POM. +

+ + + + + + + + +
+ + +

POM Information

+ + + + + + + + + + + + + + + + +
Name${companyModel.organization.name}
URL + ${companyModel.organization.url} +
Logo URL + ${companyModel.properties['organization.logo']} +
+
+ + Company POM '${companyPom.groupId}:${companyPom.artifactId}' doesn't exist. + Create company POM + +
+
+ + \ No newline at end of file diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp new file mode 100644 index 000000000..9061a3137 --- /dev/null +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp @@ -0,0 +1,45 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + Configure Appearance + + + + +

Appearance

+ +

Company Details

+ +

+ Enter the details of the company super POM below. If it exists, the organization name, URL and logo will be read + from it. +

+ + + + + + + + + + \ No newline at end of file diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp new file mode 100644 index 000000000..05ffb4446 --- /dev/null +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp @@ -0,0 +1,50 @@ +<%-- + ~ Copyright 2006 Mergere, Inc. + ~ + ~ Licensed 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + Edit Company POM + + + + +

Company POM

+ + + + + + + Version + + + (The version will automatically be incremented when you save this form) + + + + +

Organization

+ + + + <%-- TODO: how to get it to be a string, not a String[]? --%> + + +
+ + + \ No newline at end of file diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp new file mode 100644 index 000000000..c967cf061 --- /dev/null +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp @@ -0,0 +1,16 @@ +<%@ taglib uri="/webwork" prefix="ww" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + + diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp index 37c38a0d1..43bb827e5 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp @@ -49,11 +49,7 @@ - <%-- TODO: configured corporate banner - - - - --%> +
@@ -115,6 +111,9 @@ +
  • + Appearance +
  • Administration @@ -139,10 +138,10 @@ -
    My Account
    -
  • - Edit user info -
  • +
    My Account
    +
  • + Edit user info +
  • @@ -159,13 +158,13 @@ <% - int inceptionYear = 2005; - int currentYear = Calendar.getInstance().get( Calendar.YEAR ); - String copyrightRange = String.valueOf( inceptionYear ); - if ( inceptionYear != currentYear ) - { - copyrightRange = copyrightRange + "-" + String.valueOf( currentYear ); - } + int inceptionYear = 2005; + int currentYear = Calendar.getInstance().get( Calendar.YEAR ); + String copyrightRange = String.valueOf( inceptionYear ); + if ( inceptionYear != currentYear ) + { + copyrightRange = copyrightRange + "-" + String.valueOf( currentYear ); + } %>