Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

78403: Merged EOL (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      75700: ACE-2149: EOL AVM / WCM
       - Remove most of the AVM and WCM beans, scripts, classes, patches, etc
       - The Explorer client is very broken for compilation
         - TODO: Remove all WCM-related functionality, which I thought would be best left to a UI dev
                 I've murdered many of the classes and beans but there's more to do
       - The repository compiles
         TODO: Get it running again
       - TODO: Check if we can wipe the 'deployment' project as well


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Erik Winlof
2014-09-03 12:01:49 +00:00
parent eaff240152
commit 0baa0f74f4
284 changed files with 206 additions and 58844 deletions

View File

@@ -33,7 +33,6 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.ContentStore;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.UnsupportedContentUrlException;
import org.alfresco.repo.domain.avm.AVMNodeDAO;
import org.alfresco.repo.domain.contentdata.ContentDataDAO;
import org.alfresco.repo.lock.JobLockService;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -88,7 +87,6 @@ public class ContentStoreCleanerTest extends TestCase
jobLockService = serviceRegistry.getJobLockService();
TransactionService transactionService = serviceRegistry.getTransactionService();
DictionaryService dictionaryService = serviceRegistry.getDictionaryService();
AVMNodeDAO avmNodeDAO = (AVMNodeDAO) ctx.getBean("newAvmNodeDAO");
ContentDataDAO contentDataDAO = (ContentDataDAO) ctx.getBean("contentDataDAO");
// we need a store
@@ -114,7 +112,6 @@ public class ContentStoreCleanerTest extends TestCase
cleaner.setTransactionService(transactionService);
cleaner.setDictionaryService(dictionaryService);
cleaner.setContentService(contentService);
cleaner.setAvmNodeDAO(avmNodeDAO);
}
public void tearDown() throws Exception

View File

