Skip to content

Commit

Permalink
feat: migrated to generic v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev committed Jul 2, 2024
1 parent 6a00b12 commit 29e0140
Showing 1 changed file with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,30 @@
import ch.sbb.polarion.extension.api.extender.settings.GlobalRecordsSettings;
import ch.sbb.polarion.extension.api.extender.settings.ProjectCustomFieldsSettings;
import ch.sbb.polarion.extension.generic.rest.GenericRestApplication;
import ch.sbb.polarion.extension.generic.settings.GenericNamedSettings;
import ch.sbb.polarion.extension.generic.settings.NamedSettingsRegistry;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
import java.util.Set;

public class ApiExtenderRestApplication extends GenericRestApplication {

public ApiExtenderRestApplication() {
List<GenericNamedSettings<?>> settingsList = new ArrayList<>();
settingsList.add(new GlobalRecordsSettings());
settingsList.add(new ProjectCustomFieldsSettings());

NamedSettingsRegistry.INSTANCE.register(settingsList);
NamedSettingsRegistry.INSTANCE.register(
Arrays.asList(
new GlobalRecordsSettings(),
new ProjectCustomFieldsSettings()
)
);
}

@Override
@NotNull
protected Set<Class<?>> getControllerClasses() {
final Set<Class<?>> controllerClasses = super.getControllerClasses();
controllerClasses.addAll(Set.of(
GlobalRecordApiController.class,
GlobalRecordInternalController.class,
ProjectCustomFieldApiController.class,
ProjectCustomFieldInternalController.class
));
return controllerClasses;
protected @NotNull Set<Object> getExtensionControllerSingletons() {
return Set.of(
new GlobalRecordApiController(),
new GlobalRecordInternalController(),
new ProjectCustomFieldApiController(),
new ProjectCustomFieldInternalController()
);
}
}

0 comments on commit 29e0140

Please sign in to comment.