+ #if>
\ No newline at end of file
diff --git a/config/alfresco/templates/content_template_examples.xml b/config/alfresco/templates/content_template_examples.xml
index 85ac61c026..c5947af0cb 100644
--- a/config/alfresco/templates/content_template_examples.xml
+++ b/config/alfresco/templates/content_template_examples.xml
@@ -126,17 +126,17 @@
-
+ true
- Displays the current state of records in a file plan space or a space containing a file plan.
- contentUrl=classpath:alfresco/templates/content/examples/records_report.ftl|mimetype=text/plain|size=6134|encoding=UTF-8
- records_report.ftl
- records_report.ftl
+ Displays the audit trail for an object.
+ contentUrl=classpath:alfresco/templates/content/examples/show_audit.ftl|mimetype=text/plain|size=6134|encoding=UTF-8
+ show_audit.ftl
+ show_audit.ftl
diff --git a/config/alfresco/version.properties b/config/alfresco/version.properties
index 681bec09e2..bbaa2c9aa9 100644
--- a/config/alfresco/version.properties
+++ b/config/alfresco/version.properties
@@ -7,7 +7,7 @@
version.major=1
version.minor=4
version.revision=0
-version.label=RC1
+version.label=
# Edition label
diff --git a/config/alfresco/workflow-context.xml b/config/alfresco/workflow-context.xml
index 468f5d350a..ae0f4a3ece 100644
--- a/config/alfresco/workflow-context.xml
+++ b/config/alfresco/workflow-context.xml
@@ -23,26 +23,33 @@
+
+
+
+
+
+
+
+
+
+
+ alfresco.messages.workflow-interpreter-help
+
+
+
+
-
- true
-
-
-
-
-
-
-
-
-
-
+ true
+
+
+
@@ -73,7 +80,7 @@
-
+
diff --git a/source/cpp/CAlfrescoApp/source/alfresco/Alfresco.cpp b/source/cpp/CAlfrescoApp/source/alfresco/Alfresco.cpp
index 31f08bcf3e..b35d4e6922 100644
--- a/source/cpp/CAlfrescoApp/source/alfresco/Alfresco.cpp
+++ b/source/cpp/CAlfrescoApp/source/alfresco/Alfresco.cpp
@@ -309,7 +309,7 @@ DesktopResponse AlfrescoInterface::runAction(AlfrescoActionInfo& action, Desktop
// Build the run action I/O control request
DataBuffer reqbuf( 1024);
- DataBuffer respbuf( 256);
+ DataBuffer respbuf( 4096);
reqbuf.putFixedString( IOSignature, IOSignatureLen);
reqbuf.putString( action.getName());
diff --git a/source/java/org/alfresco/filesys/CIFSServer.java b/source/java/org/alfresco/filesys/CIFSServer.java
index b62f92fff4..34fa3fe64a 100644
--- a/source/java/org/alfresco/filesys/CIFSServer.java
+++ b/source/java/org/alfresco/filesys/CIFSServer.java
@@ -26,12 +26,11 @@ import org.alfresco.filesys.netbios.server.NetBIOSNameServer;
import org.alfresco.filesys.server.NetworkServer;
import org.alfresco.filesys.server.config.ServerConfiguration;
import org.alfresco.filesys.smb.server.SMBServer;
+import org.alfresco.util.AbstractLifecycleBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
@@ -41,7 +40,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
*
* @author GKSpencer
*/
-public class CIFSServer implements ApplicationListener
+public class CIFSServer extends AbstractLifecycleBean
{
private static final Log logger = LogFactory.getLog("org.alfresco.smb.server");
@@ -81,29 +80,6 @@ public class CIFSServer implements ApplicationListener
return (filesysConfig != null && filesysConfig.isSMBServerEnabled());
}
- /*
- * (non-Javadoc)
- * @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
- */
- public void onApplicationEvent(ApplicationEvent event)
- {
- if (event instanceof ContextRefreshedEvent)
- {
- try
- {
- startServer();
- }
- catch (SocketException e)
- {
- throw new AlfrescoRuntimeException("Failed to start CIFS server", e);
- }
- catch (IOException e)
- {
- throw new AlfrescoRuntimeException("Failed to start CIFS server", e);
- }
- }
- }
-
/**
* Start the CIFS server components
*
@@ -264,5 +240,27 @@ public class CIFSServer implements ApplicationListener
System.exit(1);
}
+ @Override
+ protected void onBootstrap(ApplicationEvent event)
+ {
+ try
+ {
+ startServer();
+ }
+ catch (SocketException e)
+ {
+ throw new AlfrescoRuntimeException("Failed to start CIFS server", e);
+ }
+ catch (IOException e)
+ {
+ throw new AlfrescoRuntimeException("Failed to start CIFS server", e);
+ }
+ }
+
+ @Override
+ protected void onShutdown(ApplicationEvent event)
+ {
+ stopServer();
+ }
}
diff --git a/source/java/org/alfresco/filesys/FTPServer.java b/source/java/org/alfresco/filesys/FTPServer.java
index f77cb0b67d..270b209373 100644
--- a/source/java/org/alfresco/filesys/FTPServer.java
+++ b/source/java/org/alfresco/filesys/FTPServer.java
@@ -24,11 +24,11 @@ import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.filesys.ftp.FTPNetworkServer;
import org.alfresco.filesys.server.NetworkServer;
import org.alfresco.filesys.server.config.ServerConfiguration;
+import org.alfresco.util.AbstractLifecycleBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -39,7 +39,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
*
* @author GKSpencer
*/
-public class FTPServer implements ApplicationListener
+public class FTPServer extends AbstractLifecycleBean
{
private static final Log logger = LogFactory.getLog("org.alfresco.ftp.server");
@@ -79,29 +79,6 @@ public class FTPServer implements ApplicationListener
return (filesysConfig != null && filesysConfig.isFTPServerEnabled());
}
- /*
- * (non-Javadoc)
- * @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
- */
- public void onApplicationEvent(ApplicationEvent event)
- {
- if (event instanceof ContextRefreshedEvent)
- {
- try
- {
- startServer();
- }
- catch (SocketException e)
- {
- throw new AlfrescoRuntimeException("Failed to start FTP server", e);
- }
- catch (IOException e)
- {
- throw new AlfrescoRuntimeException("Failed to start FTP server", e);
- }
- }
- }
-
/**
* Start the FTP server components
*
@@ -251,4 +228,28 @@ public class FTPServer implements ApplicationListener
}
System.exit(1);
}
+
+ @Override
+ protected void onBootstrap(ApplicationEvent event)
+ {
+ try
+ {
+ startServer();
+ }
+ catch (SocketException e)
+ {
+ throw new AlfrescoRuntimeException("Failed to start FTP server", e);
+ }
+ catch (IOException e)
+ {
+ throw new AlfrescoRuntimeException("Failed to start FTP server", e);
+ }
+ }
+
+ @Override
+ protected void onShutdown(ApplicationEvent event)
+ {
+ stopServer();
+ }
+
}
diff --git a/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java b/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java
index 16a9daa11c..afd55c32a8 100644
--- a/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java
+++ b/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java
@@ -852,7 +852,7 @@ public class FTPSrvSession extends SrvSession implements Runnable
// DEBUG
if ( logger.isDebugEnabled())
- logger.debug("Logon failed", ex);
+ logger.debug("Logon failed for user " + cInfo.getUserName());
}
// Check if the logon was successful
diff --git a/source/java/org/alfresco/filesys/server/auth/AlfrescoAuthenticator.java b/source/java/org/alfresco/filesys/server/auth/AlfrescoAuthenticator.java
index 817e7b361b..f26a8bfdd2 100644
--- a/source/java/org/alfresco/filesys/server/auth/AlfrescoAuthenticator.java
+++ b/source/java/org/alfresco/filesys/server/auth/AlfrescoAuthenticator.java
@@ -17,10 +17,17 @@
package org.alfresco.filesys.server.auth;
import java.security.NoSuchAlgorithmException;
+import net.sf.acegisecurity.Authentication;
import org.alfresco.filesys.server.SrvSession;
+import org.alfresco.filesys.server.auth.AuthContext;
+import org.alfresco.filesys.server.auth.CifsAuthenticator;
+import org.alfresco.filesys.server.auth.ClientInfo;
+import org.alfresco.filesys.server.auth.NTLanManAuthContext;
import org.alfresco.filesys.smb.server.SMBSrvSession;
+import org.alfresco.filesys.util.HexDump;
import org.alfresco.repo.security.authentication.NTLMMode;
+import org.alfresco.repo.security.authentication.ntlm.NTLMPassthruToken;
/**
* Alfresco Authenticator Class
@@ -88,10 +95,7 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
{
// Use the existing authentication token
- if ( client.isGuest())
- m_authComponent.setGuestUserAsCurrentUser();
- else
- m_authComponent.setCurrentUser(mapUserNameToPerson(client.getUserName()));
+ m_authComponent.setCurrentUser(client.getUserName());
// Debug
@@ -107,7 +111,7 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
int authSts = AUTH_DISALLOW;
- if ( client.isGuest() || client.getUserName().equalsIgnoreCase(GUEST_USERNAME))
+ if ( client.isGuest() || client.getUserName().equalsIgnoreCase(getGuestUserName()))
{
// Check if guest logons are allowed
@@ -140,7 +144,13 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
authSts = doMD4UserAuthentication(client, sess, alg);
}
-
+ else
+ {
+ // Perform passthru authentication password check
+
+ authSts = doPassthruUserAuthentication(client, sess, alg);
+ }
+
// Check if the logon status indicates a guest logon
if ( authSts == AUTH_GUEST)
@@ -172,6 +182,64 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
return authSts;
}
+ /**
+ * Return an authentication context for the new session
+ *
+ * @return AuthContext
+ */
+ public AuthContext getAuthContext( SMBSrvSession sess)
+ {
+ // Check if the client is already authenticated, and it is not a null logon
+
+ AuthContext authCtx = null;
+
+ if ( sess.hasAuthenticationContext() && sess.hasAuthenticationToken() &&
+ sess.getClientInformation().getLogonType() != ClientInfo.LogonNull)
+ {
+ // Return the previous challenge, user is already authenticated
+
+ authCtx = (NTLanManAuthContext) sess.getAuthenticationContext();
+
+ // DEBUG
+
+ if ( logger.isDebugEnabled())
+ logger.debug("Re-using existing challenge, already authenticated");
+ }
+ else if ( m_authComponent.getNTLMMode() == NTLMMode.MD4_PROVIDER)
+ {
+ // Create a new authentication context for the session
+
+ authCtx = new NTLanManAuthContext();
+ sess.setAuthenticationContext( authCtx);
+ }
+ else
+ {
+ // Create an authentication token for the session
+
+ NTLMPassthruToken authToken = new NTLMPassthruToken();
+
+ // Run the first stage of the passthru authentication to get the challenge
+
+ m_authComponent.authenticate( authToken);
+
+ // Save the authentication token for the second stage of the authentication
+
+ sess.setAuthenticationToken(authToken);
+
+ // Get the challenge from the token
+
+ if ( authToken.getChallenge() != null)
+ {
+ authCtx = new NTLanManAuthContext( authToken.getChallenge().getBytes());
+ sess.setAuthenticationContext( authCtx);
+ }
+ }
+
+ // Return the authentication context
+
+ return authCtx;
+ }
+
/**
* Perform MD4 user authentication
*
@@ -217,6 +285,20 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
// Validate the password
byte[] clientHash = client.getPassword();
+ if ( clientHash == null || clientHash.length != 24)
+ {
+ // Use the secondary password hash from the client
+
+ clientHash = client.getANSIPassword();
+
+ // DEBUG
+
+ if ( logger.isDebugEnabled())
+ {
+ logger.debug( "Using secondary password hash - " + HexDump.hexString(clientHash));
+ logger.debug( " Local hash - " + HexDump.hexString( localHash));
+ }
+ }
if ( clientHash == null || clientHash.length != localHash.length)
return CifsAuthenticator.AUTH_BADPASSWORD;
@@ -229,7 +311,7 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
// Set the current user to be authenticated, save the authentication token
- client.setAuthenticationToken( m_authComponent.setCurrentUser(mapUserNameToPerson(client.getUserName())));
+ client.setAuthenticationToken( m_authComponent.setCurrentUser(client.getUserName()));
// Get the users home folder node, if available
@@ -259,4 +341,101 @@ public class AlfrescoAuthenticator extends CifsAuthenticator
return allowGuest() ? CifsAuthenticator.AUTH_GUEST : CifsAuthenticator.AUTH_DISALLOW;
}
+
+ /**
+ * Perform passthru user authentication
+ *
+ * @param client Client information
+ * @param sess Server session
+ * @param alg Encryption algorithm
+ * @return int
+ */
+ private final int doPassthruUserAuthentication(ClientInfo client, SrvSession sess, int alg)
+ {
+ // Get the authentication token for the session
+
+ NTLMPassthruToken authToken = (NTLMPassthruToken) sess.getAuthenticationToken();
+
+ if ( authToken == null)
+ return CifsAuthenticator.AUTH_DISALLOW;
+
+ // Get the appropriate hashed password for the algorithm
+
+ int authSts = CifsAuthenticator.AUTH_DISALLOW;
+ byte[] hashedPassword = null;
+
+ if ( alg == NTLM1)
+ hashedPassword = client.getPassword();
+ else if ( alg == LANMAN)
+ hashedPassword = client.getANSIPassword();
+ else
+ {
+ // Invalid/unsupported algorithm specified
+
+ return CifsAuthenticator.AUTH_DISALLOW;
+ }
+
+ // Set the username and hashed password in the authentication token
+
+ authToken.setUserAndPassword( client.getUserName(), hashedPassword, alg);
+
+ // Authenticate the user
+
+ Authentication genAuthToken = null;
+
+ try
+ {
+ // Run the second stage of the passthru authentication
+
+ genAuthToken = m_authComponent.authenticate( authToken);
+
+ // Check if the user has been logged on as a guest
+
+ if (authToken.isGuestLogon())
+ {
+
+ // Check if the local server allows guest access
+
+ if (allowGuest() == true)
+ {
+
+ // Allow the user access as a guest
+
+ authSts = CifsAuthenticator.AUTH_GUEST;
+ }
+ }
+ else
+ {
+
+ // Allow the user full access to the server
+
+ authSts = CifsAuthenticator.AUTH_ALLOW;
+ }
+
+ // Set the current user to be authenticated, save the authentication token
+
+ client.setAuthenticationToken( genAuthToken);
+
+ // Get the users home folder node, if available
+
+ getHomeFolderForUser( client);
+
+ // DEBUG
+
+ if ( logger.isDebugEnabled())
+ logger.debug("Auth token " + genAuthToken);
+ }
+ catch ( Exception ex)
+ {
+ logger.error("Error during passthru authentication", ex);
+ }
+
+ // Clear the authentication token
+
+ sess.setAuthenticationToken(null);
+
+ // Return the authentication status
+
+ return authSts;
+ }
}
\ No newline at end of file
diff --git a/source/java/org/alfresco/filesys/server/auth/CifsAuthenticator.java b/source/java/org/alfresco/filesys/server/auth/CifsAuthenticator.java
index 7815a7cf8f..3effae1145 100644
--- a/source/java/org/alfresco/filesys/server/auth/CifsAuthenticator.java
+++ b/source/java/org/alfresco/filesys/server/auth/CifsAuthenticator.java
@@ -470,7 +470,7 @@ public abstract class CifsAuthenticator
// Store the client maximum buffer size, maximum multiplexed requests count and client
// capability flags
- sess.setClientMaximumBufferSize(maxBufSize);
+ sess.setClientMaximumBufferSize(maxBufSize != 0 ? maxBufSize : SMBSrvSession.DefaultBufferSize);
sess.setClientMaximumMultiplex(maxMpx);
sess.setClientCapabilities(capabs);
diff --git a/source/java/org/alfresco/filesys/server/auth/ClientInfo.java b/source/java/org/alfresco/filesys/server/auth/ClientInfo.java
index 56eec14aeb..421c840583 100644
--- a/source/java/org/alfresco/filesys/server/auth/ClientInfo.java
+++ b/source/java/org/alfresco/filesys/server/auth/ClientInfo.java
@@ -71,6 +71,10 @@ public class ClientInfo
private Authentication m_authToken;
+ // Authentication ticket, used for web access without having to re-authenticate
+
+ private String m_authTicket;
+
// Home folder node
private NodeRef m_homeNode;
@@ -286,6 +290,26 @@ public class ClientInfo
{
return m_authToken;
}
+
+ /**
+ * Check if the client has an authentication ticket
+ *
+ * @return boolean
+ */
+ public final boolean hasAuthenticationTicket()
+ {
+ return m_authTicket != null ? true : false;
+ }
+
+ /**
+ * Return the authentication ticket
+ *
+ * @return String
+ */
+ public final String getAuthenticationTicket()
+ {
+ return m_authTicket;
+ }
/**
* Check if the client has a home folder node
@@ -409,6 +433,16 @@ public class ClientInfo
{
m_authToken = token;
}
+
+ /**
+ * Set the authentication ticket
+ *
+ * @param ticket String
+ */
+ public final void setAuthenticationTicket(String ticket)
+ {
+ m_authTicket = ticket;
+ }
/**
* Set the home folder node
@@ -448,6 +482,12 @@ public class ClientInfo
str.append(",token=");
str.append(getAuthenticationToken());
}
+
+ if ( hasAuthenticationTicket())
+ {
+ str.append(",ticket=");
+ str.append(getAuthenticationTicket());
+ }
if (isGuest())
str.append(",Guest");
diff --git a/source/java/org/alfresco/filesys/server/auth/EnterpriseCifsAuthenticator.java b/source/java/org/alfresco/filesys/server/auth/EnterpriseCifsAuthenticator.java
index c5647faff4..4f034ee1c7 100644
--- a/source/java/org/alfresco/filesys/server/auth/EnterpriseCifsAuthenticator.java
+++ b/source/java/org/alfresco/filesys/server/auth/EnterpriseCifsAuthenticator.java
@@ -584,7 +584,7 @@ public class EnterpriseCifsAuthenticator extends CifsAuthenticator implements Ca
// Store the client maximum buffer size, maximum multiplexed requests count and client capability flags
- sess.setClientMaximumBufferSize(maxBufSize);
+ sess.setClientMaximumBufferSize(maxBufSize != 0 ? maxBufSize : SMBSrvSession.DefaultBufferSize);
sess.setClientMaximumMultiplex(maxMpx);
sess.setClientCapabilities(capabs);
diff --git a/source/java/org/alfresco/filesys/server/auth/ntlm/AlfrescoAuthenticator.java b/source/java/org/alfresco/filesys/server/auth/ntlm/AlfrescoAuthenticator.java
deleted file mode 100644
index 5b77d4171d..0000000000
--- a/source/java/org/alfresco/filesys/server/auth/ntlm/AlfrescoAuthenticator.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Copyright (C) 2005-2006 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.filesys.server.auth.ntlm;
-
-import java.security.NoSuchAlgorithmException;
-import net.sf.acegisecurity.Authentication;
-
-import org.alfresco.filesys.server.SrvSession;
-import org.alfresco.filesys.server.auth.AuthContext;
-import org.alfresco.filesys.server.auth.CifsAuthenticator;
-import org.alfresco.filesys.server.auth.ClientInfo;
-import org.alfresco.filesys.server.auth.NTLanManAuthContext;
-import org.alfresco.filesys.smb.server.SMBSrvSession;
-import org.alfresco.filesys.util.DataPacker;
-import org.alfresco.repo.security.authentication.NTLMMode;
-import org.alfresco.repo.security.authentication.ntlm.NTLMPassthruToken;
-
-/**
- * Alfresco Authenticator Class
- *
- *
The Alfresco authenticator implementation enables user level security mode using the Alfresco authentication
- * component.
- *
- *
Note: Switching off encrypted password support will cause later NT4 service pack releases and
- * Win2000 to refuse to connect to the server without a registry update on the client.
- *
- * @author GKSpencer
- */
-public class AlfrescoAuthenticator extends CifsAuthenticator
-{
- /**
- * Default Constructor
- *
- *
Default to user mode security with encrypted password support.
- */
- public AlfrescoAuthenticator()
- {
- }
-
- /**
- * Validate that the authentication component supports the required mode
- *
- * @return boolean
- */
- protected boolean validateAuthenticationMode()
- {
- // Make sure the authentication component supports MD4 hashed passwords or passthru mode
-
- if ( m_authComponent.getNTLMMode() != NTLMMode.MD4_PROVIDER &&
- m_authComponent.getNTLMMode() != NTLMMode.PASS_THROUGH)
- return false;
- return true;
- }
-
- /**
- * Authenticate a user
- *
- * @param client Client information
- * @param sess Server session
- * @param alg Encryption algorithm
- */
- public int authenticateUser(ClientInfo client, SrvSession sess, int alg)
- {
- // Check if this is an SMB/CIFS null session logon.
- //
- // The null session will only be allowed to connect to the IPC$ named pipe share.
-
- if (client.isNullSession() && sess instanceof SMBSrvSession)
- {
- // Debug
-
- if ( logger.isDebugEnabled())
- logger.debug("Null CIFS logon allowed");
-
- return CifsAuthenticator.AUTH_ALLOW;
- }
-
- // Check if the client is already authenticated, and it is not a null logon
-
- if ( client.getAuthenticationToken() != null && client.getLogonType() != ClientInfo.LogonNull)
- {
- // Use the existing authentication token
-
- m_authComponent.setCurrentUser(client.getUserName());
-
- // Debug
-
- if ( logger.isDebugEnabled())
- logger.debug("Re-using existing authentication token");
-
- // Return the authentication status
-
- return client.getLogonType() != ClientInfo.LogonGuest ? AUTH_ALLOW : AUTH_GUEST;
- }
-
- // Check if this is a guest logon
-
- int authSts = AUTH_DISALLOW;
-
- if ( client.isGuest() || client.getUserName().equalsIgnoreCase(getGuestUserName()))
- {
- // Check if guest logons are allowed
-
- if ( allowGuest() == false)
- return AUTH_DISALLOW;
-
- // Get a guest authentication token
-
- doGuestLogon( client, sess);
-
- // Indicate logged on as guest
-
- authSts = AUTH_GUEST;
-
- // DEBUG
-
- if ( logger.isDebugEnabled())
- logger.debug("Authenticated user " + client.getUserName() + " sts=" + getStatusAsString(authSts));
-
- // Return the guest status
-
- return authSts;
- }
-
- // Check if MD4 or passthru mode is configured
-
- else if ( m_authComponent.getNTLMMode() == NTLMMode.MD4_PROVIDER)
- {
- // Perform local MD4 password check
-
- authSts = doMD4UserAuthentication(client, sess, alg);
- }
- else
- {
- // Perform passthru authentication password check
-
- authSts = doPassthruUserAuthentication(client, sess, alg);
- }
-
- // Check if the logon status indicates a guest logon
-
- if ( authSts == AUTH_GUEST)
- {
- // Only allow the guest logon if user mapping is enabled
-
- if ( mapUnknownUserToGuest())
- {
- // Logon as guest, setup the security context
-
- doGuestLogon( client, sess);
- }
- else
- {
- // Do not allow the guest logon
-
- authSts = AUTH_DISALLOW;
- }
- }
-
- // DEBUG
-
- if ( logger.isDebugEnabled())
- logger.debug("Authenticated user " + client.getUserName() + " sts=" + getStatusAsString(authSts) +
- " via " + (m_authComponent.getNTLMMode() == NTLMMode.MD4_PROVIDER ? "MD4" : "Passthru"));
-
- // Return the authentication status
-
- return authSts;
- }
-
- /**
- * Return an authentication context for the new session
- *
- * @return AuthContext
- */
- public AuthContext getAuthContext( SMBSrvSession sess)
- {
- // Check if the client is already authenticated, and it is not a null logon
-
- AuthContext authCtx = null;
-
- if ( sess.hasAuthenticationContext() && sess.hasAuthenticationToken() &&
- sess.getClientInformation().getLogonType() != ClientInfo.LogonNull)
- {
- // Return the previous challenge, user is already authenticated
-
- authCtx = (NTLanManAuthContext) sess.getAuthenticationContext();
-
- // DEBUG
-
- if ( logger.isDebugEnabled())
- logger.debug("Re-using existing challenge, already authenticated");
- }
- else if ( m_authComponent.getNTLMMode() == NTLMMode.MD4_PROVIDER)
- {
- // Create a new authentication context for the session
-
- authCtx = new NTLanManAuthContext();
- sess.setAuthenticationContext( authCtx);
- }
- else
- {
- // Create an authentication token for the session
-
- NTLMPassthruToken authToken = new NTLMPassthruToken();
-
- // Run the first stage of the passthru authentication to get the challenge
-
- m_authComponent.authenticate( authToken);
-
- // Save the authentication token for the second stage of the authentication
-
- sess.setAuthenticationToken(authToken);
-
- // Get the challenge from the token
-
- if ( authToken.getChallenge() != null)
- {
- authCtx = new NTLanManAuthContext( authToken.getChallenge().getBytes());
- sess.setAuthenticationContext( authCtx);
- }
- }
-
- // Return the authentication context
-
- return authCtx;
- }
-
- /**
- * Perform MD4 user authentication
- *
- * @param client Client information
- * @param sess Server session
- * @param alg Encryption algorithm
- * @return int
- */
- private final int doMD4UserAuthentication(ClientInfo client, SrvSession sess, int alg)
- {
- // Get the stored MD4 hashed password for the user, or null if the user does not exist
-
- String md4hash = m_authComponent.getMD4HashedPassword(client.getUserName());
-
- if ( md4hash != null)
- {
- // Check if the client has supplied an NTLM hashed password, if not then do not allow access
-
- if ( client.getPassword() == null)
- return CifsAuthenticator.AUTH_BADPASSWORD;
-
- try
- {
- // Generate the local encrypted password using the challenge that was sent to the client
-
- byte[] p21 = new byte[21];
- byte[] md4byts = m_md4Encoder.decodeHash(md4hash);
- System.arraycopy(md4byts, 0, p21, 0, 16);
-
- // Get the challenge that was sent to the client
-
- NTLanManAuthContext authCtx = null;
-
- if ( sess.hasAuthenticationContext() && sess.getAuthenticationContext() instanceof NTLanManAuthContext)
- authCtx = (NTLanManAuthContext) sess.getAuthenticationContext();
- else
- return CifsAuthenticator.AUTH_DISALLOW;
-
- // Generate the local hash of the password using the same challenge
-
- byte[] localHash = getEncryptor().doNTLM1Encryption(p21, authCtx.getChallenge());
-
- // Validate the password
-
- byte[] clientHash = client.getPassword();
-
- if ( clientHash == null || clientHash.length != localHash.length)
- return CifsAuthenticator.AUTH_BADPASSWORD;
-
- for ( int i = 0; i < clientHash.length; i++)
- {
- if ( clientHash[i] != localHash[i])
- return CifsAuthenticator.AUTH_BADPASSWORD;
- }
-
- // Set the current user to be authenticated, save the authentication token
-
- client.setAuthenticationToken( m_authComponent.setCurrentUser(client.getUserName()));
-
- // Get the users home folder node, if available
-
- getHomeFolderForUser( client);
-
- // Passwords match, grant access
-
- return CifsAuthenticator.AUTH_ALLOW;
- }
- catch (NoSuchAlgorithmException ex)
- {
- }
-
- // Error during password check, do not allow access
-
- return CifsAuthenticator.AUTH_DISALLOW;
- }
-
- // Check if this is an SMB/CIFS null session logon.
- //
- // The null session will only be allowed to connect to the IPC$ named pipe share.
-
- if (client.isNullSession() && sess instanceof SMBSrvSession)
- return CifsAuthenticator.AUTH_ALLOW;
-
- // User does not exist, check if guest access is allowed
-
- return allowGuest() ? CifsAuthenticator.AUTH_GUEST : CifsAuthenticator.AUTH_DISALLOW;
- }
-
- /**
- * Perform passthru user authentication
- *
- * @param client Client information
- * @param sess Server session
- * @param alg Encryption algorithm
- * @return int
- */
- private final int doPassthruUserAuthentication(ClientInfo client, SrvSession sess, int alg)
- {
- // Get the authentication token for the session
-
- NTLMPassthruToken authToken = (NTLMPassthruToken) sess.getAuthenticationToken();
-
- if ( authToken == null)
- return CifsAuthenticator.AUTH_DISALLOW;
-
- // Get the appropriate hashed password for the algorithm
-
- int authSts = CifsAuthenticator.AUTH_DISALLOW;
- byte[] hashedPassword = null;
-
- if ( alg == NTLM1)
- hashedPassword = client.getPassword();
- else if ( alg == LANMAN)
- hashedPassword = client.getANSIPassword();
- else
- {
- // Invalid/unsupported algorithm specified
-
- return CifsAuthenticator.AUTH_DISALLOW;
- }
-
- // Set the username and hashed password in the authentication token
-
- authToken.setUserAndPassword( client.getUserName(), hashedPassword, alg);
-
- // Authenticate the user
-
- Authentication genAuthToken = null;
-
- try
- {
- // Run the second stage of the passthru authentication
-
- genAuthToken = m_authComponent.authenticate( authToken);
-
- // Check if the user has been logged on as a guest
-
- if (authToken.isGuestLogon())
- {
-
- // Check if the local server allows guest access
-
- if (allowGuest() == true)
- {
-
- // Allow the user access as a guest
-
- authSts = CifsAuthenticator.AUTH_GUEST;
- }
- }
- else
- {
-
- // Allow the user full access to the server
-
- authSts = CifsAuthenticator.AUTH_ALLOW;
- }
-
- // Set the current user to be authenticated, save the authentication token
-
- client.setAuthenticationToken( genAuthToken);
-
- // Get the users home folder node, if available
-
- getHomeFolderForUser( client);
-
- // DEBUG
-
- if ( logger.isDebugEnabled())
- logger.debug("Auth token " + genAuthToken);
- }
- catch ( Exception ex)
- {
- logger.error("Error during passthru authentication", ex);
- }
-
- // Clear the authentication token
-
- sess.setAuthenticationToken(null);
-
- // Return the authentication status
-
- return authSts;
- }
-}
\ No newline at end of file
diff --git a/source/java/org/alfresco/filesys/server/auth/ntlm/NTLMLogonDetails.java b/source/java/org/alfresco/filesys/server/auth/ntlm/NTLMLogonDetails.java
index c5c8f7f314..4615408bd5 100644
--- a/source/java/org/alfresco/filesys/server/auth/ntlm/NTLMLogonDetails.java
+++ b/source/java/org/alfresco/filesys/server/auth/ntlm/NTLMLogonDetails.java
@@ -39,6 +39,10 @@ public class NTLMLogonDetails
private String m_authSrvAddr;
+ // Date/time authentication was started
+
+ private long m_createTime;
+
// Date/time the user was authenticated
private long m_authTime;
@@ -61,6 +65,7 @@ public class NTLMLogonDetails
*/
public NTLMLogonDetails()
{
+ m_createTime = System.currentTimeMillis();
}
/**
@@ -74,6 +79,8 @@ public class NTLMLogonDetails
*/
public NTLMLogonDetails(String user, String wks, String domain, boolean guest, String authSrv)
{
+ m_createTime = System.currentTimeMillis();
+
setDetails(user, wks, domain, guest, authSrv);
}
@@ -117,6 +124,16 @@ public class NTLMLogonDetails
return m_authSrvAddr;
}
+ /**
+ * Return the date/time the authentication was started
+ *
+ * @return long
+ */
+ public final long createdAt()
+ {
+ return m_createTime;
+ }
+
/**
* Return the date/time the user was authenticated
*
diff --git a/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java b/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java
index 46c7e16839..a48040b950 100644
--- a/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java
+++ b/source/java/org/alfresco/filesys/server/config/ServerConfiguration.java
@@ -81,11 +81,10 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.transaction.TransactionService;
+import org.alfresco.util.AbstractLifecycleBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ContextRefreshedEvent;
/**
*
@@ -93,7 +92,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
*
* @author Gary K. Spencer
*/
-public class ServerConfiguration implements ApplicationListener
+public class ServerConfiguration extends AbstractLifecycleBean
{
// Debug logging
@@ -425,18 +424,6 @@ public class ServerConfiguration implements ApplicationListener
return initialised;
}
- /*
- * (non-Javadoc)
- * @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
- */
- public void onApplicationEvent(ApplicationEvent event)
- {
- if (event instanceof ContextRefreshedEvent)
- {
- init();
- }
- }
-
/**
* Initialize the configuration using the configuration service
*/
@@ -1791,9 +1778,7 @@ public class ServerConfiguration implements ApplicationListener
// Load the Alfresco authenticator dynamically
- auth = loadAuthenticatorClass("org.alfresco.filesys.server.auth.ntlm.AlfrescoAuthenticator");
- if ( auth == null)
- auth = loadAuthenticatorClass("org.alfresco.filesys.server.auth.AlfrescoAuthenticator");
+ auth = loadAuthenticatorClass("org.alfresco.filesys.server.auth.AlfrescoAuthenticator");
if ( auth == null)
throw new AlfrescoRuntimeException("Failed to load Alfresco authenticator");
@@ -3359,4 +3344,17 @@ public class ServerConfiguration implements ApplicationListener
return srvAuth;
}
+
+ @Override
+ protected void onBootstrap(ApplicationEvent event)
+ {
+ init();
+ }
+
+ @Override
+ protected void onShutdown(ApplicationEvent event)
+ {
+ // NO-OP
+ }
+
}
\ No newline at end of file
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java b/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java
index 049e5d4e7d..7ce6b8705f 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/ContentDiskDriver.java
@@ -18,6 +18,7 @@ package org.alfresco.filesys.smb.server.repo;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.net.InetAddress;
import java.util.List;
import javax.transaction.UserTransaction;
@@ -58,7 +59,6 @@ import org.alfresco.filesys.util.WildCard;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.service.ServiceRegistry;
-import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.lock.NodeLockedException;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -66,6 +66,7 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.AccessStatus;
+import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.transaction.TransactionService;
@@ -91,6 +92,10 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
private static final String KEY_ROOT_PATH = "rootPath";
private static final String KEY_RELATIVE_PATH = "relativePath";
+ // Token name to substitute current servers DNS name or TCP/IP address into the webapp URL
+
+ private static final String TokenLocalName = "${localname}";
+
// Services and helpers
private CifsHelper cifsHelper;
@@ -102,6 +107,7 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
private PermissionService permissionService;
private AuthenticationComponent authComponent;
+ private AuthenticationService authService;
// Service registry for desktop actions
@@ -127,6 +133,16 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
return this.cifsHelper;
}
+ /**
+ * Return the authentication service
+ *
+ * @return AuthenticationService
+ */
+ public final AuthenticationService getAuthenticationService()
+ {
+ return authService;
+ }
+
/**
* Return the transaction service
*
@@ -185,7 +201,7 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
{
return this.serviceRegistry;
}
-
+
/**
* @param contentService the content service
*/
@@ -255,6 +271,16 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
{
this.authComponent = authComponent;
}
+
+ /**
+ * Set the authentication service
+ *
+ * @param authService AuthenticationService
+ */
+ public void setAuthenticationService(AuthenticationService authService)
+ {
+ this.authService = authService;
+ }
/**
* Parse and validate the parameter string and create a device context object for this instance
@@ -418,7 +444,39 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
if ( pseudoName.getValue().endsWith(".url") == false)
throw new DeviceContextException("URL link file must end with .url, " + pseudoName.getValue());
- // Set the URL link file name and web path
+ // Check if the URL path name contains the local name token
+
+ int pos = path.indexOf(TokenLocalName);
+ if (pos != -1)
+ {
+
+ // Get the local server name
+
+ String srvName = "localhost";
+
+ try
+ {
+ srvName = InetAddress.getLocalHost().getHostName();
+ }
+ catch ( Exception ex)
+ {
+ }
+
+ // Rebuild the host name substituting the token with the local server name
+
+ StringBuilder hostStr = new StringBuilder();
+
+ hostStr.append( path.substring(0, pos));
+ hostStr.append(srvName);
+
+ pos += TokenLocalName.length();
+ if (pos < path.length())
+ hostStr.append( path.substring(pos));
+
+ path = hostStr.toString();
+ }
+
+ // Set the URL link file name and web path
context.setURLFileName( pseudoName.getValue());
context.setURLPrefix( path);
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/ContentIOControlHandler.java b/source/java/org/alfresco/filesys/smb/server/repo/ContentIOControlHandler.java
index d9cb60e028..f83cad068a 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/ContentIOControlHandler.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/ContentIOControlHandler.java
@@ -19,6 +19,7 @@ package org.alfresco.filesys.smb.server.repo;
import java.io.FileNotFoundException;
import org.alfresco.filesys.server.SrvSession;
+import org.alfresco.filesys.server.auth.ClientInfo;
import org.alfresco.filesys.server.filesys.IOControlNotImplementedException;
import org.alfresco.filesys.server.filesys.NetworkFile;
import org.alfresco.filesys.server.filesys.TreeConnection;
@@ -30,10 +31,12 @@ import org.alfresco.filesys.smb.server.repo.ContentDiskDriver;
import org.alfresco.filesys.smb.server.repo.IOControlHandler;
import org.alfresco.filesys.util.DataBuffer;
import org.alfresco.model.ContentModel;
+import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.service.cmr.lock.LockType;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
+import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.transaction.TransactionService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -85,6 +88,16 @@ public class ContentIOControlHandler implements IOControlHandler
return contentDriver.getCifsHelper();
}
+ /**
+ * Return the authentication service
+ *
+ * @return AuthenticationService
+ */
+ public final AuthenticationService getAuthenticationService()
+ {
+ return contentDriver.getAuthenticationService();
+ }
+
/**
* Return the transaction service
*
@@ -511,6 +524,11 @@ public class ContentIOControlHandler implements IOControlHandler
// Start a transaction
sess.beginTransaction( getTransactionService(), true);
+
+ // Get an authentication ticket for the client, or validate the existing ticket. The ticket can be used when
+ // generating URLs for the client-side application so that the user does not have to re-authenticate
+
+ getTicketForClient( sess);
// Get the list of targets for the action
@@ -624,4 +642,65 @@ public class ContentIOControlHandler implements IOControlHandler
return respBuf;
}
+
+ /**
+ * Get, or validate, an authentication ticket for the client
+ *
+ * @param sess SrvSession
+ */
+ private final void getTicketForClient(SrvSession sess)
+ {
+ // Get the client information and check if there is a ticket allocated
+
+ ClientInfo cInfo = sess.getClientInformation();
+ if ( cInfo == null)
+ return;
+
+ boolean needTicket = true;
+
+ if ( cInfo.hasAuthenticationTicket())
+ {
+ // Validate the existing ticket, it may have expired
+
+ try
+ {
+ // Validate the existing ticket
+
+ getAuthenticationService().validate( cInfo.getAuthenticationTicket());
+ needTicket = false;
+ }
+ catch ( AuthenticationException ex)
+ {
+ // Invalidate the current ticket
+
+ try
+ {
+ getAuthenticationService().invalidateTicket( cInfo.getAuthenticationTicket());
+ cInfo.setAuthenticationTicket( null);
+ }
+ catch (Exception ex2)
+ {
+ // DEBUG
+
+ if ( logger.isDebugEnabled())
+ logger.debug("Error during invalidate ticket", ex2);
+ }
+
+ // DEBUG
+
+ if ( logger.isDebugEnabled())
+ logger.debug("Auth ticket expired or invalid");
+ }
+ }
+
+ // Check if a ticket needs to be allocated
+
+ if ( needTicket == true)
+ {
+ // Allocate a new ticket and store in the client information for this session
+
+ String ticket = getAuthenticationService().getCurrentTicket();
+ cInfo.setAuthenticationTicket( ticket);
+ }
+ }
}
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java b/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java
index 1bcc759564..e5ca0a28e7 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java
@@ -19,10 +19,12 @@ package org.alfresco.filesys.smb.server.repo;
import java.io.File;
import java.io.UnsupportedEncodingException;
+import java.net.InetAddress;
import java.net.URL;
import java.net.URLDecoder;
import org.alfresco.config.ConfigElement;
+import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.filesys.server.filesys.DiskSharedDevice;
import org.alfresco.filesys.smb.server.repo.pseudo.LocalPseudoFile;
import org.alfresco.filesys.smb.server.repo.pseudo.PseudoFile;
@@ -88,7 +90,11 @@ public abstract class DesktopAction {
public static final int StsLaunchURL = 7;
public static final int StsCommandLine = 8;
- // Action name
+ // Token name to substitute current servers DNS name or TCP/IP address into the webapp URL
+
+ private static final String TokenLocalName = "${localname}";
+
+ // Action name
private String m_name;
@@ -109,6 +115,10 @@ public abstract class DesktopAction {
private ContentDiskDriver m_contentDriver;
private ContentContext m_contentContext;
+ // Webapp URL
+
+ private String m_webappURL;
+
// Debug enable flag
private boolean m_debug;
@@ -254,6 +264,26 @@ public abstract class DesktopAction {
return m_debug;
}
+ /**
+ * Check if the webapp URL is set
+ *
+ * @return boolean
+ */
+ public final boolean hasWebappURL()
+ {
+ return m_webappURL != null ? true : false;
+ }
+
+ /**
+ * Return the webapp URL
+ *
+ * @return String
+ */
+ public final String getWebappURL()
+ {
+ return m_webappURL;
+ }
+
/**
* Initialize the desktop action
*
@@ -348,7 +378,50 @@ public abstract class DesktopAction {
if ( findConfigElement("noConfirm", global, config) != null && hasPreProcessAction(PreConfirmAction))
setPreProcessActions(getPreProcessActions() - PreConfirmAction);
+
+ // Check if the webapp URL has been specified
+
+ ConfigElement webURL = findConfigElement("webpath", global, config);
+ if ( webURL != null)
+ {
+ // Check if the path name contains the local name token
+
+ String webPath = webURL.getValue();
+ if ( webPath.endsWith("/") == false)
+ webPath = webPath + "/";
+ int pos = webPath.indexOf(TokenLocalName);
+ if (pos != -1)
+ {
+
+ // Get the local server name
+
+ String srvName = "localhost";
+
+ try
+ {
+ srvName = InetAddress.getLocalHost().getHostName();
+ }
+ catch ( Exception ex)
+ {
+ }
+
+ // Rebuild the host name substituting the token with the local server name
+
+ StringBuilder hostStr = new StringBuilder();
+
+ hostStr.append(webPath.substring(0, pos));
+ hostStr.append(srvName);
+
+ pos += TokenLocalName.length();
+ if (pos < webPath.length())
+ hostStr.append(webPath.substring(pos));
+
+ webPath = hostStr.toString();
+ setWebappURL( webPath);
+ }
+ }
+
// Check if debug output is enabled for the action
ConfigElement debug = findConfigElement("debug", global, config);
@@ -511,6 +584,16 @@ public abstract class DesktopAction {
m_debug = ena;
}
+ /**
+ * Set the webapp URL
+ *
+ * @param urlStr String
+ */
+ public final void setWebappURL(String urlStr)
+ {
+ m_webappURL = urlStr;
+ }
+
/**
* Equality check
*
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/DesktopParams.java b/source/java/org/alfresco/filesys/smb/server/repo/DesktopParams.java
index 1a2e294135..6a45926dc2 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/DesktopParams.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/DesktopParams.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.alfresco.filesys.server.SrvSession;
+import org.alfresco.filesys.server.auth.ClientInfo;
import org.alfresco.filesys.server.filesys.NetworkFile;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -88,6 +89,19 @@ public class DesktopParams {
{
return m_session;
}
+
+ /**
+ * Return the authentication ticket for the user/session
+ *
+ * @return String
+ */
+ public final String getTicket()
+ {
+ ClientInfo cInfo = m_session.getClientInformation();
+ if ( cInfo != null)
+ return cInfo.getAuthenticationTicket();
+ return null;
+ }
/**
* Return the working directory node
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/desk/JavaScriptDesktopAction.java b/source/java/org/alfresco/filesys/smb/server/repo/desk/JavaScriptDesktopAction.java
index 303ff36272..1a361e62f2 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/desk/JavaScriptDesktopAction.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/desk/JavaScriptDesktopAction.java
@@ -284,6 +284,11 @@ public class JavaScriptDesktopAction extends DesktopAction {
model.put("deskParams", params);
model.put("out", System.out);
+ // Add the webapp URL, if valid
+
+ if ( hasWebappURL())
+ model.put("webURL", getWebappURL());
+
// Start a transaction
params.getSession().beginTransaction(getTransactionService(), false);
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java b/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java
index ca63252963..2a91523ae7 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java
@@ -16,6 +16,9 @@
*/
package org.alfresco.filesys.smb.server.repo.desk;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
import org.alfresco.filesys.smb.server.repo.DesktopAction;
import org.alfresco.filesys.smb.server.repo.DesktopParams;
import org.alfresco.filesys.smb.server.repo.DesktopResponse;
@@ -45,8 +48,29 @@ public class URLDesktopAction extends DesktopAction {
@Override
public DesktopResponse runAction(DesktopParams params) {
- // Return a URL in the status message
+ // Get the local IP address
- return new DesktopResponse(StsLaunchURL, "http://www.alfresco.com");
+ String ipAddr = null;
+
+ try
+ {
+ ipAddr = InetAddress.getLocalHost().getHostAddress();
+ }
+ catch (UnknownHostException ex)
+ {
+ }
+
+ // Return a URL in the status message to browse to the folder node
+
+ StringBuilder urlStr = new StringBuilder();
+
+ urlStr.append( "http://");
+ urlStr.append(ipAddr);
+ urlStr.append(":8080/alfresco/navigate/browse/workspace/SpacesStore/");
+ urlStr.append( params.getFolderNode().getId());
+ urlStr.append("?ticket=");
+ urlStr.append(params.getTicket());
+
+ return new DesktopResponse(StsLaunchURL, urlStr.toString());
}
}
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/pseudo/MemoryNetworkFile.java b/source/java/org/alfresco/filesys/smb/server/repo/pseudo/MemoryNetworkFile.java
index 76d7cafe63..8eb403b31f 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/pseudo/MemoryNetworkFile.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/pseudo/MemoryNetworkFile.java
@@ -19,7 +19,6 @@ package org.alfresco.filesys.smb.server.repo.pseudo;
import java.io.IOException;
-import org.alfresco.filesys.server.filesys.AccessDeniedException;
import org.alfresco.filesys.server.filesys.FileInfo;
import org.alfresco.filesys.server.filesys.NetworkFile;
import org.alfresco.filesys.smb.SeekType;
@@ -222,9 +221,7 @@ public class MemoryNetworkFile extends NetworkFile
*/
public void truncateFile(long siz) throws IOException
{
- // Do not allow the file to be written to
-
- throw new AccessDeniedException("Cannot truncate pseudo file");
+ // Allow the truncate, do not alter the pseduo file data
}
/**
@@ -236,9 +233,7 @@ public class MemoryNetworkFile extends NetworkFile
*/
public void writeFile(byte[] buf, int len, int pos) throws java.io.IOException
{
- // Do not allow the file to be written to
-
- throw new AccessDeniedException("Cannot write to pseudo file");
+ // Allow the write, just do not do anything
}
/**
@@ -252,8 +247,6 @@ public class MemoryNetworkFile extends NetworkFile
*/
public void writeFile(byte[] buf, int len, int pos, long offset) throws java.io.IOException
{
- // Do not allow the file to be written to
-
- throw new AccessDeniedException("Cannot write to pseudo file");
+ // Allow the write, just do not do anything
}
}
diff --git a/source/java/org/alfresco/filesys/smb/server/repo/pseudo/PseudoNetworkFile.java b/source/java/org/alfresco/filesys/smb/server/repo/pseudo/PseudoNetworkFile.java
index 0ae631897c..4bcd2cefe0 100644
--- a/source/java/org/alfresco/filesys/smb/server/repo/pseudo/PseudoNetworkFile.java
+++ b/source/java/org/alfresco/filesys/smb/server/repo/pseudo/PseudoNetworkFile.java
@@ -21,7 +21,6 @@ import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
-import org.alfresco.filesys.server.filesys.AccessDeniedException;
import org.alfresco.filesys.server.filesys.NetworkFile;
import org.alfresco.filesys.smb.SeekType;
@@ -272,9 +271,7 @@ public class PseudoNetworkFile extends NetworkFile
*/
public void truncateFile(long siz) throws IOException
{
- // Do not allow the file to be written to
-
- throw new AccessDeniedException("Cannot truncate pseudo file");
+ // Allow the truncate, just do not do anything
}
/**
@@ -286,9 +283,7 @@ public class PseudoNetworkFile extends NetworkFile
*/
public void writeFile(byte[] buf, int len, int pos) throws java.io.IOException
{
- // Do not allow the file to be written to
-
- throw new AccessDeniedException("Cannot write to pseudo file");
+ // Allow the write, just do not do anything
}
/**
@@ -302,8 +297,6 @@ public class PseudoNetworkFile extends NetworkFile
*/
public void writeFile(byte[] buf, int len, int pos, long offset) throws java.io.IOException
{
- // Do not allow the file to be written to
-
- throw new AccessDeniedException("Cannot write to pseudo file");
+ // Allow the write, just do not do anything
}
}
diff --git a/source/java/org/alfresco/jcr/exporter/JCRSystemXMLExporter.java b/source/java/org/alfresco/jcr/exporter/JCRSystemXMLExporter.java
index a9d3b3e9bf..8f973ed183 100644
--- a/source/java/org/alfresco/jcr/exporter/JCRSystemXMLExporter.java
+++ b/source/java/org/alfresco/jcr/exporter/JCRSystemXMLExporter.java
@@ -178,7 +178,7 @@ public class JCRSystemXMLExporter implements Exporter
Value[] mixinValues = mixinTypes.getValues();
for (int i = 0; i < mixinValues.length; i++)
{
- value(nodeRef, JCRMixinTypesProperty.PROPERTY_NAME, mixinValues[i], i);
+ value(nodeRef, JCRMixinTypesProperty.PROPERTY_NAME, mixinValues[i].getString(), i);
}
endProperty(nodeRef, JCRMixinTypesProperty.PROPERTY_NAME);
diff --git a/source/java/org/alfresco/model/ContentModel.java b/source/java/org/alfresco/model/ContentModel.java
index 7873190322..e74aaf3652 100644
--- a/source/java/org/alfresco/model/ContentModel.java
+++ b/source/java/org/alfresco/model/ContentModel.java
@@ -1,268 +1,268 @@
-/*
- * 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.model;
-
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-
-
-/**
- * Content Model Constants
- */
-public interface ContentModel
-{
- //
- // System Model Definitions
- //
-
- // base type constants
- static final QName TYPE_BASE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "base");
- static final QName ASPECT_REFERENCEABLE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "referenceable");
- static final QName PROP_STORE_PROTOCOL = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "store-protocol");
- static final QName PROP_STORE_IDENTIFIER = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "store-identifier");
- static final QName PROP_NODE_UUID = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "node-uuid");
- static final QName PROP_NODE_DBID = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "node-dbid");
-
- // tag for incomplete nodes
- static final QName ASPECT_INCOMPLETE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "incomplete");
-
- // tag for temporary nodes
- static final QName ASPECT_TEMPORARY = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "temporary");
-
- // archived nodes aspect constants
- static final QName ASPECT_ARCHIVED = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archived");
- static final QName PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedOriginalParentAssoc");
- static final QName PROP_ARCHIVED_BY = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedBy");
- static final QName PROP_ARCHIVED_DATE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedDate");
- static final QName PROP_ARCHIVED_ORIGINAL_OWNER = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedOriginalOwner");
- static final QName ASPECT_ARCHIVED_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archived-assocs");
- static final QName PROP_ARCHIVED_PARENT_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedParentAssocs");
- static final QName PROP_ARCHIVED_CHILD_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedChildAssocs");
- static final QName PROP_ARCHIVED_SOURCE_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedSourceAssocs");
- static final QName PROP_ARCHIVED_TARGET_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedTargetAssocs");
-
- // referenceable aspect constants
- static final QName TYPE_REFERENCE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "reference");
- static final QName PROP_REFERENCE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "reference");
-
- // container type constants
- static final QName TYPE_CONTAINER = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "container");
- /** child association type supported by {@link #TYPE_CONTAINER} */
- static final QName ASSOC_CHILDREN =QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "children");
-
- // roots
- static final QName ASPECT_ROOT = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "aspect_root");
- static final QName TYPE_STOREROOT = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "store_root");
-
- // descriptor properties
- static final QName PROP_SYS_VERSION_MAJOR = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionMajor");
- static final QName PROP_SYS_VERSION_MINOR = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionMinor");
- static final QName PROP_SYS_VERSION_REVISION = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionRevision");
- static final QName PROP_SYS_VERSION_LABEL = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionLabel");
- static final QName PROP_SYS_VERSION_BUILD = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionBuild");
- static final QName PROP_SYS_VERSION_SCHEMA = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionSchema");
- static final QName PROP_SYS_VERSION_EDITION = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionEdition");
-
-
- //
- // Content Model Definitions
- //
-
- // content management type constants
- static final QName TYPE_CMOBJECT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "cmobject");
- static final QName PROP_NAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "name");
-
- // copy aspect constants
- static final QName ASPECT_COPIEDFROM = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copiedfrom");
- static final QName PROP_COPY_REFERENCE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "source");
-
- // working copy aspect contants
- static final QName ASPECT_WORKING_COPY = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "workingcopy");
- static final QName PROP_WORKING_COPY_OWNER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "workingCopyOwner");
-
- // content type and aspect constants
- static final QName TYPE_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content");
- static final QName PROP_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content");
-
- // title aspect
- static final QName ASPECT_TITLED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "titled");
- static final QName PROP_TITLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "title");
- static final QName PROP_DESCRIPTION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "description");
-
- // auditable aspect
- static final QName ASPECT_AUDITABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "auditable");
- static final QName PROP_CREATED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "created");
- static final QName PROP_CREATOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "creator");
- static final QName PROP_MODIFIED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modified");
- static final QName PROP_MODIFIER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modifier");
- static final QName PROP_ACCESSED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "accessed");
-
- // author aspect
- static final QName ASPECT_AUTHOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "author");
- static final QName PROP_AUTHOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "author");
-
- // categories
- static final QName TYPE_CATEGORYROOT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "category_root");
- static final QName ASPECT_CLASSIFIABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "classifiable");
- //static final QName ASPECT_CATEGORISATION = QName.createQName(NamespaceService.ALFRESCO_URI, "aspect_categorisation");
- static final QName ASPECT_GEN_CLASSIFIABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "generalclassifiable");
- static final QName TYPE_CATEGORY = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "category");
- static final QName PROP_CATEGORIES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "categories");
- static final QName ASSOC_CATEGORIES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "categories");
- static final QName ASSOC_SUBCATEGORIES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "subcategories");
-
- // lock aspect
- public final static QName ASPECT_LOCKABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lockable");
- public final static QName PROP_LOCK_OWNER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lockOwner");
- public final static QName PROP_LOCK_TYPE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lockType");
- public final static QName PROP_EXPIRY_DATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "expiryDate");
-
- // version aspect
- static final QName ASPECT_VERSIONABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "versionable");
- static final QName PROP_VERSION_LABEL = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "versionLabel");
- static final QName PROP_INITIAL_VERSION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "initialVersion");
- static final QName PROP_AUTO_VERSION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "autoVersion");
-
- // folders
- static final QName TYPE_SYSTEM_FOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "systemfolder");
- static final QName TYPE_FOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "folder");
- /** child association type supported by {@link #TYPE_FOLDER} */
- static final QName ASSOC_CONTAINS = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "contains");
-
- // person
- static final QName TYPE_PERSON = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "person");
- static final QName PROP_USERNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "userName");
- static final QName PROP_HOMEFOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "homeFolder");
- static final QName PROP_FIRSTNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "firstName");
- static final QName PROP_LASTNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lastName");
- static final QName PROP_EMAIL = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "email");
- static final QName PROP_ORGID = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "organizationId");
- static final QName PROP_HOME_FOLDER_PROVIDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "homeFolderProvider");
- static final QName PROP_DEFAULT_HOME_FOLDER_PATH = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "defaultHomeFolderPath");
-
-
-
- // Ownable aspect
- static final QName ASPECT_OWNABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "ownable");
- static final QName PROP_OWNER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "owner");
-
- // Templatable aspect
- static final QName ASPECT_TEMPLATABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "templatable");
- static final QName PROP_TEMPLATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "template");
-
- // Dictionary model
- public static final QName TYPE_DICTIONARY_MODEL = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "dictionaryModel");
- public static final QName PROP_MODEL_NAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelName");
- public static final QName PROP_MODEL_DESCRIPTION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelDescription");
- public static final QName PROP_MODEL_AUTHOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelAuthor");
- public static final QName PROP_MODEL_PUBLISHED_DATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelPublishedDate");
- public static final QName PROP_MODEL_VERSION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelVersion");
- public static final QName PROP_MODEL_ACTIVE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelActive");
-
- // referencing aspect
- public static final QName ASPECT_REFERENCING = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "referencing");
- public static final QName ASSOC_REFERENCES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "references");
-
- // link object
- public static final QName TYPE_LINK = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "link");
- public static final QName PROP_LINK_DESTINATION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "destination");
-
- // email aspect
- public static final QName ASPECT_MAILED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "emailed");
- public static final QName PROP_SENTDATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "sentdate");
- public static final QName PROP_ORIGINATOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "originator");
- public static final QName PROP_ADDRESSEE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "addressee");
- public static final QName PROP_ADDRESSEES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "addressees");
- public static final QName PROP_SUBJECT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "subjectline");
-
- // countable aspect
- public static final QName ASPECT_COUNTABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "countable");
- public static final QName PROP_HITS = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "hits");
- public static final QName PROP_COUNTER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "counter");
-
- // References Node Aspect.
- public static final QName ASPECT_REFERENCES_NODE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "referencesnode");
- public static final QName PROP_NODE_REF = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "noderef");
-
- //
- // Application Model Definitions
- //
-
- // workflow
- static final QName ASPECT_SIMPLE_WORKFLOW = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "simpleworkflow");
- static final QName PROP_APPROVE_STEP = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "approveStep");
- static final QName PROP_APPROVE_FOLDER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "approveFolder");
- static final QName PROP_APPROVE_MOVE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "approveMove");
- static final QName PROP_REJECT_STEP = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "rejectStep");
- static final QName PROP_REJECT_FOLDER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "rejectFolder");
- static final QName PROP_REJECT_MOVE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "rejectMove");
-
- // ui facets aspect
- static final QName ASPECT_UIFACETS = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "uifacets");
- static final QName PROP_ICON = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "icon");
-
- // inlineeditable aspect
- static final QName ASPECT_INLINEEDITABLE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "inlineeditable");
- static final QName PROP_EDITINLINE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "editInline");
-
- // configurable aspect
- static final QName ASPECT_CONFIGURABLE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "configurable");
- static final QName TYPE_CONFIGURATIONS = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "configurations");
- static final QName ASSOC_CONFIGURATIONS = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "configurations");
-
- // object links
- static final QName TYPE_FILELINK = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "filelink");
- static final QName TYPE_FOLDERLINK = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "folderlink");
-
- // feed source aspect
- static final QName ASPECT_FEEDSOURCE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "feedsource");
- static final QName PROP_FEEDTEMPLATE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "template");
-
- // AVM web folder
- static final QName TYPE_AVMWEBFOLDER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "webfolder");
- static final QName PROP_AVMSTORE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "avmstore");
- static final QName ASSOC_WEBUSER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "webuser");
- static final QName TYPE_WEBUSER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "webuser");
- static final QName PROP_WEBUSERNAME = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "username");
- static final QName PROP_WEBUSERROLE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "role");
-
-
- //
- // User Model Definitions
- //
-
- static final String USER_MODEL_URI = "http://www.alfresco.org/model/user/1.0";
- static final String USER_MODEL_PREFIX = "usr";
-
- static final QName TYPE_USER = QName.createQName(USER_MODEL_URI, "user");
- static final QName PROP_USER_USERNAME = QName.createQName(USER_MODEL_URI, "username");
- static final QName PROP_PASSWORD = QName.createQName(USER_MODEL_URI, "password");
- static final QName PROP_ENABLED = QName.createQName(USER_MODEL_URI, "enabled");
- static final QName PROP_ACCOUNT_EXPIRES = QName.createQName(USER_MODEL_URI, "accountExpires");
- static final QName PROP_ACCOUNT_EXPIRY_DATE = QName.createQName(USER_MODEL_URI, "accountExpiryDate");
- static final QName PROP_CREDENTIALS_EXPIRE = QName.createQName(USER_MODEL_URI, "credentialsExpire");
- static final QName PROP_CREDENTIALS_EXPIRY_DATE = QName.createQName(USER_MODEL_URI, "credentialsExpiryDate");
- static final QName PROP_ACCOUNT_LOCKED = QName.createQName(USER_MODEL_URI, "accountLocked");
- static final QName PROP_SALT = QName.createQName(USER_MODEL_URI, "salt");
-
- static final QName TYPE_AUTHORITY = QName.createQName(USER_MODEL_URI, "authority");
-
- static final QName TYPE_AUTHORITY_CONTAINER = QName.createQName(USER_MODEL_URI, "authorityContainer");
- static final QName PROP_AUTHORITY_NAME = QName.createQName(USER_MODEL_URI, "authorityName");
- static final QName ASSOC_MEMBER = QName.createQName(USER_MODEL_URI, "member");
- static final QName PROP_MEMBERS = QName.createQName(USER_MODEL_URI, "members");
-}
+/*
+ * 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.model;
+
+import org.alfresco.service.namespace.NamespaceService;
+import org.alfresco.service.namespace.QName;
+
+
+/**
+ * Content Model Constants
+ */
+public interface ContentModel
+{
+ //
+ // System Model Definitions
+ //
+
+ // base type constants
+ static final QName TYPE_BASE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "base");
+ static final QName ASPECT_REFERENCEABLE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "referenceable");
+ static final QName PROP_STORE_PROTOCOL = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "store-protocol");
+ static final QName PROP_STORE_IDENTIFIER = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "store-identifier");
+ static final QName PROP_NODE_UUID = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "node-uuid");
+ static final QName PROP_NODE_DBID = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "node-dbid");
+
+ // tag for incomplete nodes
+ static final QName ASPECT_INCOMPLETE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "incomplete");
+
+ // tag for temporary nodes
+ static final QName ASPECT_TEMPORARY = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "temporary");
+
+ // archived nodes aspect constants
+ static final QName ASPECT_ARCHIVED = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archived");
+ static final QName PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedOriginalParentAssoc");
+ static final QName PROP_ARCHIVED_BY = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedBy");
+ static final QName PROP_ARCHIVED_DATE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedDate");
+ static final QName PROP_ARCHIVED_ORIGINAL_OWNER = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedOriginalOwner");
+ static final QName ASPECT_ARCHIVED_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archived-assocs");
+ static final QName PROP_ARCHIVED_PARENT_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedParentAssocs");
+ static final QName PROP_ARCHIVED_CHILD_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedChildAssocs");
+ static final QName PROP_ARCHIVED_SOURCE_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedSourceAssocs");
+ static final QName PROP_ARCHIVED_TARGET_ASSOCS = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "archivedTargetAssocs");
+
+ // referenceable aspect constants
+ static final QName TYPE_REFERENCE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "reference");
+ static final QName PROP_REFERENCE = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "reference");
+
+ // container type constants
+ static final QName TYPE_CONTAINER = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "container");
+ /** child association type supported by {@link #TYPE_CONTAINER} */
+ static final QName ASSOC_CHILDREN =QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "children");
+
+ // roots
+ static final QName ASPECT_ROOT = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "aspect_root");
+ static final QName TYPE_STOREROOT = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "store_root");
+
+ // descriptor properties
+ static final QName PROP_SYS_VERSION_MAJOR = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionMajor");
+ static final QName PROP_SYS_VERSION_MINOR = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionMinor");
+ static final QName PROP_SYS_VERSION_REVISION = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionRevision");
+ static final QName PROP_SYS_VERSION_LABEL = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionLabel");
+ static final QName PROP_SYS_VERSION_BUILD = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionBuild");
+ static final QName PROP_SYS_VERSION_SCHEMA = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionSchema");
+ static final QName PROP_SYS_VERSION_EDITION = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "versionEdition");
+
+
+ //
+ // Content Model Definitions
+ //
+
+ // content management type constants
+ static final QName TYPE_CMOBJECT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "cmobject");
+ static final QName PROP_NAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "name");
+
+ // copy aspect constants
+ static final QName ASPECT_COPIEDFROM = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "copiedfrom");
+ static final QName PROP_COPY_REFERENCE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "source");
+
+ // working copy aspect contants
+ static final QName ASPECT_WORKING_COPY = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "workingcopy");
+ static final QName PROP_WORKING_COPY_OWNER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "workingCopyOwner");
+
+ // content type and aspect constants
+ static final QName TYPE_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content");
+ static final QName PROP_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content");
+
+ // title aspect
+ static final QName ASPECT_TITLED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "titled");
+ static final QName PROP_TITLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "title");
+ static final QName PROP_DESCRIPTION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "description");
+
+ // auditable aspect
+ static final QName ASPECT_AUDITABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "auditable");
+ static final QName PROP_CREATED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "created");
+ static final QName PROP_CREATOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "creator");
+ static final QName PROP_MODIFIED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modified");
+ static final QName PROP_MODIFIER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modifier");
+ static final QName PROP_ACCESSED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "accessed");
+
+ // author aspect
+ static final QName ASPECT_AUTHOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "author");
+ static final QName PROP_AUTHOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "author");
+
+ // categories
+ static final QName TYPE_CATEGORYROOT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "category_root");
+ static final QName ASPECT_CLASSIFIABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "classifiable");
+ //static final QName ASPECT_CATEGORISATION = QName.createQName(NamespaceService.ALFRESCO_URI, "aspect_categorisation");
+ static final QName ASPECT_GEN_CLASSIFIABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "generalclassifiable");
+ static final QName TYPE_CATEGORY = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "category");
+ static final QName PROP_CATEGORIES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "categories");
+ static final QName ASSOC_CATEGORIES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "categories");
+ static final QName ASSOC_SUBCATEGORIES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "subcategories");
+
+ // lock aspect
+ public final static QName ASPECT_LOCKABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lockable");
+ public final static QName PROP_LOCK_OWNER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lockOwner");
+ public final static QName PROP_LOCK_TYPE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lockType");
+ public final static QName PROP_EXPIRY_DATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "expiryDate");
+
+ // version aspect
+ static final QName ASPECT_VERSIONABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "versionable");
+ static final QName PROP_VERSION_LABEL = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "versionLabel");
+ static final QName PROP_INITIAL_VERSION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "initialVersion");
+ static final QName PROP_AUTO_VERSION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "autoVersion");
+
+ // folders
+ static final QName TYPE_SYSTEM_FOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "systemfolder");
+ static final QName TYPE_FOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "folder");
+ /** child association type supported by {@link #TYPE_FOLDER} */
+ static final QName ASSOC_CONTAINS = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "contains");
+
+ // person
+ static final QName TYPE_PERSON = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "person");
+ static final QName PROP_USERNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "userName");
+ static final QName PROP_HOMEFOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "homeFolder");
+ static final QName PROP_FIRSTNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "firstName");
+ static final QName PROP_LASTNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "lastName");
+ static final QName PROP_EMAIL = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "email");
+ static final QName PROP_ORGID = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "organizationId");
+ static final QName PROP_HOME_FOLDER_PROVIDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "homeFolderProvider");
+ static final QName PROP_DEFAULT_HOME_FOLDER_PATH = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "defaultHomeFolderPath");
+
+
+
+ // Ownable aspect
+ static final QName ASPECT_OWNABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "ownable");
+ static final QName PROP_OWNER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "owner");
+
+ // Templatable aspect
+ static final QName ASPECT_TEMPLATABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "templatable");
+ static final QName PROP_TEMPLATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "template");
+
+ // Dictionary model
+ public static final QName TYPE_DICTIONARY_MODEL = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "dictionaryModel");
+ public static final QName PROP_MODEL_NAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelName");
+ public static final QName PROP_MODEL_DESCRIPTION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelDescription");
+ public static final QName PROP_MODEL_AUTHOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelAuthor");
+ public static final QName PROP_MODEL_PUBLISHED_DATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelPublishedDate");
+ public static final QName PROP_MODEL_VERSION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelVersion");
+ public static final QName PROP_MODEL_ACTIVE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "modelActive");
+
+ // referencing aspect
+ public static final QName ASPECT_REFERENCING = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "referencing");
+ public static final QName ASSOC_REFERENCES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "references");
+
+ // link object
+ public static final QName TYPE_LINK = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "link");
+ public static final QName PROP_LINK_DESTINATION = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "destination");
+
+ // email aspect
+ public static final QName ASPECT_MAILED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "emailed");
+ public static final QName PROP_SENTDATE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "sentdate");
+ public static final QName PROP_ORIGINATOR = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "originator");
+ public static final QName PROP_ADDRESSEE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "addressee");
+ public static final QName PROP_ADDRESSEES = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "addressees");
+ public static final QName PROP_SUBJECT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "subjectline");
+
+ // countable aspect
+ public static final QName ASPECT_COUNTABLE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "countable");
+ public static final QName PROP_HITS = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "hits");
+ public static final QName PROP_COUNTER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "counter");
+
+ // References Node Aspect.
+ public static final QName ASPECT_REFERENCES_NODE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "referencesnode");
+ public static final QName PROP_NODE_REF = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "noderef");
+
+ //
+ // Application Model Definitions
+ //
+
+ // workflow
+ static final QName ASPECT_SIMPLE_WORKFLOW = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "simpleworkflow");
+ static final QName PROP_APPROVE_STEP = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "approveStep");
+ static final QName PROP_APPROVE_FOLDER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "approveFolder");
+ static final QName PROP_APPROVE_MOVE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "approveMove");
+ static final QName PROP_REJECT_STEP = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "rejectStep");
+ static final QName PROP_REJECT_FOLDER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "rejectFolder");
+ static final QName PROP_REJECT_MOVE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "rejectMove");
+
+ // ui facets aspect
+ static final QName ASPECT_UIFACETS = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "uifacets");
+ static final QName PROP_ICON = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "icon");
+
+ // inlineeditable aspect
+ static final QName ASPECT_INLINEEDITABLE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "inlineeditable");
+ static final QName PROP_EDITINLINE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "editInline");
+
+ // configurable aspect
+ static final QName ASPECT_CONFIGURABLE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "configurable");
+ static final QName TYPE_CONFIGURATIONS = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "configurations");
+ static final QName ASSOC_CONFIGURATIONS = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "configurations");
+
+ // object links
+ static final QName TYPE_FILELINK = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "filelink");
+ static final QName TYPE_FOLDERLINK = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "folderlink");
+
+ // feed source aspect
+ static final QName ASPECT_FEEDSOURCE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "feedsource");
+ static final QName PROP_FEEDTEMPLATE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "template");
+
+ // AVM web folder
+ static final QName TYPE_AVMWEBFOLDER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "webfolder");
+ static final QName PROP_AVMSTORE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "avmstore");
+ static final QName ASSOC_WEBUSER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "webuser");
+ static final QName TYPE_WEBUSER = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "webuser");
+ static final QName PROP_WEBUSERNAME = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "username");
+ static final QName PROP_WEBUSERROLE = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "role");
+
+
+ //
+ // User Model Definitions
+ //
+
+ static final String USER_MODEL_URI = "http://www.alfresco.org/model/user/1.0";
+ static final String USER_MODEL_PREFIX = "usr";
+
+ static final QName TYPE_USER = QName.createQName(USER_MODEL_URI, "user");
+ static final QName PROP_USER_USERNAME = QName.createQName(USER_MODEL_URI, "username");
+ static final QName PROP_PASSWORD = QName.createQName(USER_MODEL_URI, "password");
+ static final QName PROP_ENABLED = QName.createQName(USER_MODEL_URI, "enabled");
+ static final QName PROP_ACCOUNT_EXPIRES = QName.createQName(USER_MODEL_URI, "accountExpires");
+ static final QName PROP_ACCOUNT_EXPIRY_DATE = QName.createQName(USER_MODEL_URI, "accountExpiryDate");
+ static final QName PROP_CREDENTIALS_EXPIRE = QName.createQName(USER_MODEL_URI, "credentialsExpire");
+ static final QName PROP_CREDENTIALS_EXPIRY_DATE = QName.createQName(USER_MODEL_URI, "credentialsExpiryDate");
+ static final QName PROP_ACCOUNT_LOCKED = QName.createQName(USER_MODEL_URI, "accountLocked");
+ static final QName PROP_SALT = QName.createQName(USER_MODEL_URI, "salt");
+
+ static final QName TYPE_AUTHORITY = QName.createQName(USER_MODEL_URI, "authority");
+
+ static final QName TYPE_AUTHORITY_CONTAINER = QName.createQName(USER_MODEL_URI, "authorityContainer");
+ static final QName PROP_AUTHORITY_NAME = QName.createQName(USER_MODEL_URI, "authorityName");
+ static final QName ASSOC_MEMBER = QName.createQName(USER_MODEL_URI, "member");
+ static final QName PROP_MEMBERS = QName.createQName(USER_MODEL_URI, "members");
+}
diff --git a/source/java/org/alfresco/repo/action/executer/CopyActionExecuter.java b/source/java/org/alfresco/repo/action/executer/CopyActionExecuter.java
index 1c1d92ebc4..229a844a9e 100644
--- a/source/java/org/alfresco/repo/action/executer/CopyActionExecuter.java
+++ b/source/java/org/alfresco/repo/action/executer/CopyActionExecuter.java
@@ -162,7 +162,7 @@ public class CopyActionExecuter extends ActionExecuterAbstractBase
else
{
// Create a new copy of the node
- this.copyService.copy(
+ this.copyService.copyAndRename(
actionedUponNodeRef,
destinationParent,
destinationAssocTypeQName,
diff --git a/source/java/org/alfresco/repo/admin/patch/AbstractPatch.java b/source/java/org/alfresco/repo/admin/patch/AbstractPatch.java
index 4375b6e101..b921a3e0f7 100644
--- a/source/java/org/alfresco/repo/admin/patch/AbstractPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/AbstractPatch.java
@@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.List;
import org.alfresco.error.AlfrescoRuntimeException;
+import org.alfresco.repo.node.integrity.IntegrityChecker;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.transaction.TransactionUtil;
import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
@@ -329,6 +330,9 @@ public abstract class AbstractPatch implements Patch
{
public String doWork() throws Exception
{
+ // downgrade integrity checking
+ IntegrityChecker.setWarnInTransaction();
+
String report = applyInternal();
// done
return report;
@@ -389,7 +393,8 @@ public abstract class AbstractPatch implements Patch
/**
* This method does the work. All transactions and thread-safety will be taken care of by this class.
- * Any exception will result in the transaction being rolled back.
+ * Any exception will result in the transaction being rolled back. Integrity checks are downgraded
+ * for the duration of the transaction.
*
* @return Returns the report (only success messages).
* @see #apply()
diff --git a/source/java/org/alfresco/repo/admin/patch/PatchExecuter.java b/source/java/org/alfresco/repo/admin/patch/PatchExecuter.java
index d0f2655d69..dbb5e0b592 100644
--- a/source/java/org/alfresco/repo/admin/patch/PatchExecuter.java
+++ b/source/java/org/alfresco/repo/admin/patch/PatchExecuter.java
@@ -21,11 +21,10 @@ import java.util.List;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.i18n.I18NUtil;
+import org.alfresco.util.AbstractLifecycleBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ContextRefreshedEvent;
/**
* This component is responsible for ensuring that patches are applied
@@ -33,7 +32,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
*
* @author Derek Hulley
*/
-public class PatchExecuter implements ApplicationListener
+public class PatchExecuter extends AbstractLifecycleBean
{
private static final String MSG_CHECKING = "patch.executer.checking";
private static final String MSG_NO_PATCHES_REQUIRED = "patch.executer.no_patches_required";
@@ -101,16 +100,16 @@ public class PatchExecuter implements ApplicationListener
}
}
- /*
- * (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)
- {
- applyOutstandingPatches();
- }
+ applyOutstandingPatches();
+ }
+
+ @Override
+ protected void onShutdown(ApplicationEvent event)
+ {
+ // NOOP
}
}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AbstractPermissionChangePatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AbstractPermissionChangePatch.java
new file mode 100644
index 0000000000..7f0cc516de
--- /dev/null
+++ b/source/java/org/alfresco/repo/admin/patch/impl/AbstractPermissionChangePatch.java
@@ -0,0 +1,169 @@
+/*
+ * 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.admin.patch.impl;
+
+import java.util.List;
+
+import org.alfresco.repo.admin.patch.AbstractPatch;
+import org.alfresco.repo.domain.DbAccessControlEntry;
+import org.alfresco.repo.domain.DbPermission;
+import org.alfresco.repo.domain.hibernate.DbPermissionImpl;
+import org.alfresco.service.namespace.QName;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.springframework.orm.hibernate3.HibernateCallback;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * Provides common functionality to change a permission type and/or name.
+ *
+ * @author Derek Hulley
+ */
+public abstract class AbstractPermissionChangePatch extends AbstractPatch
+{
+ private HibernateHelper helper;
+
+ public AbstractPermissionChangePatch()
+ {
+ helper = new HibernateHelper();
+ }
+
+ public void setSessionFactory(SessionFactory sessionFactory)
+ {
+ this.helper.setSessionFactory(sessionFactory);
+ }
+
+ /**
+ * Helper method to rename (move) a permission. This involves checking for the existence of the
+ * new permission and then moving all the entries to point to the new permission.
+ *
+ * @param oldTypeQName the old permission type
+ * @param oldName the old permission name
+ * @param newTypeQName the new permission type
+ * @param newName the new permission name
+ * @return Returns the number of permission entries modified
+ */
+ protected int renamePermission(QName oldTypeQName, String oldName, QName newTypeQName, String newName)
+ {
+ return helper.createAndUpdatePermission(oldTypeQName, oldName, newTypeQName, newName);
+ }
+
+ /** Helper to get a permission entity */
+ private static class GetPermissionCallback implements HibernateCallback
+ {
+ private QName typeQName;
+ private String name;
+ public GetPermissionCallback(QName typeQName, String name)
+ {
+ this.typeQName = typeQName;
+ this.name = name;
+ }
+ public Object doInHibernate(Session session)
+ {
+ // flush any outstanding entities
+ session.flush();
+
+ Query query = session.getNamedQuery(HibernateHelper.QUERY_GET_PERMISSION);
+ query.setParameter("permissionTypeQName", typeQName)
+ .setString("permissionName", name);
+ return query.uniqueResult();
+ }
+ }
+
+ private static class HibernateHelper extends HibernateDaoSupport
+ {
+ private static final String QUERY_GET_PERMISSION = "permission.GetPermission";
+ private static final String QUERY_GET_ENTRIES_TO_CHANGE = "permission.patch.GetAccessControlEntriesToChangePermissionOn";
+
+ public int createAndUpdatePermission(
+ final QName oldTypeQName,
+ final String oldName,
+ final QName newTypeQName,
+ final String newName)
+ {
+ if (oldTypeQName.equals(newTypeQName) && oldName.equals(newName))
+ {
+ throw new IllegalArgumentException("Cannot move permission to itself: " + oldTypeQName + "-" + oldName);
+ }
+
+ HibernateCallback getNewPermissionCallback = new GetPermissionCallback(newTypeQName, newName);
+ DbPermission permission = (DbPermission) getHibernateTemplate().execute(getNewPermissionCallback);
+ if (permission == null)
+ {
+ // create the permission
+ permission = new DbPermissionImpl();
+ permission.setTypeQname(newTypeQName);
+ permission.setName(newName);
+ // save
+ getHibernateTemplate().save(permission);
+ }
+ final DbPermission newPermission = permission;
+ // now update all entries that refer to the old permission
+ HibernateCallback updateEntriesCallback = new HibernateCallback()
+ {
+ private static final int MAX_RESULTS = 1000;
+ @SuppressWarnings("unchecked")
+ public Object doInHibernate(Session session)
+ {
+ int count = 0;
+ while (true)
+ {
+ // flush any outstanding entities
+ session.flush();
+
+ Query query = session.getNamedQuery(HibernateHelper.QUERY_GET_ENTRIES_TO_CHANGE);
+ query.setParameter("oldTypeQName", oldTypeQName)
+ .setParameter("oldName", oldName)
+ .setMaxResults(MAX_RESULTS);
+ List entries = (List) query.list();
+ // if there are no results, then we're done
+ if (entries.size() == 0)
+ {
+ break;
+ }
+ for (DbAccessControlEntry entry : entries)
+ {
+ entry.setPermission(newPermission);
+ count++;
+ session.evict(entry);
+ }
+ // flush and evict all the entries
+ session.flush();
+ for (DbAccessControlEntry entry : entries)
+ {
+ session.evict(entry);
+ }
+ // next set of results
+ }
+ // done
+ return count;
+ }
+ };
+ int updateCount = (Integer) getHibernateTemplate().execute(updateEntriesCallback);
+ // now delete the old permission
+ HibernateCallback getOldPermissionCallback = new GetPermissionCallback(oldTypeQName, oldName);
+ DbPermission oldPermission = (DbPermission) getHibernateTemplate().execute(getOldPermissionCallback);
+ if (oldPermission != null)
+ {
+ getHibernateTemplate().delete(oldPermission);
+ }
+ // done
+ return updateCount;
+ }
+ }
+}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/ActionRuleDecouplingPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/ActionRuleDecouplingPatch.java
index 8f4aab96c8..71d86005a3 100644
--- a/source/java/org/alfresco/repo/admin/patch/impl/ActionRuleDecouplingPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/impl/ActionRuleDecouplingPatch.java
@@ -54,6 +54,10 @@ public class ActionRuleDecouplingPatch extends AbstractPatch
for (NodeRef origRuleNodeRef : resultSet.getNodeRefs())
{
// Check that this rule need updated
+ if (!this.nodeService.exists(origRuleNodeRef))
+ {
+ continue;
+ }
Map origProperties = this.nodeService.getProperties(origRuleNodeRef);
if (origProperties.containsKey(RuleModel.PROP_EXECUTE_ASYNC) == false)
{
@@ -79,21 +83,21 @@ public class ActionRuleDecouplingPatch extends AbstractPatch
Map newProperties = this.nodeService.getProperties(newRuleNodeRef);
// Set the rule type, execute async and applyToChildren properties on the rule
- String ruleType = (String)origProperties.get(RuleModel.PROP_RULE_TYPE);
+ Serializable ruleType = origProperties.get(RuleModel.PROP_RULE_TYPE);
origProperties.remove(RuleModel.PROP_RULE_TYPE);
newProperties.put(RuleModel.PROP_RULE_TYPE, ruleType);
- Boolean executeAsync = (Boolean)origProperties.get(ActionModel.PROP_EXECUTE_ASYNCHRONOUSLY);
+ Serializable executeAsync = origProperties.get(ActionModel.PROP_EXECUTE_ASYNCHRONOUSLY);
origProperties.remove(ActionModel.PROP_EXECUTE_ASYNCHRONOUSLY);
newProperties.put(RuleModel.PROP_EXECUTE_ASYNC, executeAsync);
- Boolean applyToChildren = (Boolean)origProperties.get(RuleModel.PROP_APPLY_TO_CHILDREN);
+ Serializable applyToChildren = origProperties.get(RuleModel.PROP_APPLY_TO_CHILDREN);
origProperties.remove(RuleModel.PROP_APPLY_TO_CHILDREN);
newProperties.put(RuleModel.PROP_APPLY_TO_CHILDREN, applyToChildren);
origProperties.remove(QName.createQName(RuleModel.RULE_MODEL_URI, "owningNodeRef"));
// Move the action and description values from the composite action onto the rule
- String title = (String)origProperties.get(ActionModel.PROP_ACTION_TITLE);
+ Serializable title = origProperties.get(ActionModel.PROP_ACTION_TITLE);
origProperties.remove(ActionModel.PROP_ACTION_TITLE);
- String description = (String)origProperties.get(ActionModel.PROP_ACTION_DESCRIPTION);
+ Serializable description = origProperties.get(ActionModel.PROP_ACTION_DESCRIPTION);
origProperties.remove(ActionModel.PROP_ACTION_DESCRIPTION);
newProperties.put(ContentModel.PROP_TITLE, title);
newProperties.put(ContentModel.PROP_DESCRIPTION, description);
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/ContentPermissionPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/ContentPermissionPatch.java
index 6f428ccd92..031589d26c 100644
--- a/source/java/org/alfresco/repo/admin/patch/impl/ContentPermissionPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/impl/ContentPermissionPatch.java
@@ -16,33 +16,40 @@
*/
package org.alfresco.repo.admin.patch.impl;
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.service.cmr.admin.PatchException;
-import org.hibernate.SessionFactory;
+import org.alfresco.i18n.I18NUtil;
+import org.alfresco.service.namespace.NamespaceService;
+import org.alfresco.service.namespace.QName;
/**
* Roles defined in permissionsDefinition.xml moved from cm:content to sys:base.
- * This effects the data stored in the node_perm_entry table.
- *
- * WILL NOT EXECUTE ANYMORE
+ * This effects the data stored in the permission table.
*
* @author Derek Hulley
*/
-public class ContentPermissionPatch extends AbstractPatch
+public class ContentPermissionPatch extends AbstractPermissionChangePatch
{
- private static final String MSG_UPGRADE = "patch.contentPermission.upgrade";
-
- public ContentPermissionPatch()
- {
- }
-
- public void setSessionFactory(SessionFactory sessionFactory)
- {
- }
+ private static final String MSG_SUCCESS = "patch.contentPermission.result";
+ private static final QName TYPE_QNAME_OLD = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content");
+ private static final QName TYPE_QNAME_NEW = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "base");
+ private static final String[] NAMES = new String[] {"Execute", "ReadContent", "WriteContent", "ExecuteContent"};
+
@Override
protected String applyInternal() throws Exception
{
- throw new PatchException(MSG_UPGRADE);
+ int updateCount = 0;
+ for (String permissionName : NAMES)
+ {
+ updateCount += super.renamePermission(
+ ContentPermissionPatch.TYPE_QNAME_OLD,
+ permissionName,
+ ContentPermissionPatch.TYPE_QNAME_NEW,
+ permissionName);
+ }
+
+ // build the result message
+ String msg = I18NUtil.getMessage(MSG_SUCCESS, updateCount);
+ // done
+ return msg;
}
}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/PermissionDataPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/PermissionDataPatch.java
index 8c815a7d1f..5d18fb4549 100644
--- a/source/java/org/alfresco/repo/admin/patch/impl/PermissionDataPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/impl/PermissionDataPatch.java
@@ -16,35 +16,42 @@
*/
package org.alfresco.repo.admin.patch.impl;
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.service.cmr.admin.PatchException;
-import org.hibernate.SessionFactory;
+import org.alfresco.i18n.I18NUtil;
+import org.alfresco.service.namespace.NamespaceService;
+import org.alfresco.service.namespace.QName;
/**
* The roles defined in permissionsDefinition.xml moved from cm:folder to cm:cmobject.
- * This effects the data stored in the node_perm_entry table.
+ * This effects the data stored in the permission table.
*