use of org.alfresco.sync.events.types.NodeAddedEvent in project alfresco-repository by Alfresco.
the class EventsServiceImpl method secondaryAssociationCreated.
@Override
public void secondaryAssociationCreated(final ChildAssociationRef secAssociation) {
NodeInfo nodeInfo = getNodeInfo(secAssociation.getChildRef(), NodeAddedEvent.EVENT_TYPE);
if (nodeInfo.checkNodeInfo()) {
String username = AuthenticationUtil.getFullyAuthenticatedUser();
String networkId = TenantUtil.getCurrentDomain();
String name = nodeInfo.getName();
String objectId = nodeInfo.getNodeId();
String siteId = nodeInfo.getSiteId();
String txnId = AlfrescoTransactionSupport.getTransactionId();
NodeRef secParentNodeRef = secAssociation.getParentRef();
String secParentNodeName = (String) nodeService.getProperty(secAssociation.getParentRef(), ContentModel.PROP_NAME);
List<Path> secParentPath = nodeService.getPaths(secParentNodeRef, true);
List<String> nodePaths = getPaths(secParentPath, Arrays.asList(secParentNodeName, name));
List<List<String>> pathNodeIds = this.getNodeIds(secParentPath);
long timestamp = System.currentTimeMillis();
Long modificationTime = nodeInfo.getModificationTimestamp();
String nodeType = nodeInfo.getType().toPrefixString(namespaceService);
Client alfrescoClient = getAlfrescoClient(nodeInfo.getClient());
Set<String> aspects = nodeInfo.getAspectsAsStrings();
Map<String, Serializable> properties = nodeInfo.getProperties();
Event event = new NodeAddedEvent(nextSequenceNumber(), name, txnId, timestamp, networkId, siteId, objectId, nodeType, nodePaths, pathNodeIds, username, modificationTime, alfrescoClient, aspects, properties);
sendEvent(event);
}
}
use of org.alfresco.sync.events.types.NodeAddedEvent in project alfresco-repository by Alfresco.
the class EventsServiceImpl method nodeCreated.
@Override
public void nodeCreated(final NodeRef nodeRef) {
NodeInfo nodeInfo = getNodeInfo(nodeRef, NodeAddedEvent.EVENT_TYPE);
if (nodeInfo.checkNodeInfo()) {
String username = AuthenticationUtil.getFullyAuthenticatedUser();
String networkId = TenantUtil.getCurrentDomain();
String name = nodeInfo.getName();
String objectId = nodeInfo.getNodeId();
String siteId = nodeInfo.getSiteId();
String txnId = AlfrescoTransactionSupport.getTransactionId();
List<String> nodePaths = nodeInfo.getPaths();
List<List<String>> pathNodeIds = nodeInfo.getParentNodeIds();
long timestamp = System.currentTimeMillis();
Long modificationTime = nodeInfo.getModificationTimestamp();
String nodeType = nodeInfo.getType().toPrefixString(namespaceService);
Client alfrescoClient = getAlfrescoClient(nodeInfo.getClient());
Set<String> aspects = nodeInfo.getAspectsAsStrings();
Map<String, Serializable> properties = nodeInfo.getProperties();
Event event = new NodeAddedEvent(nextSequenceNumber(), name, txnId, timestamp, networkId, siteId, objectId, nodeType, nodePaths, pathNodeIds, username, modificationTime, alfrescoClient, aspects, properties);
sendEvent(event);
}
}
Aggregations