@Test public void testHandleActionUser() throws Exception { Map<String, String> httpParams = new HashMap<>(); httpParams.put(ActionConstants.KEY_ID, "1"); ActionParameters params = createActionParams(httpParams, getLoggedInUser()); handler.handleAction(params); verifyResponseContent(TEST_DATA); }
@Override public void handleAction(final ActionParameters params) throws ActionException { final int layerId = params.getRequiredParamInt(ActionConstants.KEY_ID); final OskariLayer layer = permissionHelper.getLayer(layerId, params.getUser()); final String data = getCapabilities(layer); ResponseHelper.writeResponse(params, HttpServletResponse.SC_OK, "text/xml", data.getBytes(StandardCharsets.UTF_8)); }
GetLayerCapabilitiesHandler extends ActionHandler { @Override public void handleAction(final ActionParameters params) throws ActionException { final int layerId = params.getRequiredParamInt(ActionConstants.KEY_ID); final OskariLayer layer = permissionHelper.getLayer(layerId, params.getUser()); final String data = getCapabilities(layer); ResponseHelper.writeResponse(params, HttpServletResponse.SC_OK, "text/xml", data.getBytes(StandardCharsets.UTF_8)); } }
GetLayerCapabilitiesHandler extends ActionHandler { @Override public void handleAction(final ActionParameters params) throws ActionException { final int layerId = params.getRequiredParamInt(ActionConstants.KEY_ID); final OskariLayer layer = permissionHelper.getLayer(layerId, params.getUser()); final String data = getCapabilities(layer); ResponseHelper.writeResponse(params, HttpServletResponse.SC_OK, "text/xml", data.getBytes(StandardCharsets.UTF_8)); }  }
GetLayerCapabilitiesHandler extends ActionHandler { @Override public void handleAction(final ActionParameters params) throws ActionException { final int layerId = params.getRequiredParamInt(ActionConstants.KEY_ID); final OskariLayer layer = permissionHelper.getLayer(layerId, params.getUser()); final String data = getCapabilities(layer); ResponseHelper.writeResponse(params, HttpServletResponse.SC_OK, "text/xml", data.getBytes(StandardCharsets.UTF_8)); }  void init(); void setCapabilitiesCacheService(CapabilitiesCacheService capabilitiesService); void setPermissionHelper(final PermissionHelper helper); @Override void handleAction(final ActionParameters params); }
GetLayerCapabilitiesHandler extends ActionHandler { @Override public void handleAction(final ActionParameters params) throws ActionException { final int layerId = params.getRequiredParamInt(ActionConstants.KEY_ID); final OskariLayer layer = permissionHelper.getLayer(layerId, params.getUser()); final String data = getCapabilities(layer); ResponseHelper.writeResponse(params, HttpServletResponse.SC_OK, "text/xml", data.getBytes(StandardCharsets.UTF_8)); }  void init(); void setCapabilitiesCacheService(CapabilitiesCacheService capabilitiesService); void setPermissionHelper(final PermissionHelper helper); @Override void handleAction(final ActionParameters params);  }