mirror of
				https://github.com/Alfresco/alfresco-community-repo.git
				synced 2025-10-22 15:12:38 +00:00 
			
		
		
		
	Merged WEBAPP-API (5.2.1) to 5.2.N (5.2.1)
133081 jkaabimofrad: APPSREPO-61: First cut of automatic time expiry enhancement to the quick-sharing functionality. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133216 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
		| @@ -28,6 +28,7 @@ package org.alfresco.service.cmr.action.scheduled; | ||||
| import java.util.List; | ||||
|  | ||||
| import org.alfresco.service.cmr.action.Action; | ||||
| import org.alfresco.service.cmr.repository.NodeRef; | ||||
|  | ||||
| /** | ||||
|  * A service which handles the scheduling of the | ||||
| @@ -64,6 +65,12 @@ public interface ScheduledPersistedActionService | ||||
|     *  null if it isn't currently scheduled.  | ||||
|     */ | ||||
|    public ScheduledPersistedAction getSchedule(Action persistedAction); | ||||
|  | ||||
|    /** | ||||
|     * Returns the schedule for the specified action nodeRef, or | ||||
|     * null if it isn't currently scheduled. | ||||
|     */ | ||||
|    public ScheduledPersistedAction getSchedule(NodeRef persistedActionNodeRef); | ||||
|     | ||||
|    /** | ||||
|     * Returns all currently scheduled actions. | ||||
|   | ||||
| @@ -26,6 +26,7 @@ | ||||
| package org.alfresco.service.cmr.quickshare; | ||||
|  | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * Data transfer object for holding quick share information. | ||||
| @@ -38,6 +39,7 @@ public class QuickShareDTO implements Serializable | ||||
|     private static final long serialVersionUID = -2163618127531335360L; | ||||
|  | ||||
|     private String sharedId; | ||||
|     private Date expiresAt; | ||||
|  | ||||
|     /** | ||||
|      * Default constructor | ||||
| @@ -45,8 +47,14 @@ public class QuickShareDTO implements Serializable | ||||
|      * @param sharedId The quick share id | ||||
|      */ | ||||
|     public QuickShareDTO(String sharedId) | ||||
|     { | ||||
|         this(sharedId, null); | ||||
|     } | ||||
|  | ||||
|     public QuickShareDTO(String sharedId, Date expiresAt) | ||||
|     { | ||||
|         this.sharedId = sharedId; | ||||
|         this.expiresAt = expiresAt; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -54,7 +62,7 @@ public class QuickShareDTO implements Serializable | ||||
|      */ | ||||
|     public QuickShareDTO(QuickShareDTO from)  | ||||
|     { | ||||
|         this(from.getId()); | ||||
|         this(from.getId(), from.getExpiresAt()); | ||||
|     } | ||||
|      | ||||
|     /** | ||||
| @@ -64,4 +72,9 @@ public class QuickShareDTO implements Serializable | ||||
|     { | ||||
|         return this.sharedId; | ||||
|     } | ||||
|  | ||||
|     public Date getExpiresAt() | ||||
|     { | ||||
|         return expiresAt; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,62 @@ | ||||
| /* | ||||
|  * #%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 <http://www.gnu.org/licenses/>. | ||||
|  * #L% | ||||
|  */ | ||||
|  | ||||
| package org.alfresco.service.cmr.quickshare; | ||||
|  | ||||
| import org.alfresco.service.cmr.action.Action; | ||||
| import org.alfresco.service.cmr.action.scheduled.SchedulableAction; | ||||
| import org.alfresco.service.cmr.action.scheduled.ScheduledPersistedAction; | ||||
| import org.alfresco.service.namespace.QName; | ||||
|  | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * This interface defines the details for a quick share link expiry action. | ||||
|  * | ||||
|  * @author Jamal Kaabi-Mofrad | ||||
|  */ | ||||
| public interface QuickShareLinkExpiryAction extends Action, SchedulableAction, Serializable | ||||
| { | ||||
|     /** | ||||
|      * Gets the quick share sharedId. | ||||
|      */ | ||||
|     String getSharedId(); | ||||
|  | ||||
|     /** | ||||
|      * Gets the qualified name which uniquely identifies this quick share link expiry action. | ||||
|      */ | ||||
|     QName getActionQName(); | ||||
|  | ||||
|     /** | ||||
|      * Gets the schedule ({@link ScheduledPersistedAction} used to get the trigger details. | ||||
|      */ | ||||
|     ScheduledPersistedAction getSchedule(); | ||||
|  | ||||
|     /** | ||||
|      * Sets the schedule ({@link ScheduledPersistedAction} used to set the trigger details. | ||||
|      */ | ||||
|     void setSchedule(ScheduledPersistedAction schedule); | ||||
| } | ||||
| @@ -0,0 +1,92 @@ | ||||
| /* | ||||
|  * #%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 <http://www.gnu.org/licenses/>. | ||||
|  * #L% | ||||
|  */ | ||||
|  | ||||
| package org.alfresco.service.cmr.quickshare; | ||||
|  | ||||
| import org.alfresco.service.cmr.repository.NodeRef; | ||||
| import org.alfresco.service.namespace.QName; | ||||
|  | ||||
| /** | ||||
|  * This interface defines the persistence and the retrieval of {@link QuickShareLinkExpiryAction} actions. | ||||
|  * | ||||
|  * @author Jamal Kaabi-Mofrad | ||||
|  */ | ||||
| public interface QuickShareLinkExpiryActionPersister | ||||
| { | ||||
|     /** | ||||
|      * Serializes the {@link QuickShareLinkExpiryAction} and stores it in | ||||
|      * the repository. The {@link QuickShareLinkExpiryAction}s saved in this way maybe | ||||
|      * retrieved using the <code>load()</code> method. | ||||
|      * | ||||
|      * @param linkExpiryAction The {@link QuickShareLinkExpiryAction} to be persisted. | ||||
|      */ | ||||
|     void saveQuickShareLinkExpiryAction(QuickShareLinkExpiryAction linkExpiryAction); | ||||
|  | ||||
|     /** | ||||
|      * Retrieves a {@link QuickShareLinkExpiryAction} that has been stored | ||||
|      * in the repository using the <code>save()</code> method. If no | ||||
|      * {@link QuickShareLinkExpiryAction} exists in the repository with the specified | ||||
|      * QName then this method returns null. | ||||
|      * | ||||
|      * @param linkExpiryActionName The unique identifier used to specify the | ||||
|      *                             {@link QuickShareLinkExpiryAction} to retrieve. | ||||
|      * @return The NodeRef of the specified {@link QuickShareLinkExpiryAction} or null. | ||||
|      */ | ||||
|     NodeRef getQuickShareLinkExpiryActionNode(QName linkExpiryActionName); | ||||
|  | ||||
|     /** | ||||
|      * Retrieves a {@link QuickShareLinkExpiryAction} that has been stored | ||||
|      * in the repository using the <code>save()</code> method. If no | ||||
|      * {@link QuickShareLinkExpiryAction} exists in the repository with the specified | ||||
|      * QName then this method returns null. | ||||
|      * | ||||
|      * @param linkExpiryActionName The unique identifier used to specify the | ||||
|      *                             {@link QuickShareLinkExpiryAction} to retrieve. | ||||
|      * @return The specified {@link QuickShareLinkExpiryAction} or null. | ||||
|      */ | ||||
|     QuickShareLinkExpiryAction loadQuickShareLinkExpiryAction(QName linkExpiryActionName); | ||||
|  | ||||
|     /** | ||||
|      * Retrieves a {@link QuickShareLinkExpiryAction} that has been stored | ||||
|      * in the repository using the <code>save()</code> method. If no | ||||
|      * {@link QuickShareLinkExpiryAction} exists in the repository with the specified | ||||
|      * QName then this method returns null. | ||||
|      * | ||||
|      * @param linkExpiryActionNodeRef The nodeRef of the | ||||
|      *                                {@link QuickShareLinkExpiryAction} to retrieve. | ||||
|      * @return The specified {@link QuickShareLinkExpiryAction} or null. | ||||
|      */ | ||||
|     QuickShareLinkExpiryAction loadQuickShareLinkExpiryAction(NodeRef linkExpiryActionNodeRef); | ||||
|  | ||||
|     /** | ||||
|      * Removes the previously serialized {@link QuickShareLinkExpiryAction} | ||||
|      * from the repository. The {@link QuickShareLinkExpiryAction} will then no longer | ||||
|      * be available using the load methods. | ||||
|      * | ||||
|      * @param linkExpiryAction The {@link QuickShareLinkExpiryAction} to be deleted. | ||||
|      */ | ||||
|     void deleteQuickShareLinkExpiryAction(QuickShareLinkExpiryAction linkExpiryAction); | ||||
| } | ||||
| @@ -25,6 +25,7 @@ | ||||
|  */ | ||||
| package org.alfresco.service.cmr.quickshare; | ||||
|  | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
|  | ||||
| import org.alfresco.repo.quickshare.QuickShareServiceImpl.QuickShareEmailRequest; | ||||
| @@ -50,6 +51,15 @@ public interface QuickShareService | ||||
|      */ | ||||
|     public QuickShareDTO shareContent(NodeRef nodeRef) throws QuickShareDisabledException, InvalidNodeRefException; | ||||
|  | ||||
|     /** | ||||
|      * Share content identified by nodeRef and optionally set an expiry date for the shared link. | ||||
|      * | ||||
|      * @param nodeRef The NodeRef of the content to share | ||||
|      * @param expiryDate The expiry date of the shared link | ||||
|      * @return QuickDTO with details of the share | ||||
|      */ | ||||
|     QuickShareDTO shareContent(NodeRef nodeRef, Date expiryDate) throws QuickShareDisabledException, InvalidNodeRefException; | ||||
|  | ||||
|     /** | ||||
|      * Get QuickShare related metadata for the given node. | ||||
|      *   | ||||
| @@ -105,4 +115,12 @@ public interface QuickShareService | ||||
|      * @since 5.2 | ||||
|      */ | ||||
|     boolean isQuickShareEnabled(); | ||||
|  | ||||
|     /** | ||||
|      * Removes (hard deletes) the previously persisted {@link QuickShareLinkExpiryAction} and its related | ||||
|      * schedule {@link org.alfresco.service.cmr.action.scheduled.ScheduledPersistedAction} from the repository. | ||||
|      * | ||||
|      * @param quickShareLinkExpiryAction The {@link QuickShareLinkExpiryAction} to be deleted. | ||||
|      */ | ||||
|     void deleteQuickShareLinkExpiryAction(QuickShareLinkExpiryAction quickShareLinkExpiryAction); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user