| [comment encoding = UTF-8 /] |
| [comment |
| /******************************************************************************* |
| * Copyright (c) 2014 Jad El-khoury. |
| * |
| * 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: |
| * |
| * Jad El-khoury - initial implementation of code generator (https://bugs.eclipse.org/bugs/show_bug.cgi?id=422448) |
| * |
| *******************************************************************************/ |
| /] |
| |
| [module jspServices('http://org.eclipse.lyo/oslc4j/adaptorInterface')/] |
| |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::services/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::adaptorInterfaceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::resourceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::serviceProviderServices/] |
| |
| [query private resourceCollectionJspSimpleFileName(aQueryCapability: QueryCapability) : String = |
| (if (aQueryCapability.usages->size() = 0) then |
| concatenate(aQueryCapability.resourceTypes.javaName(true)->sep('', 'sAnd', 's').oclAsType(String)).toLower() |
| else |
| javaSimpleStringFromUri(aQueryCapability.usages->first(), true) |
| endif) |
| .concat('collection').concat('.jsp') |
| /] |
| [query public resourceCollectionJspRelativeFileName(aQueryCapability: QueryCapability) : String = |
| jspFilesWebappPath(containingAdaptorInterface(aQueryCapability)).concatenatePaths(resourceCollectionJspSimpleFileName(aQueryCapability)).toLower() |
| /] |
| [query public resourceCollectionJspFullFileName(aQueryCapability: QueryCapability) : String = |
| jspFilesBasePath(containingAdaptorInterface(aQueryCapability)).concatenatePaths(resourceCollectionJspRelativeFileName(aQueryCapability)) |
| /] |
| |
| [query public getResourceJspRelativeFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesWebappPath(anAdaptorInterface).concatenatePaths(aResource.javaName(true)).concat('.jsp').toLower() |
| /] |
| [query public getResourceJspFullFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesBasePath(anAdaptorInterface).concatenatePaths(getResourceJspRelativeFileName(aResource, anAdaptorInterface)) |
| /] |
| |
| [query public getResourceSmallPreviewJspRelativeFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesWebappPath(anAdaptorInterface).concatenatePaths(aResource.javaName(true)).concat('smallpreview.jsp').toLower() |
| /] |
| [query public getResourceSmallPreviewJspFullFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesBasePath(anAdaptorInterface).concatenatePaths(getResourceSmallPreviewJspRelativeFileName(aResource, anAdaptorInterface)) |
| /] |
| |
| [query private resourceCreatorJspSimpleFileName(aCreationDialog: Dialog) : String = |
| (if (aCreationDialog.usages->size() = 0) then |
| concatenate(aCreationDialog.resourceTypes.javaName(true)->sep('', 'And', '').oclAsType(String)).toLower() |
| else |
| javaSimpleStringFromUri(aCreationDialog.usages->first(), true) |
| endif) |
| .concat('creator').concat('.jsp') |
| /] |
| [query public resourceCreatorJspRelativeFileName(aCreationDialog: Dialog) : String = |
| jspFilesWebappPath(containingAdaptorInterface(aCreationDialog)).concatenatePaths(resourceCreatorJspSimpleFileName(aCreationDialog)).toLower() |
| /] |
| [query public resourceCreatorJspFullFileName(aCreationDialog: Dialog) : String = |
| jspFilesBasePath(containingAdaptorInterface(aCreationDialog)).concatenatePaths(resourceCreatorJspRelativeFileName(aCreationDialog)) |
| /] |
| |
| [query private resourceSelectorJspSimpleFileName(aSelectionDialog: Dialog) : String = |
| (if (aSelectionDialog.usages->size() = 0) then |
| concatenate(aSelectionDialog.resourceTypes.javaName(true)->sep('', 'And', '').oclAsType(String)).toLower() |
| else |
| javaSimpleStringFromUri(aSelectionDialog.usages->first(), true) |
| endif) |
| .concat('selector').concat('.jsp') |
| /] |
| [query public resourceSelectorJspRelativeFileName(aSelectionDialog: Dialog) : String = |
| jspFilesWebappPath(containingAdaptorInterface(aSelectionDialog)).concatenatePaths(resourceSelectorJspSimpleFileName(aSelectionDialog)).toLower() |
| /] |
| [query public resourceSelectorJspFullFileName(aSelectionDialog: Dialog) : String = |
| jspFilesBasePath(containingAdaptorInterface(aSelectionDialog)).concatenatePaths(resourceSelectorJspRelativeFileName(aSelectionDialog)) |
| /] |
| |
| [query public resourceSelectorClientJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesWebappPath(anAdaptorInterface).concatenatePaths('selectionDialogSampleClient').concat('.jsp').toLower() |
| /] |
| [query public resourceSelectorClientJspFullFileName(anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesBasePath(anAdaptorInterface).concatenatePaths(resourceSelectorClientJspRelativeFileName(anAdaptorInterface)) |
| /] |
| |
| [query public resourceCreatorClientJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesWebappPath(anAdaptorInterface).concatenatePaths('creationDialogSampleClient').concat('.jsp').toLower() |
| /] |
| [query public resourceCreatorClientJspFullFileName(anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesBasePath(anAdaptorInterface).concatenatePaths(resourceCreatorClientJspRelativeFileName(anAdaptorInterface)) |
| /] |
| |
| [query public resourceShapeJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesWebappPath(anAdaptorInterface).concatenatePaths('resourceShape').concat('.jsp').toLower() |
| /] |
| |
| [query public resourceShapeJspFullFileName(anAdaptorInterface : AdaptorInterface) : String = |
| jspFilesBasePath(anAdaptorInterface).concatenatePaths(resourceShapeJspRelativeFileName(anAdaptorInterface)) |
| /] |
| |
| [query private resourceSelectorResultsJspSimpleFileName(aSelectionDialog: Dialog) : String = |
| (if (aSelectionDialog.usages->size() = 0) then |
| concatenate(aSelectionDialog.resourceTypes.javaName(true)->sep('', 'And', '').oclAsType(String)).toLower() |
| else |
| javaSimpleStringFromUri(aSelectionDialog.usages->first(), true) |
| endif) |
| .concat('selectorResults').concat('.jsp') |
| /] |
| [query public resourceSelectorResultsJspRelativeFileName(aSelectionDialog: Dialog) : String = |
| jspFilesWebappPath(containingAdaptorInterface(aSelectionDialog)).concatenatePaths(resourceSelectorResultsJspSimpleFileName(aSelectionDialog)).toLower() |
| /] |
| [query public resourceSelectorResultsJspFullFileName(aSelectionDialog: Dialog) : String = |
| jspFilesBasePath(containingAdaptorInterface(aSelectionDialog)).concatenatePaths(resourceSelectorResultsJspRelativeFileName(aSelectionDialog)) |
| /] |
| |
| [query public serviceProviderCatalogJspRelativeFileName(aServiceProviderCatalog : ServiceProviderCatalog) : String = |
| jspFilesWebappPath(containingAdaptorInterface(aServiceProviderCatalog)).concatenatePaths('serviceProviderCatalog').concat('.jsp').toLower() |
| /] |
| [query public serviceProviderCatalogJspFullFileName(aServiceProviderCatalog : ServiceProviderCatalog) : String = |
| jspFilesBasePath(containingAdaptorInterface(aServiceProviderCatalog)).concatenatePaths(serviceProviderCatalogJspRelativeFileName(aServiceProviderCatalog)) |
| /] |
| |
| [query public serviceProviderJspRelativeFileName(aServiceProvider : ServiceProvider) : String = |
| jspFilesWebappPath(containingAdaptorInterface(aServiceProvider)).concatenatePaths(aServiceProvider.javaName(false)).concat('.jsp').toLower() |
| /] |
| [query public serviceProviderJspFullFileName(aServiceProvider : ServiceProvider) : String = |
| jspFilesBasePath(containingAdaptorInterface(aServiceProvider)).concatenatePaths(serviceProviderJspRelativeFileName(aServiceProvider)) |
| /] |
| |
| [comment TODO: I need to work out how to properly set hte javascript path. This is hard-coded :-)/] |
| [query public delegatedUIJavaScriptsRelativeFileName(anAdaptorInterface : AdaptorInterface) : String = |
| 'delegatedUI'.concat('.js') |
| /] |
| [query public delegatedUIJavaScriptsFullFileName(anAdaptorInterface : AdaptorInterface) : String = |
| javascriptFilesBasePath(anAdaptorInterface).concatenatePaths(delegatedUIJavaScriptsRelativeFileName(anAdaptorInterface)) |
| /] |