@@ -22,7 +22,6 @@ import static org.mockito.Mockito.mock;
import java.util.Collection;
import org.alfresco.mbeans.VirtServerRegistry;
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
import org.alfresco.opencmis.search.CMISQueryService;
import org.alfresco.repo.admin.SysAdminParams;
@@ -36,10 +35,6 @@ import org.alfresco.service.cmr.action.ActionService;
import org.alfresco.service.cmr.admin.RepoAdminService;
import org.alfresco.service.cmr.attributes.AttributeService;
import org.alfresco.service.cmr.audit.AuditService;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avm.deploy.DeploymentService;
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.blog.BlogService;
import org.alfresco.service.cmr.calendar.CalendarService;
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
@@ -81,10 +76,6 @@ import org.alfresco.service.descriptor.DescriptorService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.wcm.asset.AssetService;
import org.alfresco.wcm.preview.PreviewURIService;
import org.alfresco.wcm.sandbox.SandboxService;
import org.alfresco.wcm.webproject.WebProjectService;
public class MockedTestServiceRegistry implements ServiceRegistry
{
@@ -117,20 +108,6 @@ public class MockedTestServiceRegistry implements ServiceRegistry
return null;
}
@Override
public WebProjectService getWebProjectService()
{
// A mock response
return null;
}
@Override
public VirtServerRegistry getVirtServerRegistry()
{
// A mock response
return null;
}
@Override
public VersionService getVersionService()
{
@@ -200,13 +177,6 @@ public class MockedTestServiceRegistry implements ServiceRegistry
return null;
}
@Override
public SandboxService getSandboxService()
{
// A mock response
return null;
}
@Override
public RuleService getRuleService()
{
@@ -228,13 +198,6 @@ public class MockedTestServiceRegistry implements ServiceRegistry
return null;
}
@Override
public PreviewURIService getPreviewURIService()
{
// A mock response
return null;
}
@Override
public PersonService getPersonService()
{
@@ -387,20 +350,6 @@ public class MockedTestServiceRegistry implements ServiceRegistry
return null;
}
@Override
public DeploymentService getDeploymentService()
{
// A mock response
return null;
}
@Override
public CrossRepositoryCopyService getCrossRepositoryCopyService()
{
// A mock response
return null;
}
@Override
public CopyService getCopyService()
{
@@ -478,13 +427,6 @@ public class MockedTestServiceRegistry implements ServiceRegistry
return null;
}
@Override
public AssetService getAssetService()
{
// A mock response
return null;
}
@Override
public ActionService getActionService()
{
@@ -492,34 +434,6 @@ public class MockedTestServiceRegistry implements ServiceRegistry
return actionService;
}
@Override
public AVMSyncService getAVMSyncService()
{
// A mock response
return null;
}
@Override
public AVMService getAVMService()
{
// A mock response
return null;
}
@Override
public AVMLockingService getAVMLockingService()
{
// A mock response
return null;
}
@Override
public AVMService getAVMLockingAwareService()
{
// A mock response
return null;
}
@Override
public RepoAdminService getRepoAdminService()
{

View File

@@ -11,7 +11,6 @@ import junit.framework.TestCase;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.domain.permissions.AccessControlListDAO;
@@ -28,8 +27,6 @@ import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.repository.ContentWriter;
@@ -47,8 +44,6 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.wcm.util.WCMUtil;
import org.alfresco.wcm.webproject.WebProjectService;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
@@ -106,28 +101,17 @@ public class AbstractReadPermissionTest extends TestCase
protected UserTransaction testTX;
protected AVMService fService;
protected IndexerAndSearcher fIndexerAndSearcher;
protected WebProjectService wpService;
protected boolean logToFile = false;
protected String[] webAuthorities = new String[] {"Web1", "Web2", "Web3", "Web4", "Web5"};
protected String[] authorities = new String[] {"Dynamic","1000","1001","Y","Z","X","10_1","avm","100","10","1","01","001","0001"};
protected String AVMStore = "main" + System.currentTimeMillis();
protected String[] authorities = new String[] {"Dynamic","1000","1001","Y","Z","X","10_1","100","10","1","01","001","0001"};
final int WEB_COUNT = 100;
protected final String TEST_RUN = ""+System.currentTimeMillis();
protected final String TEST_WEBPROJ_DNS = "testWP-"+TEST_RUN;
protected final String TEST_WEBPROJ_NAME = "testSandbox Web Project Display Name - "+TEST_RUN;
protected final String TEST_WEBPROJ_TITLE = "This is my title";
protected final String TEST_WEBPROJ_DESCRIPTION = "This is my description";
protected final String TEST_WEBPROJ_DEFAULT_WEBAPP = WCMUtil.DIR_ROOT;
protected final boolean TEST_WEBPROJ_USE_AS_TEMPLATE = true;
protected final boolean TEST_WEBPROJ_DONT_USE_AS_TEMPLATE = false;
// protected final String TEST_RUN = ""+System.currentTimeMillis();
protected class Counter
{
@@ -430,127 +414,6 @@ public class AbstractReadPermissionTest extends TestCase
}
}
protected void setupBasicTree(final String authority) throws Exception
{
runAs("admin");
final String[] dirs = new String[] {"a", "a/b", "a/b/c", "a/b/c/d", "e", "e/f", "e/f/g", "e/f/g/h", "x", "x/y"};
for(int j = 0; j < dirs.length; j++)
{
String path = dirs[j];
String dir;
String file;
int k = path.lastIndexOf('/');
if(k == -1)
{
dir = "";
file = path;
}
else
{
dir = path.substring(0, k);
file = path.substring(k+1);
}
fService.createDirectory(AVMStore + ":/" + dir, file);
}
// fService.createDirectory("main:/", "a");
// fService.createDirectory("main:/a", "b");
// fService.createDirectory("main:/a/b", "c");
// fService.createDirectory("main:/", "d");
// fService.createDirectory("main:/d", "e");
// fService.createDirectory("main:/d/e", "f");
// desc = avmService.lookup(-1, storeName + ":/base");
// nodeRef = AVMNodeConverter.ToNodeRef(-1, desc.getPath());
// permissionService.setPermission(nodeRef, PermissionService.ALL_AUTHORITIES, PermissionService.ALL_PERMISSIONS, true);
// permissionService.deletePermission(nodeRef, PermissionService.ALL_AUTHORITIES, PermissionService.ALL_PERMISSIONS);
AVMNodeDescriptor nodeDesc = fService.lookup(-1, AVMStore + ":/");
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, nodeDesc.getPath());
//permissionService.setPermission(nodeRef, "1", PermissionService.READ, true);
// for(int ii = 0; ii < COUNT; ii++)
// {
// final int i = ii;
// final int j =
// if(ii % 100 == 0)
// {
// System.out.println("Loop " + i);
// }
RetryingTransactionCallback<Void> cb = new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
for(int i = 0; i < WEB_COUNT; i++)
{
if(i % 100 == 0)
{
System.out.println("Loop " + i);
}
int j = i % webAuthorities.length;
String dir = AVMStore + ":/" + dirs[i % 10];
String file = "foo" + i;
String path = dir + "/" + file;
fService.createFile(dir, file).close();
ContentWriter writer = fService.getContentWriter(path, true);
writer.setEncoding("UTF-8");
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
//writer.putContent("I am " + path);
writer.putContent("I am main");
//String authority = webAuthorities[j];
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, path);
permissionService.setPermission(nodeRef, authority, PermissionService.READ, true);
permissionService.setInheritParentPermissions(nodeRef, false);
}
return null;
}
};
retryingTransactionHelper.doInTransaction(cb, false, false);
//}
// fService.createDirectory("main:/", "a");
// fService.createDirectory("main:/a", "b");
// fService.createDirectory("main:/a/b", "c");
// fService.createDirectory("main:/", "d");
// fService.createDirectory("main:/d", "e");
// fService.createDirectory("main:/d/e", "f");
//
// AVMNodeDescriptor nodeDesc = fService.lookup(-1, "main:/");
// NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, nodeDesc.getPath());
// permissionService.setPermission(nodeRef, "1", PermissionService.READ, true);
// fService.createFile("main:/a/b/c", "foo").close();
// ContentWriter writer = fService.getContentWriter("main:/a/b/c/foo", true);
// writer.setEncoding("UTF-8");
// writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
// writer.putContent("I am main:/a/b/c/foo");
// AVMNodeDescriptor nodeDesc = fService.lookup(-1, "main:/a/b/c/foo");
// NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, nodeDesc.getPath());
// permissionService.setPermission(nodeRef, "1", PermissionService.READ, true);
// fService.createFile("main:/a/b/c", "bar").close();
// writer = fService.getContentWriter("main:/a/b/c/bar", true);
// writer.setEncoding("UTF-8");
// writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
// writer.putContent("I am main:/a/b/c/bar");
// nodeDesc = fService.lookup(-1, "main:/a/b/c/foo");
// nodeRef = AVMNodeConverter.ToNodeRef(-1, nodeDesc.getPath());
// permissionService.setPermission(nodeRef, "1", PermissionService.READ, true);
fService.createSnapshot(AVMStore, null, null);
//testTX.commit();
}
protected void deleteAuthentication(String name)
{
if(authenticationDAO.userExists(name))
@@ -636,15 +499,7 @@ public class AbstractReadPermissionTest extends TestCase
}
authenticationService.createAuthentication(AuthenticationUtil.getAdminUserName(), "admin".toCharArray());
fService = (AVMService)applicationContext.getBean("AVMService");
fIndexerAndSearcher = (IndexerAndSearcher)applicationContext.getBean("indexerAndSearcherFactory");
wpService = (WebProjectService)applicationContext.getBean("WebProjectService");
if (fService.getStore(AVMStore) != null)
{
fService.purgeStore(AVMStore);
}
fService.createStore(AVMStore);
for(String authority : authorities)
{

View File

@@ -1,7 +1,6 @@
package org.alfresco.repo.security.permissions.impl;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -65,60 +64,6 @@ public class ReadPermissionTest extends AbstractReadPermissionTest
results.close();
}
public void testAVM() throws Exception
{
try
{
runAs("admin");
setupBasicTree("Web1");
runAs("Web1");
StoreRef storeRef = AVMNodeConverter.ToStoreRef(AVMStore);
long start;
long end;
SearchParameters sp;
ResultSet results;
// Text index
sp = new SearchParameters();
sp.addStore(storeRef);
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.setQuery("TYPE:\"cm:content\"");
sp.setMaxItems(Integer.MAX_VALUE);
sp.setMaxPermissionChecks(Integer.MAX_VALUE);
sp.setMaxPermissionCheckTimeMillis(Integer.MAX_VALUE);
start = System.nanoTime();
results = serviceRegistry.getSearchService().query(sp);
assertEquals(WEB_COUNT, results.length());
results.close();
end = System.nanoTime();
System.out.println("AVM in "+((end-start)/1e9));
sp = new SearchParameters();
sp.addStore(storeRef);
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
// sp.setQuery("TEXT:\"I am\"");
sp.setQuery("TYPE:\"cm:content\"");
sp.setMaxItems(Integer.MAX_VALUE);
sp.setMaxPermissionChecks(Integer.MAX_VALUE);
sp.setMaxPermissionCheckTimeMillis(Integer.MAX_VALUE);
start = System.nanoTime();
results = serviceRegistry.getSearchService().query(sp);
assertEquals(WEB_COUNT, results.length());
results.close();
end = System.nanoTime();
System.out.println("AVM in "+((end-start)/1e9));
}
catch (Exception e)
{
e.printStackTrace();
throw e;
}
}
public void testReadDeny()
{
SearchParameters sp;