mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged 1.4 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4316 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4317 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4319 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4328 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4652 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
A license is installed by placing the license file (.lic) within this directory.
|
||||||
|
|
||||||
|
Only one license file may exist within this directory.
|
||||||
|
|
||||||
|
Upon restarting the Alfresco server, the license file is read and installed.
|
||||||
|
If installed successfully, the license file is renamed by adding ".installed"
|
||||||
|
to the end of the filename.
|
||||||
|
|
||||||
|
|
@@ -41,6 +41,7 @@ public class ImportFileUpdater
|
|||||||
|
|
||||||
/** The current import version number **/
|
/** The current import version number **/
|
||||||
private String version;
|
private String version;
|
||||||
|
private boolean shownWarning = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the passed import file into the equivalent 1.4 format.
|
* Updates the passed import file into the equivalent 1.4 format.
|
||||||
@@ -52,6 +53,7 @@ public class ImportFileUpdater
|
|||||||
{
|
{
|
||||||
XmlPullParser reader = getReader(source);
|
XmlPullParser reader = getReader(source);
|
||||||
XMLWriter writer = getWriter(destination);
|
XMLWriter writer = getWriter(destination);
|
||||||
|
this.shownWarning = false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -206,11 +208,20 @@ public class ImportFileUpdater
|
|||||||
}
|
}
|
||||||
else if (reader.getName().equals(NAME_RULE) == true)
|
else if (reader.getName().equals(NAME_RULE) == true)
|
||||||
{
|
{
|
||||||
if (this.version.startsWith("1.3") == true)
|
if (this.shownWarning == false && this.version == null)
|
||||||
|
{
|
||||||
|
System.out.println("WARNING: No version information has been found in this import file. It will be presumed it has been exported from 1.3");
|
||||||
|
this.shownWarning = true;
|
||||||
|
}
|
||||||
|
if (this.version == null || this.version.startsWith("1.3") == true || this.version.startsWith("1.2") == true)
|
||||||
{
|
{
|
||||||
new RuleCallback().doCallback(reader, writer);
|
new RuleCallback().doCallback(reader, writer);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new RuntimeException("Import files of version " + this.version + " are not supported by this tool.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -193,11 +193,11 @@ public abstract class AbstractContentReadWriteTest extends TestCase
|
|||||||
|
|
||||||
String content = "ABC";
|
String content = "ABC";
|
||||||
// write some content
|
// write some content
|
||||||
// long before = System.currentTimeMillis();
|
long before = System.currentTimeMillis();
|
||||||
writer.setMimetype("text/plain");
|
writer.setMimetype("text/plain");
|
||||||
writer.setEncoding("UTF-8");
|
writer.setEncoding("UTF-8");
|
||||||
writer.putContent(content);
|
writer.putContent(content);
|
||||||
// long after = System.currentTimeMillis();
|
long after = System.currentTimeMillis();
|
||||||
|
|
||||||
// get a reader from the writer
|
// get a reader from the writer
|
||||||
ContentReader readerFromWriter = writer.getReader();
|
ContentReader readerFromWriter = writer.getReader();
|
||||||
@@ -219,13 +219,17 @@ public abstract class AbstractContentReadWriteTest extends TestCase
|
|||||||
int length = content.getBytes(writer.getEncoding()).length;
|
int length = content.getBytes(writer.getEncoding()).length;
|
||||||
assertEquals("Reader content length is incorrect", length, readerFromWriter.getSize());
|
assertEquals("Reader content length is incorrect", length, readerFromWriter.getSize());
|
||||||
|
|
||||||
//
|
// check that the last modified time is correct
|
||||||
// This check has been disabled as Linux is out by some variable amount of time
|
long modifiedTimeCheck = readerFromWriter.getLastModified();
|
||||||
// // check that the last modified time is correct
|
|
||||||
// long modifiedTimeCheck = readerFromWriter.getLastModified();
|
// On some versionms of Linux (e.g. Centos) this test won't work as the
|
||||||
// assertTrue("Reader last modified is incorrect", before <= modifiedTimeCheck);
|
// modified time accuracy is only to the second.
|
||||||
// assertTrue("Reader last modified is incorrect", modifiedTimeCheck <= after);
|
long beforeSeconds = before/1000L;
|
||||||
//
|
long afterSeconds = after/1000L;
|
||||||
|
long modifiedTimeCheckSeconds = modifiedTimeCheck/1000L;
|
||||||
|
|
||||||
|
assertTrue("Reader last modified is incorrect", beforeSeconds <= modifiedTimeCheckSeconds);
|
||||||
|
assertTrue("Reader last modified is incorrect", modifiedTimeCheckSeconds <= afterSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClosedState() throws Exception
|
public void testClosedState() throws Exception
|
||||||
@@ -275,6 +279,7 @@ public abstract class AbstractContentReadWriteTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Checks that the store disallows concurrent writers to be issued to the same URL.
|
* Checks that the store disallows concurrent writers to be issued to the same URL.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public void testConcurrentWriteDetection() throws Exception
|
public void testConcurrentWriteDetection() throws Exception
|
||||||
{
|
{
|
||||||
String contentUrl = AbstractContentStore.createNewUrl();
|
String contentUrl = AbstractContentStore.createNewUrl();
|
||||||
|
@@ -21,9 +21,11 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.jscript.Classification;
|
import org.alfresco.repo.jscript.Classification;
|
||||||
import org.alfresco.repo.jscript.Search;
|
import org.alfresco.repo.jscript.Search;
|
||||||
import org.alfresco.repo.jscript.Session;
|
import org.alfresco.repo.jscript.Session;
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.ScriptService;
|
import org.alfresco.service.cmr.repository.ScriptService;
|
||||||
@@ -155,7 +157,18 @@ public class AlfrescoJavaScript extends JBPMSpringActionHandler
|
|||||||
inputMap.put("session", new Session(services, null));
|
inputMap.put("session", new Session(services, null));
|
||||||
inputMap.put("classification", new Classification(services, companyHomeRef.getStoreRef(), null));
|
inputMap.put("classification", new Classification(services, companyHomeRef.getStoreRef(), null));
|
||||||
}
|
}
|
||||||
|
String userName = AuthenticationUtil.getCurrentUserName();
|
||||||
|
NodeRef person = services.getPersonService().getPerson(userName);
|
||||||
|
if (person != null)
|
||||||
|
{
|
||||||
|
inputMap.put("person", new JBPMNode(person, services));
|
||||||
|
NodeRef homeSpace = (NodeRef)services.getNodeService().getProperty(person, ContentModel.PROP_HOMEFOLDER);
|
||||||
|
if (homeSpace != null)
|
||||||
|
{
|
||||||
|
inputMap.put("userhome", new JBPMNode(homeSpace, services));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// initialise process variables
|
// initialise process variables
|
||||||
Token token = executionContext.getToken();
|
Token token = executionContext.getToken();
|
||||||
inputMap.put("executionContext", executionContext);
|
inputMap.put("executionContext", executionContext);
|
||||||
|
@@ -239,8 +239,8 @@ public interface FileFolderService
|
|||||||
* Get the reader to the file represented by the node according to the File/Folder model.
|
* Get the reader to the file represented by the node according to the File/Folder model.
|
||||||
* (This is not the same as the method on the ContentService)
|
* (This is not the same as the method on the ContentService)
|
||||||
*
|
*
|
||||||
* @param nodeRef
|
* @param nodeRef the content node
|
||||||
* @return
|
* @return Returns a handle to the content associated with the node
|
||||||
*/
|
*/
|
||||||
@Auditable(key = Auditable.Key.ARG_0, parameters = {"nodeRef"})
|
@Auditable(key = Auditable.Key.ARG_0, parameters = {"nodeRef"})
|
||||||
public ContentReader getReader(NodeRef nodeRef);
|
public ContentReader getReader(NodeRef nodeRef);
|
||||||
@@ -249,8 +249,8 @@ public interface FileFolderService
|
|||||||
* Get the writer to the file represented by the node according to the File/Folder model.
|
* Get the writer to the file represented by the node according to the File/Folder model.
|
||||||
* (This is not the same as the method on the ContentService)
|
* (This is not the same as the method on the ContentService)
|
||||||
*
|
*
|
||||||
* @param nodeRef
|
* @param nodeRef the content node
|
||||||
* @return
|
* @return Returns a handle to the content associated with the node
|
||||||
*/
|
*/
|
||||||
@Auditable(key = Auditable.Key.ARG_0, parameters = {"nodeRef"})
|
@Auditable(key = Auditable.Key.ARG_0, parameters = {"nodeRef"})
|
||||||
public ContentWriter getWriter(NodeRef nodeRef);
|
public ContentWriter getWriter(NodeRef nodeRef);
|
||||||
|
Reference in New Issue
Block a user