diff --git a/l10n.properties b/l10n.properties
index fe5e58be8e..49f12fd6ea 100644
--- a/l10n.properties
+++ b/l10n.properties
@@ -1,7 +1,7 @@
# Branch specific configuration file for localisation scripts
-MESSAGE_SEARCH_PATH="src/main/resources/alfresco/messages/action-config*.properties src/main/resources/alfresco/messages/action-service*.properties src/main/resources/alfresco/messages/activiti-engine-messages*.properties src/main/resources/alfresco/messages/activities-service*.properties src/main/resources/alfresco/messages/activity-list*.properties src/main/resources/alfresco/messages/application-model*.properties src/main/resources/alfresco/messages/authentication*.properties src/main/resources/alfresco/messages/bootstrap-content-template-examples*.properties src/main/resources/alfresco/messages/bootstrap-example-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-example-smartfoldertemplates*.properties src/main/resources/alfresco/messages/bootstrap-imapScripts*.properties src/main/resources/alfresco/messages/bootstrap-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-messages*.properties src/main/resources/alfresco/messages/bootstrap-readme-template*.properties src/main/resources/alfresco/messages/bootstrap-spaces*.properties src/main/resources/alfresco/messages/bootstrap-templates*.properties src/main/resources/alfresco/messages/bootstrap-tutorial*.properties src/main/resources/alfresco/messages/bootstrap-webScripts*.properties src/main/resources/alfresco/messages/bootstrap-webScriptsExtensions*.properties src/main/resources/alfresco/messages/bpm-messages*.properties src/main/resources/alfresco/messages/categories*.properties src/main/resources/alfresco/messages/coci-service*.properties src/main/resources/alfresco/messages/content-filter-languages*.properties src/main/resources/alfresco/messages/content-model*.properties src/main/resources/alfresco/messages/copy-service*.properties src/main/resources/alfresco/messages/custommodel-service*.properties src/main/resources/alfresco/messages/discussion-messages*.properties src/main/resources/alfresco/messages/distributionpolicies-model*.properties src/main/resources/alfresco/messages/doclink-service*.properties src/main/resources/alfresco/messages/download-model*.properties src/main/resources/alfresco/messages/email-server-model*.properties src/main/resources/alfresco/messages/email-service*.properties src/main/resources/alfresco/messages/file-folder-service*.properties src/main/resources/alfresco/messages/form-service*.properties src/main/resources/alfresco/messages/forum-model*.properties src/main/resources/alfresco/messages/imap-service*.properties src/main/resources/alfresco/messages/initiate-inplace*.properties src/main/resources/alfresco/messages/invitation-service*.properties src/main/resources/alfresco/messages/lock-service*.properties src/main/resources/alfresco/messages/notification-service*.properties src/main/resources/alfresco/messages/period-provider*.properties src/main/resources/alfresco/messages/permissions-service*.properties src/main/resources/alfresco/messages/publishing-model*.properties src/main/resources/alfresco/messages/publishing-service*.properties src/main/resources/alfresco/messages/quickshare-service*.properties src/main/resources/alfresco/messages/rendition-config*.properties src/main/resources/alfresco/messages/replication*.properties src/main/resources/alfresco/messages/repoadmin-service*.properties src/main/resources/alfresco/messages/reset-password-messages*.properties src/main/resources/alfresco/messages/rule-config*.properties src/main/resources/alfresco/messages/site-model*.properties src/main/resources/alfresco/messages/site-service*.properties src/main/resources/alfresco/messages/slingshot*.properties src/main/resources/alfresco/messages/smartfolder-model*.properties src/main/resources/alfresco/messages/subscription-service*.properties src/main/resources/alfresco/messages/system-messages*.properties src/main/resources/alfresco/messages/system-model*.properties src/main/resources/alfresco/messages/template-service*.properties src/main/resources/alfresco/messages/templates-messages*.properties src/main/resources/alfresco/messages/transfer-model*.properties src/main/resources/alfresco/messages/transfer-service*.properties src/main/resources/alfresco/messages/ui-inplace*.properties src/main/resources/alfresco/messages/webdav-messages*.properties src/main/resources/alfresco/messages/workflow-package-messages*.properties src/main/resources/alfresco/workflow/invitation-moderated-workflow-messages*.properties src/main/resources/alfresco/workflow/invitation-nominated-workflow-messages*.properties src/main/resources/alfresco/workflow/workflow-messages*.properties"
+MESSAGE_SEARCH_PATH="src/main/resources/alfresco/messages/action-config*.properties src/main/resources/alfresco/messages/action-service*.properties src/main/resources/alfresco/messages/activiti-engine-messages*.properties src/main/resources/alfresco/messages/activities-service*.properties src/main/resources/alfresco/messages/activity-list*.properties src/main/resources/alfresco/messages/application-model*.properties src/main/resources/alfresco/messages/authentication*.properties src/main/resources/alfresco/messages/bootstrap-content-template-examples*.properties src/main/resources/alfresco/messages/bootstrap-example-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-example-smartfoldertemplates*.properties src/main/resources/alfresco/messages/bootstrap-imapScripts*.properties src/main/resources/alfresco/messages/bootstrap-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-messages*.properties src/main/resources/alfresco/messages/bootstrap-readme-template*.properties src/main/resources/alfresco/messages/bootstrap-spaces*.properties src/main/resources/alfresco/messages/bootstrap-templates*.properties src/main/resources/alfresco/messages/bootstrap-tutorial*.properties src/main/resources/alfresco/messages/bootstrap-webScripts*.properties src/main/resources/alfresco/messages/bootstrap-webScriptsExtensions*.properties src/main/resources/alfresco/messages/bpm-messages*.properties src/main/resources/alfresco/messages/categories*.properties src/main/resources/alfresco/messages/coci-service*.properties src/main/resources/alfresco/messages/content-filter-languages*.properties src/main/resources/alfresco/messages/content-model*.properties src/main/resources/alfresco/messages/copy-service*.properties src/main/resources/alfresco/messages/custommodel-service*.properties src/main/resources/alfresco/messages/discussion-messages*.properties src/main/resources/alfresco/messages/distributionpolicies-model*.properties src/main/resources/alfresco/messages/doclink-service*.properties src/main/resources/alfresco/messages/download-model*.properties src/main/resources/alfresco/messages/email-server-model*.properties src/main/resources/alfresco/messages/email-service*.properties src/main/resources/alfresco/messages/file-folder-service*.properties src/main/resources/alfresco/messages/form-service*.properties src/main/resources/alfresco/messages/forum-model*.properties src/main/resources/alfresco/messages/imap-service*.properties src/main/resources/alfresco/messages/initiate-inplace*.properties src/main/resources/alfresco/messages/invitation-service*.properties src/main/resources/alfresco/messages/lock-service*.properties src/main/resources/alfresco/messages/notification-service*.properties src/main/resources/alfresco/messages/period-provider*.properties src/main/resources/alfresco/messages/permissions-service*.properties src/main/resources/alfresco/messages/quickshare-service*.properties src/main/resources/alfresco/messages/rendition-config*.properties src/main/resources/alfresco/messages/replication*.properties src/main/resources/alfresco/messages/repoadmin-service*.properties src/main/resources/alfresco/messages/reset-password-messages*.properties src/main/resources/alfresco/messages/rule-config*.properties src/main/resources/alfresco/messages/site-model*.properties src/main/resources/alfresco/messages/site-service*.properties src/main/resources/alfresco/messages/slingshot*.properties src/main/resources/alfresco/messages/smartfolder-model*.properties src/main/resources/alfresco/messages/subscription-service*.properties src/main/resources/alfresco/messages/system-messages*.properties src/main/resources/alfresco/messages/system-model*.properties src/main/resources/alfresco/messages/template-service*.properties src/main/resources/alfresco/messages/templates-messages*.properties src/main/resources/alfresco/messages/transfer-model*.properties src/main/resources/alfresco/messages/transfer-service*.properties src/main/resources/alfresco/messages/ui-inplace*.properties src/main/resources/alfresco/messages/webdav-messages*.properties src/main/resources/alfresco/messages/workflow-package-messages*.properties src/main/resources/alfresco/workflow/invitation-moderated-workflow-messages*.properties src/main/resources/alfresco/workflow/invitation-nominated-workflow-messages*.properties src/main/resources/alfresco/workflow/workflow-messages*.properties"
-EXCLUDED_FILES="src/main/resources/alfresco/messages/content-service.properties src/main/resources/alfresco/messages/module-messages.properties src/main/resources/alfresco/messages/patch-service.properties src/main/resources/alfresco/messages/repoadmin-interpreter-help.properties src/main/resources/alfresco/messages/schema-update.properties src/main/resources/alfresco/messages/tenant-interpreter-help.properties src/main/resources/alfresco/messages/version-service.properties src/main/resources/alfresco/messages/workflow-interpreter-help.properties src/main/resources/alfresco/alfresco-shared.properties src/main/resources/alfresco/caches.properties src/main/resources/alfresco/repository.properties src/main/resources/alfresco/client/config/repo-clients-apps.properties src/main/resources/alfresco/domain/cache-strategies.properties src/main/resources/alfresco/domain/hibernate-cfg.properties src/main/resources/alfresco/domain/quartz.properties src/main/resources/alfresco/domain/transaction.properties src/main/resources/alfresco/keystore/keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-truststore-passwords.properties src/main/resources/alfresco/metadata/DWGMetadataExtracter.properties src/main/resources/alfresco/metadata/HtmlMetadataExtracter.properties src/main/resources/alfresco/metadata/MailMetadataExtracter.properties src/main/resources/alfresco/metadata/MP3MetadataExtracter.properties src/main/resources/alfresco/metadata/OfficeMetadataExtracter.properties src/main/resources/alfresco/metadata/PdfBoxMetadataExtracter.properties src/main/resources/alfresco/metadata/PoiMetadataExtracter.properties src/main/resources/alfresco/metadata/RFC822MetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAudioMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAutoMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaSpringConfiguredMetadataExtracter.properties src/main/resources/alfresco/subsystems/ActivitiesFeed/default/activities-jobs.properties src/main/resources/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication.properties src/main/resources/alfresco/subsystems/Authentication/external/external-authentication.properties src/main/resources/alfresco/subsystems/Authentication/kerberos/kerberos-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap/ldap-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap-ad/ldap-ad-authentication.properties src/main/resources/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.properties src/main/resources/alfresco/subsystems/email/InboundSMTP/inboundSMTP.properties src/main/resources/alfresco/subsystems/email/OutboundSMTP/outboundSMTP.properties src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties src/main/resources/alfresco/subsystems/imap/default/imap-server.properties src/main/resources/alfresco/subsystems/Replication/default/replication.properties src/main/resources/alfresco/subsystems/Search/noindex/common-search.properties src/main/resources/alfresco/subsystems/Search/noindex/noindex-search.properties src/main/resources/alfresco/subsystems/Search/solr/common-search.properties src/main/resources/alfresco/subsystems/Search/solr/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr/facet/solr-facets-config.properties src/main/resources/alfresco/subsystems/Search/solr4/common-search.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr6/common-search.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-search.properties src/main/resources/alfresco/subsystems/Subscriptions/default/subscription-service.properties src/main/resources/alfresco/subsystems/Synchronization/default/default-synchronization.properties src/main/resources/alfresco/subsystems/sysAdmin/default/sysadmin-parameter.properties src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform.properties src/main/resources/alfresco/subsystems/thirdparty/default/imagemagick-transform.properties src/main/resources/alfresco/subsystems/Transformers/default/transformers.properties src/main/resources/org/alfresco/encryption/keystore-parameters.properties src/main/resources/org/alfresco/repo/i18n/testMessages.properties src/main/resources/org/alfresco/repo/module/tool/default-file-mapping.properties src/main/resources/org/alfresco/repo/publishing/facebook/facebook-publishing.properties src/main/resources/org/alfresco/repo/publishing/flickr/flickr-publishing.properties src/main/resources/org/alfresco/repo/publishing/linkedin/linkedin-publishing.properties src/main/resources/org/alfresco/repo/publishing/slideshare/slideshare-publishing.properties src/main/resources/org/alfresco/repo/publishing/twitter/twitter-publishing.properties src/main/resources/org/alfresco/repo/publishing/youtube/youtube-publishing.properties src/main/resources/alfresco/metadata/JodConverterMetadataExtracter.properties src/main/resources/alfresco/subsystems/OOoJodconverter/default/jodconverter.properties"
+EXCLUDED_FILES="src/main/resources/alfresco/messages/content-service.properties src/main/resources/alfresco/messages/module-messages.properties src/main/resources/alfresco/messages/patch-service.properties src/main/resources/alfresco/messages/repoadmin-interpreter-help.properties src/main/resources/alfresco/messages/schema-update.properties src/main/resources/alfresco/messages/tenant-interpreter-help.properties src/main/resources/alfresco/messages/version-service.properties src/main/resources/alfresco/messages/workflow-interpreter-help.properties src/main/resources/alfresco/alfresco-shared.properties src/main/resources/alfresco/caches.properties src/main/resources/alfresco/repository.properties src/main/resources/alfresco/client/config/repo-clients-apps.properties src/main/resources/alfresco/domain/cache-strategies.properties src/main/resources/alfresco/domain/hibernate-cfg.properties src/main/resources/alfresco/domain/quartz.properties src/main/resources/alfresco/domain/transaction.properties src/main/resources/alfresco/keystore/keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-truststore-passwords.properties src/main/resources/alfresco/metadata/DWGMetadataExtracter.properties src/main/resources/alfresco/metadata/HtmlMetadataExtracter.properties src/main/resources/alfresco/metadata/MailMetadataExtracter.properties src/main/resources/alfresco/metadata/MP3MetadataExtracter.properties src/main/resources/alfresco/metadata/OfficeMetadataExtracter.properties src/main/resources/alfresco/metadata/PdfBoxMetadataExtracter.properties src/main/resources/alfresco/metadata/PoiMetadataExtracter.properties src/main/resources/alfresco/metadata/RFC822MetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAudioMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAutoMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaSpringConfiguredMetadataExtracter.properties src/main/resources/alfresco/subsystems/ActivitiesFeed/default/activities-jobs.properties src/main/resources/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication.properties src/main/resources/alfresco/subsystems/Authentication/external/external-authentication.properties src/main/resources/alfresco/subsystems/Authentication/kerberos/kerberos-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap/ldap-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap-ad/ldap-ad-authentication.properties src/main/resources/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.properties src/main/resources/alfresco/subsystems/email/InboundSMTP/inboundSMTP.properties src/main/resources/alfresco/subsystems/email/OutboundSMTP/outboundSMTP.properties src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties src/main/resources/alfresco/subsystems/imap/default/imap-server.properties src/main/resources/alfresco/subsystems/Replication/default/replication.properties src/main/resources/alfresco/subsystems/Search/noindex/common-search.properties src/main/resources/alfresco/subsystems/Search/noindex/noindex-search.properties src/main/resources/alfresco/subsystems/Search/solr/common-search.properties src/main/resources/alfresco/subsystems/Search/solr/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr/facet/solr-facets-config.properties src/main/resources/alfresco/subsystems/Search/solr4/common-search.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr6/common-search.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-search.properties src/main/resources/alfresco/subsystems/Subscriptions/default/subscription-service.properties src/main/resources/alfresco/subsystems/Synchronization/default/default-synchronization.properties src/main/resources/alfresco/subsystems/sysAdmin/default/sysadmin-parameter.properties src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform.properties src/main/resources/alfresco/subsystems/thirdparty/default/imagemagick-transform.properties src/main/resources/alfresco/subsystems/Transformers/default/transformers.properties src/main/resources/org/alfresco/encryption/keystore-parameters.properties src/main/resources/org/alfresco/repo/i18n/testMessages.properties src/main/resources/org/alfresco/repo/module/tool/default-file-mapping.properties src/main/resources/alfresco/metadata/JodConverterMetadataExtracter.properties src/main/resources/alfresco/subsystems/OOoJodconverter/default/jodconverter.properties"
diff --git a/pom.xml b/pom.xml
index 3523bfd5b3..794de0549b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -567,38 +567,6 @@
${dependency.webscripts.version}
-
-
- org.springframework.social
- spring-social-core
- 1.0.3.RELEASE
-
-
- org.springframework.social
- spring-social-linkedin
- 1.0.0-20110711
-
-
- org.springframework.social
- spring-social-facebook
- 1.1.1.RELEASE
-
-
- org.springframework.social
- spring-social-facebook-web
- 1.1.1.RELEASE
-
-
- org.springframework.social
- spring-social-web
- 1.1.4.RELEASE
-
-
- org.springframework.social
- spring-social-twitter
- 1.1.2.RELEASE
-
-
org.apache.chemistry.opencmis
diff --git a/src/main/java/org/alfresco/repo/publishing/AbstractChannelType.java b/src/main/java/org/alfresco/repo/publishing/AbstractChannelType.java
deleted file mode 100644
index de7469d630..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/AbstractChannelType.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-
-package org.alfresco.repo.publishing;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.alfresco.repo.node.encryption.MetadataEncryptor;
-import org.alfresco.service.cmr.publishing.channels.Channel;
-import org.alfresco.service.cmr.publishing.channels.ChannelService;
-import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ParameterCheck;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.extensions.surf.util.I18NUtil;
-
-/**
- * @author Nick Smith
- * @since 4.0
- */
-public abstract class AbstractChannelType implements ChannelType, ChannelTypePublishingOperations
-{
- private NodeService nodeService;
- private ChannelService channelService;
- private MetadataEncryptor encryptor;
- private boolean hidden = false;
-
- public void setChannelService(ChannelService channelService)
- {
- this.channelService = channelService;
- channelService.register(this);
- }
-
- protected ChannelService getChannelService()
- {
- return channelService;
- }
-
- public void setEncryptor(MetadataEncryptor encryptor)
- {
- this.encryptor = encryptor;
- }
-
- protected MetadataEncryptor getEncryptor()
- {
- return encryptor;
- }
-
- protected NodeService getNodeService()
- {
- return nodeService;
- }
-
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
-
- @Override
- public String getTitle()
- {
- String title = I18NUtil.getMessage("publishing.channel-type." + getId() + ".title");
- return title == null ? getId() : title;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getMaximumStatusLength()
- {
- return 0;
- }
-
- @Override
- public AuthUrlPair getAuthorisationUrls(Channel channel, String callbackUrl)
- {
- // Returning a null as the authorisation request URL here to indicate that we should use our own
- // credential-gathering mechanism.
- return new AuthUrlPair(null, callbackUrl);
- }
-
- @Override
- public final AuthStatus acceptAuthorisationCallback(Channel channel, Map callbackHeaders,
- Map callbackParams)
- {
- ParameterCheck.mandatory("channel", channel);
- ParameterCheck.mandatory("callbackHeaders", callbackHeaders);
- ParameterCheck.mandatory("callbackParams", callbackParams);
- if (!getId().equals(channel.getChannelType().getId()))
- {
- throw new IllegalArgumentException("Supplied channel is of the incorrect type. Expected " + getId()
- + "; Received " + channel.getChannelType().getId());
- }
-
- AuthStatus result = internalAcceptAuthorisation(channel, callbackHeaders, callbackParams);
-
- Map props = new HashMap();
- props.put(PublishingModel.PROP_AUTHORISATION_COMPLETE, Boolean.valueOf(AuthStatus.AUTHORISED.equals(result)));
- channelService.updateChannel(channel, props);
- return result;
- }
-
- protected AuthStatus internalAcceptAuthorisation(Channel channel, Map callbackHeaders,
- Map callbackParams)
- {
- AuthStatus result = AuthStatus.UNAUTHORISED;
- String[] username = callbackParams.get("username");
- String[] password = callbackParams.get("password");
- if (username != null && password != null)
- {
- Map props = new HashMap();
- props.put(PublishingModel.PROP_CHANNEL_USERNAME, username[0]);
- props.put(PublishingModel.PROP_CHANNEL_PASSWORD, password[0]);
- channelService.updateChannel(channel, props);
- // TODO: BJR: 20110707: Should test the connection here
- result = AuthStatus.AUTHORISED;
- }
- return result;
- }
-
- public Resource getIcon(String sizeSuffix)
- {
- String className = this.getClass().getCanonicalName();
- className = className.replaceAll("\\.", "\\/");
- StringBuilder iconPath = new StringBuilder(className);
- iconPath.append(sizeSuffix).append('.').append(getIconFileExtension());
- Resource resource = new ClassPathResource(iconPath.toString());
- return resource.exists() ? resource : null;
- }
-
- public String getIconFileExtension()
- {
- return "png";
- }
-
- @Override
- public Set getSupportedContentTypes()
- {
- return Collections.emptySet();
- }
-
- @Override
- public Set getSupportedMimeTypes()
- {
- return Collections.emptySet();
- }
-
- @Override
- public void sendStatusUpdate(Channel channel, String status)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void publish(NodeRef nodeToPublish, Map channelProperties)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void unpublish(NodeRef nodeToUnpublish, Map channelProperties)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getNodeUrl(NodeRef node)
- {
- String url = null;
- if (node != null && nodeService.exists(node) && nodeService.hasAspect(node, PublishingModel.ASPECT_ASSET))
- {
- url = (String)nodeService.getProperty(node, PublishingModel.PROP_ASSET_URL);
- }
- return url;
- }
-
- @Override
- public boolean isHidden()
- {
- return hidden;
- }
-
- @Override
- public void setHidden(boolean hidden)
- {
- this.hidden = hidden;
- }
-}
diff --git a/src/main/java/org/alfresco/repo/publishing/AbstractOAuth1ChannelType.java b/src/main/java/org/alfresco/repo/publishing/AbstractOAuth1ChannelType.java
deleted file mode 100644
index 351ecdf55d..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/AbstractOAuth1ChannelType.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-package org.alfresco.repo.publishing;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.service.cmr.publishing.channels.Channel;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ParameterCheck;
-import org.springframework.social.connect.Connection;
-import org.springframework.social.connect.support.OAuth1ConnectionFactory;
-import org.springframework.social.oauth1.AuthorizedRequestToken;
-import org.springframework.social.oauth1.OAuth1Operations;
-import org.springframework.social.oauth1.OAuth1Parameters;
-import org.springframework.social.oauth1.OAuthToken;
-
-/**
- * @author Brian
- * @author Nick Smith
- * @since 4.0
- *
- * @param The API type, e.g. Twitter, Flickr, LinkedIn, etc.
- */
-public abstract class AbstractOAuth1ChannelType extends AbstractChannelType
-{
- private OAuth1ConnectionFactory connectionFactory;
-
- protected Connection getConnectionForChannel(NodeRef channelNode)
- {
- NodeService nodeService = getNodeService();
- Connection connection = null;
- if (nodeService.exists(channelNode)
- && nodeService.hasAspect(channelNode, PublishingModel.ASPECT_OAUTH1_DELIVERY_CHANNEL))
- {
- String tokenValue = (String) getEncryptor().decrypt(PublishingModel.PROP_OAUTH1_TOKEN_VALUE, nodeService
- .getProperty(channelNode, PublishingModel.PROP_OAUTH1_TOKEN_VALUE));
- String tokenSecret = (String) getEncryptor().decrypt(PublishingModel.PROP_OAUTH1_TOKEN_SECRET, nodeService
- .getProperty(channelNode, PublishingModel.PROP_OAUTH1_TOKEN_SECRET));
- Boolean danceComplete = (Boolean) nodeService.getProperty(channelNode, PublishingModel.PROP_AUTHORISATION_COMPLETE);
-
- if (danceComplete)
- {
- OAuthToken token = new OAuthToken(tokenValue, tokenSecret);
- connection = connectionFactory.createConnection(token);
- }
- }
- return connection;
- }
-
- @Override
- public AuthUrlPair getAuthorisationUrls(Channel channel, String callbackUrl)
- {
- ParameterCheck.mandatory("channel", channel);
- ParameterCheck.mandatory("callbackUrl", callbackUrl);
- if (!getId().equals(channel.getChannelType().getId()))
- {
- throw new IllegalArgumentException("Invalid channel type: " + channel.getChannelType().getId());
- }
-
- NodeService nodeService = getNodeService();
- OAuth1Operations oauthOperations = getOAuth1Operations();
- OAuthToken requestToken = oauthOperations.fetchRequestToken(callbackUrl, null);
-
- NodeRef channelNodeRef = channel.getNodeRef();
- nodeService.setProperty(channelNodeRef, PublishingModel.PROP_OAUTH1_TOKEN_SECRET,
- getEncryptor().encrypt(PublishingModel.PROP_OAUTH1_TOKEN_SECRET, requestToken.getSecret()));
- nodeService.setProperty(channelNodeRef, PublishingModel.PROP_OAUTH1_TOKEN_VALUE,
- getEncryptor().encrypt(PublishingModel.PROP_OAUTH1_TOKEN_VALUE, requestToken.getValue()));
-
- String authUrl = oauthOperations.buildAuthorizeUrl(requestToken.getValue(), getOAuth1Parameters(callbackUrl));
- return new AuthUrlPair(authUrl, callbackUrl);
- }
-
- @Override
- protected AuthStatus internalAcceptAuthorisation(Channel channel, Map callbackHeaders,
- Map callbackParams)
- {
- NodeService nodeService = getNodeService();
- AuthStatus authorised = AuthStatus.UNAUTHORISED;
- String[] verifier = callbackParams.get(getOAuthVerifierParamName());
- if (verifier != null)
- {
- OAuth1Operations oauthOperations = getOAuth1Operations();
- NodeRef channelNodeRef = channel.getNodeRef();
-
- Map currentProps = nodeService.getProperties(channelNodeRef);
- String tokenValue = (String) getEncryptor().decrypt(PublishingModel.PROP_OAUTH1_TOKEN_VALUE, currentProps
- .get(PublishingModel.PROP_OAUTH1_TOKEN_VALUE));
- String tokenSecret = (String) getEncryptor().decrypt(PublishingModel.PROP_OAUTH1_TOKEN_SECRET, currentProps
- .get(PublishingModel.PROP_OAUTH1_TOKEN_SECRET));
- OAuthToken token = new OAuthToken(tokenValue, tokenSecret);
- OAuthToken accessToken = oauthOperations.exchangeForAccessToken(new AuthorizedRequestToken(token, verifier[0]), null);
-
- Map newProps = new HashMap();
- newProps.put(PublishingModel.PROP_OAUTH1_TOKEN_VALUE, accessToken.getValue());
- newProps.put(PublishingModel.PROP_OAUTH1_TOKEN_SECRET, accessToken.getSecret());
- newProps = getEncryptor().encrypt(newProps);
- getChannelService().updateChannel(channel, newProps);
- authorised = AuthStatus.AUTHORISED;
- }
- return authorised;
- }
-
- /**
- * Override this method to add additonal parameters onto the URL that the user is redirected to
- * to authorise access to their account. By default, no parameters are added, but this may be useful to
- * specify things such as the permissions being sought, and so on.
- * @param callbackUrl String
- * @return Do not return null. If no parameters are to be added, return {@link OAuth1Parameters#NONE}
- */
- protected OAuth1Parameters getOAuth1Parameters(String callbackUrl)
- {
- return OAuth1Parameters.NONE;
- }
-
- protected String getOAuthVerifierParamName()
- {
- return "oauth_verifier";
- }
-
- private OAuth1Operations getOAuth1Operations()
- {
- return connectionFactory.getOAuthOperations();
- }
-
- /**
- * @param connectionFactory the connectionFactory to set
- */
- public void setConnectionFactory(OAuth1ConnectionFactory connectionFactory)
- {
- this.connectionFactory = connectionFactory;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/org/alfresco/repo/publishing/ChannelHelper.java b/src/main/java/org/alfresco/repo/publishing/ChannelHelper.java
deleted file mode 100644
index b5f6872911..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/ChannelHelper.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-
-package org.alfresco.repo.publishing;
-
-import static org.alfresco.model.ContentModel.ASSOC_CONTAINS;
-import static org.alfresco.repo.publishing.PublishingModel.ASPECT_PUBLISHED;
-import static org.alfresco.repo.publishing.PublishingModel.ASSOC_SOURCE;
-import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL;
-import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL_TYPE;
-import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL_TYPE_ID;
-import static org.alfresco.repo.publishing.PublishingModel.TYPE_DELIVERY_CHANNEL;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.node.NodeUtils;
-import org.alfresco.service.ServiceRegistry;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.dictionary.PropertyDefinition;
-import org.alfresco.service.cmr.dictionary.TypeDefinition;
-import org.alfresco.service.cmr.model.FileFolderService;
-import org.alfresco.service.cmr.model.FileInfo;
-import org.alfresco.service.cmr.publishing.channels.Channel;
-import org.alfresco.service.cmr.publishing.channels.ChannelService;
-import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.repository.AssociationRef;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
-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.AccessStatus;
-import org.alfresco.service.cmr.security.PermissionService;
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.Pair;
-import org.alfresco.util.collections.CollectionUtils;
-import org.alfresco.util.collections.Filter;
-import org.alfresco.util.collections.Function;
-
-/**
- * @author Nick Smith
- * @since 4.0
- */
-public class ChannelHelper
-{
- public static final String NAME = "channelHelper";
-
- private NodeService nodeService;
- private DictionaryService dictionaryService;
- private FileFolderService fileFolderService;
- private PermissionService permissionService;
-
- private ServiceRegistry serviceRegistry;
- private PublishingEventHelper eventHelper;
-
- public ChannelHelper()
- {
- super();
- }
-
- public ChannelHelper(ServiceRegistry serviceRegistry, PublishingEventHelper eventHelper)
- {
- this.serviceRegistry = serviceRegistry;
- this.eventHelper = eventHelper;
- }
-
- public NodeRef createChannelNode(NodeRef parent, ChannelType channelType, String channelName,
- Map props)
- {
- QName channelQName = getChannelQName(channelName);
- QName channelNodeType = channelType.getChannelNodeType();
- ChildAssociationRef channelAssoc =
- nodeService.createNode(parent, ASSOC_CONTAINS, channelQName, channelNodeType, props);
- NodeRef channelNode = channelAssoc.getChildRef();
- // Allow any user to read Channel permissions.
- permissionService.setPermission(channelNode, PermissionService.ALL_AUTHORITIES, PermissionService.READ_ASSOCIATIONS, true);
- return channelNode;
- }
-
- public Channel buildChannelObject(NodeRef nodeRef, ChannelService channelService)
- {
- if (nodeRef == null || nodeService.exists(nodeRef) == false)
- {
- return null;
- }
- Map props = nodeService.getProperties(nodeRef);
- String channelTypeId = (String) props.get(PROP_CHANNEL_TYPE_ID);
- ChannelType channelType = channelService.getChannelType(channelTypeId);
- String name = (String) props.get(ContentModel.PROP_NAME);
- return new ChannelImpl(serviceRegistry, (AbstractChannelType) channelType, nodeRef, name, this, eventHelper);
- }
-
- /**
- * Given a noderef from the editorial space (e.g. the doclib), this returns the corresponding noderef published to the specified channel.
- * @param source NodeRef
- * @param channelNode NodeRef
- * @return NodeRef
- */
- public NodeRef mapSourceToEnvironment(NodeRef source, final NodeRef channelNode)
- {
- return mapSourceToEnvironment(source, channelNode, nodeService);
- }
-
- /**
- * Given a noderef from the editorial space (e.g. the doclib), this returns the corresponding noderef published to the specified channel.
- * @param source NodeRef
- * @param channelNode NodeRef
- * @param nodeService NodeService
- * @return NodeRef
- */
- public static NodeRef mapSourceToEnvironment(NodeRef source, final NodeRef channelNode, final NodeService nodeService)
- {
- if (source == null || channelNode == null)
- {
- return null;
- }
- List sourceAssocs = nodeService.getSourceAssocs(source, ASSOC_SOURCE);
- Function super AssociationRef, Boolean> acceptor = new Filter()
- {
- public Boolean apply(AssociationRef assoc)
- {
- NodeRef publishedNode = assoc.getSourceRef();
- NodeRef parent = nodeService.getPrimaryParent(publishedNode).getParentRef();
- return channelNode.equals(parent);
- }
- };
- AssociationRef assoc = CollectionUtils.findFirst(sourceAssocs, acceptor);
- return assoc == null ? null : assoc.getSourceRef();
- }
-
- /**
- * Given a published noderef, this returns the corresponding source noderef in the editorial space (doclib).
- * @param publishedNode NodeRef
- * @return NodeRef
- */
- public NodeRef mapEnvironmentToSource(NodeRef publishedNode)
- {
- return mapEnvironmentToSource(publishedNode, nodeService);
- }
-
- /**
- * Given a published noderef, this returns the corresponding source noderef in the editorial space (doclib).
- * @param publishedNode NodeRef
- * @param nodeService NodeService
- * @return NodeRef
- */
- public static NodeRef mapEnvironmentToSource(NodeRef publishedNode, NodeService nodeService)
- {
- List assocs = nodeService.getTargetAssocs(publishedNode, ASSOC_SOURCE);
- return NodeUtils.getSingleAssocNode(assocs, true);
- }
-
- /**
- * Finds the {@link Channel} NodeRef and {@link ChannelType} id for a given node, if such a Channel exists.
- * @param node NodeRef
- * @return a {@link Pair} containing the Channel {@link NodeRef} and ChannelType Id.
- */
- public Pair findChannelAndType(NodeRef node)
- {
- Pair result = getChannelAndTypeIfChannel(node);
- if (result == null)
- {
- result = getChannelAndType(node);
- if (result == null)
- {
- ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(node);
- if (parentAssoc != null)
- {
- NodeRef parent = parentAssoc.getParentRef();
- if (parent != null)
- {
- result = findChannelAndType(parent);
- }
- }
- }
- }
- return result;
- }
-
- public Map getChannelProperties(NodeRef channel)
- {
- return nodeService.getProperties(channel);
- }
-
- public AssociationRef createMapping(NodeRef source, NodeRef publishedNode)
- {
- AssociationRef assoc = nodeService.createAssociation(publishedNode, source, ASSOC_SOURCE);
- return assoc;
- }
-
- public boolean canPublish(NodeRef nodeToPublish, ChannelType type)
- {
- if (type.canPublish() == false)
- {
- return false;
- }
- FileInfo file = fileFolderService.getFileInfo(nodeToPublish);
- ContentData contentData = file.getContentData();
- String mimetype = contentData == null ? null : contentData.getMimetype();
- boolean isContentTypeSupported = isContentTypeSupported(file.getType(), type);
- boolean isMimetypeSupported = isMimetypeSupported(mimetype, type);
- return isContentTypeSupported && isMimetypeSupported;
- }
-
- private boolean isMimetypeSupported(String mimetype, ChannelType type)
- {
- Set supportedMimetypes = type.getSupportedMimeTypes();
- if (supportedMimetypes == null || supportedMimetypes.isEmpty())
- {
- return true;
- }
- return supportedMimetypes.contains(mimetype);
- }
-
- private boolean isContentTypeSupported(QName contentType, ChannelType type)
- {
- Set supportedContentTypes = type.getSupportedContentTypes();
- if (supportedContentTypes == null || supportedContentTypes.isEmpty())
- {
- return true;
- }
- for (QName supportedType : supportedContentTypes)
- {
- if (contentType.equals(supportedType)
- || dictionaryService.isSubClass(contentType, supportedType))
- {
- return true;
- }
- }
- return false;
- }
-
- private QName getChannelQName(String channelName)
- {
- return QName.createQName(NamespaceService.APP_MODEL_1_0_URI, channelName);
- }
-
- private Pair getChannelAndTypeIfChannel(NodeRef node)
- {
- QName type = nodeService.getType(node);
- if (dictionaryService.isSubClass(type, TYPE_DELIVERY_CHANNEL))
- {
- String channelTypeId = (String) nodeService.getProperty(node, PROP_CHANNEL_TYPE_ID);
- if (channelTypeId == null)
- {
- TypeDefinition typeDef = dictionaryService.getType(type);
- PropertyDefinition channelTypeProp = typeDef.getProperties().get(PROP_CHANNEL_TYPE_ID);
- if (channelTypeProp !=null)
- {
- channelTypeId = channelTypeProp.getDefaultValue();
- }
- }
- return new Pair(node, channelTypeId);
- }
- return null;
- }
-
- public List getAllChannels(NodeRef channelContainer, final ChannelService channelService)
- {
- List channelAssocs = getChannelAssocs(channelContainer);
- return CollectionUtils.transform(channelAssocs, getChannelTransformer(channelService, false));
- }
-
-
- public List getChannelsForTypes(final NodeRef containerNode, List types, final ChannelService channelService, final boolean checkPermissions)
- {
- return CollectionUtils.transformFlat(types, new Function>()
- {
- public List apply(ChannelType channelType)
- {
- return getChannelsByType(containerNode, channelType.getId(), channelService, checkPermissions);
- }
- });
- }
-
- public List getChannelsByType(NodeRef containerNode, String channelTypeId, ChannelService channelService, boolean checkPermissions)
- {
- List channelAssocs = getChannelAssocsByType(containerNode, channelTypeId);
- return CollectionUtils.transform(channelAssocs, getChannelTransformer(channelService, checkPermissions));
- }
-
- public List filterAuthorisedChannels(Collection channels)
- {
- return CollectionUtils.filter(channels, new Filter()
- {
- @Override
- public Boolean apply(Channel value)
- {
- return value.isAuthorised();
- }
- });
- }
-
- public List getReleventChannelTypes(final NodeRef nodeToPublish, Collection channelTypes)
- {
- return CollectionUtils.filter(channelTypes, new Filter()
- {
- public Boolean apply(ChannelType type)
- {
- return canPublish(nodeToPublish, type);
- }
- });
- }
-
- public List getStatusUpdateChannelTypes(Collection channelTypes)
- {
- return CollectionUtils.filter(channelTypes, new Filter()
- {
- public Boolean apply(ChannelType type)
- {
- return type.canPublishStatusUpdates();
- }
- });
- }
-
- public void addPublishedAspect(NodeRef publishedNode, NodeRef channelNode)
- {
- nodeService.addAspect(publishedNode, ASPECT_PUBLISHED, null);
- }
-
- private List getChannelAssocs(NodeRef channelContainer)
- {
- if (channelContainer == null)
- {
- return null;
- }
- Collection channelNodeTypes = dictionaryService.getSubTypes(TYPE_DELIVERY_CHANNEL, true);
- HashSet childNodeTypeQNames = new HashSet(channelNodeTypes);
- return nodeService.getChildAssocs(channelContainer, childNodeTypeQNames);
- }
-
- private List getChannelAssocsByType(NodeRef channelContainer, String channelTypeId)
- {
- if (channelContainer == null)
- {
- return null;
- }
- return nodeService.getChildAssocsByPropertyValue(channelContainer, PROP_CHANNEL_TYPE_ID, channelTypeId);
- }
-
- private Pair getChannelAndType(NodeRef node)
- {
- NodeRef channel = (NodeRef) nodeService.getProperty(node, PROP_CHANNEL);
- if (channel != null)
- {
- String channelType = (String) nodeService.getProperty(node, PROP_CHANNEL_TYPE);
- return new Pair(channel, channelType);
- }
- return null;
- }
-
- private Function getChannelTransformer(final ChannelService channelService, final boolean checkPermissions)
- {
- return new Function()
- {
- public Channel apply(ChildAssociationRef value)
- {
- NodeRef channelNode = value.getChildRef();
- if (checkPermissions && hasPublishPermissions(channelNode)==false)
- {
- return null;
- }
- return buildChannelObject(channelNode, channelService);
- }
- };
- }
-
- public boolean hasPublishPermissions(NodeRef channelNode)
- {
- AccessStatus access = permissionService.hasPermission(channelNode, PermissionService.ADD_CHILDREN);
- return AccessStatus.ALLOWED == access;
- }
-
- public boolean isChannelAuthorised(NodeRef channelNode)
- {
- Boolean isAuthorised = Boolean.FALSE;
- if (nodeService.exists(channelNode))
- {
- isAuthorised = (Boolean)nodeService.getProperty(channelNode, PublishingModel.PROP_AUTHORISATION_COMPLETE);
- }
- return isAuthorised;
- }
-
- /**
- * @param nodeService the nodeService to set
- */
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
-
- /**
- * @param dictionaryService the dictionaryService to set
- */
- public void setDictionaryService(DictionaryService dictionaryService)
- {
- this.dictionaryService = dictionaryService;
- }
-
- /**
- * @param fileFolderService the fileFolderService to set
- */
- public void setFileFolderService(FileFolderService fileFolderService)
- {
- this.fileFolderService = fileFolderService;
- }
-
- /**
- * @param permissionService the permissionService to set
- */
- public void setPermissionService(PermissionService permissionService)
- {
- this.permissionService = permissionService;
- }
-
- public void setServiceRegistry(ServiceRegistry serviceRegistry)
- {
- this.serviceRegistry = serviceRegistry;
- }
-
- public void setEventHelper(PublishingEventHelper eventHelper)
- {
- this.eventHelper = eventHelper;
- }
-}
diff --git a/src/main/java/org/alfresco/repo/publishing/ChannelImpl.java b/src/main/java/org/alfresco/repo/publishing/ChannelImpl.java
deleted file mode 100644
index d3a9fe302c..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/ChannelImpl.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-
-package org.alfresco.repo.publishing;
-
-import static org.alfresco.repo.publishing.PublishingModel.ASPECT_PUBLISHED;
-import static org.alfresco.repo.publishing.PublishingModel.ASSOC_LAST_PUBLISHING_EVENT;
-import static org.alfresco.repo.publishing.PublishingModel.NAMESPACE;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.node.NodeUtils;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
-import org.alfresco.repo.security.permissions.AccessDeniedException;
-import org.alfresco.service.ServiceRegistry;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.publishing.NodeSnapshot;
-import org.alfresco.service.cmr.publishing.PublishingEvent;
-import org.alfresco.service.cmr.publishing.PublishingPackageEntry;
-import org.alfresco.service.cmr.publishing.channels.Channel;
-import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.service.namespace.RegexQNamePattern;
-import org.alfresco.util.GUID;
-import org.alfresco.util.ParameterCheck;
-
-/**
- * @author Brian
- * @author Nick Smith
- * @since 4.0
- */
-public class ChannelImpl implements Channel
-{
- private static final String PERMISSIONS_ERR_ACCESS_DENIED = "permissions.err_access_denied";
- private final NodeRef nodeRef;
- private final AbstractChannelType channelType;
- private final String name;
- private final ChannelHelper channelHelper;
- private final NodeService nodeService;
- private final DictionaryService dictionaryService;
- private final PublishingEventHelper eventHelper;
-
-
- public ChannelImpl(ServiceRegistry serviceRegistry, AbstractChannelType channelType, NodeRef nodeRef, String name,
- ChannelHelper channelHelper, PublishingEventHelper eventHelper)
- {
- this.nodeRef = nodeRef;
- this.channelType = channelType;
- this.name = name;
- this.channelHelper = channelHelper;
- this.nodeService = serviceRegistry.getNodeService();
- this.dictionaryService = serviceRegistry.getDictionaryService();
- this.eventHelper = eventHelper;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getId()
- {
- return nodeRef.toString();
- }
-
- /**
- * {@inheritDoc}
- */
- public ChannelType getChannelType()
- {
- return channelType;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * {@inheritDoc}
- */
- public NodeRef getNodeRef()
- {
- return nodeRef;
- }
-
- /**
- * {@inheritDoc}
- */
- public Map getProperties()
- {
- return channelHelper.getChannelProperties(nodeRef);
- }
-
- public void publishEvent(PublishingEvent event)
- {
- NodeRef eventNode = eventHelper.getPublishingEventNode(event.getId());
- for (PublishingPackageEntry entry : event.getPackage().getEntries())
- {
- if (entry.isPublish())
- {
- publishEntry(entry, eventNode);
- }
- else
- {
- unpublishEntry(entry);
- }
- }
- }
-
- public void unpublishEntry(final PublishingPackageEntry entry)
- {
- final NodeRef channelNode = getNodeRef();
- if (channelHelper.hasPublishPermissions(channelNode))
- {
- AuthenticationUtil.runAsSystem(new RunAsWork()
- {
- @Override
- public NodeRef doWork() throws Exception
- {
- NodeRef unpublishedNode = channelHelper.mapSourceToEnvironment(entry.getNodeRef(), channelNode);
- if (NodeUtils.exists(unpublishedNode, nodeService))
- {
- unpublish(unpublishedNode);
- // Need to set as temporary to delete node instead of archiving.
- nodeService.addAspect(unpublishedNode, ContentModel.ASPECT_TEMPORARY, null);
- nodeService.deleteNode(unpublishedNode);
- }
- return unpublishedNode;
- }
- });
- }
- }
-
- public NodeRef publishEntry(final PublishingPackageEntry entry, final NodeRef eventNode)
- {
- NodeRef publishedNode;
- //We decouple the permissions needed to publish from the permissions needed to do what's
- //necessary to actually do the publish. If that makes sense...
- //For example, a user may be able to publish to a channel even if they do not have permission
- //to add an aspect to a published node (which is a necessary part of the publishing process).
- if (channelHelper.hasPublishPermissions(getNodeRef()))
- {
- publishedNode = AuthenticationUtil.runAsSystem(new RunAsWork()
- {
- @Override
- public NodeRef doWork() throws Exception
- {
- NodeRef publishedNode = channelHelper.mapSourceToEnvironment(entry.getNodeRef(), getNodeRef());
- if (publishedNode == null)
- {
- publishedNode = publishNewNode(getNodeRef(), entry.getSnapshot());
- }
- else
- {
- updatePublishedNode(publishedNode, entry);
- }
- eventHelper.linkToLastEvent(publishedNode, eventNode);
- publish(publishedNode);
- return publishedNode;
- }
- });
- }
- else
- {
- throw new AccessDeniedException(PERMISSIONS_ERR_ACCESS_DENIED);
- }
- return publishedNode;
- }
-
- /**
- * Creates a new node under the root of the specified channel. The type,
- * aspects and properties of the node are determined by the supplied
- * snapshot.
- *
- * @param channel NodeRef
- * @param snapshot NodeSnapshot
- * @return the newly published node.
- */
- private NodeRef publishNewNode(NodeRef channel, NodeSnapshot snapshot)
- {
- ParameterCheck.mandatory("channel", channel);
- ParameterCheck.mandatory("snapshot", snapshot);
-
- NodeRef publishedNode = createPublishedNode(channel, snapshot);
- addAspects(publishedNode, snapshot.getAspects());
- NodeRef source = snapshot.getNodeRef();
- channelHelper.createMapping(source, publishedNode);
- return publishedNode;
- }
-
- private void updatePublishedNode(NodeRef publishedNode, PublishingPackageEntry entry)
- {
- NodeSnapshot snapshot = entry.getSnapshot();
- Set newAspects = snapshot.getAspects();
- removeUnwantedAspects(publishedNode, newAspects);
-
- Map snapshotProps = snapshot.getProperties();
- removeUnwantedProperties(publishedNode, snapshotProps);
-
- // Add new properties
- Map newProps= new HashMap(snapshotProps);
- newProps.remove(ContentModel.PROP_NODE_UUID);
- nodeService.setProperties(publishedNode, snapshotProps);
-
- // Add new aspects
- addAspects(publishedNode, newAspects);
-
- List assocs = nodeService.getChildAssocs(publishedNode, ASSOC_LAST_PUBLISHING_EVENT, RegexQNamePattern.MATCH_ALL);
- for (ChildAssociationRef assoc : assocs)
- {
- nodeService.removeChildAssociation(assoc);
- }
- }
-
- /**
- * @param publishedNode NodeRef
- * @param snapshotProps Map
- */
- private void removeUnwantedProperties(NodeRef publishedNode, Map snapshotProps)
- {
- Map publishProps = nodeService.getProperties(publishedNode);
- Set propsToRemove = new HashSet(publishProps.keySet());
- propsToRemove.removeAll(snapshotProps.keySet());
-
- //We want to retain the published asset id and URL in the updated node...
- snapshotProps.put(PublishingModel.PROP_ASSET_ID, nodeService.getProperty(publishedNode,
- PublishingModel.PROP_ASSET_ID));
- snapshotProps.put(PublishingModel.PROP_ASSET_URL, nodeService.getProperty(publishedNode,
- PublishingModel.PROP_ASSET_URL));
-
- for (QName propertyToRemove : propsToRemove)
- {
- nodeService.removeProperty(publishedNode, propertyToRemove);
- }
- }
-
- /**
- * @param publishedNode NodeRef
- * @param newAspects Set
- */
- private void removeUnwantedAspects(NodeRef publishedNode, Set newAspects)
- {
- Set aspectsToRemove = nodeService.getAspects(publishedNode);
- aspectsToRemove.removeAll(newAspects);
- aspectsToRemove.remove(ASPECT_PUBLISHED);
- aspectsToRemove.remove(PublishingModel.ASPECT_ASSET);
- for (QName publishedAssetAspect : dictionaryService.getSubAspects(PublishingModel.ASPECT_ASSET, true))
- {
- aspectsToRemove.remove(publishedAssetAspect);
- }
-
- for (QName aspectToRemove : aspectsToRemove)
- {
- nodeService.removeAspect(publishedNode, aspectToRemove);
- }
- }
-
- private void addAspects(NodeRef publishedNode, Collection aspects)
- {
- Set currentAspects = nodeService.getAspects(publishedNode);
- for (QName aspect : aspects)
- {
- if (currentAspects.contains(aspect) == false)
- {
- nodeService.addAspect(publishedNode, aspect, null);
- }
- }
- }
-
- private NodeRef createPublishedNode(NodeRef root, NodeSnapshot snapshot)
- {
- QName type = snapshot.getType();
- Map actualProps = getPropertiesToPublish(snapshot);
- String name = (String) actualProps.get(ContentModel.PROP_NAME);
- if (name == null)
- {
- name = GUID.generate();
- }
- QName assocName = QName.createQName(NAMESPACE, name);
- ChildAssociationRef publishedAssoc = nodeService.createNode(root, PublishingModel.ASSOC_PUBLISHED_NODES, assocName, type, actualProps);
- NodeRef publishedNode = publishedAssoc.getChildRef();
- return publishedNode;
- }
-
- private Map getPropertiesToPublish(NodeSnapshot snapshot)
- {
- Map properties = snapshot.getProperties();
- // Remove the Node Ref Id
- Map actualProps = new HashMap(properties);
- actualProps.remove(ContentModel.PROP_NODE_UUID);
- return actualProps;
- }
-
-
- private void publish(NodeRef nodeToPublish)
- {
- if (channelHelper.canPublish(nodeToPublish, channelType))
- {
- channelHelper.addPublishedAspect(nodeToPublish, nodeRef);
- channelType.publish(nodeToPublish, getProperties());
- }
- }
-
- private void unpublish(NodeRef nodeToUnpublish)
- {
- if (channelType.canUnpublish())
- {
- channelType.unpublish(nodeToUnpublish, getProperties());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void sendStatusUpdate(String status, String nodeUrl)
- {
- if (channelType.canPublishStatusUpdates())
- {
- int urlLength = nodeUrl == null ? 0 : nodeUrl.length();
- int maxLength = channelType.getMaximumStatusLength() - urlLength;
- if (maxLength > 0)
- {
- int endpoint = Math.min(maxLength, status.length());
- status = status.substring(0, endpoint );
- }
- String msg = nodeUrl == null ? status : status + nodeUrl;
- channelType.sendStatusUpdate(this, msg);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public String getUrl(NodeRef publishedNode)
- {
- NodeRef mappedNode = channelHelper.mapSourceToEnvironment(publishedNode, nodeRef);
- return channelType.getNodeUrl(mappedNode);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAuthorised()
- {
- return channelHelper.isChannelAuthorised(nodeRef);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean canPublish()
- {
- return channelType.canPublish() &&
- isAuthorised() &&
- channelHelper.hasPublishPermissions(nodeRef);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean canUnpublish()
- {
- return channelType.canPublish() &&
- isAuthorised() &&
- channelHelper.hasPublishPermissions(nodeRef);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean canPublishStatusUpdates()
- {
- return channelType.canPublish() &&
- isAuthorised() &&
- channelHelper.hasPublishPermissions(nodeRef);
- }
-}
diff --git a/src/main/java/org/alfresco/repo/publishing/ChannelServiceImpl.java b/src/main/java/org/alfresco/repo/publishing/ChannelServiceImpl.java
deleted file mode 100644
index 0c3bd8df0c..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/ChannelServiceImpl.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-
-package org.alfresco.repo.publishing;
-
-import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL_TYPE_ID;
-import static org.alfresco.repo.publishing.PublishingModel.TYPE_DELIVERY_CHANNEL;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.node.encryption.MetadataEncryptor;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.publishing.channels.Channel;
-import org.alfresco.service.cmr.publishing.channels.ChannelService;
-import org.alfresco.service.cmr.publishing.channels.ChannelType;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ParameterCheck;
-import org.alfresco.util.collections.CollectionUtils;
-import org.alfresco.util.collections.Filter;
-
-/**
- * @author Nick Smith
- * @author Brian
- * @since 4.0
- */
-public class ChannelServiceImpl implements ChannelService
-{
- public static final String NAME = "ChannelService";
-
- private final Map channelTypes = new TreeMap();
- private NodeService nodeService;
- private DictionaryService dictionaryService;
- private ChannelHelper channelHelper;
- private PublishingRootObject rootObject;
- private MetadataEncryptor encryptor;
-
- /**
- * @param nodeService
- * the nodeService to set
- */
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
-
- /**
- * @param dictionaryService
- * the dictionaryService to set
- */
- public void setDictionaryService(DictionaryService dictionaryService)
- {
- this.dictionaryService = dictionaryService;
- }
-
- /**
- * @param rootObject the rootObject to set
- */
- public void setPublishingRootObject(PublishingRootObject rootObject)
- {
- this.rootObject = rootObject;
- }
-
- /**
- * @param channelHelper the channelHelper to set
- */
- public void setChannelHelper(ChannelHelper channelHelper)
- {
- this.channelHelper = channelHelper;
- }
-
- public void setEncryptor(MetadataEncryptor encryptor)
- {
- this.encryptor = encryptor;
- }
-
- /**
- * {@inheritDoc}
- */
- public void register(AbstractChannelType channelType)
- {
- ParameterCheck.mandatory("channelType", channelType);
- String id = channelType.getId();
- if (channelTypes.containsKey(id))
- {
- throw new IllegalArgumentException("Channel type " + id + " is already registered!");
- }
- channelTypes.put(id, channelType);
- }
-
- /**
- * {@inheritDoc}
- */
- public List getChannelTypes()
- {
- List result = new ArrayList();
- for (ChannelType channelType : channelTypes.values())
- {
- if (!channelType.isHidden())
- {
- result.add(channelType);
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public Channel createChannel(String channelTypeId, String name, Map properties)
- {
- NodeRef channelContainer = getChannelContainer();
- ChannelType channelType = channelTypes.get(channelTypeId);
- if (channelType == null)
- {
- String message = "Channel Type: " + channelTypeId + " does not exist!";
- throw new IllegalArgumentException(message);
- }
- Map actualProps = new HashMap();
- if (properties != null)
- {
- actualProps.putAll(properties);
- }
- actualProps.put(ContentModel.PROP_NAME, name);
- actualProps.put(PROP_CHANNEL_TYPE_ID, channelType.getId());
- actualProps.put(PublishingModel.PROP_AUTHORISATION_COMPLETE, Boolean.FALSE);
- actualProps = encryptor.encrypt(actualProps);
- NodeRef channelNode = channelHelper.createChannelNode(channelContainer, channelType, name, actualProps);
- return channelHelper.buildChannelObject(channelNode, this);
- }
-
- /**
- * {@inheritDoc}
- */
- public void deleteChannel(Channel channel)
- {
- nodeService.deleteNode(channel.getNodeRef());
- }
-
- /**
- * {@inheritDoc}
- */
- public List getChannels()
- {
- NodeRef channelContainer = getChannelContainer();
- return channelHelper.getAllChannels(channelContainer, this);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Channel getChannelByName(String channelName)
- {
- NodeRef node = getChannelNodeByName(channelName);
- return channelHelper.buildChannelObject(node, this);
- }
-
- private NodeRef getChannelNodeByName(String channelName)
- {
- ParameterCheck.mandatory("channelName", channelName);
-
- NodeRef channelContainer = getChannelContainer();
- if (channelContainer == null)
- {
- return null;
- }
-
- NodeRef child = nodeService.getChildByName(channelContainer, ContentModel.ASSOC_CONTAINS, channelName);
- if (child != null)
- {
- QName type = nodeService.getType(child);
- if (dictionaryService.isSubClass(type, TYPE_DELIVERY_CHANNEL))
- {
- return child;
- }
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public List getRelevantPublishingChannels(NodeRef nodeToPublish)
- {
- NodeRef containerNode = getChannelContainer();
- List types = channelHelper.getReleventChannelTypes(nodeToPublish, channelTypes.values());
- List channels = channelHelper.getChannelsForTypes(containerNode, types, this, true);
- return channelHelper.filterAuthorisedChannels(channels);
- }
-
- /**
- * {@inheritDoc}
- */
- public List getPublishingChannels(boolean filterByPublishPermission)
- {
- final NodeRef containerNode = getChannelContainer();
- if (containerNode != null)
- {
- List types = CollectionUtils.filter(channelTypes.values(), new Filter()
- {
- public Boolean apply(ChannelType type)
- {
- return type.canPublish();
- }
- });
- return channelHelper.getChannelsForTypes(containerNode, types, this, filterByPublishPermission);
- }
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- */
- public List getStatusUpdateChannels(boolean filterByPublishPermission)
- {
- final NodeRef containerNode = getChannelContainer();
- if (containerNode != null)
- {
- List types = channelHelper.getStatusUpdateChannelTypes(channelTypes.values());
- return channelHelper.getChannelsForTypes(containerNode, types, this, filterByPublishPermission);
- }
- return Collections.emptyList();
- }
-
- public List getAuthorisedStatusUpdateChannels()
- {
- return channelHelper.filterAuthorisedChannels(getStatusUpdateChannels(false));
- }
-
- private NodeRef getChannelContainer()
- {
- return rootObject.getChannelContainer();
- }
-
- /**
- * {@inheritDoc}
- */
- public ChannelType getChannelType(String id)
- {
- return channelTypes.get(id);
- }
-
- /**
- * {@inheritDoc}
- */
- public void renameChannel(Channel channel, String newName)
- {
- NodeRef channelNode = channel.getNodeRef();
- if (channelNode != null && nodeService.exists(channelNode))
- {
- NodeRef channelContainer = getChannelContainer();
- nodeService.setProperty(channelNode, ContentModel.PROP_NAME, newName);
- nodeService.moveNode(channelNode, channelContainer, ContentModel.ASSOC_CONTAINS,
- QName.createQName(NamespaceService.APP_MODEL_1_0_URI, newName));
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void updateChannel(Channel channel, Map properties)
- {
- Map actualProps = new HashMap(properties);
- actualProps.remove(ContentModel.PROP_NODE_UUID);
- NodeRef editorialNode = new NodeRef(channel.getId());
- actualProps = encryptor.encrypt(actualProps);
- for (Map.Entry entry : actualProps.entrySet())
- {
- nodeService.setProperty(editorialNode, entry.getKey(), entry.getValue());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public Channel getChannelById(String id)
- {
- if (id != null && NodeRef.isNodeRef(id))
- {
- NodeRef node = new NodeRef(id);
- return channelHelper.buildChannelObject(node, this);
- }
- return null;
- }
-
-}
diff --git a/src/main/java/org/alfresco/repo/publishing/ChannelTypePublishingOperations.java b/src/main/java/org/alfresco/repo/publishing/ChannelTypePublishingOperations.java
deleted file mode 100644
index b48915e0cb..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/ChannelTypePublishingOperations.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-package org.alfresco.repo.publishing;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.namespace.QName;
-
-public interface ChannelTypePublishingOperations
-{
- void publish(NodeRef nodeToPublish, Map channelProperties);
- void unpublish(NodeRef nodeToUnpublish, Map channelProperties);
-}
diff --git a/src/main/java/org/alfresco/repo/publishing/Environment.java b/src/main/java/org/alfresco/repo/publishing/Environment.java
deleted file mode 100644
index 8f037c5d84..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/Environment.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-
-package org.alfresco.repo.publishing;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * @author Brian
- * @author Nick Smith
- * @since 4.0
- */
-public class Environment
-{
- private final NodeRef nodeRef;
- private final PublishingQueueImpl queue;
- private final NodeRef channelsContainer;
-
- public Environment(NodeRef nodeRef, PublishingQueueImpl queue, NodeRef channelsContainer)
- {
- this.nodeRef = nodeRef;
- this.queue = queue;
- this.channelsContainer = channelsContainer;
- }
-
- public PublishingQueueImpl getPublishingQueue()
- {
- return queue;
- }
-
- /**
- * @return the channelsContainer
- */
- public NodeRef getChannelsContainer()
- {
- return channelsContainer;
- }
-
- public NodeRef getNodeRef()
- {
- return nodeRef;
- }
-}
diff --git a/src/main/java/org/alfresco/repo/publishing/JaxbHttpMessageConverter.java b/src/main/java/org/alfresco/repo/publishing/JaxbHttpMessageConverter.java
deleted file mode 100644
index e5cc5fdd4e..0000000000
--- a/src/main/java/org/alfresco/repo/publishing/JaxbHttpMessageConverter.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-package org.alfresco.repo.publishing;
-
-import java.io.IOException;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.MarshalException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.core.annotation.AnnotationUtils;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.http.converter.HttpMessageConversionException;
-import org.springframework.http.converter.HttpMessageNotReadableException;
-import org.springframework.http.converter.HttpMessageNotWritableException;
-import org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter;
-import org.springframework.util.Assert;
-import org.springframework.util.ClassUtils;
-
-/**
- * @author Brian
- * @since 4.0
- */
-public class JaxbHttpMessageConverter extends AbstractXmlHttpMessageConverter