mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added module status to module.properties file saved in WAR for later use. Added contribution to return node path in Reference object. Fixed issues with web service caused by outdated Jars and incorrect AuthenticationService
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4980 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.Properties;
|
||||
|
||||
import org.alfresco.repo.module.tool.ModuleManagementToolException;
|
||||
import org.alfresco.service.cmr.module.ModuleDetails;
|
||||
import org.alfresco.service.cmr.module.ModuleInstallState;
|
||||
import org.alfresco.util.VersionNumber;
|
||||
|
||||
/**
|
||||
@@ -39,6 +40,7 @@ public class ModuleDetailsImpl implements ModuleDetails
|
||||
protected static final String PROP_DESCRIPTION = "module.description";
|
||||
protected static final String PROP_VERSION = "module.version";
|
||||
protected static final String PROP_INSTALL_DATE = "module.installDate";
|
||||
protected static final String PROP_INSTALL_STATE = "module.installState";
|
||||
|
||||
/** Properties object */
|
||||
protected Properties properties;
|
||||
@@ -130,6 +132,20 @@ public class ModuleDetailsImpl implements ModuleDetails
|
||||
return this.properties.getProperty(PROP_INSTALL_DATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.module.ModuleDetails#getInstallState()
|
||||
*/
|
||||
public ModuleInstallState getInstallState()
|
||||
{
|
||||
ModuleInstallState result = ModuleInstallState.INSTALLED;
|
||||
String value = this.properties.getProperty(PROP_INSTALL_STATE);
|
||||
if (value != null && value.length() != 0)
|
||||
{
|
||||
result = ModuleInstallState.valueOf(value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
|
@@ -22,6 +22,7 @@ import java.io.OutputStream;
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.repo.module.ModuleDetailsImpl;
|
||||
import org.alfresco.service.cmr.module.ModuleInstallState;
|
||||
|
||||
import de.schlichtherle.io.File;
|
||||
import de.schlichtherle.io.FileInputStream;
|
||||
@@ -125,5 +126,15 @@ public class ModuleDetailsHelper extends ModuleDetailsImpl
|
||||
throw new ModuleManagementToolException("Unable to save module details into WAR file.", exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the install state
|
||||
*
|
||||
* @param installState the install state
|
||||
*/
|
||||
public void setInstallState(ModuleInstallState installState)
|
||||
{
|
||||
this.properties.setProperty(PROP_INSTALL_STATE, installState.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -22,6 +22,8 @@ import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.alfresco.service.cmr.module.ModuleInstallState;
|
||||
import org.alfresco.service.cmr.module.ModuleService;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
@@ -136,6 +138,8 @@ public class ModuleManagementTool
|
||||
{
|
||||
try
|
||||
{
|
||||
outputMessage("Installing AMP '" + ampFileLocation + "' into WAR '" + warFileLocation + "'");
|
||||
|
||||
if (preview == false)
|
||||
{
|
||||
// Make sure the module and backup directory exisits in the WAR file
|
||||
@@ -239,6 +243,7 @@ public class ModuleManagementTool
|
||||
installedFiles.save();
|
||||
|
||||
// Update the installed module details
|
||||
installingModuleDetails.setInstallState(ModuleInstallState.INSTALLED);
|
||||
installingModuleDetails.save(warFileLocation, installingModuleDetails.getId());
|
||||
|
||||
// Update the zip file's
|
||||
|
@@ -67,4 +67,11 @@ public interface ModuleDetails
|
||||
* @return module install date
|
||||
*/
|
||||
String getInstalledDate();
|
||||
|
||||
/**
|
||||
* Get the modules install state
|
||||
*
|
||||
* @return the modules install state
|
||||
*/
|
||||
ModuleInstallState getInstallState();
|
||||
}
|
||||
|
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package org.alfresco.service.cmr.module;
|
||||
|
||||
/**
|
||||
* Enum used to indicate the install state of a module
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public enum ModuleInstallState
|
||||
{
|
||||
INSTALLED, // indicates that a module is installed
|
||||
DISABLED, // indicates that a module is installed but it functionality is disabled
|
||||
UNINSTALLED // indicates that a module is uninstalled
|
||||
}
|
Reference in New Issue
Block a user