@OslcQueryCapability( title = "SysML Part Property Query Capability", label = "SysML PartProperty Catalog Query", resourceShape = OslcConstants.PATH_RESOURCE_SHAPES + "/" + Constants.PATH_SYSML_PARTPROPERTY, resourceTypes = {Constants.TYPE_SYSML_PARTPROPERTY}, usages = {OslcConstants.OSLC_USAGE_DEFAULT}) @GET @Produces({ OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON }) public List<edu.gatech.mbsec.adapter.magicdraw.resources.SysMLPartProperty> getPartProperties( @PathParam("projectId") final String projectId, @QueryParam("oslc.where") final String where, @QueryParam("oslc.select") final String select, @QueryParam("oslc.prefix") final String prefix, @QueryParam("page") final String pageString, @QueryParam("oslc.orderBy") final String orderBy, @QueryParam("oslc.searchTerms") final String searchTerms, @QueryParam("oslc.paging") final String paging, @QueryParam("oslc.pageSize") final String pageSize) throws IOException, ServletException { MagicDrawManager.loadSysMLProjects(); return MagicDrawManager.getPartProperties(projectId); }
@GET @Produces(MediaType.TEXT_HTML) public void getHtmlPartProperties(@PathParam("projectId") final String projectId) { MagicDrawManager.loadSysMLProjects(); List<SysMLPartProperty> sysmlPartProperties = MagicDrawManager.getPartProperties(projectId); String requestURL = httpServletRequest.getRequestURL().toString(); if (sysmlPartProperties != null) { httpServletRequest.setAttribute("elements", sysmlPartProperties); httpServletRequest.setAttribute("requestURL", requestURL); httpServletRequest.setAttribute("projectId", projectId); RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/sysml/sysml_partproperties_html.jsp"); try { rd.forward(httpServletRequest, httpServletResponse); } catch (Exception e) { e.printStackTrace(); throw new WebApplicationException(e); } } }