| [comment encoding = UTF-8 /] |
| [comment |
| <%-- |
| Copyright (c) 2011, 2012 IBM Corporation and others. |
| |
| All rights reserved. This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License v1.0 |
| and Eclipse Distribution License v. 1.0 which accompanies this distribution. |
| |
| The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| and the Eclipse Distribution License is available at |
| http://www.eclipse.org/org/documents/edl-v10.php. |
| |
| Contributors: |
| |
| Sam Padgett - initial API and implementation |
| Michael Fiedler - adapted for OSLC4J |
| Jad El-khoury - initial implementation of code generator (https://bugs.eclipse.org/bugs/show_bug.cgi?id=422448) |
| --%> |
| /] |
| |
| [module generateFilteredResourceCollectionJsp('http://org.eclipse.lyo/oslc4j/adaptorInterface')] |
| |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::services/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::serviceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::resourceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::jspServices/] |
| |
| [template public generateFilteredResourceCollectionJsp(aSelectionDialog : Dialog)] |
| [file (resourceSelectorResultsJspFullFileName(aSelectionDialog), false, 'UTF-8')] |
| [let anAdaptorInterface: AdaptorInterface = containingAdaptorInterface(aSelectionDialog)] |
| <%-- |
| Copyright (c) 2011, 2012 IBM Corporation and others. |
| |
| All rights reserved. This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License v1.0 |
| and Eclipse Distribution License v. 1.0 which accompanies this distribution. |
| |
| The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| and the Eclipse Distribution License is available at |
| http://www.eclipse.org/org/documents/edl-v10.php. |
| |
| Contributors: |
| |
| Sam Padgett - initial API and implementation |
| Michael Fiedler - adapted for OSLC4J |
| Jad El-khoury - initial implementation of code generator (https://bugs.eclipse.org/bugs/show_bug.cgi?id=422448) |
| |
| This file is generated by org.eclipse.lyo.oslc4j.codegenerator |
| --%> |
| |
| <%@ page import="java.net.*" %> |
| <%@ page import="java.util.*" %> |
| <%@page import="org.eclipse.lyo.oslc4j.core.model.ServiceProvider"%> |
| <%@page import="org.eclipse.lyo.oslc4j.core.model.AbstractResource"%> |
| [for (aResource: Resource | aSelectionDialog.resourceTypes)] |
| <%@page import="[javaClassFullName(aResource, anAdaptorInterface, null) /]"%> |
| [/for] |
| <%-- |
| [protected ('imports')] |
| --%> |
| <%-- |
| [/protected] |
| --%> |
| |
| <%@ page contentType="application/json" language="java" pageEncoding="UTF-8" %> |
| |
| { |
| <% |
| String selectionUri = (String) request.getAttribute("selectionUri"); |
| List<[dialogMethodResourceType(aSelectionDialog)/]> resources = (List<[dialogMethodResourceType(aSelectionDialog)/]>) request.getAttribute("resources"); |
| String terms = (String) request.getAttribute("terms"); |
| %> |
| <%-- |
| [protected ('getRequestAttributes')] |
| --%> |
| <%-- |
| [/protected] |
| --%> |
| "oslc:results": ['['/] |
| <% int i = 0; for ([dialogMethodResourceType(aSelectionDialog)/] r : resources) { %> |
| <% if (i > 0) { %>,<% } %> |
| { |
| "oslc:label" : "<%= r.toString() %>", |
| "rdf:resource" : "<%= r.getAbout() %>" |
| } |
| <% i++; } %> |
| [']'/] |
| } |
| [/let] |
| [/file] |
| [/template] |