mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Humongous merge. It is incomplete, however; faces-config-navigation.xml and ClientConfigElement
were both beyond me, and are just the raw conflict merge data. If Kev can't figure out how they should go together by tomorrow AM (for me) I'll dig back in. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4306 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,6 +25,7 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
@@ -46,6 +47,7 @@ import org.alfresco.service.cmr.view.Location;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.AbstractLifecycleBean;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -53,8 +55,6 @@ import org.apache.commons.logging.impl.Log4JLogger;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ import org.springframework.util.FileCopyUtils;
|
||||
*
|
||||
* @author David Caruana
|
||||
*/
|
||||
public class ImporterBootstrap implements ApplicationListener
|
||||
public class ImporterBootstrap extends AbstractLifecycleBean
|
||||
{
|
||||
// View Properties (used in setBootstrapViews)
|
||||
public static final String VIEW_PATH_PROPERTY = "path";
|
||||
@@ -83,6 +83,7 @@ public class ImporterBootstrap implements ApplicationListener
|
||||
private NodeService nodeService;
|
||||
private ImporterService importerService;
|
||||
private List<Properties> bootstrapViews;
|
||||
private List<Properties> extensionBootstrapViews;
|
||||
private StoreRef storeRef = null;
|
||||
private List<String> mustNotExistStoreUrls = null;
|
||||
private Properties configuration = null;
|
||||
@@ -176,6 +177,20 @@ public class ImporterBootstrap implements ApplicationListener
|
||||
this.bootstrapViews = bootstrapViews;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bootstrap views
|
||||
*
|
||||
* @param bootstrapViews
|
||||
*/
|
||||
public void addBootstrapViews(List<Properties> bootstrapViews)
|
||||
{
|
||||
if (this.extensionBootstrapViews == null)
|
||||
{
|
||||
this.extensionBootstrapViews = new ArrayList<Properties>();
|
||||
}
|
||||
this.extensionBootstrapViews.addAll(bootstrapViews);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Store Ref to bootstrap into
|
||||
*
|
||||
@@ -348,6 +363,12 @@ public class ImporterBootstrap implements ApplicationListener
|
||||
// bootstrap the store contents
|
||||
if (bootstrapViews != null)
|
||||
{
|
||||
// add-in any extended views
|
||||
if (extensionBootstrapViews != null)
|
||||
{
|
||||
bootstrapViews.addAll(extensionBootstrapViews);
|
||||
}
|
||||
|
||||
for (Properties bootstrapView : bootstrapViews)
|
||||
{
|
||||
String view = bootstrapView.getProperty(VIEW_LOCATION_VIEW);
|
||||
@@ -643,16 +664,16 @@ public class ImporterBootstrap implements ApplicationListener
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
|
||||
*/
|
||||
public void onApplicationEvent(ApplicationEvent event)
|
||||
@Override
|
||||
protected void onBootstrap(ApplicationEvent event)
|
||||
{
|
||||
if (event instanceof ContextRefreshedEvent)
|
||||
{
|
||||
bootstrap();
|
||||
}
|
||||
bootstrap();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShutdown(ApplicationEvent event)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.repo.importer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
/**
|
||||
* Collection of views to import
|
||||
*
|
||||
* @author David Caruana
|
||||
*/
|
||||
public class ImporterBootstrapViews implements InitializingBean
|
||||
{
|
||||
// Dependencies
|
||||
private ImporterBootstrap importer;
|
||||
private List<Properties> bootstrapViews;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the importer
|
||||
*
|
||||
* @param importer
|
||||
*/
|
||||
public void setImporter(ImporterBootstrap importer)
|
||||
{
|
||||
this.importer = importer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bootstrap views
|
||||
*
|
||||
* @param bootstrapViews
|
||||
*/
|
||||
public void setBootstrapViews(List<Properties> bootstrapViews)
|
||||
{
|
||||
this.bootstrapViews = bootstrapViews;
|
||||
}
|
||||
|
||||
|
||||
public void afterPropertiesSet() throws Exception
|
||||
{
|
||||
importer.addBootstrapViews(bootstrapViews);
|
||||
}
|
||||
|
||||
}
|
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.repo.admin.patch.PatchDaoService;
|
||||
import org.alfresco.repo.domain.AppliedPatch;
|
||||
import org.alfresco.repo.domain.hibernate.VersionCounterDaoComponentImpl;
|
||||
import org.alfresco.repo.version.common.counter.VersionCounterService;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class SystemExporterImporter
|
||||
// dependencies
|
||||
private NodeService nodeService;
|
||||
private PatchDaoService patchDao;
|
||||
private VersionCounterDaoComponentImpl versionCounterDao;
|
||||
private VersionCounterService versionCounterService;
|
||||
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
@@ -50,9 +50,9 @@ public class SystemExporterImporter
|
||||
this.patchDao = patchDaoService;
|
||||
}
|
||||
|
||||
public void setVersionDao(VersionCounterDaoComponentImpl versionCounterDao)
|
||||
public void setVersionCounterService(VersionCounterService versionCounterService)
|
||||
{
|
||||
this.versionCounterDao = versionCounterDao;
|
||||
this.versionCounterService = versionCounterService;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class SystemExporterImporter
|
||||
for (StoreRef storeRef : storeRefs)
|
||||
{
|
||||
VersionCounterInfo versionCounterInfo = new VersionCounterInfo();
|
||||
int versionCount = versionCounterDao.currentVersionNumber(storeRef);
|
||||
int versionCount = versionCounterService.currentVersionNumber(storeRef);
|
||||
versionCounterInfo.storeRef = storeRef.toString();
|
||||
versionCounterInfo.count = versionCount;
|
||||
systemInfo.versionCounters.add(versionCounterInfo);
|
||||
@@ -128,7 +128,7 @@ public class SystemExporterImporter
|
||||
for (VersionCounterInfo versionCounterInfo : systemInfo.versionCounters)
|
||||
{
|
||||
StoreRef storeRef = new StoreRef(versionCounterInfo.storeRef);
|
||||
versionCounterDao.setVersionNumber(storeRef, versionCounterInfo.count);
|
||||
versionCounterService.setVersionNumber(storeRef, versionCounterInfo.count);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -26,9 +26,8 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.view.ImporterException;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.AbstractLifecycleBean;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +35,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class SystemInfoBootstrap implements ApplicationListener
|
||||
public class SystemInfoBootstrap extends AbstractLifecycleBean
|
||||
{
|
||||
// dependencies
|
||||
private TransactionService transactionService;
|
||||
@@ -177,16 +176,16 @@ public class SystemInfoBootstrap implements ApplicationListener
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
|
||||
*/
|
||||
public void onApplicationEvent(ApplicationEvent event)
|
||||
@Override
|
||||
protected void onBootstrap(ApplicationEvent event)
|
||||
{
|
||||
if (event instanceof ContextRefreshedEvent)
|
||||
{
|
||||
bootstrap();
|
||||
}
|
||||
bootstrap();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShutdown(ApplicationEvent event)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user