Search in sources :

Example 1 with AngularJSModuleDefinition

use of com.serotonin.m2m2.module.AngularJSModuleDefinition in project ma-modules-public by infiniteautomation.

the class ModulesRestController method getPublicAngularJSModules.

@ApiOperation(value = "AngularJS Modules", notes = "Publicly Available Angular JS Modules")
@RequestMapping(method = RequestMethod.GET, value = "/angularjs-modules/public", produces = { "application/json" })
public ResponseEntity<AngularJSModuleDefinitionGroupModel> getPublicAngularJSModules(HttpServletRequest request) {
    RestProcessResult<AngularJSModuleDefinitionGroupModel> result = new RestProcessResult<AngularJSModuleDefinitionGroupModel>(HttpStatus.OK);
    List<AngularJSModuleDefinition> definitions = ModuleRegistry.getAngularJSDefinitions();
    List<String> urls = new ArrayList<String>();
    for (AngularJSModuleDefinition def : definitions) urls.add(def.getModule().getWebPath() + WEB + def.getJavaScriptFilename());
    AngularJSModuleDefinitionGroupModel model = new AngularJSModuleDefinitionGroupModel();
    model.setUrls(urls);
    return result.createResponseEntity(model);
}
Also used : AngularJSModuleDefinitionGroupModel(com.serotonin.m2m2.web.mvc.rest.v1.model.modules.AngularJSModuleDefinitionGroupModel) RestProcessResult(com.serotonin.m2m2.web.mvc.rest.v1.message.RestProcessResult) AngularJSModuleDefinition(com.serotonin.m2m2.module.AngularJSModuleDefinition) ArrayList(java.util.ArrayList) JsonString(com.serotonin.json.type.JsonString) ApiOperation(com.wordnik.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

JsonString (com.serotonin.json.type.JsonString)1 AngularJSModuleDefinition (com.serotonin.m2m2.module.AngularJSModuleDefinition)1 RestProcessResult (com.serotonin.m2m2.web.mvc.rest.v1.message.RestProcessResult)1 AngularJSModuleDefinitionGroupModel (com.serotonin.m2m2.web.mvc.rest.v1.model.modules.AngularJSModuleDefinitionGroupModel)1 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)1 ArrayList (java.util.ArrayList)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1