mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
121139 jvonka: FileFolder API - create/delete Public/Quick share link - TODO ability to access content + limited metadata (also add sanity tests) - ... for now can 'demo' access to link via existing APIs &/or Share ;-) RA-708 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126399 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -408,7 +408,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="nodeRatings" class="org.alfresco.rest.api.impl.NodeRatingsImpl">
|
<bean id="nodeRatings" class="org.alfresco.rest.api.impl.NodeRatingsImpl">
|
||||||
<property name="nodes" ref="nodes" />
|
<property name="nodes" ref="nodes" />
|
||||||
<property name="ratingService" ref="RatingService" />
|
<property name="ratingService" ref="RatingService" />
|
||||||
@@ -458,6 +458,7 @@
|
|||||||
<bean id="nodes" class="org.alfresco.rest.api.impl.NodesImpl" init-method="init">
|
<bean id="nodes" class="org.alfresco.rest.api.impl.NodesImpl" init-method="init">
|
||||||
<property name="serviceRegistry" ref="ServiceRegistry"/>
|
<property name="serviceRegistry" ref="ServiceRegistry"/>
|
||||||
<property name="repositoryHelper" ref="repositoryHelper"/>
|
<property name="repositoryHelper" ref="repositoryHelper"/>
|
||||||
|
<property name="quickShareService" ref="QuickShareService"/>
|
||||||
<property name="ignoreTypes" ref="nodes.ignoreTypes"/>
|
<property name="ignoreTypes" ref="nodes.ignoreTypes"/>
|
||||||
<property name="nonAttachContentTypes" ref="nodes.nonAttachContentTypes"/>
|
<property name="nonAttachContentTypes" ref="nodes.nonAttachContentTypes"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
@@ -34,6 +34,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
import org.alfresco.model.ApplicationModel;
|
import org.alfresco.model.ApplicationModel;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.model.QuickShareModel;
|
||||||
import org.alfresco.query.PagingRequest;
|
import org.alfresco.query.PagingRequest;
|
||||||
import org.alfresco.query.PagingResults;
|
import org.alfresco.query.PagingResults;
|
||||||
import org.alfresco.repo.content.ContentLimitViolationException;
|
import org.alfresco.repo.content.ContentLimitViolationException;
|
||||||
@@ -76,6 +77,7 @@ import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
|||||||
import org.alfresco.service.cmr.model.FileFolderService;
|
import org.alfresco.service.cmr.model.FileFolderService;
|
||||||
import org.alfresco.service.cmr.model.FileInfo;
|
import org.alfresco.service.cmr.model.FileInfo;
|
||||||
import org.alfresco.service.cmr.model.FileNotFoundException;
|
import org.alfresco.service.cmr.model.FileNotFoundException;
|
||||||
|
import org.alfresco.service.cmr.quickshare.QuickShareService;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.ContentData;
|
import org.alfresco.service.cmr.repository.ContentData;
|
||||||
import org.alfresco.service.cmr.repository.ContentService;
|
import org.alfresco.service.cmr.repository.ContentService;
|
||||||
@@ -140,6 +142,7 @@ public class NodesImpl implements Nodes
|
|||||||
private ContentService contentService;
|
private ContentService contentService;
|
||||||
private ActionService actionService;
|
private ActionService actionService;
|
||||||
private VersionService versionService;
|
private VersionService versionService;
|
||||||
|
private QuickShareService quickShareService;
|
||||||
private Repository repositoryHelper;
|
private Repository repositoryHelper;
|
||||||
private ServiceRegistry sr;
|
private ServiceRegistry sr;
|
||||||
private Set<String> defaultIgnoreTypes;
|
private Set<String> defaultIgnoreTypes;
|
||||||
@@ -184,6 +187,11 @@ public class NodesImpl implements Nodes
|
|||||||
this.repositoryHelper = repositoryHelper;
|
this.repositoryHelper = repositoryHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setQuickShareService(QuickShareService quickShareService)
|
||||||
|
{
|
||||||
|
this.quickShareService = quickShareService;
|
||||||
|
}
|
||||||
|
|
||||||
public void setIgnoreTypes(Set<String> ignoreTypes)
|
public void setIgnoreTypes(Set<String> ignoreTypes)
|
||||||
{
|
{
|
||||||
this.defaultIgnoreTypes = ignoreTypes;
|
this.defaultIgnoreTypes = ignoreTypes;
|
||||||
@@ -1114,11 +1122,27 @@ public class NodesImpl implements Nodes
|
|||||||
// TODO: optional PATCH mechanism to add one new new aspect (with some related aspect properties) without affecting existing aspects/properties
|
// TODO: optional PATCH mechanism to add one new new aspect (with some related aspect properties) without affecting existing aspects/properties
|
||||||
for (QName aQName : aspectsToRemove)
|
for (QName aQName : aspectsToRemove)
|
||||||
{
|
{
|
||||||
|
// in future, this could/should be part of QuickShareService aspect "behaviour"
|
||||||
|
if (aQName.equals(QuickShareModel.ASPECT_QSHARE))
|
||||||
|
{
|
||||||
|
String qShareId = (String)nodeService.getProperty(nodeRef, QuickShareModel.PROP_QSHARE_SHAREDID);
|
||||||
|
if (qShareId != null)
|
||||||
|
{
|
||||||
|
quickShareService.unshareContent(qShareId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nodeService.removeAspect(nodeRef, aQName);
|
nodeService.removeAspect(nodeRef, aQName);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (QName aQName : aspectsToAdd)
|
for (QName aQName : aspectsToAdd)
|
||||||
{
|
{
|
||||||
|
// in future, this could/should be part of QuickShareService aspect "behaviour"
|
||||||
|
if (aQName.equals(QuickShareModel.ASPECT_QSHARE))
|
||||||
|
{
|
||||||
|
quickShareService.shareContent(nodeRef);
|
||||||
|
}
|
||||||
|
|
||||||
nodeService.addAspect(nodeRef, aQName, null);
|
nodeService.addAspect(nodeRef, aQName, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user