Skip to content

Commit

Permalink
Merge pull request #235 from xenit-eu/ALFREDAPI-562_lowlvl
Browse files Browse the repository at this point in the history
  • Loading branch information
WimCrols authored Dec 16, 2024
2 parents 7438100 + c25f9c4 commit f09e0cf
Show file tree
Hide file tree
Showing 33 changed files with 435 additions and 275 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Fixes https://xenitsupport.jira.com/browse/ALFREDAPI-<**YOUR TICKET ID**>
- [ ] Is [CHANGELOG.md](https://github.com/xenit-eu/alfred-api/blob/master/CHANGELOG.md) extended?
- [ ] Does this PR avoid breaking the API?
Breaking changes include adding, changing or removing endpoints and/or JSON objects used in requests and responses.
- [ ] Are all Alfresco services wired via ServiceRegistry (and not per service)?
- [ ] Does the PR comply to REST HTTP result codes policy outlined in the [user guide](https://docs.xenit.eu/alfred-api/user/rest-api/index.html#rest-http-result-codes)?
- [ ] Is error handling done through a method annotated with `@ExceptionHandler` in the webscript classes?
- [ ] Does the PR follow our [coding styleguide and other active procedures](https://xenitsupport.jira.com/wiki/spaces/XEN/pages/624558081/XeniT+Enhancement+Proposals+XEP)?
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# Alfred API - Changelog


## 6.0.1 (UNRELEASED)

### Added

### Changed

### Fixed
* [ALFREDAPI-563](https://xenitsupport.jira.com/browse/ALFREDAPI-563) Fix @GetMapping(value = "/v1/nodes/{space}/{store}/{guid}/content") Content-Type

### Removed


## 6.0.0 (2024-08-22)
From this version onward Dynamic Extensions for integration-testing is replaced by [remote-junit](https://github.com/ruediste/remote-junit)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package eu.xenit.alfred.api.alfresco;

import eu.xenit.alfred.api.alfresco.workflow.WorkflowServiceApsImpl;
import eu.xenit.alfred.api.alfresco.workflow.AbstractAlfredApiQueryConverter;
import eu.xenit.alfred.api.alfresco.workflow.AbstractQueryConverterFactory;
import eu.xenit.alfred.api.alfresco.workflow.WorkflowServiceActivitiImpl;
import eu.xenit.alfred.api.alfresco.workflow.WorkflowServiceApsImpl;
import eu.xenit.alfred.api.people.IPeopleService;
import eu.xenit.alfred.api.workflow.IWorkflowService;
import java.util.Properties;
import org.alfresco.service.ServiceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

/**
* Spring configuration for components based on properties.
*
* Components based on Alfresco version are wired in eu.xenit.alfred.api.alfrescoXX.SpringConfiguration (where XX is version)
* Components based on Alfresco version are wired in eu.xenit.alfred.api.alfrescoXX.SpringConfiguration (where XX is
* version)
*/
@Configuration
public class AlfredApiSpringConfiguration {
Expand Down Expand Up @@ -44,20 +50,31 @@ public String getBpm() {

@Bean(name = "eu.xenit.alfred.api.workflow.IWorkflowService")
@DependsOn("global-properties")
public IWorkflowService workflowService() {
public IWorkflowService workflowService(
ServiceRegistry serviceRegistry,
AlfredApiToAlfrescoConversion c,
@Qualifier("eu.xenit.alfred.api.alfresco.workflow.activiti.AlfredApiActivitiWorkflowProcessQueryConverter")
AbstractAlfredApiQueryConverter alfredApiWfProcQueryConverter,
@Qualifier("eu.xenit.alfred.api.alfresco.workflow.activiti.AlfredApiActivitiWorkflowTaskQueryConverter")
AbstractAlfredApiQueryConverter alfredApiWfTaskQueryConverter,
IPeopleService peopleService,
@Qualifier("eu.xenit.alfred.api.alfresco.workflow.activiti.ActivitiQueryConverterFactory")
AbstractQueryConverterFactory activitiQueryConverterFactory) {
IWorkflowService result;
String bpm = getBpm();
switch (bpm) {
case "aps":
result = new WorkflowServiceApsImpl();
result = new WorkflowServiceApsImpl(getProperties());
break;
case "embedded-activiti":
result = new WorkflowServiceActivitiImpl();
result = new WorkflowServiceActivitiImpl(serviceRegistry, c, alfredApiWfProcQueryConverter,
alfredApiWfTaskQueryConverter, peopleService, activitiQueryConverterFactory);
break;
default:
logger.warn("Bpm option not recognised in alfresco-global-properties, defaulting to embedded "
+ "activiti");
result = new WorkflowServiceActivitiImpl();
logger.warn("Bpm option '{}' not recognised in alfresco-global-properties," +
" defaulting to embedded activiti", bpm);
result = new WorkflowServiceActivitiImpl(serviceRegistry, c, alfredApiWfProcQueryConverter,
alfredApiWfTaskQueryConverter, peopleService, activitiQueryConverterFactory);
}
logger.info("Configuring BPM: using {}", result.getClass());
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,12 @@
@Service("eu.xenit.alfred.api.categories.ICategoryService")
public class CategoryService implements ICategoryService {

@Autowired
private AlfredApiToAlfrescoConversion c;
@Autowired
private NodeService nodeService;
@Autowired
private org.alfresco.service.cmr.search.CategoryService categoryService;
@Autowired
private NamespaceService namespaceService;

public CategoryService() {
}

@Autowired
public CategoryService(ServiceRegistry registry, AlfredApiToAlfrescoConversion alfredApiToAlfrescoConversion) {
nodeService = registry.getNodeService();
categoryService = registry.getCategoryService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -23,8 +24,8 @@ public class AspectService implements IAspectService {
private AlfredApiToAlfrescoConversion c;

@Autowired
public AspectService(DictionaryService dictionaryService, AlfredApiToAlfrescoConversion c) {
this.dictionaryService = dictionaryService;
public AspectService(ServiceRegistry registry, AlfredApiToAlfrescoConversion c) {
this.dictionaryService = registry.getDictionaryService();
this.c = c;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.zip.CRC32;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.ModelDefinition;
import org.alfresco.service.cmr.dictionary.NamespaceDefinition;
import org.alfresco.service.namespace.NamespaceService;
Expand All @@ -38,23 +39,25 @@
public class DictionaryService implements IDictionaryService {

private static final Logger logger = LoggerFactory.getLogger(DictionaryService.class);
@Autowired
private AlfredApiToAlfrescoConversion c;
@Autowired
private org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService;

@Autowired
private AlfredApiToAlfrescoConversion c;
private IPropertyService propertyService;

@Autowired
private ITypeService typeService;

@Autowired
private IAspectService aspectService;

@Autowired
private org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService;
private NamespaceService namespaceService;

@Autowired
public DictionaryService(ServiceRegistry registry, AlfredApiToAlfrescoConversion alfredApiToAlfrescoConversion,
IPropertyService propertyService, ITypeService typeService, IAspectService aspectService) {
dictionaryService = registry.getDictionaryService();
namespaceService = registry.getNamespaceService();
c = alfredApiToAlfrescoConversion;
this.propertyService = propertyService;
this.typeService = typeService;
this.aspectService = aspectService;
}

public Namespaces getNamespaces() {
Map<String, Namespace> ret = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.namespace.NamespaceException;
import org.slf4j.Logger;
Expand All @@ -24,9 +25,9 @@ public class TypeService implements ITypeService {
private AlfredApiToAlfrescoConversion c;

@Autowired
public TypeService(DictionaryService dictionaryService, AlfredApiToAlfrescoConversion c) {
this.dictionaryService = dictionaryService;
this.c = c;
public TypeService(ServiceRegistry registry, AlfredApiToAlfrescoConversion alfredApiToAlfrescoConversion) {
dictionaryService = registry.getDictionaryService();
c = alfredApiToAlfrescoConversion;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@
import org.alfresco.model.ContentModel;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.model.FileNotFoundException;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.service.cmr.security.PermissionService;
Expand All @@ -38,19 +35,14 @@ public class FileFolderService implements IFileFolderService {
private PermissionService permissionService;
private NamespaceService nameSpaceService;
private org.alfresco.service.cmr.model.FileFolderService fileFolderService;
private MimetypeService mimetypeService;
private ContentService contentService;
private DictionaryService dictionaryService;

@Autowired
public FileFolderService(ServiceRegistry serviceRegistry, AlfredApiToAlfrescoConversion alfredApiToAlfrescoConversion) {
public FileFolderService(ServiceRegistry serviceRegistry,
AlfredApiToAlfrescoConversion alfredApiToAlfrescoConversion) {
this.nodeService = serviceRegistry.getNodeService();
this.nameSpaceService = serviceRegistry.getNamespaceService();
this.permissionService = serviceRegistry.getPermissionService();
this.mimetypeService = serviceRegistry.getMimetypeService();
this.contentService = serviceRegistry.getContentService();
this.fileFolderService = serviceRegistry.getFileFolderService();
this.dictionaryService = serviceRegistry.getDictionaryService();

this.c = alfredApiToAlfrescoConversion;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
Expand All @@ -30,10 +31,9 @@ public class AlfrescoPropertyConvertor {
private AlfredApiToAlfrescoConversion c;
private DictionaryService dictionaryService;


@Autowired
public AlfrescoPropertyConvertor(DictionaryService dictionaryService, AlfredApiToAlfrescoConversion c) {
this.dictionaryService = dictionaryService;
public AlfrescoPropertyConvertor(ServiceRegistry registry, AlfredApiToAlfrescoConversion c) {
this.dictionaryService = registry.getDictionaryService();
this.c = c;
}

Expand Down
Loading

0 comments on commit f09e0cf

Please sign in to comment.