mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.1 to HEAD
6636: Temporary hack to fix build. 6637: Better handling of binary string bufs, disable link validation when poll interval is <= 0 6638: Forgotten files for TXT to PDF transformer. 6639: Fix for AWC-1541 6641: Fix for WCM-792. 6642: A little extra PropertyValue support for createNode, too. 6643: Fix for WCM-791 6644: Closure of AR-1528: Check concurrency handling of DuplicateChildNodeNameException 6647: Fix WCM-794 6648: WCM-656 6650: Applied user supplied patch to fix AWC-1546 - Cannot mount AVM using CIFS on new alfresco installation. 6651: Index tidy ups 6654: Various minor updates for passthru authentication debugging and error handling. 6657: Fix for WCM-799 (Some items selected for submission were not present) 6659: Updated installers. 6660: Partial fix to AWC-1524 6661: Fix WCM-803 6664: Including hibernate-3.2.1.jar in $VIRTUAL_TOMCAT_HOME/server/lib/ 6665: adding an automated unit test for output path patterns. 6668: Fixed to add shale-test-1.0.4.jar to Eclipse classpath (PHH oked) 6681: Fixes WCM-811 - Lookup.getIndirectionPath() had a bit of a howler in it. 6684: UncategorizedSQLException with the word 'deadlock' in the message is now cause for retrying a transaction. 6691: Fix for WCM-813 (lock not removed when expiration date set and no workflow on web project) 6696: Imporved SSO filters for SiteMinder etc + test filter 6697: Support for scheduled import 6699: Fix for the compliation target: compile-benchmarkframework 6701: Fix for 1.6 JVMs (1.5 gets by with lucky ordering) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6749 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<table cellspacing='0' cellpadding='0' width='100%' style='cursor:move' id='dragable'>
|
||||
<tr>
|
||||
<td class='mainSubTitle'>${node.name?html}</td>
|
||||
<#if node.isDocument>
|
||||
<#if node.isDocument || node.isLinkToDocument>
|
||||
<#assign navurl="/navigate/showDocDetails/">
|
||||
<#else>
|
||||
<#assign navurl="/navigate/showSpaceDetails/">
|
||||
|
@@ -92,42 +92,6 @@ public class HTTPRequestAuthenticationFilter extends AbstractAuthenticationFilte
|
||||
|
||||
private Pattern authPattern = null;
|
||||
|
||||
/**
|
||||
* Define the HTTP header that contains the user name
|
||||
*
|
||||
* @param httpServletRequestAuthHeaderName
|
||||
*/
|
||||
public HTTPRequestAuthenticationFilter(String httpServletRequestAuthHeaderName)
|
||||
{
|
||||
this(httpServletRequestAuthHeaderName, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the header that contains the user name and how to extract the user name.
|
||||
*
|
||||
* @param httpServletRequestAuthHeaderName
|
||||
* @param authPatternString
|
||||
*/
|
||||
public HTTPRequestAuthenticationFilter(String httpServletRequestAuthHeaderName, String authPatternString)
|
||||
{
|
||||
super();
|
||||
assert (httpServletRequestAuthHeaderName != null);
|
||||
this.httpServletRequestAuthHeaderName = httpServletRequestAuthHeaderName;
|
||||
this.authPatternString = authPatternString;
|
||||
if (this.authPatternString != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
authPattern = Pattern.compile(this.authPatternString);
|
||||
}
|
||||
catch (PatternSyntaxException e)
|
||||
{
|
||||
logger.warn("Invalid pattern: " + this.authPatternString, e);
|
||||
authPattern = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void destroy()
|
||||
{
|
||||
// Nothing to do
|
||||
@@ -341,19 +305,24 @@ public class HTTPRequestAuthenticationFilter extends AbstractAuthenticationFilte
|
||||
I18NUtil.setLocale(Application.getLanguage(httpSess));
|
||||
}
|
||||
|
||||
|
||||
public void init(FilterConfig config) throws ServletException
|
||||
{
|
||||
// Save the context
|
||||
|
||||
this.context = config.getServletContext();
|
||||
|
||||
// Setup the authentication context
|
||||
|
||||
WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
|
||||
|
||||
ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
|
||||
transactionService = serviceRegistry.getTransactionService();
|
||||
nodeService = serviceRegistry.getNodeService();
|
||||
|
||||
authService = serviceRegistry.getAuthenticationService();
|
||||
transactionService = serviceRegistry.getTransactionService();
|
||||
personService = (PersonService) ctx.getBean("PersonService"); // transactional and permission-checked
|
||||
authComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
|
||||
authService = (AuthenticationService) ctx.getBean("authenticationService");
|
||||
personService = (PersonService) ctx.getBean("personService");
|
||||
|
||||
// Get a list of the available locales
|
||||
|
||||
ConfigService configServiceService = (ConfigService) ctx.getBean("webClientConfigService");
|
||||
LanguagesConfigElement configElement = (LanguagesConfigElement) configServiceService.getConfig("Languages")
|
||||
@@ -361,7 +330,26 @@ public class HTTPRequestAuthenticationFilter extends AbstractAuthenticationFilte
|
||||
|
||||
m_languages = configElement.getLanguages();
|
||||
|
||||
authPattern = Pattern.compile(authPatternString);
|
||||
|
||||
httpServletRequestAuthHeaderName = config.getInitParameter("httpServletRequestAuthHeaderName");
|
||||
if(httpServletRequestAuthHeaderName == null)
|
||||
{
|
||||
httpServletRequestAuthHeaderName = "x-user";
|
||||
}
|
||||
this.authPatternString = config.getInitParameter("authPatternString");
|
||||
if (this.authPatternString != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
authPattern = Pattern.compile(this.authPatternString);
|
||||
}
|
||||
catch (PatternSyntaxException e)
|
||||
{
|
||||
logger.warn("Invalid pattern: " + this.authPatternString, e);
|
||||
authPattern = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -176,6 +176,9 @@ public class LinkValidationDialog extends BaseDialogBean
|
||||
this.runningReport = true;
|
||||
executeReport();
|
||||
|
||||
// reset the isFinished flag so we can run the report again
|
||||
this.isFinished = false;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@@ -51,6 +51,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransacti
|
||||
import org.alfresco.repo.workflow.WorkflowModel;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLock;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
@@ -415,6 +416,9 @@ public class SubmitDialog extends BaseDialogBean
|
||||
AVMDifference diff = new AVMDifference(-1, srcPath, -1, destPath, AVMDifference.NEWER);
|
||||
diffs.add(diff);
|
||||
|
||||
// process the expiration date (if any)
|
||||
processExpirationDate(srcPath);
|
||||
|
||||
// recursively remove locks from this item
|
||||
recursivelyRemoveLocks(storeId, -1, this.avmService.lookup(-1, srcPath, true), srcPath);
|
||||
|
||||
@@ -426,9 +430,6 @@ public class SubmitDialog extends BaseDialogBean
|
||||
{
|
||||
this.virtUpdatePath = destPath;
|
||||
}
|
||||
|
||||
// process the expiration date (if any)
|
||||
processExpirationDate(srcPath);
|
||||
}
|
||||
|
||||
// write changes to layer so files are marked as modified
|
||||
@@ -1033,11 +1034,15 @@ public class SubmitDialog extends BaseDialogBean
|
||||
submittedPaths.add(renditionPath);
|
||||
}
|
||||
}
|
||||
this.workflows.add(new FormWorkflowWrapper(fid.getForm().getDefaultWorkflow().getName(),
|
||||
WorkflowDefinition defaultWfDef = fid.getForm().getDefaultWorkflow();
|
||||
if (defaultWfDef != null)
|
||||
{
|
||||
this.workflows.add(new FormWorkflowWrapper(defaultWfDef.getName(),
|
||||
fid.getForm().getDefaultWorkflowParameters()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tx.commit();
|
||||
}
|
||||
@@ -1045,6 +1050,9 @@ public class SubmitDialog extends BaseDialogBean
|
||||
{
|
||||
// rollback the transaction on error
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
||||
|
||||
// rethrow the exception to highlight the problem
|
||||
throw (RuntimeException)e;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,7 @@ import javax.faces.context.FacesContext;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -203,6 +204,7 @@ public class FormImpl
|
||||
result = AVMUtil.buildPath(parentAVMPath,
|
||||
result,
|
||||
AVMUtil.PathRelation.SANDBOX_RELATIVE);
|
||||
result = AVMNodeConverter.NormalizePath(result);
|
||||
LOGGER.debug("processed pattern " + outputPathPattern + " as " + result);
|
||||
return result;
|
||||
}
|
||||
|
274
source/java/org/alfresco/web/forms/FormsTest.java
Normal file
274
source/java/org/alfresco/web/forms/FormsTest.java
Normal file
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing
|
||||
*/
|
||||
package org.alfresco.web.forms;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
import junit.framework.AssertionFailedError;
|
||||
import org.alfresco.service.cmr.repository.*;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.util.BaseSpringTest;
|
||||
import org.alfresco.web.forms.XMLUtil;
|
||||
import org.apache.commons.jxpath.JXPathContext;
|
||||
import org.apache.commons.jxpath.Pointer;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.chiba.xml.ns.NamespaceConstants;
|
||||
import org.chiba.xml.events.XFormsEventNames;
|
||||
import org.chiba.xml.events.XMLEvent;
|
||||
import org.chiba.xml.xforms.ChibaBean;
|
||||
import org.chiba.xml.xforms.exception.XFormsException;
|
||||
import org.chiba.xml.xforms.XFormsElement;
|
||||
import org.chiba.xml.events.DOMEventNames;
|
||||
import org.w3c.dom.*;
|
||||
import org.w3c.dom.events.*;
|
||||
import org.xml.sax.*;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.model.*;
|
||||
import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
|
||||
import org.alfresco.util.TestWithUserUtils;
|
||||
import org.apache.shale.test.mock.*;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
|
||||
/**
|
||||
* JUnit tests to exercise parts of the forms codebase
|
||||
*
|
||||
* @author ariel backenroth
|
||||
*/
|
||||
public class FormsTest
|
||||
extends BaseSpringTest
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private static class MockForm
|
||||
extends FormImpl
|
||||
{
|
||||
|
||||
MockForm(final NodeRef folderNodeRef,
|
||||
final FormsService formsService)
|
||||
{
|
||||
super(folderNodeRef, formsService);
|
||||
}
|
||||
|
||||
|
||||
public void setOutputPathPattern(final String opp)
|
||||
{
|
||||
final NodeService nodeService = this.getServiceRegistry().getNodeService();
|
||||
nodeService.setProperty(this.getNodeRef(), WCMAppModel.PROP_OUTPUT_PATH_PATTERN, opp);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private final static Log LOGGER = LogFactory.getLog(FormsTest.class);
|
||||
private final static String WEB_CLIENT_APPLICATION_CONTEXT =
|
||||
"classpath:alfresco/web-client-application-context.xml";
|
||||
|
||||
private NodeService nodeService;
|
||||
private FormsService formsService;
|
||||
private MockForm mockForm;
|
||||
|
||||
protected void onSetUpInTransaction()
|
||||
throws Exception
|
||||
{
|
||||
System.err.println("onSetUpInTransaction");
|
||||
super.onSetUpInTransaction();
|
||||
this.nodeService = (NodeService)super.applicationContext.getBean("dbNodeService");
|
||||
assertNotNull(this.nodeService);
|
||||
final FileFolderService fileFolderService = (FileFolderService)
|
||||
super.applicationContext.getBean("fileFolderService");
|
||||
assertNotNull(fileFolderService);
|
||||
this.formsService = (FormsService)super.applicationContext.getBean("FormsService");
|
||||
assertNotNull(this.formsService);
|
||||
final AuthenticationService authenticationService = (AuthenticationService)
|
||||
applicationContext.getBean("authenticationService");
|
||||
authenticationService.clearCurrentSecurityContext();
|
||||
final MutableAuthenticationDao authenticationDAO = (MutableAuthenticationDao)
|
||||
applicationContext.getBean("authenticationDao");
|
||||
|
||||
// Create a workspace that contains the 'live' nodes
|
||||
final StoreRef testStoreRef = this.nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE,
|
||||
"Test_" + System.currentTimeMillis());
|
||||
|
||||
// Get a reference to the root node
|
||||
final NodeRef rootNodeRef = this.nodeService.getRootNode(testStoreRef);
|
||||
|
||||
// Create an authenticate the user
|
||||
if(!authenticationDAO.userExists("admin"))
|
||||
{
|
||||
authenticationService.createAuthentication("admin", "admin".toCharArray());
|
||||
}
|
||||
|
||||
TestWithUserUtils.authenticateUser("admin",
|
||||
"admin",
|
||||
rootNodeRef,
|
||||
authenticationService);
|
||||
|
||||
// set up a faces context
|
||||
final MockExternalContext ec = new MockExternalContext(new MockServletContext(),
|
||||
new MockHttpServletRequest(),
|
||||
new MockHttpServletResponse());
|
||||
final StaticWebApplicationContext ac = new StaticWebApplicationContext();
|
||||
ac.setParent(this.applicationContext);
|
||||
this.applicationContext = ac;
|
||||
ec.getApplicationMap().put(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
|
||||
this.applicationContext);
|
||||
new MockFacesContext(ec);
|
||||
|
||||
|
||||
final FileInfo folderInfo =
|
||||
fileFolderService.create(rootNodeRef,
|
||||
"test_form",
|
||||
WCMAppModel.TYPE_FORMFOLDER);
|
||||
final HashMap<QName, Serializable> props = new HashMap<QName, Serializable>();
|
||||
this.nodeService.addAspect(folderInfo.getNodeRef(),
|
||||
WCMAppModel.ASPECT_FORM,
|
||||
props);
|
||||
this.mockForm = new MockForm(folderInfo.getNodeRef(), this.formsService);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getConfigLocations()
|
||||
{
|
||||
return (String[])ArrayUtils.add(super.getConfigLocations(),
|
||||
WEB_CLIENT_APPLICATION_CONTEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConfigurableApplicationContext loadContext(Object key)
|
||||
throws Exception
|
||||
{
|
||||
return new ClassPathXmlApplicationContext((String[])key);
|
||||
}
|
||||
|
||||
public void testOutputPathPatternForFormInstanceData()
|
||||
throws Exception
|
||||
{
|
||||
class OutputPathPatternTest
|
||||
{
|
||||
public final String expected;
|
||||
public final String pattern;
|
||||
public final Document xml;
|
||||
public final String name;
|
||||
public final String parentAVMPath;
|
||||
public final String webapp;
|
||||
|
||||
public OutputPathPatternTest(final String expected,
|
||||
final String pattern,
|
||||
final Document xml,
|
||||
final String name,
|
||||
final String parentAVMPath,
|
||||
final String webapp)
|
||||
{
|
||||
this.expected = expected;
|
||||
this.pattern = pattern;
|
||||
this.xml = xml;
|
||||
this.name = name;
|
||||
this.parentAVMPath = parentAVMPath;
|
||||
this.webapp = webapp;
|
||||
}
|
||||
}
|
||||
|
||||
final OutputPathPatternTest[] opps = new OutputPathPatternTest[] {
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/dir/foo.xml",
|
||||
"${name}.xml",
|
||||
XMLUtil.parse("<foo/>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/foo.xml",
|
||||
"/${name}.xml",
|
||||
XMLUtil.parse("<foo/>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/foo.xml",
|
||||
"/${webapp}/${name}.xml",
|
||||
XMLUtil.parse("<foo/>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/foo.xml",
|
||||
"/${webapp}/${name}.xml",
|
||||
XMLUtil.parse("<foo/>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/another_webapp/dir",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/dir1/dir2/foo.xml",
|
||||
"/${webapp}/${cwd}/${name}.xml",
|
||||
XMLUtil.parse("<foo/>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/another_webapp/dir1/dir2",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/dir/" + Calendar.getInstance().get(Calendar.YEAR) + "_foo.xml",
|
||||
"${date?string('yyyy')}_${name}.xml",
|
||||
XMLUtil.parse("<foo/>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/dir/foo.xml",
|
||||
"${xml.root_tag.name}.xml",
|
||||
XMLUtil.parse("<root_tag><name>foo</name></root_tag>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/dir/07.xml",
|
||||
"${xml.root_tag.date?date('yyyy-MM-dd')?string('MM')}.xml",
|
||||
XMLUtil.parse("<root_tag><date>1776-07-04</date></root_tag>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp"),
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/dir/foo.xml",
|
||||
"${xml['foons:root_tag/foons:name']}.xml",
|
||||
XMLUtil.parse("<foons:root_tag xmlns:foons='bar'><foons:name>foo</foons:name></foons:root_tag>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp")/*,
|
||||
new OutputPathPatternTest("avmstore:/www/avm_webapps/webapp/dir/foo.xml",
|
||||
"${xml.root_tag.name}",
|
||||
XMLUtil.parse("<foons:root_tag xmlns:foons='bar'><foons:name>foo</foons:name></foons:root_tag>"),
|
||||
"foo",
|
||||
"avmstore:/www/avm_webapps/webapp/dir",
|
||||
"webapp")*/
|
||||
};
|
||||
for (final OutputPathPatternTest oppt : opps)
|
||||
{
|
||||
this.mockForm.setOutputPathPattern(oppt.pattern);
|
||||
assertEquals(oppt.pattern + " failed",
|
||||
oppt.expected,
|
||||
this.mockForm.getOutputPathForFormInstanceData(oppt.xml,
|
||||
oppt.name,
|
||||
oppt.parentAVMPath,
|
||||
oppt.webapp));
|
||||
}
|
||||
}
|
||||
}
|
@@ -57,6 +57,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.filesys.CIFSServer;
|
||||
import org.alfresco.filesys.server.filesys.DiskSharedDevice;
|
||||
import org.alfresco.filesys.smb.server.repo.ContentContext;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.repo.webdav.WebDAVServlet;
|
||||
@@ -821,7 +822,8 @@ public final class Utils
|
||||
String outcome = ExternalAccessServlet.OUTCOME_DOCDETAILS;
|
||||
|
||||
// if the node is a type of folder then make the outcome to show space details
|
||||
if (dd.isSubClass(node.getType(), ContentModel.TYPE_FOLDER))
|
||||
if ((dd.isSubClass(node.getType(), ContentModel.TYPE_FOLDER)) ||
|
||||
(dd.isSubClass(node.getType(), ApplicationModel.TYPE_FOLDERLINK)))
|
||||
{
|
||||
outcome = ExternalAccessServlet.OUTCOME_SPACEDETAILS;
|
||||
}
|
||||
|
@@ -40,10 +40,7 @@
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/comon.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/tiny_mce_wcm_extensions.js"> </script>
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/common.js"> </script>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
@@ -82,7 +79,7 @@
|
||||
theme_advanced_disable: "styleselect",
|
||||
extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]",
|
||||
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback",
|
||||
execcommand_callback: "alfresco_TinyMCE_execcommand_callback"
|
||||
file_browser_callback: "alfresco_TinyMCE_file_browser_callback"
|
||||
});
|
||||
|
||||
function saveContent(id, content)
|
||||
@@ -90,6 +87,21 @@
|
||||
document.getElementById("wizard:wizard-body:editor-output").value = content;
|
||||
}
|
||||
</script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/tiny_mce_wcm_extensions.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/upload_helper.js"> </script>
|
||||
|
||||
<div id='editor' style='width:100%; height:360px'>
|
||||
<h:outputText value="#{WizardManager.bean.content}" escape="false" />
|
||||
|
@@ -1,203 +0,0 @@
|
||||
<!--
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing
|
||||
|
||||
Produces the index page for the press release page.
|
||||
-->
|
||||
<jsp:root version="1.2"
|
||||
xmlns:jsp="http://java.sun.com/JSP/Page"
|
||||
xmlns:c="http://java.sun.com/jsp/jstl/core"
|
||||
xmlns:pr="http://www.alfresco.org/alfresco/pr"
|
||||
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt">
|
||||
|
||||
<jsp:output doctype-root-element="html"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
|
||||
|
||||
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
|
||||
<jsp:directive.page isELIgnored="false"/>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_insert_image_title}</title>
|
||||
<link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="${pageContext.request.contextPath}/css/xforms.css"> </link>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce_popup.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/mctabs.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/form_utils.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/themes/advanced/jscripts/image.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js"> </script>
|
||||
<script type="text/javascript">
|
||||
var alfresco = {};
|
||||
alfresco.constants = tinyMCEPopup.windowOpener.alfresco.constants;
|
||||
alfresco.resources = tinyMCEPopup.windowOpener.alfresco.resources;
|
||||
</script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/common.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/upload_helper.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js"> </script>
|
||||
<script type="text/javascript">
|
||||
var alfFilePickerWidgetInstance;
|
||||
|
||||
function loadPicker()
|
||||
{
|
||||
var d = document.getElementById("alfFilePicker");
|
||||
var pwOrigHeight = document.getElementById("panel_wrapper").offsetHeight;
|
||||
function resizeHandler(event)
|
||||
{
|
||||
document.getElementById("panel_wrapper").style.height =
|
||||
(d.offsetHeight >= 100
|
||||
? document.getElementById("panel_wrapper").offsetHeight + d.offsetHeight
|
||||
: pwOrigHeight) + "px";
|
||||
};
|
||||
|
||||
function changeHandler(picker)
|
||||
{
|
||||
document.getElementById("src").value = picker.getValue();
|
||||
};
|
||||
alfFilePickerWidgetInstance = new alfresco.FilePickerWidget("alfFilePicker",
|
||||
d,
|
||||
"",
|
||||
false,
|
||||
changeHandler,
|
||||
resizeHandler,
|
||||
["wcm:avmcontent"],
|
||||
["image/*"]);
|
||||
alfFilePickerWidgetInstance.setValue(document.getElementById("src").value);
|
||||
alfFilePickerWidgetInstance.render();
|
||||
}
|
||||
|
||||
setTimeout("loadPicker();", 500);
|
||||
</script>
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="image" onload="tinyMCEPopup.executeOnLoad('init();'); " style="display: none">
|
||||
<form onsubmit="insertImage();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_image_title}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper" id="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table border="0" cellpadding="4" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="src">{$lang_insert_image_src}</label></td>
|
||||
<td width="100%" nowrap="nowrap">
|
||||
<input id="src" name="src" type="hidden" value="" onchange="getImageData();"/>
|
||||
<div id="alfFilePicker" style="width: 100%; height: 100%;"/>
|
||||
</td>
|
||||
<td colspan="0" id="srcbrowsercontainer"/>
|
||||
</tr>
|
||||
<!-- Image list -->
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0)
|
||||
{
|
||||
var html = "";
|
||||
|
||||
html += '<tr><td><label for="image_list">{$lang_image_list}</label></td>';
|
||||
html += '<td><select id="image_list" name="image_list" style="width: 200px" onchange="this.form.src.value=this.options[this.selectedIndex].value;resetImageData();getImageData();">';
|
||||
html += '<option value="">-" + "-" + "-</option>';
|
||||
|
||||
for (var i=0; i<tinyMCEImageList.length; i++)
|
||||
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
|
||||
|
||||
html += '</select></td></tr>';
|
||||
|
||||
document.write(html);
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<!-- /Image list -->
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="alt">{$lang_insert_image_alt}</label></td>
|
||||
<td><input id="alt" name="alt" type="text" value="" style="width: 200px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="align">{$lang_insert_image_align}</label></td>
|
||||
<td><select id="align" name="align">
|
||||
<option value="">{$lang_insert_image_align_default}</option>
|
||||
<option value="baseline">{$lang_insert_image_align_baseline}</option>
|
||||
<option value="top">{$lang_insert_image_align_top}</option>
|
||||
<option value="middle">{$lang_insert_image_align_middle}</option>
|
||||
<option value="bottom">{$lang_insert_image_align_bottom}</option>
|
||||
<option value="texttop">{$lang_insert_image_align_texttop}</option>
|
||||
<option value="absmiddle">{$lang_insert_image_align_absmiddle}</option>
|
||||
<option value="absbottom">{$lang_insert_image_align_absbottom}</option>
|
||||
<option value="left">{$lang_insert_image_align_left}</option>
|
||||
<option value="right">{$lang_insert_image_align_right}</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="width">{$lang_insert_image_dimensions}</label></td>
|
||||
<td><input id="width" name="width" type="text" value="" size="3" maxlength="3"/>
|
||||
x
|
||||
<input id="height" name="height" type="text" value="" size="3" maxlength="3"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="border">{$lang_insert_image_border}</label></td>
|
||||
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="vspace">{$lang_insert_image_vspace}</label></td>
|
||||
<td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="hspace">{$lang_insert_image_hspace}</label></td>
|
||||
<td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertImage();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
</jsp:root>
|
@@ -1,192 +0,0 @@
|
||||
<!--
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing
|
||||
|
||||
Produces the index page for the press release page.
|
||||
-->
|
||||
<jsp:root version="1.2"
|
||||
xmlns:jsp="http://java.sun.com/JSP/Page"
|
||||
xmlns:c="http://java.sun.com/jsp/jstl/core"
|
||||
xmlns:pr="http://www.alfresco.org/alfresco/pr"
|
||||
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt">
|
||||
|
||||
<jsp:output doctype-root-element="html"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
|
||||
|
||||
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
|
||||
<jsp:directive.page isELIgnored="false"/>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_insert_link_title}</title>
|
||||
<link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="${pageContext.request.contextPath}/css/xforms.css"> </link>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce_popup.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/mctabs.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/form_utils.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/tiny_mce/themes/advanced/jscripts/link.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js"> </script>
|
||||
<script type="text/javascript">
|
||||
var alfresco = {};
|
||||
alfresco.constants = tinyMCEPopup.windowOpener.alfresco.constants;
|
||||
alfresco.resources = tinyMCEPopup.windowOpener.alfresco.resources;
|
||||
</script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/common.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/upload_helper.js"> </script>
|
||||
<script language="javascript"
|
||||
type="text/javascript"
|
||||
src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js"> </script>
|
||||
<script type="text/javascript">
|
||||
var alfFilePickerWidgetInstance;
|
||||
|
||||
function loadPicker()
|
||||
{
|
||||
var d = document.getElementById("alfFilePicker");
|
||||
var pwOrigHeight = document.getElementById("panel_wrapper").offsetHeight;
|
||||
function resizeHandler(event)
|
||||
{
|
||||
document.getElementById("panel_wrapper").style.height =
|
||||
(d.offsetHeight >= 100
|
||||
? document.getElementById("panel_wrapper").offsetHeight + d.offsetHeight
|
||||
: pwOrigHeight) + "px";
|
||||
};
|
||||
function changeHandler(picker)
|
||||
{
|
||||
document.getElementById("href").value = picker.getValue();
|
||||
};
|
||||
alfFilePickerWidgetInstance = new alfresco.FilePickerWidget("alfFilePicker", d, "", false, changeHandler, resizeHandler)
|
||||
alfFilePickerWidgetInstance.setValue(document.getElementById("href").value);
|
||||
alfFilePickerWidgetInstance.render();
|
||||
}
|
||||
setTimeout("loadPicker();", 500);
|
||||
</script>
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="link" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
||||
<form onsubmit="insertLink();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_link_title}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper" id="panel_wrapper">
|
||||
<div id="general_panel" class="panel current" style="width: 100%">
|
||||
<table border="0" cellpadding="4" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="href">{$lang_insert_link_url}</label></td>
|
||||
<td width="100%" nowrap="nowrap">
|
||||
<input id="href" name="href" type="hidden" value=""/>
|
||||
<div id="alfFilePicker" style="width: 100%; height: 100%;"/>
|
||||
</td>
|
||||
<td colspan="0" id="hrefbrowsercontainer"/>
|
||||
</tr>
|
||||
<!-- Link list -->
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0)
|
||||
{
|
||||
var html = "";
|
||||
|
||||
html += "<tr><td><label for='link_list'>{$lang_link_list}</label></td>";
|
||||
html += "<td><select id='link_list' name='link_list' style='width: 200px' " +
|
||||
"onchange='this.form.href.value=this.options[this.selectedIndex].value;'>";
|
||||
html += "<option value=''>-" + "-" + "-</option>";
|
||||
for (var i = 0; i < tinyMCELinkList.length; i++)
|
||||
{
|
||||
html += "<option value='" + tinyMCELinkList[i][1] + "'>" + tinyMCELinkList[i][0] + "</option>";
|
||||
}
|
||||
html += "</select></td></tr>";
|
||||
document.write(html);
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<!-- /Link list -->
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="target">{$lang_insert_link_target}</label></td>
|
||||
<td><select id="target" name="target" style="width: 200px">
|
||||
<option value="_self">{$lang_insert_link_target_same}</option>
|
||||
<option value="_blank">{$lang_insert_link_target_blank}</option>
|
||||
<script language="javascript">
|
||||
<!--
|
||||
var html = "";
|
||||
var targets = tinyMCE.getParam("theme_advanced_link_targets", "").split(";");
|
||||
|
||||
for (var i = 0; i < targets.length; i++)
|
||||
{
|
||||
var key, value;
|
||||
if (targets[i] == "")
|
||||
continue;
|
||||
key = targets[i].split("=")[0];
|
||||
value = targets[i].split("=")[1];
|
||||
html += "<option value='" + value + "'>" + key + "</option>";
|
||||
}
|
||||
document.write(html);
|
||||
-->
|
||||
</script>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="linktitle">{$lang_theme_insert_link_titlefield}</label></td>
|
||||
<td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px"/></td>
|
||||
</tr>
|
||||
<tr id="styleSelectRow">
|
||||
<td><label for="styleSelect">{$lang_class_name}</label></td>
|
||||
<td>
|
||||
<select id="styleSelect" name="styleSelect">
|
||||
<option value="" selected="selected">{$lang_theme_style_select}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertLink();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
</jsp:root>
|
@@ -47,6 +47,7 @@ alfresco.FilePickerWidget = function(uploadId,
|
||||
value,
|
||||
readonly,
|
||||
change_callback,
|
||||
cancel_callback,
|
||||
resize_callback,
|
||||
selectableTypes,
|
||||
filterMimetypes)
|
||||
@@ -56,7 +57,8 @@ alfresco.FilePickerWidget = function(uploadId,
|
||||
this.value = value == null || value.length == 0 ? null : value;
|
||||
this.readonly = readonly || false;
|
||||
this.change_callback = change_callback;
|
||||
this.resize_callback = resize_callback;
|
||||
this.cancel_callback = cancel_callback || function() {};
|
||||
this.resize_callback = resize_callback || function() {};
|
||||
this.selectableTypes = selectableTypes;
|
||||
this.filterMimetypes = filterMimetypes;
|
||||
}
|
||||
@@ -72,7 +74,6 @@ alfresco.FilePickerWidget._handleUpload = function(id, fileInput, webappRelative
|
||||
path: fileInput.value,
|
||||
webappRelativePath: webappRelativePath
|
||||
};
|
||||
|
||||
handle_upload_helper(fileInput,
|
||||
id,
|
||||
alfresco.FilePickerWidget._upload_completeHandler,
|
||||
@@ -123,6 +124,13 @@ setReadonly: function(r)
|
||||
}
|
||||
},
|
||||
|
||||
destroy: function()
|
||||
{
|
||||
dojo.dom.removeChildren(this.node);
|
||||
this.node.parentNode.removeChild(this.node);
|
||||
this.node = null;
|
||||
},
|
||||
|
||||
render: function()
|
||||
{
|
||||
this._showSelectedValue();
|
||||
@@ -181,6 +189,10 @@ _hideStatus: function()
|
||||
|
||||
_showSelectedValue: function()
|
||||
{
|
||||
if (this.node == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var d = this.node.ownerDocument;
|
||||
dojo.dom.removeChildren(this.node);
|
||||
this.statusDiv = null;
|
||||
@@ -306,21 +318,21 @@ _showPicker: function(data)
|
||||
event.currentTarget.style.borderStyle = "solid";
|
||||
}
|
||||
});
|
||||
dojo.event.connect(this.headerMenuTriggerLink,
|
||||
"onclick",
|
||||
function(event)
|
||||
// can't use dojo's event handling since it screws up when opened in another window
|
||||
var filePickerWidget = this;
|
||||
var headerMenuTriggerLink = this.headerMenuTriggerLink;
|
||||
this.headerMenuTriggerLink.onclick = function(event)
|
||||
{
|
||||
var t = event.currentTarget;
|
||||
var w = t.filePickerWidget;
|
||||
if (w.parentPathMenu)
|
||||
if (filePickerWidget.parentPathMenu)
|
||||
{
|
||||
w._closeParentPathMenu();
|
||||
filePickerWidget._closeParentPathMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
w._openParentPathMenu(t, t.getAttribute("webappRelativePath"));
|
||||
filePickerWidget._openParentPathMenu(headerMenuTriggerLink,
|
||||
headerMenuTriggerLink.getAttribute("webappRelativePath"));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.headerMenuTriggerLink.appendChild(d.createTextNode(currentPathName));
|
||||
|
||||
@@ -422,6 +434,7 @@ _showPicker: function(data)
|
||||
dojo.event.connect(cancelButton, "onclick", function(event)
|
||||
{
|
||||
var w = event.target.filePickerWidget;
|
||||
w.cancel_callback(this);
|
||||
w._showSelectedValue();
|
||||
});
|
||||
this.contentDiv.style.height = (this.node.offsetHeight -
|
||||
@@ -457,33 +470,19 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
|
||||
var d = this.contentDiv.ownerDocument;
|
||||
var result = d.createElement("div");
|
||||
result.setAttribute("id", fileName + "-row");
|
||||
|
||||
result.setAttribute("webappRelativePath", webappRelativePath);
|
||||
result.filePickerWidget = this;
|
||||
dojo.html.setClass(result, "xformsFilePickerRow " + rowClass);
|
||||
dojo.event.browser.addListener(result,
|
||||
"mouseover",
|
||||
function(event)
|
||||
result.onmouseover = function()
|
||||
{
|
||||
var prevHover = event.currentTarget.parentNode.hoverNode;
|
||||
var prevHover = result.parentNode.hoverNode;
|
||||
if (prevHover)
|
||||
{
|
||||
dojo.html.removeClass(prevHover, "xformsRowHover");
|
||||
}
|
||||
event.currentTarget.parentNode.hoverNode = event.currentTarget;
|
||||
dojo.html.addClass(event.currentTarget, "xformsRowHover");
|
||||
},
|
||||
true);
|
||||
dojo.event.browser.addListener(result,
|
||||
"mouseout",
|
||||
function(event)
|
||||
{
|
||||
if (event.relatedTarget &&
|
||||
event.relatedTarget.parentNode == event.currentTarget)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
dojo.html.removeClass(event.currentTarget, "xformsRowHover");
|
||||
},
|
||||
true);
|
||||
result.parentNode.hoverNode = result;
|
||||
dojo.html.addClass(result, "xformsRowHover");
|
||||
};
|
||||
var e = d.createElement("img");
|
||||
e.align = "absmiddle";
|
||||
e.style.margin = "0px 4px 0px 4px";
|
||||
@@ -493,16 +492,15 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
|
||||
if (isDirectory)
|
||||
{
|
||||
e = d.createElement("a");
|
||||
e.filePickerWidget = this;
|
||||
e.style.textDecoration = "none";
|
||||
e.setAttribute("href", "javascript:void(0)");
|
||||
e.setAttribute("webappRelativePath", webappRelativePath);
|
||||
dojo.event.connect(e, "onclick", function(event)
|
||||
|
||||
e.onclick = function()
|
||||
{
|
||||
var w = event.target.filePickerWidget;
|
||||
w._navigateToNode(event.target.getAttribute("webappRelativePath"));
|
||||
var w = result.filePickerWidget;
|
||||
w._navigateToNode(result.getAttribute("webappRelativePath"));
|
||||
return true;
|
||||
});
|
||||
};
|
||||
e.appendChild(d.createTextNode(fileName));
|
||||
result.appendChild(e);
|
||||
}
|
||||
@@ -513,7 +511,6 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
|
||||
if (isSelectable)
|
||||
{
|
||||
e = d.createElement("input");
|
||||
e.filePickerWidget = this;
|
||||
e.type = "button";
|
||||
e.name = webappRelativePath;
|
||||
e.value = "Select";
|
||||
@@ -522,12 +519,12 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
|
||||
e.style.position = "absolute";
|
||||
e.style.right = "10px";
|
||||
e.style.top = (.5 * result.offsetHeight) - (.5 * e.offsetHeight) + "px";
|
||||
dojo.event.connect(e, "onclick", function(event)
|
||||
e.onclick = function()
|
||||
{
|
||||
var w = event.target.filePickerWidget;
|
||||
w.setValue(event.target.name);
|
||||
var w = result.filePickerWidget;
|
||||
w.setValue(result.getAttribute("webappRelativePath"));
|
||||
w._showSelectedValue();
|
||||
});
|
||||
};
|
||||
}
|
||||
return result;
|
||||
},
|
||||
@@ -578,17 +575,17 @@ _showAddContent: function(currentPath)
|
||||
fileInputDiv.style.right = "10px";
|
||||
fileInputDiv.style.top = (.5 * this.addContentDiv.offsetHeight) - (.5 * fileInputDiv.offsetHeight) + "px";
|
||||
|
||||
dojo.event.connect(fileInput,
|
||||
"onchange",
|
||||
function(event)
|
||||
fileInput.onchange = function(event)
|
||||
{
|
||||
var w = event.target.widget;
|
||||
event = event || fileInput.ownerDocument.parentWindow.event;
|
||||
var target = event.target || event.srcElement;
|
||||
var w = target.widget;
|
||||
if (w.addContentDiv)
|
||||
{
|
||||
var d = w.addContentDiv.ownerDocument;
|
||||
dojo.dom.removeChildren(w.addContentDiv);
|
||||
|
||||
var fileName = event.target.value.replace(/.*[\/\\]([^\/\\]+)/, "$1");
|
||||
var fileName = target.value.replace(/.*[\/\\]([^\/\\]+)/, "$1");
|
||||
w.addContentDiv.appendChild(d.createTextNode(alfresco.resources["upload"] + ": " + fileName));
|
||||
var img = d.createElement("img");
|
||||
img.setAttribute("src", alfresco.constants.WEBAPP_CONTEXT +
|
||||
@@ -601,10 +598,10 @@ _showAddContent: function(currentPath)
|
||||
}
|
||||
|
||||
alfresco.FilePickerWidget._handleUpload(w.uploadId,
|
||||
event.target,
|
||||
event.target.getAttribute("webappRelativePath"),
|
||||
target,
|
||||
target.getAttribute("webappRelativePath"),
|
||||
w);
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
_upload_completeHandler: function(fileName, webappRelativePath, fileTypeImage, error)
|
||||
@@ -626,6 +623,7 @@ _upload_completeHandler: function(fileName, webappRelativePath, fileTypeImage, e
|
||||
var row = this._createRow(fileName,
|
||||
webappRelativePath == "/" ? "/" + fileName : webappRelativePath + "/" + fileName,
|
||||
false,
|
||||
true /* this is potentially inaccurate - need to add some checks in the backing bean to check selectable */,
|
||||
fileTypeImage,
|
||||
rowClass);
|
||||
this.contentDiv.replaceChild(row, this.addContentDiv);
|
||||
@@ -655,11 +653,11 @@ _openParentPathMenu: function(target, path)
|
||||
// outside of the menu
|
||||
var parentPathMenu_documentClickHandler = function(event)
|
||||
{
|
||||
var t = event.target;
|
||||
var d = event.target.ownerDocument;
|
||||
event = event || d.parentWindow.event;
|
||||
var t = event.target || event.srcElement;
|
||||
|
||||
// always remove - this handler only ever needs to handle a single click
|
||||
d.removeEventListener("click", parentPathMenu_documentClickHandler, true);
|
||||
dojo.event.browser.removeListener(d, "click", parentPathMenu_documentClickHandler, true, true);
|
||||
while (t && t != d)
|
||||
{
|
||||
if (t == d.currentParentPathMenu ||
|
||||
@@ -672,7 +670,8 @@ _openParentPathMenu: function(target, path)
|
||||
}
|
||||
d.currentParentPathMenu.filePickerWidget._closeParentPathMenu();
|
||||
};
|
||||
d.addEventListener("click", parentPathMenu_documentClickHandler, true);
|
||||
|
||||
dojo.event.browser.addListener(d, "click", parentPathMenu_documentClickHandler, true, true);
|
||||
|
||||
dojo.html.setClass(this.parentPathMenu, "xformsFilePickerParentPathMenu");
|
||||
|
||||
|
210
source/web/scripts/ajax/tiny_mce_wcm_extensions.js
vendored
210
source/web/scripts/ajax/tiny_mce_wcm_extensions.js
vendored
@@ -48,184 +48,42 @@ function alfresco_TinyMCE_urlconverter_callback(href, element, onsave)
|
||||
return result;
|
||||
}
|
||||
|
||||
function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_interface, value)
|
||||
function alfresco_TinyMCE_file_browser_callback(field_name, url, type, win)
|
||||
{
|
||||
if (command == "mceLink")
|
||||
tinyMCE.importCSS(win.document, alfresco.constants.WEBAPP_CONTEXT + "/css/xforms.css");
|
||||
var div = win.document.createElement("div");
|
||||
div.style.width = "100%";
|
||||
div.style.height = "100%";
|
||||
div.style.backgroundColor = "white";
|
||||
div.style.position = "absolute";
|
||||
div.style.top = "0px";
|
||||
div.style.left = "0px";
|
||||
win.document.body.appendChild(div);
|
||||
var pickerDiv = win.document.createElement("div");
|
||||
pickerDiv.style.height = "100%";
|
||||
pickerDiv.style.position = "relative";
|
||||
div.appendChild(pickerDiv);
|
||||
var picker = new alfresco.FilePickerWidget("alfFilePicker",
|
||||
pickerDiv,
|
||||
url,
|
||||
false,
|
||||
function(picker)
|
||||
{
|
||||
// BEGIN COPIED FROM ADVANCED THEME editor_template_src.js
|
||||
var inst = tinyMCE.getInstanceById(editor_id);
|
||||
var doc = inst.getDoc();
|
||||
var selectedText = (tinyMCE.isMSIE
|
||||
? doc.selection.createRange().text
|
||||
: inst.getSel().toString());
|
||||
|
||||
if (!tinyMCE.linkElement &&
|
||||
tinyMCE.selectedElement.nodeName.toLowerCase() != "img" &&
|
||||
selectedText.length <= 0)
|
||||
win.document.getElementById(field_name).value = picker.getValue();
|
||||
picker.destroy();
|
||||
div.parentNode.removeChild(div);
|
||||
},
|
||||
function()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
|
||||
|
||||
if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
|
||||
picker.destroy();
|
||||
div.parentNode.removeChild(div);
|
||||
},
|
||||
function(picker)
|
||||
{
|
||||
tinyMCE.linkElement = tinyMCE.selectedElement;
|
||||
}
|
||||
|
||||
// Is anchor not a link
|
||||
if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
|
||||
{
|
||||
tinyMCE.linkElement = null;
|
||||
}
|
||||
|
||||
if (tinyMCE.linkElement)
|
||||
{
|
||||
href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
|
||||
target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
|
||||
title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
|
||||
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
|
||||
style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
|
||||
|
||||
// Try old onclick to if copy/pasted content
|
||||
if (onclick == "")
|
||||
{
|
||||
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
|
||||
}
|
||||
onclick = tinyMCE.cleanupEventStr(onclick);
|
||||
|
||||
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
|
||||
|
||||
// Use mce_href if defined
|
||||
mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
|
||||
if (mceRealHref != "")
|
||||
{
|
||||
href = mceRealHref;
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
{
|
||||
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
|
||||
}
|
||||
}
|
||||
|
||||
action = "update";
|
||||
}
|
||||
|
||||
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_link_dialog.jsp",
|
||||
width: 510 + tinyMCE.getLang('lang_insert_link_delta_width', 0),
|
||||
height: 265 + tinyMCE.getLang('lang_insert_link_delta_height', 0) };
|
||||
var dialog_props = { href: href,
|
||||
target: target,
|
||||
title: title,
|
||||
onclick: onclick,
|
||||
action: action,
|
||||
className: style_class,
|
||||
inline: "yes" };
|
||||
tinyMCE.openWindow(window_props, dialog_props);
|
||||
return true;
|
||||
}
|
||||
else if (command == "mceImage")
|
||||
{
|
||||
var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "",
|
||||
title = "", onmouseover = "", onmouseout = "", action = "insert";
|
||||
var img = tinyMCE.imgElement;
|
||||
var inst = tinyMCE.getInstanceById(editor_id);
|
||||
|
||||
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
|
||||
{
|
||||
img = tinyMCE.selectedElement;
|
||||
tinyMCE.imgElement = img;
|
||||
}
|
||||
|
||||
if (img)
|
||||
{
|
||||
// Is it a internal MCE visual aid image, then skip this one.
|
||||
if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
src = tinyMCE.getAttrib(img, 'src');
|
||||
alt = tinyMCE.getAttrib(img, 'alt');
|
||||
|
||||
// Try polling out the title
|
||||
if (alt == "")
|
||||
{
|
||||
alt = tinyMCE.getAttrib(img, 'title');
|
||||
}
|
||||
|
||||
// Fix width/height attributes if the styles is specified
|
||||
if (tinyMCE.isGecko)
|
||||
{
|
||||
var w = img.style.width;
|
||||
if (w != null && w.length != 0)
|
||||
{
|
||||
img.setAttribute("width", w);
|
||||
}
|
||||
|
||||
var h = img.style.height;
|
||||
if (h != null && h.length != 0)
|
||||
{
|
||||
img.setAttribute("height", h);
|
||||
}
|
||||
}
|
||||
|
||||
border = tinyMCE.getAttrib(img, 'border');
|
||||
hspace = tinyMCE.getAttrib(img, 'hspace');
|
||||
vspace = tinyMCE.getAttrib(img, 'vspace');
|
||||
width = tinyMCE.getAttrib(img, 'width');
|
||||
height = tinyMCE.getAttrib(img, 'height');
|
||||
align = tinyMCE.getAttrib(img, 'align');
|
||||
onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
|
||||
onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
|
||||
title = tinyMCE.getAttrib(img, 'title');
|
||||
|
||||
// Is realy specified?
|
||||
if (tinyMCE.isMSIE)
|
||||
{
|
||||
width = img.attributes['width'].specified ? width : "";
|
||||
height = img.attributes['height'].specified ? height : "";
|
||||
}
|
||||
|
||||
//onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
|
||||
//onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
|
||||
|
||||
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
|
||||
|
||||
// Use mce_src if defined
|
||||
mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
|
||||
if (mceRealSrc != "")
|
||||
{
|
||||
src = mceRealSrc;
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
{
|
||||
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
|
||||
}
|
||||
}
|
||||
action = "update";
|
||||
}
|
||||
|
||||
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_image_dialog.jsp",
|
||||
width: 510 + tinyMCE.getLang('lang_insert_image_delta_width', 0),
|
||||
height: 265 + (tinyMCE.isMSIE ? 25 : 0) + tinyMCE.getLang('lang_insert_image_delta_height', 0) };
|
||||
var dialog_props = { src: src,
|
||||
alt: alt,
|
||||
border: border,
|
||||
hspace: hspace,
|
||||
vspace: vspace,
|
||||
width: width,
|
||||
height: height,
|
||||
align: align,
|
||||
title: title,
|
||||
onmouseover: onmouseover,
|
||||
onmouseout: onmouseout,
|
||||
action: action,
|
||||
inline: "yes" };
|
||||
tinyMCE.openWindow(window_props, dialog_props);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
picker.node.style.height = div.offsetHeight + "px";
|
||||
picker.node.style.width = div.offsetWidth + "px";
|
||||
},
|
||||
type == "image" ? ["wcm:avmcontent"] : [],
|
||||
type == "image" ? ["image/*"] : []);
|
||||
picker._navigateToNode(url);
|
||||
}
|
||||
|
@@ -534,6 +534,7 @@ dojo.declare("alfresco.xforms.FilePicker",
|
||||
this.getInitialValue(),
|
||||
false,
|
||||
this._filePicker_changeHandler,
|
||||
null /* cancel is ignored */,
|
||||
this._filePicker_resizeHandler,
|
||||
this._selectableTypes,
|
||||
this._filterMimetypes);
|
||||
@@ -4725,13 +4726,13 @@ alfresco.constants.TINY_MCE_DEFAULT_SETTINGS =
|
||||
entity_encoding: "raw",
|
||||
add_unload_trigger: false,
|
||||
add_form_submit_trigger: false,
|
||||
execcommand_callback: "alfresco_TinyMCE_execcommand_callback",
|
||||
theme_advanced_toolbar_location: "top",
|
||||
theme_advanced_toolbar_align: "left",
|
||||
theme_advanced_buttons1: "",
|
||||
theme_advanced_buttons2: "",
|
||||
theme_advanced_buttons3: "",
|
||||
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback"
|
||||
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback",
|
||||
file_browser_callback: "alfresco_TinyMCE_file_browser_callback"
|
||||
};
|
||||
|
||||
tinyMCE.init(dojo.lang.mixin(new Object(), alfresco.constants.TINY_MCE_DEFAULT_SETTINGS));
|
||||
|
@@ -9,14 +9,15 @@ function handle_upload_helper(fileInputElement,
|
||||
{
|
||||
var id = fileInputElement.getAttribute("name");
|
||||
var d = fileInputElement.ownerDocument;
|
||||
var w = d.defaultView || d.parentWindow;
|
||||
var iframe = d.createElement("iframe");
|
||||
iframe.style.display = "none";
|
||||
iframe.name = id + "upload_frame";
|
||||
iframe.id = iframe.name;
|
||||
document.body.appendChild(iframe);
|
||||
d.body.appendChild(iframe);
|
||||
|
||||
// makes it possible to target the frame properly in ie.
|
||||
window.frames[iframe.name].name = iframe.name;
|
||||
w.frames[iframe.name].name = iframe.name;
|
||||
|
||||
_uploads[uploadId] = { path: fileInputElement.value, callback: callback };
|
||||
|
||||
@@ -33,7 +34,7 @@ function handle_upload_helper(fileInputElement,
|
||||
form.action = contextPath + actionUrl;
|
||||
form.appendChild(fileInputElement);
|
||||
|
||||
var id = document.createElement("input");
|
||||
var id = d.createElement("input");
|
||||
id.type = "hidden";
|
||||
form.appendChild(id);
|
||||
id.name = "upload-id";
|
||||
@@ -41,17 +42,22 @@ function handle_upload_helper(fileInputElement,
|
||||
|
||||
for (var i in params)
|
||||
{
|
||||
var p = document.createElement("input");
|
||||
var p = d.createElement("input");
|
||||
p.type = "hidden";
|
||||
form.appendChild(p);
|
||||
id.name = i;
|
||||
id.value = params[i];
|
||||
}
|
||||
|
||||
var rp = document.createElement("input");
|
||||
var rp = d.createElement("input");
|
||||
rp.type = "hidden";
|
||||
form.appendChild(rp);
|
||||
rp.name = "return-page";
|
||||
if (w != window)
|
||||
{
|
||||
w.upload_complete_helper = window.upload_complete_helper;
|
||||
}
|
||||
|
||||
rp.value = "javascript:window.parent.upload_complete_helper('" + uploadId +
|
||||
"',{error: '${_UPLOAD_ERROR}', fileTypeImage: '${_FILE_TYPE_IMAGE}'})";
|
||||
|
||||
|
Reference in New Issue
Block a user