diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2017-08-18 15:00:17 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2017-08-18 15:00:17 +0800 |
commit | 169a896f8fc4db5a0054d31bb5bfd254f2352bb0 (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
parent | 40f14a360b080c804935ddfc277bf05c526ff9ee (diff) |
Remove abandoned codes of catalog
Change-Id: Id258c64b6fbf0e25da8c033991e4a3ba21ad806e
Issue-Id: VFC-107
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
244 files changed, 0 insertions, 37275 deletions
diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 13e92efa..00000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.java text eol=lf -*.xml text eol=lf diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 98c7c056..00000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.idea -*.iml -.classpath -.project -.settings -target -dependency-reduced-pom.xml
\ No newline at end of file diff --git a/.gitreview b/.gitreview deleted file mode 100644 index c5d97b4b..00000000 --- a/.gitreview +++ /dev/null @@ -1,4 +0,0 @@ -[gerrit] -host=gerrit.open-o.org -port=29418 -project=common-tosca-catalog.git diff --git a/README.md b/README.md deleted file mode 100644 index a404e883..00000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -Catalog
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/pom.xml b/catalog-core/catalog-mgr/pom.xml deleted file mode 100644 index 23411d8b..00000000 --- a/catalog-core/catalog-mgr/pom.xml +++ /dev/null @@ -1,311 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-core-parent</artifactId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>catalog-mgr</artifactId> - <name>common-tosca-catalog/catalog-core/catalog-mgr</name> - <packaging>jar</packaging> - <properties> - <httpclient.version>4.4.1</httpclient.version> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <versionRange>[2.0,)</versionRange> - <goals> - <goal>copy-dependencies</goal> - </goals> - </pluginExecutionFilter> - <action> - <ignore/> - </action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifest> - <addDefaultImplementationEntries>true</addDefaultImplementationEntries> - </manifest> - </archive> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <configuration> - <createDependencyReducedPom>true</createDependencyReducedPom> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <exclude>META-INF/*.SF</exclude> - <exclude>META-INF/*.DSA</exclude> - <exclude>META-INF/*.RSA</exclude> - </excludes> - </filter> - </filters> - </configuration> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> - <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> - <mainClass>org.openo.commontosca.catalog.catalogApp</mainClass> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-dependencies</id> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-core</artifactId> - <version>${dropwizard.version}</version> - <overWrite>true</overWrite> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <!-- dropwizard --> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-core</artifactId> - </dependency> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-assets</artifactId> - </dependency> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-hibernate</artifactId> - </dependency> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-migrations</artifactId> - </dependency> - <!-- swagger --> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-jersey2-jaxrs</artifactId> - </dependency> - <!-- lombok --> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </dependency> - <!-- jersey --> - <dependency> - <groupId>org.glassfish.jersey.core</groupId> - <artifactId>jersey-server</artifactId> - </dependency> - <dependency> - <groupId>org.glassfish.jersey.media</groupId> - <artifactId>jersey-media-multipart</artifactId> - </dependency> - <dependency> - <groupId>org.glassfish.jersey.containers</groupId> - <artifactId>jersey-container-servlet-core</artifactId> - </dependency> - <!-- consumer --> - <dependency> - <groupId>com.eclipsesource.jaxrs</groupId> - <artifactId>consumer</artifactId> - <exclusions> - <exclusion> - <groupId>com.eclipsesource.jaxrs</groupId> - <artifactId>jersey-all</artifactId> - </exclusion> - </exclusions> - </dependency> - <!-- jackson --> - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-xml</artifactId> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - </dependency> - <!-- gson --> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - </dependency> - <!-- dom4j --> - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - </dependency> - <!-- cometd --> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>bayeux-api</artifactId> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-annotations</artifactId> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-client</artifactId> - <version>${cometd.version}</version> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-common</artifactId> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-oort</artifactId> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-server</artifactId> - </dependency> - <!-- ftp --> - <dependency> - <groupId>commons-net</groupId> - <artifactId>commons-net</artifactId> - </dependency> - <!-- mysql --> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - </dependency> - <!-- http server --> - <dependency> - <groupId>commons-fileupload</groupId> - <artifactId>commons-fileupload</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <!-- UT --> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-testing</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.ant</groupId> - <artifactId>ant</artifactId> - <scope>test</scope> - </dependency> - <!-- UT end --> - <!-- httpclient--> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>${httpclient.version}</version> - <exclusions> - <!-- provided by jcl-over-slf4j to enable logging via logback --> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpcore</artifactId> - <version>${httpclient.version}</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpmime</artifactId> - <version>${httpclient.version}</version> - </dependency> - <dependency> - <groupId>com.esotericsoftware.yamlbeans</groupId> - <artifactId>yamlbeans</artifactId> - <version>${yamlbeans.version}</version> - </dependency> - </dependencies> -</project> diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java deleted file mode 100644 index 1528edc7..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog; - -import com.fasterxml.jackson.annotation.JsonInclude; - -import io.dropwizard.Application; -import io.dropwizard.assets.AssetsBundle; -import io.dropwizard.db.DataSourceFactory; -import io.dropwizard.hibernate.HibernateBundle; -import io.dropwizard.migrations.MigrationsBundle; -import io.dropwizard.server.SimpleServerFactory; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; -import io.swagger.jaxrs.config.BeanConfig; -import io.swagger.jaxrs.listing.ApiListingResource; - -import org.eclipse.jetty.servlets.CrossOriginFilter; -import org.glassfish.jersey.media.multipart.MultiPartFeature; -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.common.HttpServerAddrConfig; -import org.openo.commontosca.catalog.common.HttpServerPathConfig; -import org.openo.commontosca.catalog.common.MsbAddrConfig; -import org.openo.commontosca.catalog.common.ServiceRegistrer; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.commontosca.catalog.db.hibernate.HibernateBundleAgent; -import org.openo.commontosca.catalog.health.ConsoleHealthCheck; -import org.openo.commontosca.catalog.resources.PackageResource; -import org.openo.commontosca.catalog.resources.TemplateResource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.EnumSet; -import javax.servlet.DispatcherType; - - - - -public class CatalogApp extends Application<CatalogAppConfiguration> { - - private static final Logger LOGGER = LoggerFactory.getLogger(CatalogApp.class); - - public static void main(String[] args) throws Exception { - new CatalogApp().run(args); - } - - @Override - public String getName() { - return "OPENO-Catalog"; - } - private final HibernateBundleAgent bundle = new HibernateBundleAgent(); - @Override - public void initialize(Bootstrap<CatalogAppConfiguration> bootstrap) { - bootstrap.addBundle(new AssetsBundle("/api-doc", "/api-doc", "index.html", "api-doc")); - initDb(bootstrap); - } - - // private void initDao() { - // DaoManager.getInstance().setSessionFactory(bundle.getSessionFactory()); - // } - - private void initDb(Bootstrap<CatalogAppConfiguration> bootstrap) { - bootstrap.addBundle(bundle); - bootstrap.addBundle(new MigrationsBundle<CatalogAppConfiguration>() { - @Override - public DataSourceFactory getDataSourceFactory(CatalogAppConfiguration configuration) { - return configuration.getDataSourceFactory(); - } - }); - } - - @Override - public void run(CatalogAppConfiguration configuration, Environment environment) { - LOGGER.info("Start to initialize catalogue."); - MsbAddrConfig.setMsbAddress(configuration.getMsbServerAddr()); - HttpServerAddrConfig.setHttpServerAddress(configuration.getHttpServerAddr()); - HttpServerPathConfig.setHttpServerPath(configuration.getHttpServerPath()); - //initDao(); - final ConsoleHealthCheck healthCheck = new ConsoleHealthCheck(configuration.getTemplate()); - environment.healthChecks().register("template", healthCheck); - - environment.jersey().register(new PackageResource()); - environment.jersey().register(new TemplateResource()); - // environment.jersey().register(new VNFHostImageResource()); - // environment.jersey().register(new VNFSoftwareVersionResource()); - - // register rest interface - environment.jersey().packages("org.openo.commontosca.catalog.resources"); - // upload file by inputstream need to register MultiPartFeature - environment.jersey().register(MultiPartFeature.class); - - initSwaggerConfig(environment, configuration); - initCometd(environment); - Config.setConfigration(configuration); - initService(); - LOGGER.info("Initialize catalogue finished."); - } - - /** - * initialize swagger configuration. - * - * @param environment environment information - * @param configuration catalogue configuration - */ - private void initSwaggerConfig(Environment environment, CatalogAppConfiguration configuration) { - environment.jersey().register(new ApiListingResource()); - environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL); - - BeanConfig config = new BeanConfig(); - config.setTitle("Open-o Catalog Service rest API"); - config.setVersion("1.0.0"); - config.setResourcePackage("org.openo.commontosca.catalog.resources"); - // set rest api basepath in swagger - SimpleServerFactory simpleServerFactory = - (SimpleServerFactory) configuration.getServerFactory(); - String basePath = simpleServerFactory.getApplicationContextPath(); - String rootPath = simpleServerFactory.getJerseyRootPath(); - rootPath = rootPath.substring(0, rootPath.indexOf("/*")); - basePath = - basePath.equals("/") ? rootPath : (new StringBuilder()).append(basePath).append(rootPath) - .toString(); - config.setBasePath(basePath); - config.setScan(true); - } - - private void initService() { - Thread registerCatalogService = new Thread(new ServiceRegistrer()); - registerCatalogService.setName("register catalog service to Microservice Bus"); - registerCatalogService.start(); - } - - /** - * initialize cometd server. - * - * @param environment environment information - */ - private void initCometd(Environment environment) { - // add filter - environment.getApplicationContext().addFilter(CrossOriginFilter.class, - "/openoapi/catalog/v1/catalognotification/*", EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR)); - // add servlet - environment.getApplicationContext() - .addServlet("org.cometd.server.CometDServlet", "/openoapi/catalog/v1/catalognotification/*") - .setInitOrder(1); - // add servlet - environment.getApplicationContext() - .addServlet("org.openo.commontosca.catalog.cometd.CometdServlet", "/openoapi/catalog/v1/catalognotification") - .setInitOrder(2); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java deleted file mode 100644 index b3204873..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.dropwizard.Configuration; -import io.dropwizard.db.DataSourceFactory; -import org.hibernate.validator.constraints.NotEmpty; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - - - - -public class CatalogAppConfiguration extends Configuration { - @NotEmpty - private String template; - - @NotEmpty - private String defaultName = "OPENO-Catalog"; - - @NotEmpty - private String msbServerAddr; - - @NotEmpty - private String httpServerAddr; - - @NotEmpty - private String parserType; - - @NotEmpty - private String cataloguePath; - @NotEmpty - private String httpServerPath; - - @Valid - private String serviceIp; - - @Valid - @NotNull - private DataSourceFactory database = new DataSourceFactory(); - - @JsonProperty("database") - public DataSourceFactory getDataSourceFactory() { - return database; - } - - @JsonProperty("database") - public void setDataSourceFactory(DataSourceFactory dataSourceFactory) { - this.database = dataSourceFactory; - } - - @JsonProperty - public String getTemplate() { - return template; - } - - @JsonProperty - public void setTemplate(String template) { - this.template = template; - } - - @JsonProperty - public String getDefaultName() { - return defaultName; - } - - @JsonProperty - public void setDefaultName(String name) { - this.defaultName = name; - } - - @JsonProperty - public String getMsbServerAddr() { - return msbServerAddr; - } - - @JsonProperty - public void setMsbServerAddr(String msbServerAddr) { - this.msbServerAddr = msbServerAddr; - } - - @JsonProperty - public String getHttpServerAddr() { - return httpServerAddr; - } - - @JsonProperty - public void setHttpServerAddr(String httpServerAddr) { - this.httpServerAddr = httpServerAddr; - } - - public String getParserType() { - return parserType; - } - - public void setParserType(String parserType) { - this.parserType = parserType; - } - - @JsonProperty - public String getCataloguePath() { - return cataloguePath; - } - - @JsonProperty - public void setCataloguePath(String cataloguePath) { - this.cataloguePath = cataloguePath; - } - - @JsonProperty - public String getHttpServerPath() { - return httpServerPath; - } - - @JsonProperty - public void setHttpServerPath(String httpServerPath) { - this.httpServerPath = httpServerPath; - } - - @JsonProperty - public String getServiceIp() { - return serviceIp; - } - - @JsonProperty - public void setServiceIp(String serviceIp) { - this.serviceIp = serviceIp; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdException.java deleted file mode 100644 index 7237a37b..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.cometd; - -public class CometdException extends Exception { - public static int ERROR_CODE_BAYEUX = 0; - public static int ERROR_CODE_PARAM_ERROR = 1; - public static int ERROR_CODE_SESSION_ERROR = 2; - public static int ERROR_CODE_SUBSCRIBE_TIMEOUT = 3; - private int errorCode = -1; - - public CometdException(Throwable e1) { - super(e1); - } - - public CometdException(int code, String message) { - super(message); - this.errorCode = code; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdService.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdService.java deleted file mode 100644 index a54b9abf..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdService.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.cometd; - -import org.cometd.bayeux.server.BayeuxServer; -import org.cometd.bayeux.server.ConfigurableServerChannel; -import org.cometd.bayeux.server.LocalSession; -import org.cometd.bayeux.server.ServerChannel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -public class CometdService { - private static final Logger LOGGER = LoggerFactory.getLogger(CometdService.class); - public static String DATA_UPLOAD_CHANNEL = "/upload/data"; - public static String SNMPTRAP_CHANNEL = "/upload/snmptrap"; - - private BayeuxServer bayeux; - private LocalSession session; - - private static String bayeuxChannel = "/meta/"; - - private static String serviceChannel = "/service/"; - - private static CometdService service = new CometdService(); - - public static CometdService getInstance() { - return service; - } - - public void publish(String channel, Object message) throws CometdException { - if (bayeux == null) { - this.bayeux = CometdUtil.getBayeuxServer(); - checkBayeuxServer(); - this.session = this.bayeux.newLocalSession("openo_catalog_local_session~"); - this.session.handshake(); - } - String jsonMsg; - try { - // jsonMsg = CometdUtil.convertBean2Json(message); - jsonMsg = CometdUtil.toJson(message); - LOGGER.debug("upload json=" + jsonMsg); - } catch (IOException e) { - throw new CometdException(e); - } - - checkAndInit(channel); - ServerChannel serverChannel = this.bayeux.getChannel(channel); - serverChannel.publish(this.session, jsonMsg); - } - - private void checkAndInit(String channel) throws CometdException { - checkBayeuxServer(); - checkSession(); - checkChannel(channel); - bayeux.createChannelIfAbsent(channel, new ConfigurableServerChannel.Initializer() { - public void configureChannel(ConfigurableServerChannel channel) { - channel.setPersistent(true); - channel.setLazy(true); - } - }); - } - - private void checkBayeuxServer() throws CometdException { - if (bayeux == null) { - throw new CometdException(CometdException.ERROR_CODE_BAYEUX, "bayeux is null."); - } - } - - private void checkSession() throws CometdException { - if (session == null || !session.isConnected()) { - throw new CometdException(CometdException.ERROR_CODE_SESSION_ERROR, "session is invalid."); - } - } - - private void checkChannel(String channel) throws CometdException { - if (channel == null || "".equals(channel)) { - throw new CometdException(CometdException.ERROR_CODE_PARAM_ERROR, "channel is null."); - } - if (channel.startsWith(bayeuxChannel)) { - throw new CometdException(CometdException.ERROR_CODE_PARAM_ERROR, - "channel [" + channel + "] is bayeuxChannel."); - } - if (channel.startsWith(serviceChannel)) { - throw new CometdException(CometdException.ERROR_CODE_PARAM_ERROR, - "channel [" + channel + "] is serviceChannel."); - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdServlet.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdServlet.java deleted file mode 100644 index ace95455..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdServlet.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.cometd; - -import org.cometd.annotation.Listener; -import org.cometd.annotation.ServerAnnotationProcessor; -import org.cometd.annotation.Service; -import org.cometd.bayeux.Message; -import org.cometd.bayeux.server.BayeuxServer; -import org.cometd.bayeux.server.ServerChannel; -import org.cometd.bayeux.server.ServerMessage; -import org.cometd.bayeux.server.ServerSession; -import org.cometd.server.BayeuxServerImpl; -import org.cometd.server.authorizer.GrantAuthorizer; -import org.cometd.server.ext.AcknowledgedMessagesExtension; -import org.cometd.server.ext.TimesyncExtension; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import javax.servlet.GenericServlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.UnavailableException; -import javax.servlet.http.HttpServletResponse; - - -public class CometdServlet extends GenericServlet { - private static final long serialVersionUID = 8807005039926977330L; - - private static final Logger logger = LoggerFactory.getLogger(CometdServlet.class); - - @Override - public void init() throws ServletException { - super.init(); - - final BayeuxServerImpl bayeux = - (BayeuxServerImpl) getServletContext().getAttribute(BayeuxServer.ATTRIBUTE); - if (bayeux == null) { - throw new UnavailableException("No BayeuxServer!"); - } - // Create extensions - bayeux.addExtension(new TimesyncExtension()); - bayeux.addExtension(new AcknowledgedMessagesExtension()); - - // Allow anybody to handshake - bayeux.getChannel(ServerChannel.META_HANDSHAKE).addAuthorizer(GrantAuthorizer.GRANT_PUBLISH); - - ServerAnnotationProcessor processor = new ServerAnnotationProcessor(bayeux); - processor.process(new CatalogComet()); - - CometdUtil.setBayeuxServer(bayeux); - } - - @Service("catalog") - public static class CatalogComet { - @Listener("/meta/subscribe") - public void catalogSubscribe(ServerSession session, ServerMessage message) { - logger.info("Catalog Subscribe from " + session + " for " - + message.get(Message.SUBSCRIPTION_FIELD)); - } - - @Listener("/meta/unsubscribe") - public void catalogUnsubscribe(ServerSession session, ServerMessage message) { - logger.info("Catalog Unsubscribe from " + session + " for " - + message.get(Message.SUBSCRIPTION_FIELD)); - } - - @Listener("/meta/*") - public void catalogMeta(ServerSession session, ServerMessage message) { - logger.debug(message.toString()); - } - } - - @Override - public void service(ServletRequest servletRequest, ServletResponse servletResponse) - throws ServletException, IOException { - ((HttpServletResponse) servletResponse).sendError(503); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdUtil.java deleted file mode 100644 index efb2d35d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdUtil.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.cometd; - -import java.io.IOException; -import java.util.Map; - -import org.cometd.server.BayeuxServerImpl; - -import com.google.gson.Gson; - -public class CometdUtil { - private static BayeuxServerImpl bayeuxServer = null; - - public static BayeuxServerImpl getBayeuxServer() { - return bayeuxServer; - } - - public static void setBayeuxServer(BayeuxServerImpl bayeux) { - bayeuxServer = bayeux; - } - -// public static String convertBean2Json(Object object) throws IOException { -// ObjectMapper mapper = new ObjectMapper(); -// return mapper.writeValueAsString(object); -// } -// -// public static Map convertJson2Map(String jsonStr) throws IOException { -// ObjectMapper objectMapper = new ObjectMapper(); -// return objectMapper.readValue(jsonStr, Map.class); -// } - public static <T> T fromJson(String jsonString, Class<T> templateClass) throws IOException { - Gson gson = new Gson(); - return gson.fromJson(jsonString, templateClass); - } - - /** - * gson to json. - * @param template class name - * @return String - */ - public static <T> String toJson(T template) throws IOException { - Gson gson = new Gson(); - return gson.toJson(template); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonConstant.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonConstant.java deleted file mode 100644 index 8250c94f..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonConstant.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -public class CommonConstant { - // Package Status - public static final String PACKAGE_STATUS_DELETING = "deleting"; - - public static final String PACKAGE_STATUS_DELETE_FAIL = "deleteFailed"; - - public static final String PACKAGE_XML_FORMAT = "xml"; - - - public static final String PACKAGE_YAML_FORMAT = "yaml"; - - // host image progress - - public static final String TOSCA_METADATA = "TOSCA-Metadata"; - - public static final String CSAR_VERSION_META = "version"; - - public static final String CSAR_TYPE_META = "type"; - - public static final String CSAR_PROVIDER_META = "provider"; - - public static final String DEFINITIONS = "Definitions"; - - public static final String CSAR_META = "csar.meta"; - - public static final String CSAR_SUFFIX = ".csar"; - - public static final String HTTP_HEADER_CONTENT_RANGE = "Content-Range"; - - public static final String CATALOG_CSAR_DIR_NAME = "/csar"; - - public static final String COMETD_CHANNEL_PACKAGE_DELETE = "/package/delete"; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java deleted file mode 100644 index 31709064..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CommonErrorResponse { - - private String code; - - private String message; - - - public static Object failure(String message) { - return message; - } - - public CommonErrorResponse(String message) { - super(); - this.message = message; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java deleted file mode 100644 index 0b9c4074..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import org.openo.commontosca.catalog.CatalogAppConfiguration; - - -public class Config { - private static CatalogAppConfiguration configration; - - public static CatalogAppConfiguration getConfigration() { - return configration; - } - - public static void setConfigration(CatalogAppConfiguration config) { - configration = config; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/DateTimeUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/DateTimeUtil.java deleted file mode 100644 index d41993fc..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/DateTimeUtil.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import java.text.SimpleDateFormat; -import java.util.Date; - -public class DateTimeUtil { - public static String getCurrentTime() { - return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()); - } - - public static String getFormatTime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(date); - } - - public static String getFormatTime(Date date, String format) { - return new SimpleDateFormat(format).format(date); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/EnumUploadStatus.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/EnumUploadStatus.java deleted file mode 100644 index 1aa6d478..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/EnumUploadStatus.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -public enum EnumUploadStatus { - Create_Directory_Success, Create_Directory_Fail, File_Exist, - Upload_From_Break_Success, Upload_From_Break_Failed, Upload_New_File_Success, - Upload_New_File_Failed -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java deleted file mode 100644 index ae17de61..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - - -public final class FileUtil { - - public static final Logger LOG = LoggerFactory.getLogger(FileUtil.class); - - private static final int BUFFER_SIZE = 2 * 1024 * 1024; - - private static final int TRY_COUNT = 3; - - private FileUtil() { - - } - - - /** - * create dir. - * @param dir dir to create - * @return boolean - */ - public static boolean createDirectory(String dir) { - File folder = new File(dir); - int tryCount = 0; - while (tryCount < TRY_COUNT) { - tryCount++; - if (!folder.exists() && !folder.mkdirs()) { - continue; - } else { - return true; - } - } - - return folder.exists(); - } - - /** - * delete file. - * @param file the file to delete - * @return boolean - */ - public static boolean deleteFile(File file) { - String hintInfo = file.isDirectory() ? "dir " : "file "; - boolean isFileDeleted = file.delete(); - boolean isFileExist = file.exists(); - if (!isFileExist) { - if (isFileDeleted) { - LOG.info("delete " + hintInfo + file.getAbsolutePath()); - } else { - isFileDeleted = true; - LOG.info("file not exist. no need delete " + hintInfo + file.getAbsolutePath()); - } - } else { - LOG.info("fail to delete " + hintInfo + file.getAbsolutePath()); - } - return isFileDeleted; - } - - - /** - * unzip zip file. - * @param zipFileName file name to zip - * @param extPlace extPlace - * @return unzip file name - * @throws IOException e1 - */ - public static ArrayList<String> unzip(String zipFileName, String extPlace) throws IOException { - ZipFile zipFile = null; - ArrayList<String> unzipFileNams = new ArrayList<String>(); - - try { - zipFile = new ZipFile(zipFileName); - Enumeration<?> fileEn = zipFile.entries(); - byte[] buffer = new byte[BUFFER_SIZE]; - - while (fileEn.hasMoreElements()) { - InputStream input = null; - BufferedOutputStream bos = null; - try { - ZipEntry entry = (ZipEntry) fileEn.nextElement(); - if (entry.isDirectory()) { - continue; - } - - input = zipFile.getInputStream(entry); - File file = new File(extPlace, entry.getName()); - if (!file.getParentFile().exists()) { - createDirectory(file.getParentFile().getAbsolutePath()); - } - - bos = new BufferedOutputStream(new FileOutputStream(file)); - while (true) { - int length = input.read(buffer); - if (length == -1) { - break; - } - bos.write(buffer, 0, length); - } - unzipFileNams.add(file.getAbsolutePath()); - } finally { - closeOutputStream(bos); - closeInputStream(input); - } - } - } finally { - closeZipFile(zipFile); - } - return unzipFileNams; - } - - /** - * close InputStream. - * - * @param inputStream the inputstream to close - */ - private static void closeInputStream(InputStream inputStream) { - try { - if (inputStream != null) { - inputStream.close(); - } - } catch (Exception e1) { - LOG.info("close InputStream error!"); - } - } - - /** - * close OutputStream. - * - * @param outputStream the output stream to close - */ - private static void closeOutputStream(OutputStream outputStream) { - try { - if (outputStream != null) { - outputStream.close(); - } - } catch (Exception e1) { - LOG.info("close OutputStream error!"); - } - } - - /** - * close zipFile. - * - * @param zipFile the zipFile to close - */ - private static void closeZipFile(ZipFile zipFile) { - try { - if (zipFile != null) { - zipFile.close(); - zipFile = null; - } - } catch (IOException e1) { - LOG.info("close ZipFile error!"); - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FtpClient.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FtpClient.java deleted file mode 100644 index 62a68df8..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FtpClient.java +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import org.apache.commons.net.ftp.FTP; -import org.apache.commons.net.ftp.FTPClient; -import org.apache.commons.net.ftp.FTPFile; -import org.apache.commons.net.ftp.FTPReply; - -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - - - -/** - * FTP client user for upload or delete files in ftp client. - */ -public class FtpClient { - private FTPClient ftpClient; - - public static final String ZIP = ".zip"; - - public FtpClient(String host, String username, String password, int port) throws Exception { - ftpClient = new FTPClient(); - connect(host, username, password, port); - } - - private void connect(String host, String user, String pwd, int port) throws Exception { - ftpClient.connect(host, port); - if (!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) { - ftpClient.disconnect(); - throw new Exception("Exception in connecting to FTP Server"); - } - ftpClient.login(user, pwd); - ftpClient.setFileType(FTP.BINARY_FILE_TYPE); - ftpClient.enterLocalPassiveMode(); - } - - /** - * disconnect to ftp. - * @throws Exception e - */ - public void disconnect() throws Exception { - if (this.ftpClient.isConnected()) { - this.ftpClient.logout(); - this.ftpClient.disconnect(); - } - } - - /** - * get remote file. - * @param remoteFilePath remote file path - * @param localFilePath local file path - * @throws IOException e - */ - public void get(String remoteFilePath, String localFilePath) throws IOException { - FileOutputStream fos = new FileOutputStream(localFilePath); - this.ftpClient.retrieveFile(remoteFilePath, fos); - fos.close(); - } - - public void delete(String filePath) throws IOException { - ftpClient.dele(filePath); - } - - - /** - * upload a file to FTP client. support resuming. - * @param startPosition start position to upload - * @param endPosition end position of upload - * @param inputstream upload inputstream - * @param remote remote path - * @return enum - * @throws IOException e - */ - public EnumUploadStatus upload(int startPosition, int endPosition, InputStream inputstream, - String remote) throws IOException { - // set transfer mode: PassiveMode - ftpClient.enterLocalPassiveMode(); - // set transfer file type: binary - ftpClient.setFileType(FTP.BINARY_FILE_TYPE); - ftpClient.setControlEncoding("GBK"); - String remoteFileName = remote; - if (remote.contains("/")) { - remoteFileName = remote.substring(remote.lastIndexOf("/") + 1); - if (createDirecroty(remote, ftpClient) == EnumUploadStatus.Create_Directory_Fail) { - return EnumUploadStatus.Create_Directory_Fail; - } - } - - long lstartPos = 0; - FTPFile[] files = ftpClient.listFiles(new String(remoteFileName.getBytes("GBK"), "iso-8859-1")); - if (files.length == 1) { - lstartPos = files[0].getSize(); - } - if (lstartPos > endPosition) { - return EnumUploadStatus.File_Exist; - } - if (lstartPos < startPosition) { - lstartPos = startPosition; - } else if (lstartPos > startPosition && lstartPos < endPosition) { - lstartPos = startPosition; - } - - return uploadFile(remoteFileName, inputstream, ftpClient, lstartPos); - } - - /** - * Create a remote server directory recursively. - * - * @param remote remote directory - * @param ftpClient ftpclient - * @return enum - * @throws IOException e - */ - public EnumUploadStatus createDirecroty(String remote, FTPClient ftpClient) throws IOException { - String directory = remote.substring(0, remote.lastIndexOf("/") + 1); - if (!directory.equalsIgnoreCase("/") - && !ftpClient.changeWorkingDirectory(new String(directory.getBytes("GBK"), "iso-8859-1"))) { - int start = 0; - int end = 0; - if (directory.startsWith("/")) { - start = 1; - } else { - start = 0; - } - end = directory.indexOf("/", start); - while (true) { - String subDirectory = - new String(remote.substring(start, end).getBytes("GBK"), "iso-8859-1"); - if (!ftpClient.changeWorkingDirectory(subDirectory)) { - if (ftpClient.makeDirectory(subDirectory)) { - ftpClient.changeWorkingDirectory(subDirectory); - } else { - return EnumUploadStatus.Create_Directory_Fail; - } - } - - start = end + 1; - end = directory.indexOf("/", start); - - // check whether all directories are created or not - if (end <= start) { - break; - } - } - } - return EnumUploadStatus.Create_Directory_Success; - } - - /** - * upload file to client. - * - * @param remoteFile remote file name - * @param localFile local file name including absolute path - * @param ftpClient FTPClient class - * @param lStartPos starting position - * @return enum - * @throws IOException e - */ - /** - * upload file to client. - * @param remoteFile remote file name - * @param inputstream inputstream to upload file - * @param ftpClient ftp client - * @param lstartPos start position - * @return enum - * @throws IOException e - */ - public EnumUploadStatus uploadFile(String remoteFile, InputStream inputstream, - FTPClient ftpClient, long lstartPos) throws IOException { - OutputStream out = - ftpClient.appendFileStream(new String(remoteFile.getBytes("GBK"), "iso-8859-1")); - if (out == null) { - out = ftpClient.storeFileStream(new String(remoteFile.getBytes("GBK"), "iso-8859-1")); - } - if (lstartPos > 0) { - ftpClient.setRestartOffset(lstartPos); - } - byte[] bytes = new byte[512]; - int count; - while ((count = inputstream.read(bytes, 0, 512)) > 0) { - out.write(bytes, 0, count); - } - out.flush(); - out.close(); - boolean result = ftpClient.completePendingCommand(); - if (lstartPos > 0) { - return result ? EnumUploadStatus.Upload_From_Break_Success - : EnumUploadStatus.Upload_From_Break_Failed; - } else { - return result ? EnumUploadStatus.Upload_New_File_Success - : EnumUploadStatus.Upload_New_File_Failed; - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java deleted file mode 100644 index 07d26458..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - - -public class HttpServerAddrConfig { - - protected static String httpServerAddress; - - public static String getHttpServerAddress() { - return httpServerAddress; - } - - public static void setHttpServerAddress(String httpServerAddress) { - HttpServerAddrConfig.httpServerAddress = httpServerAddress; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java deleted file mode 100644 index cef93583..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - - -public class HttpServerPathConfig { - protected static String httpServerPath; - - public static String getHttpServerPath() { - return httpServerPath; - } - - public static void setHttpServerPath(String httpServerPath) { - HttpServerPathConfig.httpServerPath = httpServerPath; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java deleted file mode 100644 index 4f27a0f3..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -public class MsbAddrConfig { - - protected static String msbAddress; - - public static String getMsbAddress() { - return msbAddress; - } - - public static void setMsbAddress(String msbAddress) { - MsbAddrConfig.msbAddress = msbAddress; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbUtil.java deleted file mode 100644 index a241c112..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbUtil.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -/** - * micro-service bus utility class. - * - */ -public class MsbUtil { - - public static String getRocBaseUrl() { - return Config.getConfigration().getMsbServerAddr() + getRocApiRootDomain(); - } - - private static String getRocApiRootDomain() { - return "/api/roc/v1"; - } - - public static String getNsocLifecycleBaseUrl() { - return Config.getConfigration().getMsbServerAddr() + getNsocLifeCycleRootDomain(); - } - - private static String getNsocLifeCycleRootDomain() { - return "/api/nsoc/v1"; - } - - public static String getVimBaseUrl() { - return Config.getConfigration().getMsbServerAddr() + getVimRootDomain(); - } - - private static String getVimRootDomain() { - return "/api/vim/v1"; - } - - public static String getPackageUrl() { - return Config.getConfigration().getMsbServerAddr() + "/api/nsoc/v1/csar/"; - } - - public static String getYamlParseBaseUrl() { - return Config.getConfigration().getMsbServerAddr() + "/openoapi/yamlparser/v1"; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java deleted file mode 100644 index 049aac26..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import javax.ws.rs.core.Response; - - -public class RestUtil { - - /** - * get rest exception. - * @param errorMsg error message - * @return Response - */ - public static Response getRestException(String errorMsg) { - String code = "001"; - return Response.status(Response.Status.INTERNAL_SERVER_ERROR) - .entity(new CommonErrorResponse(code, errorMsg)).build(); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ServiceRegistrer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ServiceRegistrer.java deleted file mode 100644 index 1e2be58a..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ServiceRegistrer.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.externalservice.msb.MicroserviceBusConsumer; -import org.openo.commontosca.catalog.externalservice.msb.ServiceRegisterEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Iterator; - -public class ServiceRegistrer implements Runnable { - private final ArrayList<ServiceRegisterEntity> serviceEntityList = - new ArrayList<ServiceRegisterEntity>(); - private static final Logger LOG = LoggerFactory.getLogger(ServiceRegistrer.class); - - public ServiceRegistrer() { - initServiceEntity(); - } - - @Override - public void run() { - LOG.info("start microservice register"); - boolean flag = false; - ServiceRegisterEntity entity = new ServiceRegisterEntity(); - int retry = 0; - while (retry < 1000 && serviceEntityList.size() > 0) { - Iterator<ServiceRegisterEntity> it = serviceEntityList.iterator(); - while (it.hasNext()) { - entity = it.next(); - LOG.info("start" + entity.getServiceName() + " catalog microservice register.retry:" - + retry); - flag = MicroserviceBusConsumer.registerService(entity); - if (flag == false) { - LOG.warn(entity.getServiceName() - + " microservice register failed, sleep 30S and try again."); - threadSleep(30000); - } else { - LOG.info(entity.getServiceName() + " microservice register success!"); - it.remove(); - } - } - retry++; - - } - LOG.info("catalog microservice register end."); - - } - - /** - * sleep thread. - * @param second sleep second - */ - private void threadSleep(int seconds) { - LOG.info("start sleep ...."); - try { - Thread.sleep(seconds); - } catch (InterruptedException e1) { - LOG.error("thread sleep error.errorMsg:" + e1.getMessage()); - } - LOG.info("sleep end ."); - } - - private void initServiceEntity() { - ServiceRegisterEntity catalogEntity = new ServiceRegisterEntity(); - catalogEntity.setServiceName("catalog"); - catalogEntity.setProtocol("REST"); - catalogEntity.setVersion("v1"); - catalogEntity.setUrl("/openoapi/catalog/v1"); - catalogEntity.setSingleNode(Config.getConfigration().getServiceIp(), "8200", 0); - catalogEntity.setVisualRange("1"); - serviceEntityList.add(catalogEntity); - ServiceRegisterEntity httpServiceEntity = new ServiceRegisterEntity(); - httpServiceEntity.setServiceName("/files/catalog-http"); - httpServiceEntity.setProtocol("REST"); - httpServiceEntity.setVersion("v1"); - httpServiceEntity.setUrl("/"); - httpServiceEntity.setSingleNode(Config.getConfigration().getServiceIp(), "8201", 0); - httpServiceEntity.setVisualRange("1"); - serviceEntityList.add(httpServiceEntity); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ToolUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ToolUtil.java deleted file mode 100644 index 576cade3..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ToolUtil.java +++ /dev/null @@ -1,403 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; - -import org.openo.commontosca.catalog.model.common.EnumToscaNodeTypeDefinition; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.UUID; - - - -/** - * common utility class. - * - */ -public class ToolUtil { - private static final Logger LOG = LoggerFactory.getLogger(ToolUtil.class); - - public static final String CATALOGUE_CSAR_DIR_NAME = "csar"; - - public static final String CATALOGUE_IMAGE_DIR_NAME = "image"; - - public static final int FILE_PERCENT = 1024 * 1024; // 1M - - public static boolean isEmptyString(String val) { - return val == null || "".equals(val); - } - - public static boolean isTrimedEmptyString(String val) { - return val == null || "".equals(val.trim()); - } - - public static boolean isTrimedEmptyArray(String[] val) { - return val == null || val.length == 0; - } - - /** - * trimed string. - * - * @param val string array to trim - * @return String[] - */ - public static String[] trimedStringArray(String[] val) { - if (isTrimedEmptyArray(val)) { - return val; - } - - String[] rets = new String[val.length]; - for (int i = 0; i < val.length; i++) { - rets[i] = val[i].trim(); - } - return rets; - } - - public static boolean isEmptyCollection(Collection<?> coll) { - return null == coll || coll.isEmpty(); - } - - /** - * store chunk file to local temp directory. - * - * @param dirName directory name - * @param fileName file name - * @param uploadedInputStream upload input stream - * @return String - * @throws IOException e - */ - public static String storeChunkFileInLocal(String dirName, String fileName, - InputStream uploadedInputStream) throws IOException { - File tmpDir = new File(dirName); - LOG.info("tmpdir = " + File.separator + dirName); - if (!tmpDir.exists()) { - tmpDir.mkdirs(); - } - File file = new File(tmpDir + File.separator + fileName); - OutputStream os = null; - try { - int read = 0; - byte[] bytes = new byte[1024]; - os = new FileOutputStream(file, true); - while ((read = uploadedInputStream.read(bytes)) != -1) { - os.write(bytes, 0, read); - } - os.flush(); - return file.getAbsolutePath(); - } finally { - if (os != null) { - os.close(); - } - } - } - - /** - * get temp dirctory when upload package. - * - * @param dirName temp directory name - * @param fileName package name - * @return String - */ - public static String getTempDir(String dirName, String fileName) { - // File tmpDir = new File(File.separator + dirName); - return Class.class.getClass().getResource("/").getPath() + dirName + File.separator - + fileName.replace(".csar", ""); - } - - public static String getUnzipDir(String dirName) { - File tmpDir = new File(File.separator + dirName); - return tmpDir.getAbsolutePath().replace(".csar", ""); - } - - /** - * delete file. - * - * @param dirName the directory of file - * @param fileName file name - * @return boolean - */ - public static boolean deleteFile(String dirName, String fileName) { - File tmpDir = new File(getCataloguePath() + File.separator + dirName); - if (!tmpDir.exists()) { - return true; - } - File file = new File(tmpDir.getAbsolutePath() + File.separator + fileName); - if (file.exists()) { - return file.delete(); - } - return true; - } - - public static String getCataloguePath() { - return Config.getConfigration().getCataloguePath(); - } - - public static String getCatalogueCsarPath() { - return getCataloguePath() + File.separator + CATALOGUE_CSAR_DIR_NAME; - } - - public static String getCatalogueImagePath() { - return getCataloguePath() + File.separator + CATALOGUE_IMAGE_DIR_NAME; - } - - /** - * get file size. - * - * @param file file which to get the size - * @param fileUnit file unit - * @return String file size - */ - public static String getFileSize(File file, int fileUnit) { - String fileSize = ""; - DecimalFormat format = new DecimalFormat("#0.00"); - if (file.exists()) { - fileSize = format.format((double) file.length() / fileUnit) + "M"; - } - return fileSize; - } - - public static String formatFileSize(double fileLength, int fileUnit) { - DecimalFormat format = new DecimalFormat("#0.00"); - return format.format(fileLength / fileUnit) + "M"; - } - - /** - * get file size by content. - * - * @param contentRange content range - * @return String - */ - public static String getFileSizeByContent(String contentRange) { - String size = - contentRange.substring(contentRange.indexOf("/") + 1, contentRange.length()).trim(); - return formatFileSize(Double.parseDouble(size), FILE_PERCENT); - } - - /** - * fix package format. - * - * @param csarId package ID - * @return String - */ - public static String formatCsar(String csarId) { - String result = csarId; - if (csarId.indexOf(".csar") < 0) { - result += ".csar"; - } - return result; - } - - /** - * judge the package format is xml or not. - * - * @param fileLocation package location - * @param unzipDir the directory where the package unzip to - * @return boolean - * @throws IOException e - */ - public static boolean isXmlCsar(String fileLocation, String unzipDir) throws IOException { - String tempfolder = unzipDir; - ArrayList<String> unzipFiles = FileUtil.unzip(fileLocation, tempfolder); - if (unzipFiles.isEmpty()) { - return true; - } - for (String unzipFile : unzipFiles) { - if (isYamlFile(new File(unzipFile))) { - return false; - } - } - return true; - } - - - /** - * delete the file and file directory. - * - * @param dir file - * @return boolean - */ - public static boolean deleteDir(File dir) { - if (dir.isDirectory()) { - String[] children = dir.list(); - for (int i = 0; i < children.length; i++) { - boolean success = deleteDir(new File(dir, children[i])); - if (!success) { - return false; - } - } - } - return dir.delete(); - } - - // public static boolean unZipCsar(String fileLocation) throws IOException { - // String tempfolder=System.getProperty("java.io.tmpdir"); - // ArrayList<String> unzipFiles = FileUtil.unzip(fileLocation, tempfolder); - // if(unzipFiles.isEmpty()){ - // return true; - // } - // } - - /** - * judge the file's format is yaml or not. - * - * @param file file to judge - * @return boolean - */ - public static boolean isYamlFile(File file) { - if (!file.isDirectory() && file.getName().indexOf(".yaml") != -1) { - return true; - } - return false; - } - - /** - * remove the csar suffix. - * - * @param csarName package name - * @return String - */ - public static String removeCsarSuffix(String csarName) { - return csarName.replaceAll(".csar", ""); - } - - /** - * add the csar fuffix. - * - * @param csarName package name - * @return String - */ - public static String addCsarSuffix(String csarName) { - if (csarName.indexOf(".csar") == -1) { - return csarName + ".csar"; - } - return csarName; - } - - /** - * judge whether the type is vnf node type. - * - * @param type type - * @return boolean - */ - public static boolean isVnfNodetype(String type) { - if (type.toLowerCase().contains(EnumToscaNodeTypeDefinition.VNFC.getName().toLowerCase())) { - return false; - } - return type.toLowerCase().contains(EnumToscaNodeTypeDefinition.VNF.getName().toLowerCase()); - } - - /** - * process file name. - * - * @param fileName file's name - * @return String - */ - public static String processFileName(String fileName) { - int index = fileName.indexOf(".zip"); - if (index == -1) { - return fileName; - } - - return addCsarSuffix(fileName.replaceAll(".zip", "")); - } - - /** - * exchange object to string. - * - * @param obj object - * @return String - */ - public static String objectToString(Object obj) { - if (obj == null) { - return ""; - } - Gson gson = new Gson(); - String str = gson.toJson(obj); - return str; - } - - public static String generateId() { - return UUID.randomUUID().toString(); - } - - /** - * get the size format according file size. - * - * @param fileSize file size - * @return size format - */ - public static String getFormatFileSize(long fileSize) { - long kb = 1024; - long mb = kb * 1024; - long gb = mb * 1024; - - if (fileSize >= gb) { - return String.format("%.1f GB", (float) fileSize / gb); - } else if (fileSize >= mb) { - float fi = (float) fileSize / mb; - return String.format(fi > 100 ? "%.0f MB" : "%.1f MB", fi); - } else if (fileSize >= kb) { - float fi = (float) fileSize / kb; - return String.format(fi > 100 ? "%.0f KB" : "%.1f KB", fi); - } else { - return String.format("%d B", fileSize); - } - } - - /** - * get gson from json. - * @param jsonString json string - * @param templateClass template class - * @return Template - */ - public static <T> T fromJson(String jsonString, Class<T> templateClass) { - Gson gson = new Gson(); - return gson.fromJson(jsonString, templateClass); - } - - /** - * gson to json. - * @param template class name - * @return String - */ - public static <T> String toJson(T template) { - Gson gson = new Gson(); - return gson.toJson(template); - } - - /** - * @param value - * @return - */ - public static String getAsString(JsonElement value) { - if (value.isJsonPrimitive()) { - return value.getAsString(); - } - - return value.toString(); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java deleted file mode 100644 index 08925f9c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.common; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.util.zip.CRC32; -import java.util.zip.CheckedOutputStream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - - -public class ZipCompressor { - - public static final Logger LOG = LoggerFactory.getLogger(ZipCompressor.class); - static final int BUFFER = 8192; - - private File zipFile; - - public ZipCompressor(String pathName) { - zipFile = new File(pathName); - } - - /** - * compress file according several path. - * @param pathName file path name - */ - public void compress(String... pathName) { - ZipOutputStream out = null; - try { - FileOutputStream fileOutputStream = new FileOutputStream(zipFile); - CheckedOutputStream cos = new CheckedOutputStream(fileOutputStream, new CRC32()); - out = new ZipOutputStream(cos); - String basedir = ""; - for (int i = 0; i < pathName.length; i++) { - compress(new File(pathName[i]), out, basedir); - } - out.close(); - } catch (Exception e1) { - throw new RuntimeException(e1); - } - } - - /** - * compress file according file path. - * @param srcPathName file path name - */ - public void compress(String srcPathName) { - File file = new File(srcPathName); - if (!file.exists()) { - throw new RuntimeException(srcPathName + "not exist!"); - } - try { - FileOutputStream fileOutputStream = new FileOutputStream(zipFile); - CheckedOutputStream cos = new CheckedOutputStream(fileOutputStream, new CRC32()); - ZipOutputStream out = new ZipOutputStream(cos); - String basedir = ""; - compress(file, out, basedir); - out.close(); - } catch (Exception e1) { - throw new RuntimeException(e1); - } - } - - private void compress(File file, ZipOutputStream out, String basedir) { - if (file.isDirectory()) { - System.out.println("compress: " + basedir + file.getName()); - this.compressDirectory(file, out, basedir); - } else { - System.out.println("compress: " + basedir + file.getName()); - this.compressFile(file, out, basedir); - } - } - - private void compressDirectory(File dir, ZipOutputStream out, String basedir) { - if (!dir.exists()) { - return; - } - - File[] files = dir.listFiles(); - for (int i = 0; i < files.length; i++) { - compress(files[i], out, basedir + dir.getName() + "/"); - } - } - - private void compressFile(File file, ZipOutputStream out, String basedir) { - if (!file.exists()) { - return; - } - try { - byte data[] = new byte[BUFFER]; - BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); - ZipEntry entry = new ZipEntry(basedir + file.getName()); - out.putNextEntry(entry); - int count; - while ((count = bis.read(data, 0, BUFFER)) != -1) { - out.write(data, 0, count); - } - bis.close(); - } catch (Exception e1) { - throw new RuntimeException(e1); - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/CatalogResuorceType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/CatalogResuorceType.java deleted file mode 100644 index e610d562..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/CatalogResuorceType.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.common; - - -public enum CatalogResuorceType { - SERVICETEMPLATE, PACKAGE, NODETEMPLATE, TEMPLATE, SERVICETEMPLATEMAPPING; - - public static CatalogResuorceType getType(String type) { - return valueOf(type); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/Parameters.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/Parameters.java deleted file mode 100644 index 2211a748..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/Parameters.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.common; - -public enum Parameters { - oid, name, provider, version, deletionPending, - type, status, csarId, vendor, serviceTemplateId, - nodeTemplateId, mappingId, nodeType; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/BaseDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/BaseDao.java deleted file mode 100644 index fab22d6a..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/BaseDao.java +++ /dev/null @@ -1,218 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.dao; - -import io.dropwizard.hibernate.AbstractDAO; -import io.dropwizard.util.Generics; - -import org.hibernate.Criteria; -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.criterion.Restrictions; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.HqlFactory; - -import java.util.List; -import java.util.Map; - - -/** - * a base class for Hibernate DAO classes. provide the common methods to create,delete,update and - * query data. - * - */ -public class BaseDao<T> extends AbstractDAO<T> { - - /** - * base dao constructor. - * - * @param sessionFactory session factory - */ - public BaseDao(SessionFactory sessionFactory) { - super(sessionFactory); - this.sessionFactory = sessionFactory; - this.entityClass = Generics.getTypeParameter(getClass()); - } - - public String[] excludeProperties; - private SessionFactory sessionFactory; - protected Session session; - private final Class<?> entityClass; - - @Override - protected Session currentSession() { - return this.session; - } - - /** - * update data. - * - * @param data the object to update - * @throws CatalogResourceException e1 - */ - public void update(T data, String filter) throws CatalogResourceException { - try { - String hql = HqlFactory.getUpdateHql(data, excludeProperties, filter); - beginTransaction(); - Query query = this.session.createQuery(hql); - query.executeUpdate(); - closeTransaction(); - } catch (Exception e1) { - transactionRollBack(); - throw new CatalogResourceException("error while updating data.errorMsg:" + e1.getMessage(), - e1); - } finally { - closeSession(); - } - } - - /** - * delete data. - * - * @param data the object to delete - * @throws CatalogResourceException e1 - */ - public void delete(T data) throws CatalogResourceException { - try { - beginTransaction(); - this.session.delete(data); - closeTransaction(); - } catch (Exception e1) { - transactionRollBack(); - throw new CatalogResourceException("error while deleting data.errorMsg:" + e1.getMessage(), - e1); - } finally { - closeSession(); - } - } - - /** - * create data. - * - * @param data the object to create - * @return data - * @throws CatalogResourceException e1 - */ - public T create(T data) throws CatalogResourceException { - try { - beginTransaction(); - session.save(data); - closeTransaction(); - } catch (HibernateException e1) { - transactionRollBack(); - throw new CatalogResourceException("error while creating data.errorMsg:" + e1.getMessage(), - e1); - } finally { - closeSession(); - } - return data; - } - - /** - * union query. - * - * @param unionHql union hql - * @return list - * @throws CatalogResourceException e1 - */ - public List<T> unionQuery(String unionHql) throws CatalogResourceException { - List<T> data; - try { - beginTransaction(); - Query query = this.session.createQuery(unionHql); - data = query.list(); - closeTransaction(); - } catch (Exception e1) { - transactionRollBack(); - throw new CatalogResourceException("error while union query data.errorMsg:" + e1.getMessage(), - e1); - } finally { - closeSession(); - } - return data; - } - - /** - * union delete. - * - * @param unionHql union hql - * @return int - * @throws CatalogResourceException e1 - */ - public int unionDelete(String unionHql) throws CatalogResourceException { - int num = 0; - try { - beginTransaction(); - Query query = this.session.createQuery(unionHql); - num = query.executeUpdate(); - closeTransaction(); - } catch (Exception e1) { - transactionRollBack(); - throw new CatalogResourceException("error while union query data.errorMsg:" + e1.getMessage(), - e1); - } finally { - closeSession(); - } - return num; - } - - /** - * query data. - * - * @param queryParams the condition map used to query objects - * @return data list - * @throws CatalogResourceException e1 - */ - @SuppressWarnings("unchecked") - public List<T> query(Map<String, String> queryParams) throws CatalogResourceException { - List<T> result = null; - try { - beginTransaction(); - Criteria criteria = this.session.createCriteria(entityClass); - for (String key : queryParams.keySet()) { - criteria.add(Restrictions.eq(key, queryParams.get(key))); - } - result = (List<T>) criteria.list(); - closeTransaction(); - } catch (HibernateException e1) { - throw new CatalogResourceException("error while querying data.errorMsg:" + e1.getMessage(), - e1); - } finally { - closeSession(); - } - return result; - } - - protected void beginTransaction() { - this.session = this.sessionFactory.openSession(); - this.session.beginTransaction(); - } - - protected void closeTransaction() { - this.session.getTransaction().commit(); - } - - protected void closeSession() { - this.session.close(); - } - - protected void transactionRollBack() { - this.session.getTransaction().rollback(); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/DaoManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/DaoManager.java deleted file mode 100644 index cdd1f666..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/DaoManager.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.dao; - -import org.hibernate.SessionFactory; - -import org.openo.commontosca.catalog.db.common.CatalogResuorceType; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; - -/** - * DAO manager class. - * a class to store DAO instances and provide methods to get these instances. - * - */ -public class DaoManager { - private static DaoManager instance = new DaoManager(); - - private ServiceTemplateDao serviceTemplateDao; - private PackageDao packageDao; - private NodeTemplateDao nodeTemplateDao; - private TemplateDao templateDao; - private ServiceTemplateMappingDao templateMappingDao; - private SessionFactory sessionFactory; - - private DaoManager() {} - - public static synchronized DaoManager getInstance() { - return instance; - } - - /** - * get dao. - * @param type data type - * @return BaseDao<?> - */ - public BaseDao<?> getDao(String type) throws CatalogResourceException{ - if (sessionFactory == null) { - throw new CatalogResourceException("errorMsg:database connect init faild!"); - } - switch (CatalogResuorceType.getType(type)) { - case SERVICETEMPLATE: - return getServiceTemplateDao(); - case PACKAGE: - return getPackageDao(); - case NODETEMPLATE: - return getNodeTemplateDao(); - case TEMPLATE: - return getTemplateDao(); - case SERVICETEMPLATEMAPPING: - return getTemplateMappingDao(); - default: - return null; - } - } - - public void setSessionFactory(SessionFactory sessionFactory) { - this.sessionFactory = sessionFactory; - } - - public SessionFactory getSessionFactory() { - return sessionFactory; - } - - /** - * get service template dao. - * @return ServiceTemplateDao - */ - public ServiceTemplateDao getServiceTemplateDao() { - //if (serviceTemplateDao == null) { - serviceTemplateDao = new ServiceTemplateDao(sessionFactory); - // } - return serviceTemplateDao; - } - - public void setServiceTemplateDao(ServiceTemplateDao serviceTemplateDao) { - this.serviceTemplateDao = serviceTemplateDao; - } - - /** - * get package dao. - * @return PackageDao - */ - public PackageDao getPackageDao() { - // if (packageDao == null) { - packageDao = new PackageDao(sessionFactory); - // } - return packageDao; - } - - public void setPackageDao(PackageDao packageDao) { - this.packageDao = packageDao; - } - - /** - * get node templage dao. - * @return NodeTemplateDao - */ - public NodeTemplateDao getNodeTemplateDao() { - // if (nodeTemplateDao == null) { - nodeTemplateDao = new NodeTemplateDao(sessionFactory); - // } - return nodeTemplateDao; - } - - public void setTemplateDao(TemplateDao templateDao) { - this.templateDao = templateDao; - } - - /** - * get template dao. - * @return TemplateDao - */ - public TemplateDao getTemplateDao() { - // if (templateDao == null) { - templateDao = new TemplateDao(sessionFactory); - // } - return templateDao; - } - - public void setNodeTemplateDao(NodeTemplateDao nodeTemplateDao) { - this.nodeTemplateDao = nodeTemplateDao; - } - - /** - * get template mapping dao. - * @return ServiceTemplateMappingDao - */ - public ServiceTemplateMappingDao getTemplateMappingDao() { - //if (templateMappingDao == null) { - templateMappingDao = new ServiceTemplateMappingDao(sessionFactory); - // } - return templateMappingDao; - } - - public void setTemplateMappingDao(ServiceTemplateMappingDao templateMappingDao) { - this.templateMappingDao = templateMappingDao; - } - - /** - * set dao null. - */ - public void setDaoNull() { - this.nodeTemplateDao = null; - this.templateDao = null; - this.serviceTemplateDao = null; - this.packageDao = null; - this.templateMappingDao = null; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/NodeTemplateDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/NodeTemplateDao.java deleted file mode 100644 index 4669e37c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/NodeTemplateDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; - - -/** - * host DAO class. - * - */ -public class NodeTemplateDao extends BaseDao<NodeTemplateData> { - - public NodeTemplateDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/PackageDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/PackageDao.java deleted file mode 100644 index 81869de5..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/PackageDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.commontosca.catalog.db.entity.PackageData; - - -/** - * host DAO class. - * - */ -public class PackageDao extends BaseDao<PackageData> { - - public PackageDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateDao.java deleted file mode 100644 index bd38a915..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateDao.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; - -/** - * DAO class. - * - */ -public class ServiceTemplateDao extends BaseDao<ServiceTemplateData> { - - public ServiceTemplateDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateMappingDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateMappingDao.java deleted file mode 100644 index d5e41306..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateMappingDao.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; - -/** - * DAO class. - * - */ -public class ServiceTemplateMappingDao extends BaseDao<ServiceTemplateMappingData> { - - public ServiceTemplateMappingDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/TemplateDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/TemplateDao.java deleted file mode 100644 index 5a772ba4..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/TemplateDao.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.dao; - -import org.hibernate.HibernateException; -import org.hibernate.SessionFactory; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * DAO class. - * - */ -public class TemplateDao extends BaseDao<TemplateData> { - private static final Logger logger = LoggerFactory.getLogger(TemplateDao.class); - - public TemplateDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - /** - * create template data. - */ - public TemplateData create(TemplateData data) throws CatalogResourceException { - logger.info("TemplateDao:start add template.info:" + CatalogDbUtil.objectToString(data)); - beginTransaction(); - try { - this.session.persist(data.getServiceTemplate()); - for (NodeTemplateData nodeData : data.getNodeTemplates()) { - this.session.persist(nodeData); - } - closeTransaction(); - } catch (HibernateException e1) { - logger.error("TemplateDao:error while add template data.errorMsg:" + e1.getMessage()); - throw new CatalogResourceException("error while add template data" + e1.getMessage(), e1); - } finally { - closeSession(); - } - logger.info("TemplateDao: add template end ."); - return data; - } - - /** - * delete template data. - */ - public void delete(TemplateData data) throws CatalogResourceException { - logger.info("TemplateDao:start delete template.info:" + CatalogDbUtil.objectToString(data)); - beginTransaction(); - try { - for (NodeTemplateData nodeData : data.getNodeTemplates()) { - this.session.delete(nodeData); - } - this.session.delete(data.getServiceTemplate()); - closeTransaction(); - } catch (HibernateException e1) { - logger.error("TemplateDao:error while delete template data.errorMsg:" + e1.getMessage()); - throw new CatalogResourceException("error while delete template data" + e1.getMessage(), e1); - } finally { - closeSession(); - } - logger.info("TemplateDao: delete template end ."); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/BaseData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/BaseData.java deleted file mode 100644 index ce688cbb..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/BaseData.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.entity; - -public class BaseData { - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/NodeTemplateData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/NodeTemplateData.java deleted file mode 100644 index 0457e068..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/NodeTemplateData.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import java.io.Serializable; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "catalog_node_template_table") -@JsonIgnoreProperties(ignoreUnknown = true) -public class NodeTemplateData extends BaseData implements Serializable{ - - private static final long serialVersionUID = -2512216362645538471L; - @Id - @Column(name = "NODETEMPLATEID") - private String nodeTemplateId; - @Column(name = "NAME") - private String name; - @Id - @Column(name = "SERVICETEMPLATEID") - private String serviceTemplateId; - - @Column(name = "TYPE") - private String type; - - @Column(name = "PROPERTIES") - private String properties; - - @Column(name = "RELATIONSHIPS") - private String relationShips; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getServiceTemplateId() { - return serviceTemplateId; - } - - public void setServiceTemplateId(String serviceTemplateId) { - this.serviceTemplateId = serviceTemplateId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getProperties() { - return properties; - } - - public void setProperties(String properties) { - this.properties = properties; - } - - public String getRelationShips() { - return relationShips; - } - - public void setRelationShips(String relationShips) { - this.relationShips = relationShips; - } - - public void setNodeTemplateId(String nodeTemplateId) { - this.nodeTemplateId = nodeTemplateId; - } - - public String getNodeTemplateId() { - return nodeTemplateId; - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/PackageData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/PackageData.java deleted file mode 100644 index 631c6d9b..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/PackageData.java +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "catalog_package_table") -@JsonIgnoreProperties(ignoreUnknown = true) -public class PackageData extends BaseData { - - @Id - @Column(name = "CSARID") - private String csarId; - @Column(name = "DOWNLOADURi") - private String downloadUri; - - @Column(name = "NAME") - private String name; - - @Column(name = "SIZE") - private String size; - @Column(name = "VERSION") - private String version; - - @Column(name = "PROVIDER") - private String provider; - @Column(name = "TYPE") - private String type; - @Column(name = "FORMAT") - private String format; - - @Column(name = "DELETIONPENDING") - private String deletionPending; - - @Column(name = "MODIFYTIME") - private String modifyTime; - @Column(name = "OPERATIONALSTATE") - private String operationalState; - @Column(name = "USAGESTATE") - private String usageState; - @Column(name = "CREATETIME") - private String createTime; - @Column(name = "ONBOARDSTATE") - private String onBoardState; - @Column(name = "PROCESSSTATE") - private String processState; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getOnBoardState() { - return onBoardState; - } - - public void setOnBoardState(String onBoardState) { - this.onBoardState = onBoardState; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getProvider() { - return provider; - } - - public void setProvider(String provider) { - this.provider = provider; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDownloadUri() { - return downloadUri; - } - - public void setDownloadUri(String downloadUri) { - this.downloadUri = downloadUri; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } - - public String getFormat() { - return format; - } - - public void setFormat(String format) { - this.format = format; - } - - public String getDeletionPending() { - return deletionPending; - } - - public void setDeletionPending(String deletionPending) { - this.deletionPending = deletionPending; - } - - public String getModifyTime() { - return modifyTime; - } - - public void setModifyTime(String modifyTime) { - this.modifyTime = modifyTime; - } - - public String getOperationalState() { - return operationalState; - } - - public void setOperationalState(String operationalState) { - this.operationalState = operationalState; - } - - public String getUsageState() { - return usageState; - } - - public void setUsageState(String usageState) { - this.usageState = usageState; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public void setCsarId(String csarId) { - this.csarId = csarId; - } - - public String getCsarId() { - return csarId; - } - - public String getProcessState() { - return processState; - } - - public void setProcessState(String processState) { - this.processState = processState; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateData.java deleted file mode 100644 index 7348b868..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateData.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - - -@Entity -@Table(name = "catalog_service_template_table") -@JsonIgnoreProperties(ignoreUnknown = true) -public class ServiceTemplateData extends BaseData { - @Id - @Column(name = "SERVICETEMPLATEID") - private String serviceTemplateId; - @Column(name = "TEMPLATENAME") - private String templateName; - - @Column(name = "TYPE") - private String type; - - @Column(name = "VENDOR") - private String vendor; - - @Column(name = "VERSION") - private String version; - - @Column(name = "CSARID") - private String csarId; - - @Column(name = "INPUTS") - private String inputs; - - @Column(name = "DOWNLOADURI") - private String downloadUri; - - @Column(name = "ROWDATA") - private String rowData; - @Column(name = "OPERATIONS") - private String operations; - - @Column(name = "METADATA") - private String metadata; - - @Column(name = "SERVICETEMPLATEORIGINALID") - private String serviceTemplateOriginalId; - - public String getRowData() { - return rowData; - } - - public void setRowData(String rowData) { - this.rowData = rowData; - } - - public String getOperations() { - return operations; - } - - public void setOperations(String operations) { - this.operations = operations; - } - - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getVendor() { - return vendor; - } - - public void setVendor(String vendor) { - this.vendor = vendor; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getCsarId() { - return csarId; - } - - public void setCsarId(String csarId) { - this.csarId = csarId; - } - - public String getInputs() { - return inputs; - } - - public void setInputs(String inputs) { - this.inputs = inputs; - } - - public String getDownloadUri() { - return downloadUri; - } - - public void setDownloadUri(String downloadUri) { - this.downloadUri = downloadUri; - } - - public void setServiceTemplateId(String serviceTemplateId) { - this.serviceTemplateId = serviceTemplateId; - } - - public String getServiceTemplateId() { - return serviceTemplateId; - } - - public String getMetadata() { - return metadata; - } - - public void setMetadata(String metadata) { - this.metadata = metadata; - } - - public String getServiceTemplateOriginalId() { - return serviceTemplateOriginalId; - } - - public void setServiceTemplateOriginalId(String serviceTemplateOriginalId) { - this.serviceTemplateOriginalId = serviceTemplateOriginalId; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateMappingData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateMappingData.java deleted file mode 100644 index fab23d6c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateMappingData.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "catalog_model_substitution_mapping_table") -@JsonIgnoreProperties(ignoreUnknown = true) -public class ServiceTemplateMappingData extends BaseData { - - @Id - @Column(name = "MAPPINGID") - private String mappingId; - - @Column(name = "NODETYPE") - private String nodeType; - - @Column(name = "SERVICETEMPLATEID") - private String serviceTemplateId; - - @Column(name = "REQUIREMENTS") - private String requirements; - - @Column(name = "CAPABILITIES") - private String capabilities; - - public String getMappingId() { - return mappingId; - } - - public void setMappingId(String mappingId) { - this.mappingId = mappingId; - } - - public String getNodeType() { - return nodeType; - } - - public void setNodeType(String nodeType) { - this.nodeType = nodeType; - } - - public String getServiceTemplateId() { - return serviceTemplateId; - } - - public void setServiceTemplateId(String serviceTemplateId) { - this.serviceTemplateId = serviceTemplateId; - } - - public String getRequirements() { - return requirements; - } - - public void setRequirements(String requirements) { - this.requirements = requirements; - } - - public String getCapabilities() { - return capabilities; - } - - public void setCapabilities(String capabilities) { - this.capabilities = capabilities; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/TemplateData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/TemplateData.java deleted file mode 100644 index 415465c4..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/TemplateData.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.entity; - -import java.util.ArrayList; - -public class TemplateData extends BaseData { - private ServiceTemplateData serviceTemplate; - private ArrayList<NodeTemplateData> nodeTemplates = new ArrayList<NodeTemplateData>(); - - public ServiceTemplateData getServiceTemplate() { - return serviceTemplate; - } - - public void setServiceTemplate(ServiceTemplateData serviceTemplate) { - this.serviceTemplate = serviceTemplate; - } - - public ArrayList<NodeTemplateData> getNodeTemplates() { - return nodeTemplates; - } - - public void setNodeTemplates(ArrayList<NodeTemplateData> nodeTemplates) { - this.nodeTemplates = nodeTemplates; - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/CatalogResourceException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/CatalogResourceException.java deleted file mode 100644 index c18ad432..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/CatalogResourceException.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.exception; - -public class CatalogResourceException extends ErrorCodeException { - private static final long serialVersionUID = 5699508780537383310L; - - - public CatalogResourceException(int errcode) { - super(errcode, ""); - } - - - public CatalogResourceException(int errcode, Throwable cause) { - super(cause, errcode); - } - - - public CatalogResourceException(int errcode, String message, Throwable cause) { - super(cause, errcode, message); - } - - - public CatalogResourceException() { - super(9999999, null); - } - - - public CatalogResourceException(String message) { - super(9999999, message); - } - - - public CatalogResourceException(Throwable cause) { - super(cause, 9999999); - } - - - public CatalogResourceException(String message, Throwable cause) { - super(cause, 9999999, message); - } - - - /** - * catalog resource exception. - * @param source throwable source - * @param errId error Id - * @param debugMessage debug message - * @param arguments arguments - */ - public CatalogResourceException(Throwable source, int errId, String debugMessage, - String[] arguments) { - super(source, errId, debugMessage, arguments); - } - - public CatalogResourceException(Throwable source, int category, int code, String debugMessage, - String[] arguments) { - super(source, category, code, debugMessage, arguments); - } - - public int getErrcode() { - return super.getErrorCode(); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/ErrorCodeException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/ErrorCodeException.java deleted file mode 100644 index 1a57f5e6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/ErrorCodeException.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.exception; - - -public class ErrorCodeException extends Exception { - - private static final long serialVersionUID = 3220072444842529499L; - private int categoryCode = 0; - private int errorCode = 1; - private String[] arguments = null; - - private static String defaultText = null; - - - public static void setDefaultText(String text) { - defaultText = text; - } - - - public static String getDefaultText() { - return defaultText; - } - - - public ErrorCodeException(int code, String debugMessage) { - this(code, debugMessage, null); - } - - /** - * error code exception. - * @param code error code - * @param debugMessage debug message - * @param arguments arguments - */ - public ErrorCodeException(int code, String debugMessage, String[] arguments) { - super(debugMessage); - this.errorCode = code; - this.arguments = arguments; - } - - - public ErrorCodeException(Throwable source, int code) { - this(source, code, (String[]) null); - } - - /** - * error code exception. - * @param source Throwable - * @param code error code - * @param arguments arguments - */ - public ErrorCodeException(Throwable source, int code, String[] arguments) { - super(source); - this.errorCode = code; - this.arguments = arguments; - } - - - public ErrorCodeException(Throwable source, int code, String debugMessage) { - this(source, code, debugMessage, null); - } - - /** - * error code exception. - * @param source Throwable - * @param code error code - * @param debugMessage debug message - * @param arguments arguments - */ - public ErrorCodeException(Throwable source, int code, String debugMessage, String[] arguments) { - super(debugMessage, source); - this.errorCode = code; - this.arguments = arguments; - } - - - public ErrorCodeException(int category, int code, String debugMessage) { - this(category, code, debugMessage, null); - } - - - public ErrorCodeException(int category, int code, String debugMessage, String[] arguments) { - super(debugMessage); - this.categoryCode = category; - this.errorCode = code; - this.arguments = arguments; - } - - - public ErrorCodeException(Throwable source, int category, int code) { - this(source, category, code, (String[]) null); - } - - - public ErrorCodeException(Throwable source, int category, int code, String[] arguments) { - super(source); - this.categoryCode = category; - this.errorCode = code; - this.arguments = arguments; - } - - - public ErrorCodeException(Throwable source, int category, int code, String debugMessage) { - this(source, category, code, debugMessage, null); - } - - - public ErrorCodeException(Throwable source, int category, int code, String debugMessage, - String[] arguments) { - super(debugMessage, source); - this.categoryCode = category; - this.errorCode = code; - this.arguments = arguments; - } - - - public int getCategory() { - return categoryCode; - } - - public int getErrorCode() { - return errorCode; - } - - - public String[] getArguments() { - return arguments; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/hibernate/HibernateBundleAgent.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/hibernate/HibernateBundleAgent.java deleted file mode 100644 index 43b9333e..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/hibernate/HibernateBundleAgent.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright 2016 [ZTE] and others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.db.hibernate; - -import io.dropwizard.ConfiguredBundle; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; - -import org.openo.commontosca.catalog.CatalogAppConfiguration; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class HibernateBundleAgent implements ConfiguredBundle<CatalogAppConfiguration> { - - private final HibernateBundleExt bundle = new HibernateBundleExt(ServiceTemplateData.class, - PackageData.class, NodeTemplateData.class, ServiceTemplateMappingData.class); - private static final Logger LOGGER = LoggerFactory.getLogger(HibernateBundleAgent.class); - - @Override - public void run(final CatalogAppConfiguration configuration, final Environment environment) - throws Exception { - Thread thread = new Thread(new Runnable() { - int retry = 0; - boolean flag = true; - - public void run() { - while (retry < 1000) { - LOGGER.info("init hibernateBundle.retry:" + retry); - retry++; - try { - bundle.runExt(configuration, environment); - } catch (Exception e1) { - flag = false; - LOGGER.warn( - "init hibernateBundle failed, sleep 15S and try again.errorMsg:" + e1.getMessage()); - threadSleep(15000); - } - if (flag) { - LOGGER.info("init hibernateBundle success!"); - initDao(); - break; - } - } - } - }); - thread.setName("init hibernateBundle"); - thread.start(); - } - - private void initDao() { - DaoManager.getInstance().setSessionFactory(bundle.getSessionFactory()); - } - - private void threadSleep(int second) { - LOGGER.info("start sleep ...."); - try { - Thread.sleep(second); - } catch (InterruptedException error) { - LOGGER.error("thread sleep error.errorMsg:" + error.getMessage()); - } - LOGGER.info("sleep end ."); - } - - @Override - public void initialize(Bootstrap<?> bootstrap) { - bundle.initializeExt(bootstrap); - } - // - // public SessionFactory getSessionFactory() { - // return bundle.getSessionFactory(); - // } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/hibernate/HibernateBundleExt.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/hibernate/HibernateBundleExt.java deleted file mode 100644 index 20759491..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/hibernate/HibernateBundleExt.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright 2016 [ZTE] and others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.db.hibernate; - -import com.google.common.collect.ImmutableList; - -import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module; - -import io.dropwizard.db.DataSourceFactory; -import io.dropwizard.hibernate.HibernateBundle; -import io.dropwizard.hibernate.SessionFactoryFactory; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; - -import org.hibernate.SessionFactory; -import org.openo.commontosca.catalog.CatalogAppConfiguration; - - -public class HibernateBundleExt extends HibernateBundle<CatalogAppConfiguration> { - - private static final String DEFAULT_NAME = "hibernate"; - - private SessionFactory sessionFactory; - - private final ImmutableList<Class<?>> entities; - private final SessionFactoryFactory sessionFactoryFactory; - - protected HibernateBundleExt(Class<?> entity, Class<?>... entities) { - this(ImmutableList.<Class<?>>builder().add(entity).add(entities).build(), - new SessionFactoryFactory()); - } - - protected HibernateBundleExt(ImmutableList<Class<?>> entities, - SessionFactoryFactory sessionFactoryFactory) { - super(entities, sessionFactoryFactory); - this.entities = entities; - this.sessionFactoryFactory = sessionFactoryFactory; - } - - public final void initializeExt(Bootstrap<?> bootstrap) { - bootstrap.getObjectMapper().registerModule(createHibernate4Module()); - } - - /** - * Override to configure the {@link Hibernate4Module}. - */ - protected Hibernate4Module createHibernate4Module() { - return new Hibernate4Module(); - } - - protected String name() { - return DEFAULT_NAME; - } - - public final void runExt(CatalogAppConfiguration configuration, Environment environment) - throws Exception { - final DataSourceFactory dbConfig = getDataSourceFactory(configuration); - this.sessionFactory = - sessionFactoryFactory.build(this, environment, dbConfig, entities, name()); - - } - - public SessionFactory getSessionFactory() { - return sessionFactory; - } - - - @Override - public DataSourceFactory getDataSourceFactory(CatalogAppConfiguration configuration) { - return configuration.getDataSourceFactory(); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/PackageManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/PackageManager.java deleted file mode 100644 index a22fc66b..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/PackageManager.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.resource; - -import org.openo.commontosca.catalog.db.common.Parameters; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; - -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; -import org.openo.commontosca.catalog.db.util.HqlFactory; -import org.openo.commontosca.catalog.db.wrapper.PackageHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -public class PackageManager { - private static final Logger LOGGER = LoggerFactory.getLogger(PackageManager.class); - private static PackageManager manager; - PackageHandler handler = new PackageHandler(); - - /** - * get PackageManager instance. - * @return PackageManager instance - */ - public static synchronized PackageManager getInstance() { - if (manager == null) { - manager = new PackageManager(); - } - return manager; - } - - private PackageManager() {} - - /** - * add package. - * @param packageData package data - * @return PackageData - * @throws CatalogResourceException e - */ - public PackageData addPackage(PackageData packageData) throws CatalogResourceException { - LOGGER.info("start add package info to db.info:" + CatalogDbUtil.objectToString(packageData)); - PackageData data = handler.create(packageData); - LOGGER.info(" package info to db end.info:" + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query package by package id. - * @param csarId package id - * @return package data list - * @throws CatalogResourceException e - */ - public ArrayList<PackageData> queryPackageByCsarId(String csarId) - throws CatalogResourceException { - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.csarId.name(), csarId); - LOGGER.info("start query package info by csarid." + csarId); - ArrayList<PackageData> data = handler.query(queryParam); - LOGGER.info("query package info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query package by condition. - * @param name package name - * @param provider package provider - * @param version package version - * @param deletionPending deletionPending - * @param type package type - * @return package data list - * @throws CatalogResourceException e - */ - public ArrayList<PackageData> queryPackage(String name, String provider, String version, - String deletionPending, String type) throws CatalogResourceException { - LOGGER.info("start query package info.name:" + name + " provider:" + provider + " version:" - + version + " type:" + type); - Map<String, String> queryParam = new HashMap<String, String>(); - if (CatalogDbUtil.isNotEmpty(name)) { - queryParam.put(Parameters.name.name(), name); - } - if (CatalogDbUtil.isNotEmpty(version)) { - queryParam.put(Parameters.version.name(), version); - } - if (CatalogDbUtil.isNotEmpty(deletionPending)) { - queryParam.put(Parameters.deletionPending.name(), deletionPending); - } - if (CatalogDbUtil.isNotEmpty(type)) { - queryParam.put(Parameters.type.name(), type); - } - if (CatalogDbUtil.isNotEmpty(provider)) { - queryParam.put(Parameters.provider.name(), provider); - } - ArrayList<PackageData> data = handler.query(queryParam); - LOGGER.info("query package info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * delete package according package id. - * @param packageId package id - * @throws CatalogResourceException e - */ - public void deletePackage(String packageId) throws CatalogResourceException { - LOGGER.info("start delete package info by id." + packageId); - handler.delete(packageId); - LOGGER.info(" delete package info end id." + packageId); - } - - /** - * delete package by service template id. - * @param serviceTemplateId service template id - * @throws CatalogResourceException e - */ - public void deletePackageByServiceTemplateId(String serviceTemplateId) - throws CatalogResourceException { - LOGGER.info("start delete package info by serviceTemplateid." + serviceTemplateId); - ServiceTemplateData serviceTemplate = new ServiceTemplateData(); - serviceTemplate.setServiceTemplateId(serviceTemplateId); - String filter = - HqlFactory.getDeleteHqlByFilter(PackageData.class, serviceTemplate, - Parameters.csarId.name()); - int data = handler.unionDelete(filter); - - LOGGER.info("delete serviceTemplate info end.num:" + data); - } - - /** - * query package by service template id. - * @param serviceTemplateId service template id - * @return package data list - * @throws CatalogResourceException e - */ - public ArrayList<PackageData> queryPackageByServiceTemplateId(String serviceTemplateId) - throws CatalogResourceException { - LOGGER.info("start query package info by serviceTemplateid." + serviceTemplateId); - ServiceTemplateData serviceTemplate = new ServiceTemplateData(); - serviceTemplate.setServiceTemplateId(serviceTemplateId); - String filter = - HqlFactory - .getQueryHqlByFilter(PackageData.class, serviceTemplate, Parameters.csarId.name()); - ArrayList<PackageData> data = handler.unionQuery(filter); - LOGGER.info("query package info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * update package data. - * - * @param packageData package data - * @param csarId package id - * @throws CatalogResourceException e - */ - public void updatePackage(PackageData packageData, String csarId) - throws CatalogResourceException { - LOGGER.info("start update package info by id." + csarId + " info:" - + CatalogDbUtil.objectToString(packageData)); - handler.update(packageData, csarId); - LOGGER.info(" update package end id." + csarId); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/TemplateManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/TemplateManager.java deleted file mode 100644 index e389bfe6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/TemplateManager.java +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.resource; - -import org.openo.commontosca.catalog.db.common.Parameters; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; -import org.openo.commontosca.catalog.db.util.HqlFactory; -import org.openo.commontosca.catalog.db.wrapper.NodeTemplateHandler; -import org.openo.commontosca.catalog.db.wrapper.ServiceTemplateHandler; -import org.openo.commontosca.catalog.db.wrapper.ServiceTemplateMappingHandler; -import org.openo.commontosca.catalog.db.wrapper.TemplateHandler; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -public class TemplateManager { - private static final Logger LOGGER = LoggerFactory.getLogger(TemplateManager.class); - private static TemplateManager manager; - ServiceTemplateHandler handler = new ServiceTemplateHandler(); - NodeTemplateHandler nodeTemplateHandler = new NodeTemplateHandler(); - TemplateHandler templateHandler = new TemplateHandler(); - ServiceTemplateMappingHandler mappingHandler = new ServiceTemplateMappingHandler(); - - /** - * get TemplateManager instance. - * @return TemplateManager instance - */ - public static synchronized TemplateManager getInstance() { - if (manager == null) { - manager = new TemplateManager(); - } - return manager; - } - - private TemplateManager() {} - - /** - * add service template. - * - * @param templateData TemplateData - * @return TemplateData - * @throws CatalogResourceException e - */ - public TemplateData addServiceTemplate(TemplateData templateData) - throws CatalogResourceException { - LOGGER - .info("start add template info to db.info:" + CatalogDbUtil.objectToString(templateData)); - TemplateData data = templateHandler.create(templateData); - LOGGER.info(" template info to db end.info:" + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * add service template mapping. - * @param templateMappingData mapping data - * @return ServiceTemplateMappingData - * @throws CatalogResourceException e - */ - public ServiceTemplateMappingData addServiceTemplateMapping( - ServiceTemplateMappingData templateMappingData) throws CatalogResourceException { - LOGGER.info("start add servicetemplate Mapping info to db.info:" - + CatalogDbUtil.objectToString(templateMappingData)); - ServiceTemplateMappingData data = mappingHandler.create(templateMappingData); - LOGGER.info(" template mapping info to db end.info:" + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query service template mapping by id. - * @param id id - * @return ServiceTemplateMappingData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateMappingData> queryServiceTemplateMappingById(String id) - throws CatalogResourceException { - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.mappingId.name(), id); - LOGGER.info("start query serviceTemplateMapping info by id." + id); - ArrayList<ServiceTemplateMappingData> data = mappingHandler.query(queryParam); - LOGGER.info("query serviceTemplateMapping info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * delete service template mapping by id. - * @param id id - * @throws CatalogResourceException e - */ - public void deleteServiceTemplateMappingById(String id) throws CatalogResourceException { - - LOGGER.info("start delete serviceTemplateMapping info by id." + id); - mappingHandler.delete(id); - LOGGER.info("delete serviceTemplateMapping info end"); - } - - /** - * delete service template mapping. - * @param nodeType node type - * @param serviceTemplateId service template id - * @throws CatalogResourceException e - */ - public void deleteServiceTemplateMapping(String nodeType, String serviceTemplateId) - throws CatalogResourceException { - Map<String, String> delParam = new HashMap<String, String>(); - if (CatalogDbUtil.isNotEmpty(nodeType)) { - delParam.put(Parameters.nodeType.name(), nodeType); - } - if (CatalogDbUtil.isNotEmpty(serviceTemplateId)) { - delParam.put(Parameters.serviceTemplateId.name(), serviceTemplateId); - } - LOGGER.info("start delete serviceTemplateMapping info.nodeType:" + nodeType - + " serviceTemplateId:" + serviceTemplateId); - mappingHandler.delete(delParam); - LOGGER.info("delete serviceTemplateMapping info "); - } - - /** - * query service template mapping. - * @param nodeType nodeType - * @param serviceTemplateId serviceTemplateId - * @return ServiceTemplateMappingData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateMappingData> queryServiceTemplateMapping(String nodeType, - String serviceTemplateId) throws CatalogResourceException { - Map<String, String> queryParam = new HashMap<String, String>(); - if (CatalogDbUtil.isNotEmpty(nodeType)) { - queryParam.put(Parameters.nodeType.name(), nodeType); - } - if (CatalogDbUtil.isNotEmpty(serviceTemplateId)) { - queryParam.put(Parameters.serviceTemplateId.name(), serviceTemplateId); - } - LOGGER.info("start query serviceTemplateMapping info.nodeType:" + nodeType - + " serviceTemplateId:" + serviceTemplateId); - ArrayList<ServiceTemplateMappingData> data = mappingHandler.query(queryParam); - LOGGER.info("query serviceTemplateMapping info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query service template by id. - * @param id service template id - * @return ServiceTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateData> queryServiceTemplateById(String id) - throws CatalogResourceException { - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.serviceTemplateId.name(), id); - LOGGER.info("start query serviceTemplate info by id." + id); - ArrayList<ServiceTemplateData> data = handler.query(queryParam); - LOGGER.info("query serviceTemplate info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query service template according to condition. - * @param type template type - * @param version template version - * @param vendor template vendor - * @return ServiceTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateData> queryServiceTemplate(String type, String version, - String vendor) throws CatalogResourceException { - LOGGER.info("start query serviceTemplate info.type:" + type + " vendor:" + vendor + " version:" - + version); - Map<String, String> queryParam = new HashMap<String, String>(); - if (CatalogDbUtil.isNotEmpty(type)) { - queryParam.put(Parameters.type.name(), type); - } - if (CatalogDbUtil.isNotEmpty(vendor)) { - queryParam.put(Parameters.vendor.name(), vendor); - } - if (CatalogDbUtil.isNotEmpty(version)) { - queryParam.put(Parameters.version.name(), version); - } - ArrayList<ServiceTemplateData> data = handler.query(queryParam); - LOGGER.info("query serviceTemplate info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query node template service template id. - * @param serviceTemplateId service template id - * @return NodeTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<NodeTemplateData> queryNodeTemplateBySeriviceTemplateId(String serviceTemplateId) - throws CatalogResourceException { - LOGGER.info("start query NodeTemplate info.serviceTemplateId:" + serviceTemplateId); - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.serviceTemplateId.name(), serviceTemplateId); - ArrayList<NodeTemplateData> data = nodeTemplateHandler.query(queryParam); - LOGGER.info("query NodeTemplate info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query node template by id. - * @param serviceTemplateId service template id - * @param nodeTemplateId nodetemplate id - * @return NodeTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<NodeTemplateData> queryNodeTemplateById(String serviceTemplateId, - String nodeTemplateId) throws CatalogResourceException { - LOGGER.info("start query NodeTemplate info.serviceTemplateId:" + serviceTemplateId - + "nodeTemplateId:" + nodeTemplateId); - Map<String, String> queryParam = new HashMap<String, String>(); - if (CatalogDbUtil.isNotEmpty(serviceTemplateId)) { - queryParam.put(Parameters.serviceTemplateId.name(), serviceTemplateId); - } - if (CatalogDbUtil.isNotEmpty(nodeTemplateId)) { - queryParam.put(Parameters.nodeTemplateId.name(), nodeTemplateId); - } - ArrayList<NodeTemplateData> data = nodeTemplateHandler.query(queryParam); - LOGGER.info("query NodeTemplate info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * query service template by package infomation. - * @param packageInfo package information - * @return ServiceTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateData> queryServiceTemplateByCsarPackageInfo( - PackageData packageInfo) throws CatalogResourceException { - LOGGER.info("start query serviceTemplate info by package.package:" - + CatalogDbUtil.objectToString(packageInfo)); - String filter = - HqlFactory.getQueryHqlByFilter(ServiceTemplateData.class, packageInfo, - Parameters.csarId.name()); - ArrayList<ServiceTemplateData> data = handler.unionQuery(filter); - LOGGER.info("query serviceTemplate info end.size:" + data.size() + "detail:" - + CatalogDbUtil.objectToString(data)); - return data; - } - - /** - * delete service template by id. - * @param serviceTemplateId service template id - * @throws CatalogResourceException e - */ - public void deleteServiceTemplateById(String serviceTemplateId) throws CatalogResourceException { - LOGGER.info("start delete serviceTemplate info.id:" + serviceTemplateId); - ArrayList<NodeTemplateData> nodeTemplateList = - queryNodeTemplateBySeriviceTemplateId(serviceTemplateId); - templateHandler.delete(serviceTemplateId, nodeTemplateList); - LOGGER.info(" delete serviceTemplate info end id." + serviceTemplateId); - } - - /** - * delete service template by package info. - * @param packageInfo package information - * @throws CatalogResourceException e - */ - public void deleteServiceTemplateByCsarPackageInfo(PackageData packageInfo) - throws CatalogResourceException { - LOGGER.info("start delete serviceTemplate info by package.package:" - + CatalogDbUtil.objectToString(packageInfo)); - - ArrayList<ServiceTemplateData> serviceTemplate = - queryServiceTemplateByCsarPackageInfo(packageInfo); - for (int i = 0; i < serviceTemplate.size(); i++) { - deleteServiceTemplateById(serviceTemplate.get(i).getServiceTemplateId()); - } - LOGGER.info("delete serviceTemplate info end."); - - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/CatalogDbUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/CatalogDbUtil.java deleted file mode 100644 index ff6518e0..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/CatalogDbUtil.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.util; - - -import com.google.gson.Gson; - -import java.util.UUID; - - -public class CatalogDbUtil { - - public static String generateId() { - return UUID.randomUUID().toString(); - } - - public static boolean isNotEmpty(String str) { - return str != null && !"".equals(str) && str.length() > 0; - } - - /** - * exchange object to string. - * @param obj Object - * @return string - */ - public static String objectToString(Object obj) { - Gson gson = new Gson(); - if (obj != null) { - return gson.toJson(obj); - } else { - return null; - } - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/HqlFactory.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/HqlFactory.java deleted file mode 100644 index 08e2e35c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/HqlFactory.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.Arrays; - -/** - * a tool class for creating Hibernate's HQL. - * - */ -public class HqlFactory { - - private static final Logger logger = LoggerFactory.getLogger(HqlFactory.class); - - /** - * get update hql. - * @param obj the object that used to be generate the hql - * @param excludeProperties the properties that need not to be used - * @param filter the condition after "where" - * @return hibernate hql - */ - public static String getUpdateHql(Object obj, String[] excludeProperties, String filter) { - StringBuffer hql = new StringBuffer(); - String objName = obj.getClass().getSimpleName(); - hql.append("update "); - hql.append(objName); - hql.append(" set "); - Field[] fields = obj.getClass().getDeclaredFields(); - if (obj.getClass().getGenericSuperclass() != null) { - Field[] parentFields = obj.getClass().getSuperclass().getDeclaredFields(); - fields = concat(fields, parentFields); - } - for (Field field : fields) { - String name = field.getName(); - Method method = null; - Object value = null; - if (!contain(excludeProperties, name)) { - String upperName = name.substring(0, 1).toUpperCase() + name.substring(1); - try { - method = obj.getClass().getMethod("get" + upperName); - value = method.invoke(obj); - if (value != null) { - if (value instanceof String) { - hql.append(name); - hql.append("="); - hql.append("'"); - hql.append(value); - hql.append("'"); - hql.append(","); - } else { - hql.append(name); - hql.append("="); - hql.append(value); - hql.append(","); - } - } - } catch (Exception e1) { - logger.error("error while creating update hql", e1); - } - } - } - - String sql = hql.toString(); - sql = sql.substring(0, sql.lastIndexOf(",")); - if (filter != null) { - sql = sql + " where " + filter; - } - logger.info("update hql is : " + sql); - return sql; - } - - /** - * judge wether target contains src. - * @param src String[] - * @param target String - * @return boolean - */ - public static boolean contain(String[] src, String target) { - if (src == null || src.length == 0 || target == null) { - return false; - } else { - for (String str : src) { - if(str.equals(target)){ - return true; - } - } - } - return false; - } - - /** - * concat two array. - * @param first first array - * @param second second array - * @return T - */ - public static <T> T[] concat(T[] first, T[] second) { - T[] result = Arrays.copyOf(first, first.length + second.length); - System.arraycopy(second, 0, result, first.length, second.length); - return result; - } - - public static String getOidFilter(String key, String value) { - return key + "= '" + value + "'"; - } - - /** - * get query hql. - * @param data Object - * @param column String - * @return String - */ - public static String getQueryHql(Object data, String column) { - StringBuffer hql = new StringBuffer(); - String objName = data.getClass().getSimpleName(); - hql.append("select q."); - hql.append(column); - hql.append(" from "); - hql.append(objName); - hql.append(" as q where "); - Field[] fields = data.getClass().getDeclaredFields(); - if (data.getClass().getGenericSuperclass() != null) { - Field[] parentFields = data.getClass().getSuperclass().getDeclaredFields(); - fields = concat(fields, parentFields); - } - for (Field field : fields) { - String name = field.getName(); - Method method = null; - Object value = null; - String upperName = name.substring(0, 1).toUpperCase() + name.substring(1); - try { - method = data.getClass().getMethod("get" + upperName); - value = method.invoke(data); - if (value != null) { - if (value instanceof String) { - hql.append("q." + name); - hql.append("="); - hql.append("'"); - hql.append(value); - hql.append("'"); - hql.append(" and "); - } else { - hql.append("q." + name); - hql.append("="); - hql.append(value); - hql.append("and "); - } - } - } catch (Exception e1) { - logger.error("error while creating update hql", e1); - } - } - String sql = hql.toString(); - sql = sql.substring(0, sql.lastIndexOf("and")); - - logger.info("query hql is : " + sql); - return sql.trim(); - } - - public static String getQueryHqlByFilter(Class mainObject, Object filterData, String foreignKey) { - StringBuffer hql = new StringBuffer(); - String objName = mainObject.getSimpleName(); - // hql.append("select queryTable."); - hql.append(" from "); - hql.append(objName); - hql.append(" as a where "); - String filterHql = getQueryHql(filterData, foreignKey); - hql.append("a." + foreignKey); - hql.append(" in("); - hql.append(filterHql); - hql.append(")"); - logger.info("QueryHqlByFilter is : " + hql); - return hql.toString(); - } - - public static String getDeleteHqlByFilter(Class mainObject, Object filterData, String foreignKey) { - StringBuffer hql = new StringBuffer(); - String objName = mainObject.getSimpleName(); - hql.append("delete from "); - hql.append(objName); - hql.append(" as b where "); - String filterHql = getQueryHql(filterData, foreignKey); - hql.append("b." + foreignKey); - hql.append(" in("); - hql.append(filterHql); - hql.append(")"); - logger.info("DeleteHqlByFilter is : " + hql); - return hql.toString(); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/BaseHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/BaseHandler.java deleted file mode 100644 index 276b1c6a..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/BaseHandler.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.wrapper; - -import com.google.gson.Gson; - -import org.openo.commontosca.catalog.db.dao.BaseDao; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.BaseData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.Map; - - - -/** - * an abstract class for NFV wrapper class. - * provide the common methods to process the CRUD rest request. - * - */ -public abstract class BaseHandler<T extends BaseData> { - private static final Logger logger = LoggerFactory.getLogger(BaseHandler.class); - - public Gson gson = new Gson(); - - /** - * create date. - * @param data data to create - * @param resouceType resouce type - * @return T - * @throws CatalogResourceException e1 - */ - @SuppressWarnings({"unchecked", "rawtypes"}) - public T create(T data, String resouceType) throws CatalogResourceException { - T rtnData = null; - logger.info("BaseHandler:start create data.info:" + CatalogDbUtil.objectToString(data)); - try { - check(data); - BaseDao dao = DaoManager.getInstance().getDao(resouceType); - rtnData = (T) dao.create(data); - } catch (CatalogResourceException e1) { - logger.error("BaseHandler:error while creating " + resouceType, e1); - throw e1; - } - logger.info("BaseHandler:create data end.info:" + CatalogDbUtil.objectToString(data)); - return rtnData; - } - - /** - * delete data. - * @param data data to delete - * @param resouceType resource type - * @throws CatalogResourceException e1 - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - public void delete(T data, String resouceType) throws CatalogResourceException { - logger.info("BaseHandler:start delete data.info:" + CatalogDbUtil.objectToString(data)); - try { - BaseDao dao = DaoManager.getInstance().getDao(resouceType); - dao.delete(data); - } catch (CatalogResourceException e1) { - logger.error("BaseHandler:error while deleting " + resouceType, e1); - throw e1; - } - logger.info("BaseHandler:delete data end"); - } - - /** - * delete data. - * @param queryParam query param - * @param resouceType String - * @throws CatalogResourceException e1 - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - public void delete(Map<String, String> queryParam, String resouceType) - throws CatalogResourceException { - logger.info("BaseHandler:start delete data by condition.info:" - + CatalogDbUtil.objectToString(queryParam)); - List<T> datas; - try { - BaseDao dao = DaoManager.getInstance().getDao(resouceType); - datas = dao.query(queryParam); - for (T data : datas) { - delete(data, resouceType); - } - } catch (CatalogResourceException e1) { - logger.error("BaseHandler:error while deleting " + resouceType, e1); - throw e1; - } - - } - - /** - * update data. - * @param data data to update - * @param filter filter - * @param resouceType resource type - * @throws CatalogResourceException e1 - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - public void update(T data, String filter, String resouceType) throws CatalogResourceException { - logger.info("BaseHandler:start update data .info:" + CatalogDbUtil.objectToString(data) - + " filter:" + filter); - try { - check(data); - BaseDao dao = DaoManager.getInstance().getDao(resouceType); - dao.update(data, filter); - - } catch (CatalogResourceException e1) { - logger.error("BaseHandler:error while updating " + resouceType, e1); - throw e1; - } - logger.info("BaseHandler:update data end "); - } - - /** - * query data. - * @param queryParam query parameter - * @param resouceType resource type - * @return T list - * @throws CatalogResourceException e1 - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - public List<T> query(Map<String, String> queryParam, String resouceType) - throws CatalogResourceException { - logger.info("BaseHandler:start query data .info:" + CatalogDbUtil.objectToString(queryParam)); - List<T> datas = null; - try { - BaseDao dao = DaoManager.getInstance().getDao(resouceType); - datas = dao.query(queryParam); - - } catch (CatalogResourceException e1) { - logger.error("BaseHandler:error while querying " + resouceType, e1); - throw e1; - } - logger.info("BaseHandler: query data end .info:" + CatalogDbUtil.objectToString(datas)); - return datas; - } - - /** - * union query. - * @param filter filter - * @param resouceType resource type - * @return T list - * @throws CatalogResourceException e1 - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - public List<T> unionQuery(String filter, String resouceType) throws CatalogResourceException { - logger.info("BaseHandler:start union query data.fliter:" + filter); - List<T> datas = null; - try { - BaseDao dao = DaoManager.getInstance().getDao(resouceType); - datas = dao.unionQuery(filter); - - } catch (CatalogResourceException e1) { - logger.error("BaseHandler:error while union querying " + resouceType, e1); - throw e1; - } - logger.info("BaseHandler:union query data end .info:" + CatalogDbUtil.objectToString(datas)); - return datas; - } - - /** - * union delete. - * @param filter filter - * @param resouceType resource type - * @return int - * @throws CatalogResourceException e1 - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - public int unionDelete(String filter, String resouceType) throws CatalogResourceException { - logger.info("BaseHandler:start delete query data.fliter:" + filter); - int num; - try { - BaseDao dao = DaoManager.getInstance().getDao(resouceType); - num = dao.unionDelete(filter); - - } catch (CatalogResourceException e1) { - logger.error("BaseHandler:error while union delete " + resouceType, e1); - throw e1; - } - logger.info("BaseHandler:union delete data end .num:" + num); - return num; - } - - /** - * check if the related object id exists in the system. - * - * @param data data to check - * @throws CatalogResourceException e - */ - public abstract void check(T data) throws CatalogResourceException; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/NodeTemplateHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/NodeTemplateHandler.java deleted file mode 100644 index 4ee455bf..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/NodeTemplateHandler.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.wrapper; - -import org.openo.commontosca.catalog.db.common.CatalogResuorceType; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Map; - -public class NodeTemplateHandler extends BaseHandler<NodeTemplateData> { - private static final Logger logger = LoggerFactory.getLogger(NodeTemplateHandler.class); - - /** - * query node template. - * @param queryParam query parameter - * @return NodeTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<NodeTemplateData> query(Map<String, String> queryParam) - throws CatalogResourceException { - logger.info("NodeTemplateHandler query nodeTemplate info."); - ArrayList<NodeTemplateData> data = new ArrayList<NodeTemplateData>(); - Object result = query(queryParam, CatalogResuorceType.NODETEMPLATE.name()); - if (result != null) { - data = (ArrayList<NodeTemplateData>) result; - } else { - logger.warn("NodeTemplateHandler: query nodeTemplate info is null."); - } - logger.info("NodeTemplateHandler: query nodeTemplate info end."); - return data; - - } - - @Override - public void check(NodeTemplateData nodeTemplateData) throws CatalogResourceException { - - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/PackageHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/PackageHandler.java deleted file mode 100644 index 2ec747d0..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/PackageHandler.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.wrapper; - -import org.openo.commontosca.catalog.db.common.CatalogResuorceType; -import org.openo.commontosca.catalog.db.common.Parameters; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; -import org.openo.commontosca.catalog.db.util.HqlFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Map; - -public class PackageHandler extends BaseHandler<PackageData> { - private static final Logger logger = LoggerFactory.getLogger(PackageHandler.class); - - /** - * create package data. - * @param packageData package data to create - * @return PackageData - * @throws CatalogResourceException e1 - */ - public PackageData create(PackageData packageData) throws CatalogResourceException { - logger.info("packageHandler:start create package info."); - PackageData data = null; - if (!CatalogDbUtil.isNotEmpty(packageData.getCsarId())) { - - logger.info("packageHandler:package info does not have csarid,generate UUID."); - String id = CatalogDbUtil.generateId(); - packageData.setCsarId(id); - } - Object result = create(packageData, CatalogResuorceType.PACKAGE.name()); - if (result != null) { - data = (PackageData) result; - } else { - logger.info("packageHandler: query package info is null."); - } - logger.info("packageHandler: create package info end."); - return data; - } - - /** - * delete data. - * @param id package id - * @throws CatalogResourceException e - */ - public void delete(String id) throws CatalogResourceException { - logger.info("packageHandler:start delete package info."); - PackageData packageData = new PackageData(); - packageData.setCsarId(id); - delete(packageData, CatalogResuorceType.PACKAGE.name()); - logger.info("packageHandler: delete package info end."); - } - - /** - * delete data. - * @param queryParam query parameter - * @throws CatalogResourceException e - */ - public void delete(Map<String, String> queryParam) throws CatalogResourceException { - logger.info("packageHandler:start delete package info."); - delete(queryParam, CatalogResuorceType.PACKAGE.name()); - logger.info("packageHandler:delete package info end."); - } - - /** - * update data. - * @param packageData packate data to update - * @param id package id - * @throws CatalogResourceException e - */ - public void update(PackageData packageData, String id) throws CatalogResourceException { - // HostData host = gson.fromJson(hostJson, HostData.class); - logger.info("packageHandler:start update package info."); - update(packageData, HqlFactory.getOidFilter(Parameters.csarId.name(), id), - CatalogResuorceType.PACKAGE.name()); - logger.info("packageHandler:update package info end."); - } - - /** - * union delete. - * @param filter delete filter - * @return int - * @throws CatalogResourceException e - */ - public int unionDelete(String filter) throws CatalogResourceException { - logger.info("packageHandler delete package info by union.filter:" + filter); - int num = 0; - Object result = unionDelete(filter, CatalogResuorceType.PACKAGE.name()); - if (result != null) { - num = (int) result; - } else { - logger.warn("packageHandler: delete package info is null."); - } - logger.info("packageHandler: delete package info end.num:" + num); - return num; - } - - /** - * union query. - * @param filter query filter - * @return PackageData list - * @throws CatalogResourceException e - */ - public ArrayList<PackageData> unionQuery(String filter) throws CatalogResourceException { - logger.info("packageHandler query package info by union.filter:" + filter); - ArrayList<PackageData> data = new ArrayList<PackageData>(); - Object result = unionQuery(filter, CatalogResuorceType.PACKAGE.name()); - if (result != null) { - data = data = (ArrayList<PackageData>) result; - } else { - logger.info("packageHandler: query package info is null."); - } - logger.info("packageHandler: query package info end"); - return data; - } - - /** - * query package data by map. - * @param queryParam map data - * @return PackageData list - * @throws CatalogResourceException e - */ - public ArrayList<PackageData> query(Map<String, String> queryParam) - throws CatalogResourceException { - logger.info("packageHandler:start query package info."); - ArrayList<PackageData> data = new ArrayList<PackageData>(); - Object result = query(queryParam, CatalogResuorceType.PACKAGE.name()); - if (result != null) { - data = (ArrayList<PackageData>) result; - } else { - logger.info("packageHandler: query package info is null."); - } - logger.info("packageHandler: query package info end."); - return data; - } - - @Override - public void check(PackageData packageData) throws CatalogResourceException { - - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateHandler.java deleted file mode 100644 index 8d7d2a1b..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateHandler.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.wrapper; - -import org.openo.commontosca.catalog.db.common.CatalogResuorceType; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Map; - -public class ServiceTemplateHandler extends BaseHandler<TemplateData> { - private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateHandler.class); - - @Override - public void check(TemplateData data) throws CatalogResourceException { - // TODO Auto-generated method stub - - } - - /** - * query service template data by map. - * @param queryParam map data - * @return ServiceTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateData> query(Map<String, String> queryParam) - throws CatalogResourceException { - logger.info("ServiceTemplateHandler query serviceTemplate info."); - ArrayList<ServiceTemplateData> data = new ArrayList<ServiceTemplateData>(); - Object result = query(queryParam, CatalogResuorceType.SERVICETEMPLATE.name()); - if (result != null) { - data = (ArrayList<ServiceTemplateData>) result; - } else { - logger.info("ServiceTemplateHandler: query serviceTemplate info is null."); - } - logger.info("ServiceTemplateHandler: query serviceTemplate info end."); - return data; - } - - /** - * query service template by union query. - * @param filter query filter - * @return ServiceTemplateData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateData> unionQuery(String filter) throws CatalogResourceException { - logger.info("ServiceTemplateHandler query serviceTemplate info by union.filter:" + filter); - ArrayList<ServiceTemplateData> data = new ArrayList<ServiceTemplateData>(); - Object result = unionQuery(filter, CatalogResuorceType.SERVICETEMPLATE.name()); - if (result != null) { - data = (ArrayList<ServiceTemplateData>) result; - } else { - logger.info("ServiceTemplateHandler: query serviceTemplate info is null."); - } - logger.info("ServiceTemplateHandler: query serviceTemplate info end."); - return data; - } - - /** - * union delete. - * @param filter delete filter - * @return int - * @throws CatalogResourceException e - */ - public int unionDelete(String filter) throws CatalogResourceException { - logger.info("ServiceTemplateHandler delete serviceTemplate info by union.filter:" + filter); - int num = 0; - Object result = unionDelete(filter, CatalogResuorceType.SERVICETEMPLATE.name()); - if (result != null) { - num = (int) result; - } else { - logger.info("ServiceTemplateHandler: delete serviceTemplate info is null."); - } - logger.info("ServiceTemplateHandler: delete serviceTemplate info end.num:" + num); - return num; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateMappingHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateMappingHandler.java deleted file mode 100644 index dfa16f5d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateMappingHandler.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.wrapper; - -import org.openo.commontosca.catalog.db.common.CatalogResuorceType; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Map; - - -public class ServiceTemplateMappingHandler extends BaseHandler<ServiceTemplateMappingData> { - private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateMappingHandler.class); - - /** - * create service template data. - * @param serviceTemplateMappingData service template maping data - * @return ServiceTemplateMappingData - * @throws CatalogResourceException e - */ - public ServiceTemplateMappingData create(ServiceTemplateMappingData serviceTemplateMappingData) - throws CatalogResourceException { - logger.info("ServiceTemplateMappingHandler:start create serviceTemplateMapping info."); - ServiceTemplateMappingData data = null; - if (!CatalogDbUtil.isNotEmpty(serviceTemplateMappingData.getMappingId())) { - logger.info( - "ServiceTemplateMappingHandler:mapping info " + "does not have mappingId,generate UUID."); - String id = CatalogDbUtil.generateId(); - serviceTemplateMappingData.setMappingId(id); - } - Object result = - create(serviceTemplateMappingData, CatalogResuorceType.SERVICETEMPLATEMAPPING.name()); - if (result != null) { - data = (ServiceTemplateMappingData) result; - } else { - logger.info("ServiceTemplateMappingHandler: query mapping info is null."); - } - logger.info("ServiceTemplateMappingHandler: create mapping info end."); - return data; - } - - /** - * delete data by id. - * @param id service template id - * @throws CatalogResourceException e - */ - public void delete(String id) throws CatalogResourceException { - logger.info("ServiceTemplateMappingHandler:start delete mapping info."); - ServiceTemplateMappingData serviceTemplateMappingData = new ServiceTemplateMappingData(); - serviceTemplateMappingData.setMappingId(id); - delete(serviceTemplateMappingData, CatalogResuorceType.SERVICETEMPLATEMAPPING.name()); - logger.info("ServiceTemplateMappingHandler: delete mapping info end."); - } - - /** - * delete data. - * @param delParam delete data according to delParam - * @throws CatalogResourceException e - */ - public void delete(Map<String, String> delParam) throws CatalogResourceException { - logger.info("ServiceTemplateMappingHandler:start delete mapping info."); - delete(delParam, CatalogResuorceType.SERVICETEMPLATEMAPPING.name()); - logger.info("ServiceTemplateMappingHandler:delete mapping info end."); - } - - /** - * query service template mapping data. - * @param queryParam query map - * @return ServiceTemplateMappingData list - * @throws CatalogResourceException e - */ - public ArrayList<ServiceTemplateMappingData> query(Map<String, String> queryParam) - throws CatalogResourceException { - logger.info("ServiceTemplateMappingHandler:start query mapping info."); - ArrayList<ServiceTemplateMappingData> data = new ArrayList<ServiceTemplateMappingData>(); - Object result = query(queryParam, CatalogResuorceType.SERVICETEMPLATEMAPPING.name()); - if (result != null) { - data = (ArrayList<ServiceTemplateMappingData>) result; - } else { - logger.info("ServiceTemplateMappingHandler: query mapping info is null."); - } - logger.info("ServiceTemplateMappingHandler: query mapping info end."); - return data; - - } - - @Override - public void check(ServiceTemplateMappingData data) throws CatalogResourceException { - // TODO Auto-generated method stub - - } - - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/TemplateHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/TemplateHandler.java deleted file mode 100644 index 43b8ae64..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/TemplateHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.wrapper; - -import org.openo.commontosca.catalog.db.common.CatalogResuorceType; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; - -public class TemplateHandler extends BaseHandler<TemplateData> { - private static final Logger logger = LoggerFactory.getLogger(TemplateHandler.class); - - /** - * create template data. - * @param templateData template data to create - * @return TemplateData - * @throws CatalogResourceException e - */ - public TemplateData create(TemplateData templateData) throws CatalogResourceException { - logger.info("TemplateHandler create template info."); - TemplateData data = null; - String serviceTemplateOid = templateData.getServiceTemplate().getServiceTemplateId(); - if (!CatalogDbUtil.isNotEmpty(serviceTemplateOid)) { - logger.info("TemplateHandler:template info does not have oid,generate UUID."); - serviceTemplateOid = CatalogDbUtil.generateId(); - templateData.getServiceTemplate().setServiceTemplateId(serviceTemplateOid); - } - for (NodeTemplateData nodeData : templateData.getNodeTemplates()) { - String nodeTemplateOid = nodeData.getNodeTemplateId(); - if (!CatalogDbUtil.isNotEmpty(nodeTemplateOid)) { - logger.info("TemplateHandler:nodeTemplate info does not have id,generate UUID."); - nodeData.setNodeTemplateId(CatalogDbUtil.generateId()); - } - nodeData.setServiceTemplateId(serviceTemplateOid); - } - Object result = create(templateData, CatalogResuorceType.TEMPLATE.name()); - if (result != null) { - data = (TemplateData) result; - } else { - logger.info("TemplateHandler: query template info is null."); - } - logger.info("TemplateHandler: create template info end."); - return data; - } - - @Override - public void check(TemplateData data) throws CatalogResourceException { - // TODO Auto-generated method stub - - } - - /** - * delete node template. - * @param serviceTemplateId service template id - * @param nodeTemplateList node template list - * @throws CatalogResourceException e - */ - public void delete(String serviceTemplateId, ArrayList<NodeTemplateData> nodeTemplateList) - throws CatalogResourceException { - logger.info("TemplateHandler delete Template info."); - TemplateData templateData = new TemplateData(); - ServiceTemplateData serviceTemplateData = new ServiceTemplateData(); - serviceTemplateData.setServiceTemplateId(serviceTemplateId); - templateData.setServiceTemplate(serviceTemplateData); - templateData.setNodeTemplates(nodeTemplateList); - delete(templateData, CatalogResuorceType.TEMPLATE.name()); - logger.info("TemplateHandler: delete Template info end."); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarPackage.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarPackage.java deleted file mode 100644 index bf7a2d3d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarPackage.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -public class CsarPackage { - private String id; - private String name; - private String createTime; - private String size; - private String status; - private String deletionPending; - private String format; - private String url; - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getFormat() { - return format; - } - - public void setFormat(String format) { - this.format = format; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDeletionPending() { - return deletionPending; - } - - public void setDeletionPending(String deletionPending) { - this.deletionPending = deletionPending; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarQueryCondition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarQueryCondition.java deleted file mode 100644 index 5e3ba2ab..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarQueryCondition.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CsarQueryCondition { - - private String csarId; - - private String name; - - private String provider; - - private String version; - - private Boolean deletionPending; - - private EnumType type; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOnboardState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOnboardState.java deleted file mode 100644 index d89c31a6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOnboardState.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -public enum EnumOnboardState { - onBoarded("onBoarded"), nonOnBoarded("non-onBoarded"); - - String value; - - EnumOnboardState(String value) { - this.value = value; - } - - public String getValue() { - return value; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java deleted file mode 100644 index 3294d25e..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -public enum EnumOperationalState { - Enabled, Disabled -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java deleted file mode 100644 index ef1a59d5..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -public enum EnumProcessState { - normal, onBoarding, onBoardFailed, deleting, deleteFailed -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java deleted file mode 100644 index 969c18c0..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -public enum EnumType { - GSAR, SSAR, NSAR, NFAR -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java deleted file mode 100644 index c5766ff6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -public enum EnumUsageState { - InUse, NotInUse -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java deleted file mode 100644 index afbd9a43..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity; - -public class VnfPackage { - private String vnfPackageId; - private String name; - private String version; - private String provider; - private String vnfd; - private EnumOperationalState operationalState = EnumOperationalState.Disabled; - private EnumUsageState usageState = EnumUsageState.InUse; - private String deletionPending; - private String vnfPackageUrl; - - public String getVnfPackageId() { - return vnfPackageId; - } - - public void setVnfPackageId(String vnfPackageId) { - this.vnfPackageId = vnfPackageId; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getProvider() { - return provider; - } - - public void setProvider(String provider) { - this.provider = provider; - } - - public String getVnfd() { - return vnfd; - } - - public void setVnfd(String vnfd) { - this.vnfd = vnfd; - } - - public EnumOperationalState getOperationalState() { - return operationalState; - } - - public void setOperationalState(EnumOperationalState operationalState) { - this.operationalState = operationalState; - } - - public EnumUsageState getUsageState() { - return usageState; - } - - public void setUsageState(EnumUsageState usageState) { - this.usageState = usageState; - } - - public String getVnfPackageUrl() { - return vnfPackageUrl; - } - - public void setVnfPackageUrl(String vnfPackageUrl) { - this.vnfPackageUrl = vnfPackageUrl; - } - - public String getDeletionPending() { - return deletionPending; - } - - public void setDeletionPending(String deletionPending) { - this.deletionPending = deletionPending; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java deleted file mode 100644 index 0ff5b2f7..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity.request; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import org.openo.commontosca.catalog.entity.EnumType; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class PackageBasicInfo { - - private String provider; - - private EnumType type; - - private String version; - - private String format; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java deleted file mode 100644 index a9e1b0c6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity.response; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CsarFileUriResponse { - - private String downloadUri; - - private String localPath; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java deleted file mode 100644 index aba10a1d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity.response; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import org.openo.commontosca.catalog.entity.EnumOperationalState; -import org.openo.commontosca.catalog.entity.EnumProcessState; -import org.openo.commontosca.catalog.entity.EnumUsageState; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class PackageMeta { - - private String csarId; - - private String name; - - private String downloadUri; - - private String size; - - private String version; - - private String provider; - - private String type; - - private String format; - - private boolean deletionPending; - - private String createTime; - - private String modifyTime; - - private EnumOperationalState operationalState; - - private EnumUsageState usageState; - - private String onBoardState; - - private EnumProcessState processState; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java deleted file mode 100644 index d1ec09bf..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.entity.response; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class UploadPackageResponse { - - private String csarId; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ApiRouteInfo.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ApiRouteInfo.java deleted file mode 100644 index d98af250..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ApiRouteInfo.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Copyright 2016 [ZTE] and others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.externalservice.msb; - -import java.io.Serializable; - -public class ApiRouteInfo implements Serializable { - private static final long serialVersionUID = 1L; - private String serviceName; - private String version = ""; - private String url; - private String apiJson = ""; - private String apiJsonType = "1"; - private String metricsUrl = ""; - private String control = "0"; - private String status = "1"; - - private RouteServer []servers; - - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getApiJson() { - return apiJson; - } - - public void setApiJson(String apiJson) { - this.apiJson = apiJson; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public RouteServer[] getServers() { - return servers; - } - - public void setServers(RouteServer[] servers) { - this.servers = servers; - } - - public String getApiJsonType() { - return apiJsonType; - } - - public void setApiJsonType(String apiJsonType) { - this.apiJsonType = apiJsonType; - } - - public String getMetricsUrl() { - return metricsUrl; - } - - public void setMetricsUrl(String metricsUrl) { - this.metricsUrl = metricsUrl; - } - - public String getControl() { - return control; - } - - public void setControl(String control) { - this.control = control; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusConsumer.java deleted file mode 100644 index 6732d6e5..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusConsumer.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.externalservice.msb; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; -import org.glassfish.jersey.client.ClientConfig; - -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.db.util.CatalogDbUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class MicroserviceBusConsumer { - private static final Logger LOG = LoggerFactory.getLogger(MicroserviceBusConsumer.class); - - /** - * register service to MSB. - * - * @param entity ServiceRegisterEntity - * @return boolean - */ - public static boolean registerService(ServiceRegisterEntity entity) { - ClientConfig config = new ClientConfig(); - LOG.info("microservice register body:" + CatalogDbUtil.objectToString(entity)); - try { - MicroserviceBusRest resourceserviceproxy = ConsumerFactory.createConsumer( - Config.getConfigration().getMsbServerAddr(), config, MicroserviceBusRest.class); - resourceserviceproxy.registerServce("false", entity); - } catch (Exception e1) { - LOG.error("microservice register failed!" + e1.getMessage()); - return false; - } - return true; - } - - public static ApiRouteInfo queryApiRouteInfo(String serviceName, String version) { - ClientConfig config = new ClientConfig(); - LOG.info("microservice register body:" + "serviceName:" + serviceName + " version:" + version); - ApiRouteInfo apiRouteInfo = null; - try { - MicroserviceBusRest resourceserviceproxy = ConsumerFactory.createConsumer( - Config.getConfigration().getMsbServerAddr(), config, MicroserviceBusRest.class); - apiRouteInfo = resourceserviceproxy.queryApiRouteInfo(serviceName, version); - } catch (Exception e1) { - LOG.error("query api route failed!" + e1.getMessage()); - - } - return apiRouteInfo; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusRest.java deleted file mode 100644 index 51a5971d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusRest.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.externalservice.msb; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -@Path("/openoapi/microservices/v1/services") -// @Path("/api/microservices/v1/services") -public interface MicroserviceBusRest { - @Path("") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public ServiceRegisterEntity registerServce(@QueryParam("createOrUpdate") String createOrUpdate, - ServiceRegisterEntity entity) throws Exception; - - @Path("") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public ApiRouteInfo queryApiRouteInfo(@PathParam("serviceName") String serviceName, - @PathParam("version") String version ) throws Exception; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/RouteServer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/RouteServer.java deleted file mode 100644 index 8aa22a0d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/RouteServer.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2016 [ZTE] and others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openo.commontosca.catalog.externalservice.msb; - -import java.io.Serializable; - -public class RouteServer implements Serializable { - private static final long serialVersionUID = 1L; - private String ip; - private int weight; - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - - - public int getWeight() { - return weight; - } - - public void setWeight(int weight) { - this.weight = weight; - } - - public RouteServer() { - - } - - public RouteServer(String ip) { - this.ip = ip; - this.weight = 0; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceNode.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceNode.java deleted file mode 100644 index 55195e8e..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceNode.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.externalservice.msb; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class ServiceNode { - private String ip; - private String port; - private int ttl; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceRegisterEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceRegisterEntity.java deleted file mode 100644 index 7732437a..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceRegisterEntity.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.externalservice.msb; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class ServiceRegisterEntity { - private String serviceName; - private String version; - private String url; - private String protocol; - private String visualRange; - private ArrayList<ServiceNode> nodes = new ArrayList<ServiceNode>(); - - /** - * set single node. - * @param ip ip - * @param port port - * @param ttl ttl - */ - public void setSingleNode(String ip, String port, int ttl) { - ServiceNode node = new ServiceNode(); - if (ip != null && ip.length() > 0) { - node.setIp(ip); - } else { - node.setIp(null); - } - node.setPort(port); - node.setTtl(ttl); - nodes.add(node); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManager.java deleted file mode 100644 index 1965ee01..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManager.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.filemanage; - - -public interface FileManager { - - /** - * package upload api. - * @param srcPath source path - * @param dstPath/packageType/provider/packageName/version - * @return boolean - */ - boolean upload(String srcPath, String dstPath); - - boolean download(String srcPath, String dstPath); - - boolean delete(String srcPath); - - //ArrayList<FileLink> queryWorkFlow(String path); - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerFactory.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerFactory.java deleted file mode 100644 index 8030ea92..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.filemanage; - -import org.openo.commontosca.catalog.filemanage.http.HttpFileManagerImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class FileManagerFactory { - private static final Logger logger = LoggerFactory.getLogger(FileManagerFactory.class); - - private static FileManager getHttpFileManager() { - return new HttpFileManagerImpl(); - } - - /** - * create file manager. - * @return FileManager - */ - public static FileManager createFileManager() { - switch (getType()) { - case http: - return getHttpFileManager(); - case ftp: - return null; - default: - return getHttpFileManager(); - } - } - - private static FileManagerType getType() { - String type = System.getenv("useFtp"); - logger.info("read environment varibale uesFtp:" + type); - if (type != null && "true".equals(type)) { - return FileManagerType.ftp; - } else { - return FileManagerType.http; - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerType.java deleted file mode 100644 index f238e438..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerType.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.filemanage; - -public enum FileManagerType { - ftp, http; - public static FileManagerType getType(String type) { - return valueOf(type); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/HttpFileManagerImpl.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/HttpFileManagerImpl.java deleted file mode 100644 index 0d3df052..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/HttpFileManagerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.filemanage.http; - -import org.openo.commontosca.catalog.filemanage.FileManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; - - -public class HttpFileManagerImpl implements FileManager { - private static final Logger LOGGER = LoggerFactory.getLogger(HttpFileManagerImpl.class); - - @Override - public boolean upload(String srcPath, String dstPath) { - boolean flag = true; - LOGGER.info("start upload file.srcPath:" + srcPath + " dstPath" + dstPath); - File srcFile = new File(srcPath); - if (!srcFile.exists()) { - LOGGER.error("src file not exist!"); - return false; - } - // File dstFile = new File(ToolUtil.getHttpServerPath() + dstPath); - // LOGGER.info("dstFile AbsolutePath:" + dstFile.getAbsolutePath()); - String targetDir = ToolUtil.getHttpServerAbsolutePath() + dstPath; - try { - ToolUtil.copyDirectory(srcPath, targetDir, true); - } catch (IOException e1) { - flag = false; - LOGGER.error("copy file failed.errorMsg:" + e1.getMessage()); - } - LOGGER.info("upload file success!"); - return flag; - } - - @Override - public boolean download(String srcPath, String dstPath) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean delete(String srcPath) { - boolean flag = true; - LOGGER.info("start delete file from http server.srcPath:" + srcPath); - flag = ToolUtil.deleteDir(new File(ToolUtil.getHttpServerAbsolutePath() + srcPath)); - LOGGER.info("delete file from http server end.flag:" + flag); - return flag; - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/ToolUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/ToolUtil.java deleted file mode 100644 index d2fd8393..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/ToolUtil.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.filemanage.http; - -import org.openo.commontosca.catalog.common.HttpServerPathConfig; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - - -public class ToolUtil { - private static final Logger LOGGER = LoggerFactory.getLogger(ToolUtil.class); - - /** - * copy from directory. - * @param srcDirName source directory name - * @param destDirName destination directory name - * @param overlay overwrite or not - * @return boolean - * @throws IOException e - */ - public static boolean copyDirectory(String srcDirName, String destDirName, boolean overlay) - throws IOException { - File srcDir = new File(srcDirName); - if (!srcDir.exists()) { - return false; - } else if (!srcDir.isDirectory()) { - return false; - } - - if (!destDirName.endsWith(File.separator)) { - destDirName = destDirName + File.separator; - } - File destDir = new File(destDirName); - if (destDir.exists()) { - if (overlay) { - new File(destDirName).delete(); - } else { - return false; - } - } else { - if (!destDir.mkdirs()) { - return false; - } - } - boolean flag = true; - File[] files = srcDir.listFiles(); - for (int i = 0; i < files.length; i++) { - if (files[i].isFile()) { - flag = copyFile(files[i].getAbsolutePath(), destDirName + files[i].getName(), true); - if (!flag) { - break; - } - } else if (files[i].isDirectory()) { - flag = copyDirectory(files[i].getAbsolutePath(), destDirName + files[i].getName(), overlay); - if (!flag) { - break; - } - } - } - if (!flag) { - String message = "Copy catagory " + srcDirName + " to " + destDirName + " failed!"; - LOGGER.error(message); - return false; - } else { - return true; - } - } - - /** - * copy file. - * @param srcFileName source file name - * @param destFileName target file name - * @param overlay overwrite or not - * @return boolean - */ - public static boolean copyFile(String srcFileName, String destFileName, boolean overlay) { - File srcFile = new File(srcFileName); - - if (!srcFile.exists()) { - String message = "Source file : " + srcFileName + " not exist !"; - LOGGER.error(message); - return false; - } else if (!srcFile.isFile()) { - return false; - } - - File destFile = new File(destFileName); - if (destFile.exists()) { - if (overlay) { - new File(destFileName).delete(); - } - } else { - if (!destFile.getParentFile().exists()) { - if (!destFile.getParentFile().mkdirs()) { - return false; - } - } - } - - int byteread = 0; - InputStream in = null; - OutputStream out = null; - - try { - in = new FileInputStream(srcFile); - out = new FileOutputStream(destFile); - byte[] buffer = new byte[1024]; - - while ((byteread = in.read(buffer)) != -1) { - out.write(buffer, 0, byteread); - } - return true; - } catch (FileNotFoundException e1) { - return false; - } catch (IOException e1) { - return false; - } finally { - try { - if (out != null) { - out.close(); - } - if (in != null) { - in.close(); - } - } catch (IOException e1) { - e1.printStackTrace(); - } - } - } - - /** - * create directory. - * @param destDirName target directory name - * @return boolean - */ - public static boolean createDir(String destDirName) { - File dir = new File(destDirName); - if (dir.exists()) { - dir.delete(); - } - if (!destDirName.endsWith(File.separator)) { - destDirName = destDirName + File.separator; - } - if (dir.mkdirs()) { - return true; - } else { - return false; - } - } - - public static String getHttpServerAbsolutePath() { - return Class.class.getClass().getResource("/").getPath() + HttpServerPathConfig.getHttpServerPath(); - } - - /** - * delete directory. - * @param dir file to delete - * @return boolean - */ - public static boolean deleteDir(File dir) { - if (dir.isDirectory()) { - String[] children = dir.list(); - for (int i = 0; i < children.length; i++) { - boolean success = deleteDir(new File(dir, children[i])); - if (!success) { - return false; - } - } - } - return dir.delete(); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java deleted file mode 100644 index 4318dcc5..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.ftp; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class Ftp { - - private String ipAddr; - - private Integer port; - - private String userName; - - private String pwd; - - private String path; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java deleted file mode 100644 index 933871ae..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java +++ /dev/null @@ -1,206 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.ftp; - -import org.apache.commons.net.ftp.FTPClient; -import org.apache.commons.net.ftp.FTPFile; -import org.apache.commons.net.ftp.FTPReply; -import org.apache.log4j.Logger; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -public class FtpUtil { - - private static Logger logger = Logger.getLogger(FtpUtil.class); - - private static FTPClient ftp; - - /** - * get ftp connection. - * - * @param conftp Ftp - * @return boolean - * @throws Exception e - */ - public static boolean connectFtp(Ftp conftp) throws Exception { - ftp = new FTPClient(); - boolean flag = false; - if (conftp.getPort() == null) { - ftp.connect(conftp.getIpAddr(), 21); - } else { - ftp.connect(conftp.getIpAddr(), conftp.getPort()); - } - ftp.login(conftp.getUserName(), conftp.getPwd()); - ftp.setFileType(FTPClient.BINARY_FILE_TYPE); - int reply = ftp.getReplyCode(); - if (!FTPReply.isPositiveCompletion(reply)) { - ftp.disconnect(); - return flag; - } - ftp.changeWorkingDirectory(conftp.getPath()); - flag = true; - return flag; - } - - /** - * close ftp connection. - */ - public static void closeFtp() { - if (ftp != null && ftp.isConnected()) { - try { - ftp.logout(); - ftp.disconnect(); - } catch (IOException e1) { - e1.printStackTrace(); - } - } - } - - /** - * upload file by ftp. - * - * @param file file to upload - * @throws Exception e - */ - public static void upload(File file) throws Exception { - if (file.isDirectory()) { - ftp.makeDirectory(file.getName()); - ftp.changeWorkingDirectory(file.getName()); - String[] files = file.list(); - for (String fstr : files) { - File file1 = new File(file.getPath() + "/" + fstr); - if (file1.isDirectory()) { - upload(file1); - ftp.changeToParentDirectory(); - } else { - File file2 = new File(file.getPath() + "/" + fstr); - FileInputStream input = new FileInputStream(file2); - ftp.storeFile(file2.getName(), input); - input.close(); - } - } - } else { - File file2 = new File(file.getPath()); - FileInputStream input = new FileInputStream(file2); - ftp.storeFile(file2.getName(), input); - input.close(); - } - } - - /** - * download inline config. - * - * @param downftp ftp to download - * @param localBaseDir local directory - * @param remoteBaseDir remote directory - * @throws Exception e - */ - public static void startDown(Ftp downftp, String localBaseDir, String remoteBaseDir) - throws Exception { - if (FtpUtil.connectFtp(downftp)) { - - try { - FTPFile[] files = null; - boolean changedir = ftp.changeWorkingDirectory(remoteBaseDir); - if (changedir) { - ftp.setControlEncoding("GBK"); - files = ftp.listFiles(); - for (int i = 0; i < files.length; i++) { - try { - downloadFile(files[i], localBaseDir, remoteBaseDir); - } catch (Exception e1) { - logger.error(e1); - logger.error("<" + files[i].getName() + ">download failed"); - } - } - } - } catch (Exception e1) { - logger.error(e1); - logger.error("error occoured while download"); - } - } else { - logger.error("Connect failed !"); - } - - } - - - /** - * download ftp file. - * - * @param ftpFile ftp file to download - * @param relativeLocalPath relative local path - * @param relativeRemotePath relative remote path - */ - private static void downloadFile(FTPFile ftpFile, String relativeLocalPath, - String relativeRemotePath) { - if (ftpFile.isFile()) { - if (ftpFile.getName().indexOf("?") == -1) { - OutputStream outputStream = null; - try { - File locaFile = new File(relativeLocalPath + ftpFile.getName()); - if (locaFile.exists()) { - return; - } else { - outputStream = new FileOutputStream(relativeLocalPath + ftpFile.getName()); - ftp.retrieveFile(ftpFile.getName(), outputStream); - outputStream.flush(); - outputStream.close(); - } - } catch (Exception e1) { - logger.error(e1); - } finally { - try { - if (outputStream != null) { - outputStream.close(); - } - } catch (IOException e1) { - logger.error("OutputStream error !"); - } - } - } - } else { - String newlocalRelatePath = relativeLocalPath + ftpFile.getName(); - String newRemote = new String(relativeRemotePath + ftpFile.getName().toString()); - File fl = new File(newlocalRelatePath); - if (!fl.exists()) { - fl.mkdirs(); - } - try { - newlocalRelatePath = newlocalRelatePath + '/'; - newRemote = newRemote + "/"; - String currentWorkDir = ftpFile.getName().toString(); - boolean changedir = ftp.changeWorkingDirectory(currentWorkDir); - if (changedir) { - FTPFile[] files = null; - files = ftp.listFiles(); - for (int i = 0; i < files.length; i++) { - downloadFile(files[i], newlocalRelatePath, newRemote); - } - } - if (changedir) { - ftp.changeToParentDirectory(); - } - } catch (Exception e1) { - logger.error(e1); - } - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java deleted file mode 100644 index ed3fb5e6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.health; - -import com.codahale.metrics.health.HealthCheck; - -public class ConsoleHealthCheck extends HealthCheck { - private final String template; - - public ConsoleHealthCheck(String template) { - this.template = template; - } - - @Override - protected Result check() throws Exception { - final String saying = String.format(template, "TEST"); - if (!saying.contains("TEST")) { - return Result.unhealthy("template doesn't include a name"); - } - return Result.healthy(); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java deleted file mode 100644 index 3c341094..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.common; - -public enum EnumToscaNodeTypeDefinition { - VNF { - @Override - public String getName() { - return "tosca.nodes.nfv.VNF"; - } - }, - VDU { - @Override - public String getName() { - return "tosca.nodes.nfv.VDU"; - } - }, - VNFC { - @Override - public String getName() { - return "tosca.nodes.nfv.VNFC"; - } - }, - VL { - @Override - public String getName() { - return "tosca.nodes.nfv.VL"; - } - }, - CP { - @Override - public String getName() { - return "tosca.nodes.nfv.CP"; - } - }; - - public abstract String getName(); - - /** - * judge wether is tosca node type definition or not. - * @param type node type - * @return boolean - */ - public static boolean isToscaNodeTypeDef(String type) { - for (EnumToscaNodeTypeDefinition enumDef : EnumToscaNodeTypeDefinition.values()) { - if (type.indexOf(enumDef.getName()) != -1) { - return true; - } - } - return false; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java deleted file mode 100644 index d1d26cef..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.common; - -public enum EnumToscaRelationShipDefinition { - VirtualBindsTo { - @Override - public String getName() { - return "tosca.relationships.nfv.VirtualBindsTo"; - } - }, - VirtualLinksTo { - @Override - public String getName() { - return "tosca.relationships.nfv.VirtualLinksTo"; - } - }, - DeployedOn { - @Override - public String getName() { - return "tosca.relationships.nfv.DeployedOn"; - } - }, - BelongTo { - @Override - public String getName() { - return "tosca.relationships.nfv.BelongTo"; - } - }; - - public abstract String getName(); - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateDataHelper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateDataHelper.java deleted file mode 100644 index a26a32bc..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateDataHelper.java +++ /dev/null @@ -1,267 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.common; - -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.TemplateManager; -import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; -import org.openo.commontosca.catalog.model.entity.NodeTemplate; -import org.openo.commontosca.catalog.model.entity.Parameters; -import org.openo.commontosca.catalog.model.entity.RelationShip; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; -import org.openo.commontosca.catalog.wrapper.PackageWrapper; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -public class TemplateDataHelper { - - /** - * convert to template data. - * @param st ServiceTemplate - * @param ntList NodeTemplate list - * @return TemplateData - */ - public static TemplateData convert2TemplateData(ServiceTemplate st, String rawData, - List<NodeTemplate> ntList) { - TemplateData td = new TemplateData(); - td.setServiceTemplate(convert2ServiceTemplateData(st, rawData)); - td.setNodeTemplates(convert2NodeTemplateDataList(ntList, st.getServiceTemplateId())); - return td; - } - - /** - * convert to service template data. - * @param st ServiceTemplate - * @return ServiceTemplateData - */ - private static ServiceTemplateData convert2ServiceTemplateData(ServiceTemplate st, - String rawData) { - ServiceTemplateData std = new ServiceTemplateData(); - std.setServiceTemplateId(st.getServiceTemplateId()); - std.setServiceTemplateOriginalId(st.getId()); - std.setTemplateName(st.getTemplateName()); - std.setVendor(st.getVendor()); - std.setVersion(st.getVersion()); - std.setCsarId(st.getCsarId()); - std.setType(st.getType()); - std.setDownloadUri(st.getDownloadUri()); - Parameters parameters = new Parameters(st.getInputs(), st.getOutputs()); - std.setInputs(ToolUtil.toJson(parameters)); - std.setOperations(ToolUtil.toJson(st.getOperations())); - std.setRowData(rawData); - return std; - } - - /** - * convert to nodeTemplate data list. - * @param ntList NodeTemplate list - * @param serviceTemplateId service template id - * @return NodeTemplateData list - */ - private static ArrayList<NodeTemplateData> convert2NodeTemplateDataList(List<NodeTemplate> ntList, - String serviceTemplateId) { - ArrayList<NodeTemplateData> ntdList = new ArrayList<>(); - for (NodeTemplate nt : ntList) { - ntdList.add(convert2NodeTemplateData(nt, serviceTemplateId)); - - } - return ntdList; - } - - - /** - * convert to nodeTemplate data. - * @param nt NodeTemplate - * @param serviceTemplateId service template id - * @return NodeTemplateData - */ - private static NodeTemplateData convert2NodeTemplateData(NodeTemplate nt, - String serviceTemplateId) { - NodeTemplateData ntd = new NodeTemplateData(); - - ntd.setNodeTemplateId(nt.getId()); - ntd.setName(nt.getName()); - ntd.setType(nt.getType()); - ntd.setServiceTemplateId(serviceTemplateId); - ntd.setProperties(ToolUtil.toJson(nt.getProperties())); - ntd.setRelationShips(ToolUtil.toJson(nt.getRelationShips())); - - return ntd; - } - - - /** - * convert to service templates. - * @param stdList ServiceTemplateData list - * @return ServiceTemplate list - * @throws CatalogResourceException - */ - public static ServiceTemplate[] convert2ServiceTemplates(List<ServiceTemplateData> stdList) throws CatalogResourceException { - List<ServiceTemplate> stList = new ArrayList<>(); - for (ServiceTemplateData std : stdList) { - stList.add(convert2ServiceTemplate(std)); - } - - return stList.toArray(new ServiceTemplate[0]); - } - - /** - * covert to service template. - * @param std ServiceTemplateData - * @return ServiceTemplate - * @throws CatalogResourceException - */ - public static ServiceTemplate convert2ServiceTemplate(ServiceTemplateData std) throws CatalogResourceException { - Parameters parameters = ToolUtil.fromJson(std.getInputs(), Parameters.class); - ServiceTemplateOperation[] operations = - ToolUtil.fromJson(std.getOperations(), ServiceTemplateOperation[].class); - String downloadUri = buildSTDownloadUri(std.getCsarId(), std.getDownloadUri()); - - return new ServiceTemplate(std.getServiceTemplateId(), std.getServiceTemplateOriginalId(), - std.getTemplateName(), std.getVendor(), - std.getVersion(), std.getCsarId(), std.getType(), downloadUri, - parameters.getInputs(), parameters.getOutputs(), operations, - getSubstitutionMappingsByServiceTemplateId(std.getServiceTemplateId())); - } - - private static SubstitutionMapping getSubstitutionMappingsByServiceTemplateId(String serviceTemplateId) - throws CatalogResourceException { - List<ServiceTemplateMappingData> stmDataList = - TemplateManager.getInstance().queryServiceTemplateMapping(null, serviceTemplateId); - if (stmDataList == null || stmDataList.isEmpty()) { - return null; - } - - return convert2SubstitutionMapping(stmDataList.get(0)); - } - - private static String buildSTDownloadUri(String packageId, String stFileName) - throws CatalogResourceException { - CsarFileUriResponse stDownloadUri = - PackageWrapper.getInstance().getCsarFileDownloadUri(packageId, stFileName); - return stDownloadUri.getDownloadUri(); - } - - /** - * covert to nodeTemplates. - * @param ntdList NodeTemplateData list - * @return NodeTemplate list - */ - public static NodeTemplate[] convert2NodeTemplates(List<NodeTemplateData> ntdList) { - List<NodeTemplate> ntList = new ArrayList<>(); - for (NodeTemplateData ntd : ntdList) { - ntList.add(convert2NodeTemplate(ntd)); - } - return ntList.toArray(new NodeTemplate[0]); - } - - /** - * covert to nodeTemplate. - * @param ntd NodeTemplateData - * @return NodeTemplate - */ - public static NodeTemplate convert2NodeTemplate(NodeTemplateData ntd) { - List<RelationShip> relationShips = convert2RelationShipList(ntd.getRelationShips()); - return new NodeTemplate(ntd.getNodeTemplateId(), ntd.getName(), ntd.getType(), - convert2Property(ntd.getProperties()), relationShips); - } - - /** - * covert to relationship list. - * @param sRelationShips relationships - * @return RelationShip list - */ - private static List<RelationShip> convert2RelationShipList(String srelationShips) { - RelationShip[] relationShips = ToolUtil.fromJson(srelationShips, RelationShip[].class); - return Arrays.asList(relationShips); - } - - /** - * convert to propterty. - * @param properties properties to covert - * @return map - */ - private static Map<String, Object> convert2Property(String properties) { - JsonObject jsonObject = new Gson().fromJson(properties, JsonObject.class); - return parseMapValue(jsonObject); - } - - private static Map<String, Object> parseMapValue(JsonObject jsonObject) { - Map<String, Object> map = new HashMap<>(); - - Iterator<Entry<String, JsonElement>> iterator = jsonObject.entrySet().iterator(); - while (iterator.hasNext()) { - Entry<String, JsonElement> next = iterator.next(); - if (next.getValue() instanceof JsonPrimitive) { - map.put(next.getKey(), next.getValue().getAsString()); - continue; - } - - if (next.getValue() instanceof JsonObject) { - map.put(next.getKey(), parseMapValue((JsonObject) next.getValue())); - continue; - } - } - return map; - } - - - /** - * covert to template mapping data. - * @param stm data to convert - * @return ServiceTemplateMappingData - */ - public static ServiceTemplateMappingData convert2TemplateMappingData(SubstitutionMapping stm) { - ServiceTemplateMappingData stmd = new ServiceTemplateMappingData(); - - stmd.setMappingId(ToolUtil.generateId()); - stmd.setServiceTemplateId(stm.getServiceTemplateId()); - stmd.setNodeType(stm.getNodeType()); - stmd.setRequirements(ToolUtil.toJson(stm.getRequirements())); - stmd.setCapabilities(ToolUtil.toJson(stm.getCapabilities())); - - return stmd; - } - - /** - * convert to substitution mapping. - * @param stmData data to covert - * @return SubstitutionMapping - */ - public static SubstitutionMapping convert2SubstitutionMapping( - ServiceTemplateMappingData stmData) { - return new SubstitutionMapping(stmData.getServiceTemplateId(), stmData.getNodeType()); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateUtils.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateUtils.java deleted file mode 100644 index 697ca1ab..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateUtils.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.common; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.List; -import java.util.Map; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.model.parser.yaml.yamlmodel.Input; -import org.openo.commontosca.catalog.model.parser.yaml.yamlmodel.Plan; -import org.openo.commontosca.catalog.model.parser.yaml.yamlmodel.ServiceTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.esotericsoftware.yamlbeans.YamlConfig; -import com.esotericsoftware.yamlbeans.YamlException; -import com.esotericsoftware.yamlbeans.YamlReader; - -public class TemplateUtils { - private static final Logger logger = LoggerFactory.getLogger(TemplateUtils.class); - - public static Map<String, Plan> loadPlan(String yamlString) throws CatalogResourceException { - ServiceTemplate st = loadServiceTemplate(yamlString); - return st.getPlans(); - } - - /** - * @param yamlString - * @return - * @throws CatalogResourceException - */ - public static ServiceTemplate loadServiceTemplate(String yamlString) throws CatalogResourceException { - if (yamlString == null || yamlString.isEmpty()) { - return new ServiceTemplate(); - } - final YamlReader reader = new YamlReader(yamlString); - adjustConfig(reader.getConfig()); - try { - return reader.read(ServiceTemplate.class); - } catch (final YamlException e) { - throw new CatalogResourceException("Load plan information failed.", e); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - } - } - } - } - - - /** - * @param config - */ - private static void adjustConfig(YamlConfig config) { - config.setPropertyElementType(ServiceTemplate.class, "plans", Plan.class); - config.setPropertyElementType(Plan.class, "inputs", Input.class); - } - - - /** - * @param zipFileName - * @param zipEntryName - * @return - * @throws CatalogResourceException - */ - public static String readStringFromZipFile(String zipFileName, String zipEntryName) throws CatalogResourceException { - String[] lines = readFromZipFile(zipFileName, zipEntryName); - StringBuffer sb = new StringBuffer(); - for (String line : lines) { - sb.append(line).append(System.lineSeparator()); - } - return sb.toString(); - } - - /** - * @param zipFileName - * @param zipEntryName - * @return - * @throws CatalogResourceException - */ - public static String[] readFromZipFile(String zipFileName, String zipEntryName) - throws CatalogResourceException { - ZipFile zf = null; - InputStream ins = null; - try { - zf = new ZipFile(zipFileName); - ZipEntry ze = getZipEntryZipFile(zf, zipEntryName); - - if (ze != null) { - ins = zf.getInputStream(ze); - return readFromInputStream(ins); - } - } catch (IOException e) { - throw new CatalogResourceException("readFromZipFile failed.", e); - } finally { - closeInputStream(ins); - closeZipFile(zf); - } - return new String[0]; - } - - public static ZipEntry getZipEntryZipFile(ZipFile zf, String zipEntryName) { - Enumeration<?> zes = zf.entries(); - while (zes.hasMoreElements()) { - ZipEntry ze = (ZipEntry) zes.nextElement(); - if (zipEntryName.equals(ze.getName()) - || (zipEntryName.replaceAll("\\\\", "/")).equals(ze.getName())) { - return ze; - } - } - - return null; - } - - /** - * @param ins - */ - public static void closeInputStream(InputStream ins) { - if (ins != null) { - try { - ins.close(); - } catch (IOException e) { - logger.warn("closeInputStream failed.", e); - } - } - } - - /** - * @param zf - */ - public static void closeZipFile(ZipFile zf) { - if (zf != null) { - try { - zf.close(); - } catch (IOException e) { - logger.warn("closeZipFile failed.", e); - } - } - } - - private static String[] readFromInputStream(InputStream ins) throws CatalogResourceException { - InputStreamReader insReader = new InputStreamReader(ins); - BufferedReader reader = new BufferedReader(insReader); - - List<String> lineList = new ArrayList<>(); - String line; - try { - while ((line = reader.readLine()) != null) { - lineList.add(line); - } - } catch (IOException e) { - throw new CatalogResourceException("readFromInputStream failed.", e); - } finally { - closeReader(reader); - closeReader(insReader); - } - - return lineList.toArray(new String[0]); - } - - /** - * @param reader - */ - private static void closeReader(Reader reader) { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - logger.warn("closeReader failed.", e); - } - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/CapReqMapping.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/CapReqMapping.java deleted file mode 100644 index 6afbd492..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/CapReqMapping.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 [ZTE] and others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author 10090474 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CapReqMapping { - private String mapped_name; - private String node_id; - private String name; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/InputParameter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/InputParameter.java deleted file mode 100644 index b77d272f..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/InputParameter.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class InputParameter { - private String name; - private String type = "string"; - private String description; - private Object defaultValue; - private boolean required; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/KeyValuePair.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/KeyValuePair.java deleted file mode 100644 index cb2acde7..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/KeyValuePair.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class KeyValuePair { - private String key; - private String value; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NfvTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NfvTemplate.java deleted file mode 100644 index d5307c77..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NfvTemplate.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class NfvTemplate { - private List<NodeTemplate> vduNodes; - private List<NodeTemplate> networkNodes; - private List<NodeTemplate> vnfcNodes; - private List<NodeTemplate> vnfNodes; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NodeTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NodeTemplate.java deleted file mode 100644 index 03939dd7..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NodeTemplate.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; -import java.util.Map; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class NodeTemplate { - private String id; - private String name; - private String type; - private Map<String, Object> properties; - private List<RelationShip> relationShips; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/OutputParameter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/OutputParameter.java deleted file mode 100644 index 298370c2..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/OutputParameter.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class OutputParameter { - - private String name; - - private String description; - - private Object value; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/Parameters.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/Parameters.java deleted file mode 100644 index 249c2975..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/Parameters.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class Parameters { - - private InputParameter[] inputs; - - private OutputParameter[] outputs; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/QueryRawDataCondition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/QueryRawDataCondition.java deleted file mode 100644 index a1493aa7..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/QueryRawDataCondition.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class QueryRawDataCondition { - private String csarId; - private KeyValuePair[] inputParameters; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/RelationShip.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/RelationShip.java deleted file mode 100644 index 6e101802..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/RelationShip.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class RelationShip { - - private String sourceNodeName; - - private String targetNodeName; - - private String sourceNodeId; - - private String targetNodeId; - - private String type; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplate.java deleted file mode 100644 index 6f5dfb3a..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplate.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ServiceTemplate { - - private String serviceTemplateId; - - private String id; - - private String templateName; - - private String vendor; - - private String version; - - private String csarId; - - private String type; - - private String downloadUri; - - private InputParameter[] inputs; - - private OutputParameter[] outputs; - - private ServiceTemplateOperation[] operations; - - private SubstitutionMapping substitution; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateOperation.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateOperation.java deleted file mode 100644 index 510a1592..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateOperation.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ServiceTemplateOperation { - - private String name; - - private String description; - - private String packageName; - - private String processId; - - private InputParameter[] inputs; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateRawData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateRawData.java deleted file mode 100644 index 505444d6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateRawData.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ServiceTemplateRawData { - - private String rawData; - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/SubstitutionMapping.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/SubstitutionMapping.java deleted file mode 100644 index 2f34a4a9..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/SubstitutionMapping.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import com.fasterxml.jackson.annotation.JsonIgnore; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SubstitutionMapping { - @JsonIgnore - private String serviceTemplateId; - private String nodeType; - private CapReqMapping[] requirements; - private CapReqMapping[] capabilities; - - /** - * substitution mapping. - * @param serviceTemplateId service template id - * @param nodeType node type - */ - public SubstitutionMapping(String serviceTemplateId, String nodeType) { - super(); - this.serviceTemplateId = serviceTemplateId; - this.nodeType = nodeType; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java deleted file mode 100644 index e6690920..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfService; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - - - - -/** - * The opentosca container self service returns data to the entity. - * - * @author 10189609 - * - */ -public class ContainerSelfServiceProvider implements MessageBodyReader<ContainerSelfService> { - - @Override - public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, - MediaType mediaType) { - return ContainerSelfService.class.isAssignableFrom(type); - } - - @Override - public ContainerSelfService readFrom(Class<ContainerSelfService> type, Type genericType, - Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, - InputStream entityStream) throws IOException, WebApplicationException { - ContainerSelfService object = null; - - try { - JAXBContext jaxbContext = JAXBContext.newInstance(ContainerSelfService.class); - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - object = (ContainerSelfService) unmarshaller.unmarshal(entityStream); - } catch (JAXBException e1) { - e1.printStackTrace(); - } - - return object; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceConsumer.java deleted file mode 100644 index da809fb7..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceConsumer.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import com.google.gson.JsonObject; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; - -import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.media.multipart.BodyPart; -import org.glassfish.jersey.media.multipart.FormDataBodyPart; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataMultiPart; -import org.glassfish.jersey.media.multipart.MultiPartFeature; -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfService; -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfServiceOption; -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceNodeTemplateList; -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceTemplateList; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.InputStream; -import java.util.List; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - - - -/** - * By rest requesting access container services. - * - * @author 10189609 - * - */ -public class ContainerServiceConsumer { - private static final Logger LOG = LoggerFactory.getLogger(ContainerServiceConsumer.class); - - /** - * get service template by template id from container service. - * - * @param templateid id - * @return template list entity - */ - public static ContainerServiceTemplateList getServiceTemplates(final String templateid) { - ClientConfig config = new ClientConfig(new ContainerServiceTemplateProvider()); - IContainerTemplateRest containerservicetemplateproxy = - ConsumerFactory.createConsumer(getBaseUrl(), config, IContainerTemplateRest.class); - return containerservicetemplateproxy.getToscaServiceTemplate(templateid); - } - - /** - * get operation input param xml from container service. - * - * @param csarId package Id - * @param operationId operation id - * @return xml - */ - public static String getOperationInputParamXml(final String csarId, final String operationId) { - String inputparamsSoapXml = null; - ClientConfig config = new ClientConfig().register(new ContainerSelfServiceProvider()); - IContainerSelfServiceRest containerserviceoperationproxy = - ConsumerFactory.createConsumer(getPackageUrl(), config, IContainerSelfServiceRest.class); - String csarid = ToolUtil.formatCsar(csarId); - ContainerSelfService containerselfservice = - containerserviceoperationproxy.getContainerSelfService(csarid); - if (containerselfservice != null) { - for (int i = 0; i < containerselfservice.getOptionList().size(); i++) { - ContainerSelfServiceOption serviceOption = containerselfservice.getOptionList().get(i); - if (serviceOption != null && operationId.equals(serviceOption.getId())) { - inputparamsSoapXml = - containerserviceoperationproxy.getContainerSelfServiceOptionInputMessage(csarid, - serviceOption.getPlanInputMessageUrl()); - break; - } - } - } - return inputparamsSoapXml; - } - - /** - * get operations by csar id. - * - * @param csarId package id - * @return xml - */ - public static String getOperations(final String csarId) { - ClientConfig config = new ClientConfig().register(new ContainerSelfServiceProvider()); - IContainerSelfServiceRest containerselfserviceproxy = - ConsumerFactory.createConsumer(getPackageUrl(), config, IContainerSelfServiceRest.class); - return containerselfserviceproxy.getContainerSelfServiceXml(ToolUtil.formatCsar(csarId)); - } - - /** - * get operation list. - * @param csarId package id - * @return container operation list - */ - public static List<ContainerSelfServiceOption> getOperationList(final String csarId) { - ClientConfig config = new ClientConfig().register(new ContainerSelfServiceProvider()); - IContainerSelfServiceRest containerserviceoperationproxy = - ConsumerFactory.createConsumer(getPackageUrl(), config, IContainerSelfServiceRest.class); - String csarid = ToolUtil.formatCsar(csarId); - ContainerSelfService containerselfservice = - containerserviceoperationproxy.getContainerSelfService(csarid); - return containerselfservice.getOptionList(); - } - - /** - * upload csar package to opentosca containerapi service. - * - * @param uploadedInputStream stream - * @param fileDetail file detail - * @return response - */ - public static Response uploadServicePackage(InputStream uploadedInputStream, - FormDataContentDisposition fileDetail) { - final FormDataMultiPart formData = new FormDataMultiPart(); - final BodyPart bodyPart = - new FormDataBodyPart(fileDetail, uploadedInputStream, - MediaType.APPLICATION_OCTET_STREAM_TYPE); - formData.bodyPart(bodyPart); - formData.setContentDisposition(fileDetail); - formData.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE); - final Client client = ClientBuilder.newBuilder().register(MultiPartFeature.class).build(); - final WebTarget target = client.target(getPackageUrl()).path("/containerapi/CSARs"); - final Response response = - target.request().post(Entity.entity(formData, formData.getMediaType())); - return response; - } - - /** - * upload csar package by file location. - * - * @param fileLocation file location - * @return response - */ - public static Response uploadServicePackageByLocation(String fileLocation) { - ClientConfig config = new ClientConfig(); - IContainerExtPackageRest containerservicepackageproxy = - ConsumerFactory.createConsumer(getBaseUrl(), config, IContainerExtPackageRest.class); - String result = containerservicepackageproxy.uploadPackageByToscaService(fileLocation); - JsonObject json = new JsonObject(); - json.addProperty("result", result); - return Response.ok(json.toString()).build(); - } - - /** - * delete a csar package by csar name. - * - * @param csarName package name - * @return package id which deleted - */ - public static String delServicePackage(final String csarName) { - ClientConfig config = new ClientConfig(); - IContainerExtPackageRest containerservicepackageproxy = - ConsumerFactory.createConsumer(getBaseUrl(), config, IContainerExtPackageRest.class); - LOG.info("url:" + getBaseUrl() + " csarName:" + csarName); - return containerservicepackageproxy.deletePackageById(csarName); - } - - /** - * get node template list. - * - * @param templateId template id - * @return container service nodeTemplate list - */ - public static ContainerServiceNodeTemplateList getNodeTemplates(final String templateId) { - ClientConfig config = new ClientConfig(new ContainerServiceNodeTemplateProvider()); - IContainerTemplateRest containertemplateproxy = - ConsumerFactory.createConsumer(getBaseUrl(), config, IContainerTemplateRest.class); - return containertemplateproxy.getToscaServiceNodeTemplates(templateId); - } - - /** - * get policy infomation by service template id from vnfd. - * - * @param serviceTemplateId service template id - * @return tosca policys - */ - public static String getPolicys(String serviceTemplateId) { - ClientConfig config = new ClientConfig(new StringProvider()); - IContainerPortabilityRest containerPolicyproxy = - ConsumerFactory.createConsumer(getBaseUrl(), config, IContainerPortabilityRest.class); - return containerPolicyproxy.getToscaPolicys(serviceTemplateId); - } - - /** - * http://127.0.0.1:1337/containerapi/extension. - * - * @return base url - */ - private static String getBaseUrl() { - StringBuffer buffer = new StringBuffer(); - buffer.append(Config.getConfigration().getMsbServerAddr() + "/containerapi/extension"); - return buffer.toString(); - } - - /** - * http://127.0.0.1:1337 - * - * @return package url - */ - private static String getPackageUrl() { - StringBuffer buffer = new StringBuffer(); - buffer.append(Config.getConfigration().getMsbServerAddr()); - return buffer.toString(); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java deleted file mode 100644 index f2593d49..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceNodeTemplateList; -import org.xml.sax.InputSource; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.Source; -import javax.xml.transform.sax.SAXSource; - -/** - * The opentosca container service returns data to the node template entity. - * - * @author 10189609 - * - */ -public class ContainerServiceNodeTemplateProvider implements - MessageBodyReader<ContainerServiceNodeTemplateList> { - - @Override - public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, - MediaType mediaType) { - return ContainerServiceNodeTemplateList.class.isAssignableFrom(type); - } - - @Override - public ContainerServiceNodeTemplateList readFrom(Class<ContainerServiceNodeTemplateList> type, - Type genericType, Annotation[] annotations, MediaType mediaType, - MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, - WebApplicationException { - ContainerServiceNodeTemplateList nodetemplatelist = null; - - try { - JAXBContext jaxbContext = JAXBContext.newInstance(ContainerServiceNodeTemplateList.class); - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - // ignore namespace - NamespaceFilter inFilter = new NamespaceFilter(null, false); - XMLReader reader = XMLReaderFactory.createXMLReader(); - inFilter.setParent(reader); - Source source = new SAXSource(inFilter, new InputSource(entityStream)); - - nodetemplatelist = (ContainerServiceNodeTemplateList) unmarshaller.unmarshal(source); - } catch (Exception e1) { - e1.printStackTrace(); - } - - return nodetemplatelist; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java deleted file mode 100644 index c0cf0f7d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServicePackageList; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - - - -/** - * The opentosca container service returns data to the package entity. - * - * @author 10189609 - * - */ -public class ContainerServicePackageProvider implements - MessageBodyReader<ContainerServicePackageList> { - - @Override - public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, - MediaType mediaType) { - return ContainerServicePackageList.class.isAssignableFrom(type); - } - - @Override - public ContainerServicePackageList readFrom(Class<ContainerServicePackageList> type, - Type genericType, Annotation[] annotations, MediaType mediaType, - MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, - WebApplicationException { - ContainerServicePackageList packageList = null; - - try { - JAXBContext jaxbContext = JAXBContext.newInstance(ContainerServicePackageList.class); - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - packageList = (ContainerServicePackageList) unmarshaller.unmarshal(entityStream); - } catch (JAXBException e1) { - e1.printStackTrace(); - } - - return packageList; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java deleted file mode 100644 index bfd1b04a..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceTemplateList; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - - -/** - * The opentosca container self service returns data to the service template entity. - * - * @author 10189609 - * - */ -public class ContainerServiceTemplateProvider implements - MessageBodyReader<ContainerServiceTemplateList> { - - @Override - public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, - MediaType mediaType) { - return ContainerServiceTemplateList.class.isAssignableFrom(type); - } - - @Override - public ContainerServiceTemplateList readFrom(Class<ContainerServiceTemplateList> type, - Type genericType, Annotation[] annotations, MediaType mediaType, - MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, - WebApplicationException { - ContainerServiceTemplateList object = null; - - try { - JAXBContext jaxbContext = JAXBContext.newInstance(ContainerServiceTemplateList.class); - Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); - object = (ContainerServiceTemplateList) jaxbUnmarshaller.unmarshal(entityStream); - } catch (JAXBException e1) { - e1.printStackTrace(); - } - - return object; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java deleted file mode 100644 index 15823ea1..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServicePackageList; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -/** - * The opentosca container interface for csar. - * - * @author 10189609 - * - */ -@Path("/csars") -public interface IContainerExtPackageRest { - @GET - @Produces(MediaType.APPLICATION_OCTET_STREAM) - public ContainerServicePackageList getToscaServicePackage( - @QueryParam("csarName") String csarName); - - @POST - @Consumes(MediaType.TEXT_PLAIN) - public String uploadPackageByToscaService(@QueryParam("fileLocation") String fileLocation); - - @Path("/{csarId}") - @DELETE - public String deletePackageById(@PathParam("csarId") String csarId); -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerPortabilityRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerPortabilityRest.java deleted file mode 100644 index b864c74f..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerPortabilityRest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; - -/** - * The opentosca container interface for policy. - * - * @author 10189609 - * - */ -@Path("/servicetemplates") -public interface IContainerPortabilityRest { - - @Path("/{templateid}/policys") - @GET - String getToscaPolicys(@PathParam("templateid") String serviceTemplateId); -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java deleted file mode 100644 index 9149c5b2..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfService; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; - - -/** - * The opentosca container interface for self service. - * - * @author 10189609 - * - */ -@Path("/containerapi/CSARs/{csarid}/Content/SELFSERVICE-Metadata") -public interface IContainerSelfServiceRest { - @GET - @Path("/data.xml") - @Produces({"application/octet-stream"}) - ContainerSelfService getContainerSelfService(@PathParam("csarid") String csarId); - - @GET - @Path("/data.xml") - @Produces({"application/octet-stream"}) - String getContainerSelfServiceXml(@PathParam("csarid") String csarId); - - @GET - @Path("/{inputmessageurl}") - @Produces({"application/octet-stream"}) - String getContainerSelfServiceOptionInputMessage(@PathParam("csarid") String csarId, - @PathParam("inputmessageurl") String inputmessageUrl); -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java deleted file mode 100644 index a39840c3..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceNodeTemplateList; -import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceTemplateList; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - - -/** - * The opentosca container interface for service template. - * - * @author 10189609 - * - */ -@Path("/servicetemplates") -public interface IContainerTemplateRest { - @GET - @Produces(MediaType.APPLICATION_OCTET_STREAM) - ContainerServiceTemplateList getToscaServiceTemplate(@QueryParam("templateid") String templateId); - - @Path("/{templateid}/nodetemplates") - @GET - @Produces(MediaType.APPLICATION_OCTET_STREAM) - ContainerServiceNodeTemplateList getToscaServiceNodeTemplates( - @PathParam("templateid") String templateId); -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java deleted file mode 100644 index ad440c4f..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.XMLFilterImpl; - -/** - * NamespaceFilter. - * - * @author 10189609 - * - */ -public class NamespaceFilter extends XMLFilterImpl { - - private String usedNamespaceUri; - private boolean addNamespace; - - // State variable - private boolean addedNamespace = false; - - /** - * constructor. - * @param namespaceUri namspace uri - * @param addNamespace add namespace or not - */ - public NamespaceFilter(String namespaceUri, boolean addNamespace) { - super(); - - if (addNamespace) { - this.usedNamespaceUri = namespaceUri; - } else { - this.usedNamespaceUri = ""; - } - this.addNamespace = addNamespace; - } - - - - @Override - public void startDocument() throws SAXException { - super.startDocument(); - if (addNamespace) { - startControlledPrefixMapping(); - } - } - - - - @Override - public void startElement(String arg0, String arg1, String arg2, Attributes arg3) - throws SAXException { - - super.startElement(this.usedNamespaceUri, arg1, arg2, arg3); - } - - @Override - public void endElement(String arg0, String arg1, String arg2) throws SAXException { - - super.endElement(this.usedNamespaceUri, arg1, arg2); - } - - @Override - public void startPrefixMapping(String prefix, String url) throws SAXException { - - - if (addNamespace) { - this.startControlledPrefixMapping(); - } else { - // Remove the namespace, i.e. don´t call startPrefixMapping for parent! - } - - } - - private void startControlledPrefixMapping() throws SAXException { - - if (this.addNamespace && !this.addedNamespace) { - // We should add namespace since it is set and has not yet been done. - super.startPrefixMapping("", this.usedNamespaceUri); - - // Make sure we dont do it twice - this.addedNamespace = true; - } - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/StringProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/StringProvider.java deleted file mode 100644 index 085865ba..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/StringProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.container; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; - -/** - * The opentosca container service returns data directly. - * - * @author 10189609 - * - */ -public class StringProvider implements MessageBodyReader<String> { - - @Override - public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, - MediaType mediaType) { - return false;// false representation not convert query results , returned directly - } - - @Override - public String readFrom(Class<String> type, Type genericType, Annotation[] annotations, - MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) - throws IOException, WebApplicationException { - return null; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerSelfService.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerSelfService.java deleted file mode 100644 index 6fd02289..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerSelfService.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "Application", namespace = ContainerSelfService.NAMESPACE_OF_SELFSERVICE) -public class ContainerSelfService { - public static final String NAMESPACE_OF_SELFSERVICE = - "http://www.eclipse.org/winery/model/selfservice"; - - @XmlElement(namespace = NAMESPACE_OF_SELFSERVICE) - private String displayName; - - @XmlElement(namespace = NAMESPACE_OF_SELFSERVICE) - private String description; - - @XmlElement(namespace = NAMESPACE_OF_SELFSERVICE) - private String iconUrl; - - @XmlElement(namespace = NAMESPACE_OF_SELFSERVICE) - private String imageUrl; - - @XmlElementWrapper(name = "options", namespace = NAMESPACE_OF_SELFSERVICE) - @XmlElement(name = "option", namespace = NAMESPACE_OF_SELFSERVICE) - private List<ContainerSelfServiceOption> optionList; - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getIconUrl() { - return iconUrl; - } - - public void setIconUrl(String iconUrl) { - this.iconUrl = iconUrl; - } - - public String getImageUrl() { - return imageUrl; - } - - public void setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - } - - public List<ContainerSelfServiceOption> getOptionList() { - return optionList; - } - - public void setOptionList(List<ContainerSelfServiceOption> optionList) { - this.optionList = optionList; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerSelfServiceOption.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerSelfServiceOption.java deleted file mode 100644 index 48bf9cdc..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerSelfServiceOption.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlTransient; - -@XmlAccessorType(XmlAccessType.FIELD) -public class ContainerSelfServiceOption { - @XmlElement(namespace = ContainerSelfService.NAMESPACE_OF_SELFSERVICE) - private String description; - @XmlElement(namespace = ContainerSelfService.NAMESPACE_OF_SELFSERVICE) - private String iconUrl; - @XmlElement(namespace = ContainerSelfService.NAMESPACE_OF_SELFSERVICE) - private String planServiceName; - @XmlElement(namespace = ContainerSelfService.NAMESPACE_OF_SELFSERVICE) - private String planInputMessageUrl; - @XmlAttribute - private String id; - @XmlAttribute - private String name; - @XmlTransient - private String inputMessageSoap; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getIconUrl() { - return iconUrl; - } - - public void setIconUrl(String iconUrl) { - this.iconUrl = iconUrl; - } - - public String getPlanServiceName() { - return planServiceName; - } - - public void setPlanServiceName(String planServiceName) { - this.planServiceName = planServiceName; - } - - public String getPlanInputMessageUrl() { - return planInputMessageUrl; - } - - public void setPlanInputMessageUrl(String planInputMessageUrl) { - this.planInputMessageUrl = planInputMessageUrl; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getInputMessageSoap() { - return inputMessageSoap; - } - - public void setInputMessageSoap(String inputMessageSoap) { - this.inputMessageSoap = inputMessageSoap; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceCommonParam.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceCommonParam.java deleted file mode 100644 index 14b5191e..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceCommonParam.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class ContainerServiceCommonParam { - @XmlElement - private String key; - - @XmlElement - private String value; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceNodeTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceNodeTemplate.java deleted file mode 100644 index 1300f82c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceNodeTemplate.java +++ /dev/null @@ -1,315 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import org.openo.commontosca.catalog.common.ToolUtil; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -public class ContainerServiceNodeTemplate { - - @XmlAttribute(name = "nodetemplateid") - private String id; - - @XmlAttribute(name = "nodetemplatename") - private String name; - - @XmlAttribute - private String type; - - @XmlElementWrapper(name = "properties") - @XmlElement(name = "property") - private List<ContainerServiceCommonParam> properties; - - @XmlElementWrapper(name = "relationshipInfos") - @XmlElement(name = "relationship") - private List<ContainerServiceRelationShip> relationShips; - - @XmlElement(name = "Capabilities") - private ContainerServiceNodeTemplate.Capablitiies capabilities; - - public ContainerServiceNodeTemplate.Capablitiies getCapabilities() { - return capabilities; - } - - public void setCapabilities(ContainerServiceNodeTemplate.Capablitiies capabilities) { - this.capabilities = capabilities; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public List<ContainerServiceCommonParam> getProperties() { - return properties; - } - - public void setProperties(List<ContainerServiceCommonParam> properties) { - this.properties = properties; - } - - public List<ContainerServiceRelationShip> getRelationShips() { - return relationShips; - } - - public void setRelationShips(List<ContainerServiceRelationShip> relationShips) { - this.relationShips = relationShips; - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class Capablitiies { - @XmlElement(name = "Capability") - private List<ContainerServiceNodeTemplate.Capability> capabilityList; - - public List<ContainerServiceNodeTemplate.Capability> getCapabilityList() { - return capabilityList; - } - - public void setCapabilityList(List<ContainerServiceNodeTemplate.Capability> capabilityList) { - this.capabilityList = capabilityList; - } - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class Capability { - @XmlAttribute(name = "id") - private String flavorName; - - @XmlElement(name = "Properties") - private ContainerServiceNodeTemplate.CapabilityProperties properties; - - public String getFlavorName() { - return flavorName; - } - - public void setFlavorName(String flavorName) { - this.flavorName = flavorName; - } - - public ContainerServiceNodeTemplate.CapabilityProperties getProperties() { - return properties; - } - - public void setProperties(ContainerServiceNodeTemplate.CapabilityProperties properties) { - this.properties = properties; - } - - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class CapabilityProperties { - @XmlElement(name = "Properties") - private ContainerServiceNodeTemplate.CapabilityProperty property; - - public ContainerServiceNodeTemplate.CapabilityProperty getProperty() { - return property; - } - - public void setProperty(ContainerServiceNodeTemplate.CapabilityProperty property) { - this.property = property; - } - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.FIELD) - public static class CapabilityProperty { - @XmlElement - private String vcpu; - - @XmlElement - private String vram; - - @XmlElement - private String rootDisk; - - @XmlElement - private String swapDisk; - - @XmlElement - private String tempDisk; - - public String getVcpu() { - return vcpu; - } - - public void setVcpu(String vcpu) { - this.vcpu = vcpu; - } - - public String getVram() { - return vram; - } - - public void setVram(String vram) { - this.vram = vram; - } - - public String getRootDisk() { - return rootDisk; - } - - public void setRootDisk(String rootDisk) { - this.rootDisk = rootDisk; - } - - public String getSwapDisk() { - return swapDisk; - } - - public void setSwapDisk(String swapDisk) { - this.swapDisk = swapDisk; - } - - public String getTempDisk() { - return tempDisk; - } - - public void setTempDisk(String tempDisk) { - this.tempDisk = tempDisk; - } - } - - public class NtFlavor { - private String flavorName; - - private String vcpu; - - private String vram; - - private String rootDisk; - - private String swapDisk; - - private String tempDisk; - - public String getFlavorName() { - return flavorName; - } - - public void setFlavorName(String flavorName) { - this.flavorName = flavorName; - } - - public String getVcpu() { - return vcpu; - } - - public void setVcpu(String vcpu) { - this.vcpu = vcpu; - } - - public String getVram() { - return vram; - } - - public void setVram(String vram) { - this.vram = vram; - } - - public String getRootDisk() { - return rootDisk; - } - - public void setRootDisk(String rootDisk) { - this.rootDisk = rootDisk; - } - - public String getSwapDisk() { - return swapDisk; - } - - public void setSwapDisk(String swapDisk) { - this.swapDisk = swapDisk; - } - - public String getTempDisk() { - return tempDisk; - } - - public void setTempDisk(String tempDisk) { - this.tempDisk = tempDisk; - } - - } - - /** - * get nt flavor list. - * @return nt flavor list - */ - public List<NtFlavor> getNtFlavorList() { - if (null == this.capabilities || ToolUtil.isEmptyCollection(capabilities.getCapabilityList())) { - return null; - } - - List<NtFlavor> ntFlavors = new ArrayList<NtFlavor>(); - List<Capability> capabilityList = capabilities.getCapabilityList(); - for (Capability capabilty : capabilityList) { - NtFlavor ntFlavor = convertCap2Flavor(capabilty); - ntFlavors.add(ntFlavor); - } - - return ntFlavors; - } - - private NtFlavor convertCap2Flavor(Capability capabilty) { - NtFlavor ntFlavor = new NtFlavor(); - ntFlavor.setFlavorName(capabilty.getFlavorName()); - if (null != capabilty.getProperties() && null != capabilty.getProperties().getProperty()) { - CapabilityProperty property = capabilty.getProperties().getProperty(); - ntFlavor.setRootDisk(property.getRootDisk()); - ntFlavor.setSwapDisk(property.getSwapDisk()); - ntFlavor.setTempDisk(property.getTempDisk()); - ntFlavor.setVcpu(property.getVcpu()); - ntFlavor.setVram(property.getVram()); - } - - return ntFlavor; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceNodeTemplateList.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceNodeTemplateList.java deleted file mode 100644 index a65bdaab..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceNodeTemplateList.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "nodetemplates") -public class ContainerServiceNodeTemplateList { - @XmlElement(name = "nodetemplate") - private List<ContainerServiceNodeTemplate> nodeTemplate; - - public List<ContainerServiceNodeTemplate> getNodeTemplate() { - return nodeTemplate; - } - - public void setNodeTemplate(List<ContainerServiceNodeTemplate> nodeTemplate) { - this.nodeTemplate = nodeTemplate; - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceOperationParameter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceOperationParameter.java deleted file mode 100644 index 701a1318..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceOperationParameter.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -public class ContainerServiceOperationParameter { - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServicePackage.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServicePackage.java deleted file mode 100644 index 398d0e9c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServicePackage.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement -public class ContainerServicePackage { - @XmlAttribute - private String name; - @XmlAttribute - private String createTime; - @XmlAttribute - private String size; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServicePackageList.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServicePackageList.java deleted file mode 100644 index e841784c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServicePackageList.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "packages") -public class ContainerServicePackageList { - public static final String NAMESPACE_OF_SELFSERVICE = - "http://www.eclipse.org/winery/model/selfservice"; - - @XmlElement(name = "package") - private List<ContainerServicePackage> packageList; - - public List<ContainerServicePackage> getPackageList() { - return packageList; - } - - public void setPackageList(List<ContainerServicePackage> packageList) { - this.packageList = packageList; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceRelationShip.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceRelationShip.java deleted file mode 100644 index d0e7cde1..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceRelationShip.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class ContainerServiceRelationShip { - @XmlElement - private String sourceNodeName; - - @XmlElement - private String targetNodeName; - - @XmlElement - private String sourceNodeId; - - @XmlElement - private String targetNodeId; - - @XmlElement - private String type; - - public String getSourceNodeId() { - return sourceNodeId; - } - - public void setSourceNodeId(String sourceNodeId) { - this.sourceNodeId = sourceNodeId; - } - - public String getTargetNodeId() { - return targetNodeId; - } - - public void setTargetNodeId(String targetNodeId) { - this.targetNodeId = targetNodeId; - } - - public String getSourceNodeName() { - return sourceNodeName; - } - - public void setSourceNodeName(String sourceNodeName) { - this.sourceNodeName = sourceNodeName; - } - - public String getTargetNodeName() { - return targetNodeName; - } - - public void setTargetNodeName(String targetNodeName) { - this.targetNodeName = targetNodeName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceTemplate.java deleted file mode 100644 index 54e02cdb..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceTemplate.java +++ /dev/null @@ -1,329 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -public class ContainerServiceTemplate { - @XmlAttribute - private String templateid; - - @XmlAttribute - private String templatename; - - @XmlElement(name = "BoundaryDefinitions") - private BoundaryDefinitions boundary; - - public String getTemplateid() { - return templateid; - } - - public void setTemplateid(String templateid) { - this.templateid = templateid; - } - - public String getTemplatename() { - return templatename; - } - - public void setTemplatename(String templatename) { - this.templatename = templatename; - } - - public BoundaryDefinitions getBoundary() { - return boundary; - } - - public void setBoundary(BoundaryDefinitions boundary) { - this.boundary = boundary; - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class BoundaryDefinitions { - @XmlElement(name = "Properties", namespace = "http://docs.oasis-open.org/tosca/ns/2011/12") - private BoundaryProperties properties; - - public BoundaryProperties getProperties() { - return properties; - } - - public void setProperties(BoundaryProperties properties) { - this.properties = properties; - } - - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class BoundaryProperties { - @XmlElement(name = "Properties") - private BoundaryProperty property; - - public BoundaryProperty getProperty() { - return property; - } - - public void setProperty(BoundaryProperty property) { - this.property = property; - } - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class BoundaryProperty { - public String getTemplateVersion() { - return templateVersion; - } - - public void setTemplateVersion(String templateVersion) { - this.templateVersion = templateVersion; - } - - public String getTemplateAuthor() { - return templateAuthor; - } - - public void setTemplateAuthor(String templateAuthor) { - this.templateAuthor = templateAuthor; - } - - public String getVendor() { - return vendor; - } - - public void setVendor(String vendor) { - this.vendor = vendor; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getNfvType() { - return nfvType; - } - - public void setNfvType(String nfvType) { - this.nfvType = nfvType; - } - - public String getMoc() { - return moc; - } - - public void setMoc(String moc) { - this.moc = moc; - } - - public String getFlavor() { - return flavor; - } - - public void setFlavor(String flavor) { - this.flavor = flavor; - } - - public List<StFlavor> getStFlavor() { - return stFlavor; - } - - public void setStFlavor(List<StFlavor> stFlavor) { - this.stFlavor = stFlavor; - } - - @XmlElement - private String templateVersion; - - @XmlElement - private String templateAuthor; - - @XmlElement - private String vendor; - - @XmlElement - private String version; - - @XmlElement - private String nfvType; - - @XmlElement - private String moc; - - @XmlElement - private String flavor; - - @XmlElementWrapper(name = "flavorList") - @XmlElement(name = "flavor") - private List<StFlavor> stFlavor; - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class StFlavor { - @XmlAttribute - private String name; - - @XmlAttribute - private String desc; - - @XmlElementWrapper(name = "nodeList") - @XmlElement(name = "node") - private List<StFlavorConstituent> stFlavorConstituent; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public List<StFlavorConstituent> getStFlavorConstituent() { - return stFlavorConstituent; - } - - public void setStFlavorConstituent(List<StFlavorConstituent> stFlavorConstituent) { - this.stFlavorConstituent = stFlavorConstituent; - } - } - - @XmlRootElement - @XmlAccessorType(XmlAccessType.NONE) - public static class StFlavorConstituent { - @XmlAttribute - private String numberOfInstances; - - @XmlAttribute - private String name; - - @XmlAttribute - private String refNodeFlavor; - - @XmlAttribute - private String affinity; - - @XmlAttribute - private String redundancyModel; - - @XmlAttribute - private String capability; - - public String getAffinity() { - return affinity; - } - - public void setAffinity(String affinity) { - this.affinity = affinity; - } - - public String getRedundancyModel() { - return redundancyModel; - } - - public void setRedundancyModel(String redundancyModel) { - this.redundancyModel = redundancyModel; - } - - public String getCapability() { - return capability; - } - - public void setCapability(String capability) { - this.capability = capability; - } - - public String getNumberOfInstances() { - return numberOfInstances; - } - - public void setNumberOfInstances(String numberOfInstances) { - this.numberOfInstances = numberOfInstances; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRefNodeFlavor() { - return refNodeFlavor; - } - - public void setRefNodeFlavor(String refNodeFlavor) { - this.refNodeFlavor = refNodeFlavor; - } - } - - private Boolean propNullFlag; - - private boolean isPropNotNull() { - if (null == propNullFlag) { - propNullFlag = - null != this.getBoundary() && null != this.getBoundary().getProperties() - && null != this.getBoundary().getProperties().getProperty(); - } - return propNullFlag; - } - - public String getProductType() { - return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getMoc() : null; - } - - public String getVendor() { - return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getVendor() : null; - } - - public String getVersion() { - return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getVersion() : null; - } - - public String getNfvtype() { - return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getNfvType() : null; - } - - public String getFlavor() { - return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getFlavor() : null; - } - - public List<StFlavor> getStFlavorList() { - return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getStFlavor() : null; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceTemplateList.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceTemplateList.java deleted file mode 100644 index c4ebfbc4..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/container/ContainerServiceTemplateList.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.container; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "servicetemplates") -public class ContainerServiceTemplateList { - public static final String NAMESPACE_OF_SELFSERVICE = - "http://www.eclipse.org/winery/model/selfservice"; - - @XmlElement(name = "serviceTemplate") - private List<ContainerServiceTemplate> serviceTemplateList; - - public List<ContainerServiceTemplate> getServiceTemplateList() { - return serviceTemplateList; - } - - public void setServiceTemplateList(List<ContainerServiceTemplate> optionList) { - this.serviceTemplateList = optionList; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/lifecycle/InstanceEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/lifecycle/InstanceEntity.java deleted file mode 100644 index caace7e8..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/lifecycle/InstanceEntity.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.lifecycle; - -public class InstanceEntity { - private String serviceTemplateId; - - public String getServiceTemplateId() { - return serviceTemplateId; - } - - public void setServiceTemplateId(String serviceTemplateId) { - this.serviceTemplateId = serviceTemplateId; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/ro/ResourceResponseEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/ro/ResourceResponseEntity.java deleted file mode 100644 index f6da4549..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/ro/ResourceResponseEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.ro; - -import java.util.ArrayList; - -public class ResourceResponseEntity { - ArrayList<VimEntity> data = new ArrayList<VimEntity>(); - String operationResult; - - public String getOperationResult() { - return operationResult; - } - - public void setOperationResult(String operationResult) { - this.operationResult = operationResult; - } - - public ArrayList<VimEntity> getData() { - return data; - } - - public void setData(ArrayList<VimEntity> data) { - this.data = data; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/ro/VimEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/ro/VimEntity.java deleted file mode 100644 index 98edf112..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/ro/VimEntity.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.entity.ro; - -public class VimEntity { - private String oid; - private String name; - private String user; - private String url; - private String userName; - private String password; - - public String getOid() { - return oid; - } - - public void setOid(String oid) { - this.oid = oid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUser() { - return user; - } - - public void setUser(String user) { - this.user = user; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java deleted file mode 100644 index 8e33c9b1..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.lifecycle; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -/** - * The lifecycle interface. - * - * @author 10189609 - * - */ -@Path("/appinstances") -public interface ILifeCycleServiceRest { - @GET - @Produces(MediaType.APPLICATION_JSON) - public String getVnfInstances(); -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java deleted file mode 100644 index 9c264ada..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.lifecycle; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; -import org.openo.commontosca.catalog.common.MsbUtil; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.model.externalservice.entity.lifecycle.InstanceEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Type; -import java.util.ArrayList; - - - -/** - * The lifecycle service. - * - * @author 10189609 - * - */ -public class LifeCycleServiceConsumer { - private static final Logger LOG = LoggerFactory.getLogger(LifeCycleServiceConsumer.class); - - /** - * get lifecycle application instances. - * - * @return instance entity - */ - public static ArrayList<InstanceEntity> getInstances() { - ILifeCycleServiceRest resourceserviceproxy = - ConsumerFactory.createConsumer(MsbUtil.getNsocLifecycleBaseUrl(), - ILifeCycleServiceRest.class); - String result = ""; - try { - result = resourceserviceproxy.getVnfInstances(); - } catch (Exception e1) { - LOG.error("query vim info faild.", e1); - return null; - } - if (ToolUtil.isEmptyString(result)) { - return null; - } - - Gson gson = new Gson(); - Type listType = new TypeToken<ArrayList<InstanceEntity>>() {}.getType(); - return gson.fromJson(result, listType); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java deleted file mode 100644 index 5c45776c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.ro; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -/** - * The roc resource interface. - * - * @author 10189609 - * - */ -@Path("/resource") -public interface IResourceServiceRest { - @Path("/vims/{vim_id}") - @GET - @Produces(MediaType.APPLICATION_JSON) - public String getResourceVim(@PathParam("vim_id") String vimId) throws Exception; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java deleted file mode 100644 index b06d7667..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.externalservice.ro; - -import com.google.gson.Gson; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; - -import org.openo.commontosca.catalog.common.MsbUtil; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.model.externalservice.entity.ro.ResourceResponseEntity; -import org.openo.commontosca.catalog.model.externalservice.entity.ro.VimEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * The roc resource service. - * - * @author 10189609 - * - */ -public class ResourceServiceConsumer { - private static final Logger LOG = LoggerFactory.getLogger(ResourceServiceConsumer.class); - - private static final String RESOURCE_REST_RESULT = "SUCCESS"; - - /** - * get vim entity from roc by vimid. - * - * @param vimId id - * @return vim entity - */ - public static VimEntity getResourceVim(String vimId) { - LOG.info("begin query vim info from roc,vimId:" + vimId); - IResourceServiceRest resourceserviceproxy = - ConsumerFactory.createConsumer(MsbUtil.getRocBaseUrl(), IResourceServiceRest.class); - String result = ""; - try { - result = resourceserviceproxy.getResourceVim(vimId); - } catch (Exception e1) { - LOG.error("query vim info faild.", e1); - return null; - } - if (ToolUtil.isEmptyString(result)) { - LOG.error("query vim info faild, vim info is null, vimId:" + vimId); - return null; - } - - Gson gson = new Gson(); - ResourceResponseEntity responseEntity = gson.fromJson(result, ResourceResponseEntity.class); - if (!RESOURCE_REST_RESULT.equalsIgnoreCase(responseEntity.getOperationResult())) { - LOG.error("query vim info faild.vimId:" + vimId); - return null; - } - if (responseEntity.getData().size() <= 0) { - LOG.error("query vim info faild, vim info is empty, vimId:" + vimId); - return null; - } - - LOG.info("end query vim info from roc."); - return responseEntity.getData().get(0); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java deleted file mode 100644 index 76cc97a0..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser; - -import org.openo.commontosca.catalog.common.MsbAddrConfig; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.model.common.TemplateUtils; -import org.openo.commontosca.catalog.model.entity.InputParameter; -import org.openo.commontosca.catalog.model.entity.NodeTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.parser.yaml.yamlmodel.Input; -import org.openo.commontosca.catalog.model.parser.yaml.yamlmodel.Plan; -import org.openo.commontosca.catalog.model.plan.wso2.Wso2ServiceConsumer; -import org.openo.commontosca.catalog.model.plan.wso2.entity.DeployPackageResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -public abstract class AbstractModelParser { - private static final Logger logger = LoggerFactory.getLogger(AbstractModelParser.class); - - public abstract String parse(String packageId, String fileLocation) - throws CatalogResourceException; - - public String copyTemporaryFile2HttpServer(String fileLocation) throws CatalogResourceException { - String destPath = org.openo.commontosca.catalog.filemanage.http.ToolUtil.getHttpServerAbsolutePath() - + toTempFilePath(fileLocation); - if (!org.openo.commontosca.catalog.filemanage.http.ToolUtil.copyFile( - fileLocation, destPath, true)) { - throw new CatalogResourceException("Copy Temporary To HttpServer Failed."); - } - - logger.info("destPath = " + destPath); - return destPath; - } - - public String getUrlOnHttpServer(String path) { - if (MsbAddrConfig.getMsbAddress().endsWith("/")) { - return MsbAddrConfig.getMsbAddress() + "files/catalog-http" + path; - } else { - return MsbAddrConfig.getMsbAddress() + "/files/catalog-http" + path; - } - } - - protected String toTempFilePath(String fileLocation) { - return "/temp/" + (new File(fileLocation)).getName(); - } - - protected EnumTemplateType getTemplateType(String substitutionType, List<NodeTemplate> ntList) { - if (isNsType(substitutionType)) { - return EnumTemplateType.NS; - } - - if (isVnfType(substitutionType)) { - return EnumTemplateType.VNF; - } - - return getTemplateTypeFromNodeTemplates(ntList); - } - - private boolean isVnfType(String type) { - if (ToolUtil.isTrimedEmptyString(type)) { - return false; - } - return type.toUpperCase().endsWith(".VNF") || type.toUpperCase().contains(".VNF."); - } - - private boolean isNsType(String type) { - if (ToolUtil.isTrimedEmptyString(type)) { - return false; - } - return type.toUpperCase().endsWith(".NS") || type.toUpperCase().contains(".NS."); - } - - private EnumTemplateType getTemplateTypeFromNodeTemplates(List<NodeTemplate> ntList) { - for (NodeTemplate nt : ntList) { - if (isNsType(nt.getType()) || isVnfType(nt.getType())) { - return EnumTemplateType.NS; - } - } - - return EnumTemplateType.VNF; - } - - private static final String TOSCA_META_FIELD_ENTRY_DEFINITIONS = "Entry-Definitions"; - - protected String parseServiceTemplateFileName(String packageId, String fileLocation) - throws CatalogResourceException { - return "/" + parseToscaMeta(fileLocation).get(TOSCA_META_FIELD_ENTRY_DEFINITIONS); - } - - private static final String TOSCA_META_FILE_NAME = "TOSCA-Metadata/TOSCA.meta"; - protected Map<String, String> parseToscaMeta(String zipLocation) throws CatalogResourceException { - Map<String, String> toscaMeta = new HashMap<>(); - String[] lines = TemplateUtils.readFromZipFile(zipLocation, TOSCA_META_FILE_NAME); - - for (String line : lines) { - String[] tmps; - if (line.indexOf(":") > 0) { - tmps = line.split(":"); - toscaMeta.put(tmps[0].trim(), tmps[1].trim()); - } - } - - return toscaMeta; - } - - /** - * @param fileLocation - * @return - * @throws CatalogResourceException - */ - protected ServiceTemplateOperation[] parseOperations(String fileLocation) throws CatalogResourceException { - String sPlan = TemplateUtils.readStringFromZipFile(fileLocation, "Definitions/plans.yaml"); - Map<String, Plan> plans = TemplateUtils.loadPlan(sPlan); - return parseAndDeployPlans(plans, fileLocation); - } - - /** - * @param plans - * @param fileLocation - * @return - * @throws CatalogResourceException - */ - private ServiceTemplateOperation[] parseAndDeployPlans(Map<String, Plan> plans, - String zipFileLocation) throws CatalogResourceException { - if (plans == null || plans.isEmpty()) { - return new ServiceTemplateOperation[0]; - } - - List<ServiceTemplateOperation> opList = new ArrayList<>(); - for (Entry<String, Plan> plan : plans.entrySet()) { - ServiceTemplateOperation op = new ServiceTemplateOperation(); - op.setName(plan.getKey()); - op.setDescription(plan.getValue().getDescription()); - checkPlanLanguage(plan.getValue().getPlanLanguage()); - DeployPackageResponse response = - Wso2ServiceConsumer.deployPackage(zipFileLocation, plan.getValue().getReference()); - op.setPackageName(parsePackageName(response)); - op.setProcessId(response.getProcessId()); - op.setInputs(parsePlanInputs(plan.getValue().getInputs())); - - opList.add(op); - } - - return opList.toArray(new ServiceTemplateOperation[0]); - } - - private String parsePackageName(DeployPackageResponse response) { - String packageName = response.getPackageName(); - if (packageName != null && packageName.indexOf("-") > 0) { - packageName = packageName.substring(0, packageName.lastIndexOf("-")); - } - return packageName; - } - - private void checkPlanLanguage(String planLanguage) throws CatalogResourceException { - if (planLanguage == null || planLanguage.isEmpty()) { - throw new CatalogResourceException("Plan Language is empty."); - } - if (planLanguage.equalsIgnoreCase("bpel")) { - return; - } - if (planLanguage.equalsIgnoreCase("bpmn")) { - return; - } - if (planLanguage.equalsIgnoreCase("bpmn4tosca")) { - return; - } - throw new CatalogResourceException( - "Plan Language is not supported. Language = " + planLanguage); - } - - /** - * @param inputs - * @return - */ - private InputParameter[] parsePlanInputs( - Map<String, Input> inputs) { - if (inputs == null || inputs.isEmpty()) { - return new InputParameter[0]; - } - - List<InputParameter> retList = new ArrayList<>(); - for (Entry<String, Input> input : inputs.entrySet()) { - retList.add(new InputParameter( - input.getKey(), - input.getValue().getType(), - input.getValue().getDescription(), - input.getValue().getDefault(), - input.getValue().isRequired())); - } - return retList.toArray(new InputParameter[0]); - } - - /** - * @param metadata - * @return - */ - public String parserId(Map<String, String> metadata) { - if (metadata.containsKey("id")) { - return metadata.get("id"); - } - return metadata.get("template_name"); - } - - /** - * @param metadata - * @return - */ - public String parserServiceTemplateName(Map<String, String> metadata) { - if (metadata.containsKey("name")) { - return metadata.get("name"); - } - return metadata.get("template_name"); - } - - /** - * @param metadata - * @return - */ - public String parserServiceTemplateVendor(Map<String, String> metadata) { - if (metadata.containsKey("vendor")) { - return metadata.get("vendor"); - } - return metadata.get("template_author"); - } - - /** - * @param metadata - * @return - */ - public String parserServiceTemplateVersion(Map<String, String> metadata) { - if (metadata.containsKey("version")) { - return metadata.get("version"); - } - return metadata.get("template_version"); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java deleted file mode 100644 index 5aaf9061..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser; - -/** - * enum data. - * - * @author 10189609 - * - */ -public enum EnumPackageFormat { - TOSCA_XML, TOSCA_YAML -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java deleted file mode 100644 index 44e21e5f..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser; - -public enum EnumTemplateType { - NS, VNF -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java deleted file mode 100644 index 5e9ef1aa..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser; - -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.model.parser.yaml.aria.AriaModelParser; -import org.openo.commontosca.catalog.model.parser.yaml.zte.ToscaYamlModelParser; - -import java.util.HashMap; -import java.util.Map; - - -public class ModelParserFactory { - private static final ModelParserFactory instance = new ModelParserFactory(); - - public static ModelParserFactory getInstance() { - return instance; - } - - private Map<EnumPackageFormat, AbstractModelParser> pkgType2ParseMap = - new HashMap<EnumPackageFormat, AbstractModelParser>(); - - /** - * @param format - * @param parse - */ - public void put(EnumPackageFormat format, AbstractModelParser parse) { - if (parse != null) { - pkgType2ParseMap.put(format, parse); - } - } - - private ModelParserFactory() { - // PackageParseMap.put(EnumPackageFormat.TOSCA_XML, new ToscaXmlModelParser()); - if (isAriaParser()) { - pkgType2ParseMap.put(EnumPackageFormat.TOSCA_YAML, new AriaModelParser()); - } else { - pkgType2ParseMap.put(EnumPackageFormat.TOSCA_YAML, new ToscaYamlModelParser()); - } - } - - /** - * @return - */ - private boolean isAriaParser() { - return "aria".equalsIgnoreCase(Config.getConfigration().getParserType()); - } - - /** - * parse package. - * @param packageId package id - * @param fileLocation package location - * @param format package format - * @return service template id - * @throws CatalogResourceException e - */ - public String parse(String packageId, String fileLocation, EnumPackageFormat format) - throws CatalogResourceException { - if (pkgType2ParseMap.get(format) == null) { - throw new CatalogResourceException("Can't find its parser. package type = " - + format.toString()); - } - - return pkgType2ParseMap.get(format).parse(packageId, fileLocation); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/AriaModelParser.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/AriaModelParser.java deleted file mode 100644 index 8d37319c..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/AriaModelParser.java +++ /dev/null @@ -1,311 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.aria; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.TemplateManager; -import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; -import org.openo.commontosca.catalog.model.common.TemplateDataHelper; -import org.openo.commontosca.catalog.model.entity.CapReqMapping; -import org.openo.commontosca.catalog.model.entity.InputParameter; -import org.openo.commontosca.catalog.model.entity.NodeTemplate; -import org.openo.commontosca.catalog.model.entity.OutputParameter; -import org.openo.commontosca.catalog.model.entity.RelationShip; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; -import org.openo.commontosca.catalog.model.parser.AbstractModelParser; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult.Instance.Input; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult.Instance.Node; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult.Instance.Node.Relationship; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult.Instance.Output; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult.Instance.Substitution.Mapping; -import org.openo.commontosca.catalog.model.parser.yaml.aria.service.AriaParserServiceConsumer; -import org.openo.commontosca.catalog.wrapper.PackageWrapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author 10090474 - * - */ -public class AriaModelParser extends AbstractModelParser { - private static final Logger logger = LoggerFactory.getLogger(AriaModelParser.class); - - /* (non-Javadoc) - * @see org.openo.commontosca.catalog.model.parser.AbstractModelParser#parse(java.lang.String, java.lang.String) - */ - @Override - public String parse(String packageId, String fileLocation) throws CatalogResourceException { - logger.info("Parse begin."); - - String stFileLocation = parseServiceTemplateFileName(packageId, fileLocation); - AriaParserResult result = getAriaParserResult(packageId, stFileLocation); - - // service template - ServiceTemplate st = parseServiceTemplate(result, packageId, stFileLocation); - // workflow - ServiceTemplateOperation[] operations = parseOperations(fileLocation); - st.setOperations(operations); - // node templates - List<NodeTemplate> ntList = parseNodeTemplates(packageId, st.getServiceTemplateId(), result); - st.setType(getTemplateType(getSubstitutionType(result), ntList).toString()); - // save to db - TemplateManager.getInstance().addServiceTemplate( - TemplateDataHelper.convert2TemplateData(st, result.getRawData(), ntList)); - - // substitution - SubstitutionMapping stm = parseSubstitutionMapping(st.getServiceTemplateId(), result); - if (stm != null) { - TemplateManager.getInstance() - .addServiceTemplateMapping(TemplateDataHelper.convert2TemplateMappingData(stm)); - } - - return st.getServiceTemplateId(); - } - - - /** - * @param serviceTemplateId - * @param result - * @return - */ - private SubstitutionMapping parseSubstitutionMapping(String serviceTemplateId, - AriaParserResult result) { - String type = getSubstitutionType(result); - if (ToolUtil.isTrimedEmptyString(type)) { - return null; - } - - org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult.Instance.Substitution stm = - result.getInstance().getSubstitution(); - return new SubstitutionMapping( - serviceTemplateId, - type, - parseSubstitutionRequirements(stm.getRequirement()), - parseSubstitutionCapabilities(stm.getCapabilities())); - } - - - /** - * @param capabilities - * @return - */ - private CapReqMapping[] parseSubstitutionCapabilities(Mapping[] capabilities) { - return parseMappings(capabilities); - } - - /** - * @param requirement - * @return - */ - private CapReqMapping[] parseSubstitutionRequirements(Mapping[] requirement) { - return parseMappings(requirement); - } - - private CapReqMapping[] parseMappings(Mapping[] mappings) { - List<CapReqMapping> ret = new ArrayList<>(); - if (mappings != null) { - for (Mapping mapping : mappings) { - ret.add(new CapReqMapping( - mapping.getMapped_name(), mapping.getNode_id(), mapping.getName())); - } - } - - return ret.toArray(new CapReqMapping[0]); - } - - /** - * @param result - * @return - */ - private String getSubstitutionType(AriaParserResult result) { - if (result.getInstance().getSubstitution() == null) { - return null; - } - return result.getInstance().getSubstitution().getNode_type_name(); - } - - - /** - * @param packageId - * @param serviceTemplateId - * @param result - * @return - * @throws CatalogResourceException - */ - private List<NodeTemplate> parseNodeTemplates(String packageId, String serviceTemplateId, - AriaParserResult result) throws CatalogResourceException { - Node[] nodes = result.getInstance().getNodes(); - if (nodes == null || nodes.length == 0) { - return null; - } - - List<NodeTemplate> retList = new ArrayList<>(); - for (Node node : nodes) { - NodeTemplate ret = new NodeTemplate(); - ret.setId(node.getTemplate_name()); - ret.setName(node.getTemplate_name()); - ret.setType(node.getType_name()); - ret.setProperties(node.getPropertyAssignments()); - List<RelationShip> relationShipList = - parseNodeTemplateRelationShip(node.getRelationships(), node, nodes); - ret.setRelationShips(relationShipList); - - retList.add(ret); - } - - return retList; - } - - - /** - * @param relationships - * @param sourceNode - * @param nodes - * @return - * @throws CatalogResourceException - */ - private List<RelationShip> parseNodeTemplateRelationShip(Relationship[] relationships, - Node sourceNode, Node[] nodes) throws CatalogResourceException { - List<RelationShip> retList = new ArrayList<>(); - - if (relationships == null || relationships.length == 0) { - return retList; - } - - for (Relationship relationship : relationships) { - if (relationship.getTarget_node_id().equals(sourceNode.getId())) { - continue; // target == source, ignore. - } - - RelationShip ret = new RelationShip(); - ret.setSourceNodeId(sourceNode.getTemplate_name()); - ret.setSourceNodeName(sourceNode.getTemplate_name()); - Node targetNode = getNodeById(nodes, relationship.getTarget_node_id()); - ret.setTargetNodeId(targetNode.getTemplate_name()); - ret.setTargetNodeName(targetNode.getTemplate_name()); - ret.setType(relationship.getType_name()); - retList.add(ret); - } - - return retList; - } - - - /** - * @param nodes - * @param nodeId - * @return - * @throws CatalogResourceException - */ - private Node getNodeById(Node[] nodes, String nodeId) throws CatalogResourceException { - if (nodeId == null) { - throw new CatalogResourceException("Target node id is null."); - } - if (nodes == null || nodes.length == 0) { - throw new CatalogResourceException("Can't find target node. nodeId = " + nodeId); - } - - for (Node node : nodes) { - if (nodeId.equals(node.getId())) { - return node; - } - } - - throw new CatalogResourceException("Can't find target node. nodeId = " + nodeId); - } - - - /** - * @param result - * @param packageId - * @param downloadUri - * @return - */ - private ServiceTemplate parseServiceTemplate(AriaParserResult result, String packageId, - String downloadUri) { - ServiceTemplate st = new ServiceTemplate(); - - st.setServiceTemplateId(ToolUtil.generateId()); - st.setId(parserId(result.getInstance().getMetadata())); - st.setTemplateName(parserServiceTemplateName(result.getInstance().getMetadata())); - st.setVendor(parserServiceTemplateVendor(result.getInstance().getMetadata())); - st.setVersion(parserServiceTemplateVersion(result.getInstance().getMetadata())); - st.setCsarId(packageId); - st.setDownloadUri(downloadUri); - st.setInputs(parseInputs(result)); - st.setOutputs(parseOutputs(result)); - return st; - } - - - /** - * @param result - * @return - */ - private InputParameter[] parseInputs(AriaParserResult result) { - Map<String, Input> inputs = result.getInstance().getInputs(); - if (inputs == null || inputs.isEmpty()) { - return new InputParameter[0]; - } - List<InputParameter> retList = new ArrayList<InputParameter>(); - for (Entry<String, Input> e : inputs.entrySet()) { - retList.add( - new InputParameter( - e.getKey(), - e.getValue().getType_name(), - e.getValue().getDescription(), - e.getValue().getValue(), - false)); - } - return retList.toArray(new InputParameter[0]); - } - - /** - * @param result - * @return - */ - private OutputParameter[] parseOutputs(AriaParserResult result) { - Map<String, Output> outputs = result.getInstance().getOutpus(); - if (outputs == null || outputs.isEmpty()) { - return new OutputParameter[0]; - } - - List<OutputParameter> retList = new ArrayList<OutputParameter>(); - for (Entry<String, Output> e: outputs.entrySet()) { - retList.add( - new OutputParameter( - e.getKey(), e.getValue().getDescription(), e.getValue().getValue())); - } - - return retList.toArray(new OutputParameter[0]); - } - - private AriaParserResult getAriaParserResult(String packageId, String stFileLocation) throws CatalogResourceException { - CsarFileUriResponse stDownloadUri = - PackageWrapper.getInstance().getCsarFileDownloadUri(packageId, stFileLocation); - return AriaParserServiceConsumer.parseCsarPackage(stDownloadUri.getDownloadUri()); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserExceptionResult.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserExceptionResult.java deleted file mode 100644 index b06c97de..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserExceptionResult.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.aria.entity; - -//import lombok.AllArgsConstructor; -//import lombok.Data; -//import lombok.NoArgsConstructor; -// -//@Data -//@NoArgsConstructor -//@AllArgsConstructor -//public class AriaParserExceptionResult { -// private Issue[] issues; -// -// @Data -// public class Issue { -// private int level; -// private String message; -// private String location; -// private String line; -// private String column; -// private String snippet; -// private String exception; -// } -//} - diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserRequest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserRequest.java deleted file mode 100644 index aae8008d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserRequest.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.aria.entity; - -/** - * - */ -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class AriaParserRequest { - private String uri; - private List<Parameter> inputs; - - @Data - @NoArgsConstructor - @AllArgsConstructor - public class Parameter { - private String name; - private String value; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserResult.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserResult.java deleted file mode 100644 index f2968fd5..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/entity/AriaParserResult.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.aria.entity; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class AriaParserResult { - private Issue[] issues; - private Instance instance = new Instance(); - - private String rawData; -// private Type[] types; -// private Model model; - -// @Data -// public class Type { -// } -// @Data -// public class Model { -// } - @Data - public class Issue { - private int level; - private String message; - private String location; - private String line; - private String column; - private String snippet; - private String exception; - } - - @Data - public class Instance { - private String description; - private Map<String, String> metadata; - private Node[] nodes; - private Group[] groups; - private Policy[] policies; - private Substitution substitution; - private Map<String, Input> inputs; - private Map<String, Output> outpus; - - public Map<String, String> getMetadata() { - if (this.metadata == null) { - return new HashMap<>(); - } - - return metadata; - } - - @Data - public class Node { - private String id; - private String type_name; - private String template_name; - private Map<String, Property> properties; - private Interface[] interfaces; - private Artifact[] artifacts; - private Capability[] capabilities; - private Relationship[] relationships; - - @Data - public class Artifact { - private String name; - private String type_name; - private String source_path; - private String target_path; - private String repository_url; - private Credential repository_credential; - private Map<String, Property> properties; - - @Data - public class Credential { - private String protocol; - private String token_type; - private Map<String, String> keys; - private String user; - } - } - - @Data - public class Capability { - private String name; - private String type_name; - private Map<String, Property> properties; - } - - @Data - public class Relationship { - private String target_node_id; - private String target_capability_name; - private String type_name; - private String template_name; - private Map<String, Property> properties; - private Interface[] source_interfaces; - private Interface[] target_interfaces; - } - - /** - * @return - */ - public Map<String, Object> getPropertyAssignments() { - if (this.properties == null || this.properties.isEmpty()) { - return new HashMap<String, Object>(); - } - - Map<String, Object> ret = new HashMap<String, Object>(); - for (Entry<String, Property> e : this.properties.entrySet()) { - ret.put(e.getKey(), e.getValue().getValue()); - } - - return ret; - } - } - - @Data - public class Group { - private String id; - private String type_name; - private String template_name; - private Map<String, Property> properties; - private Interface[] interfaces; - private GroupPolicy[] policies; - private String[] member_node_ids; - - @Data - public class GroupPolicy { - private String id; - private String type_name; - private Map<String, Property> properties; - private Trigger[] triggers; - - @Data - public class Trigger { - private String name; - private String implementation; - private Map<String, Property> properties; - } - } - - } - - - @Data - public class Policy { - private String name; - private String type_name; - private Map<String, Property> properties; - private String[] target_node_ids; - private String[] target_group_ids; - } - - @Data - public class Substitution { - private String node_type_name; - private Mapping[] requirement; - private Mapping[] capabilities; - - @Data - public class Mapping { - private String mapped_name; - private String node_id; - private String name; - - } - } - - @Data - public class Input { - private String type_name; - private Object value; - private String description; - } - - @Data - public class Output { - private String type_name; - private Object value; - private String description; - } - } - -} - - -@Data -class Property { - private String type_name; - private Object value; - private String description; -} - -@Data -class Interface { - private String name; - private String type_name; - private Map<String, Property> inputs; - private Operation[] operation; - - @Data - class Operation { - private String name; - private String implementation; - private String[] dependencies; - private String executor; - private int max_retries; - private int retry_interval; - private Map<String, Property> inputs; - } -} - diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/AriaParserServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/AriaParserServiceConsumer.java deleted file mode 100644 index 1701c60f..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/AriaParserServiceConsumer.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.aria.service; - -import org.glassfish.jersey.client.ClientConfig; -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserRequest; -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; -import com.google.gson.Gson; - - -public class AriaParserServiceConsumer { - private static final Logger logger = LoggerFactory.getLogger(AriaParserServiceConsumer.class); - - public static AriaParserResult parseCsarPackage(String uri) throws CatalogResourceException { - logger.info("parseCsarPackage uri = " + uri); - return parseCsarPackage(new AriaParserRequest(uri, null)); - } - /** - * parse csar package via aria parser. - * - * @param request parse yaml request - * @return parase yaml result - * @throws CatalogResourceException e - */ - public static AriaParserResult parseCsarPackage(AriaParserRequest request) - throws CatalogResourceException { - try { - IAriaParserRest parseProxy = - ConsumerFactory.createConsumer( - Config.getConfigration().getMsbServerAddr(), - new ClientConfig(), - IAriaParserRest.class); - String strResult = parseProxy.parse(request); - AriaParserResult result = new Gson().fromJson(strResult, AriaParserResult.class); - result.setRawData(strResult); - validateResult(result, strResult); - return result; - } catch (Exception e) { - throw new CatalogResourceException("Call aria parser api failed.", e); - } - - } - private static void validateResult(AriaParserResult result, String strResult) throws CatalogResourceException { - if (result.getIssues() != null && result.getIssues().length > 0) { - logger.error("Aria parser return failure message: " + strResult); - throw new CatalogResourceException("Aria parser return failure message: " + strResult); - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/IAriaParserRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/IAriaParserRest.java deleted file mode 100644 index df9e50d3..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/IAriaParserRest.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.aria.service; - -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserRequest; - - -@Path("/openoapi/tosca/v1") -public interface IAriaParserRest { - - @POST - @Path("/indirect/instance") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - String parse(AriaParserRequest request) throws Exception; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/EntrySchema.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/EntrySchema.java deleted file mode 100644 index 42542c6d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/EntrySchema.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.yamlmodel; - -/** - * @author 10090474 - * - */ -public class EntrySchema { - private String type = ""; - - public EntrySchema() { - - } - - public EntrySchema(String type) { - super(); - this.type = type; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/Input.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/Input.java deleted file mode 100644 index 87483ffa..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/Input.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.yamlmodel; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class Input extends YAMLElement { - - private String type = ""; - private String defaultValue = ""; - private boolean required = false; - private List<Map<String, Object>> constraints = new ArrayList<Map<String, Object>>(); - private EntrySchema entry_schema; - - public String getType() { - return this.type; - } - - public void setType(String type) { - if (type != null) { - this.type = type; - } - } - - public String getDefault() { - return this.defaultValue; - } - - public void setDefault(String defaultValue) { - if (defaultValue != null) { - this.defaultValue = defaultValue; - } - } - - public List<Map<String, Object>> getConstraints() { - return this.constraints; - } - - public void setConstraints(List<Map<String, Object>> constraints) { - if (constraints != null) { - this.constraints = constraints; - } - } - - public boolean isRequired() { - return required; - } - - public void setRequired(boolean required) { - this.required = required; - } - - public EntrySchema getEntry_schema() { - return entry_schema; - } - - public void setEntry_schema(EntrySchema entry_schema) { - if (entry_schema != null) { - this.entry_schema = entry_schema; - } - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/Plan.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/Plan.java deleted file mode 100644 index c59a81c6..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/Plan.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.yamlmodel; - -import java.util.HashMap; -import java.util.Map; - -/** - * - */ -public class Plan extends YAMLElement { - private String reference = ""; - private String planLanguage = ""; - private Map<String, Input> inputs = new HashMap<String, Input>(); - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } - public String getPlanLanguage() { - return planLanguage; - } - public void setPlanLanguage(String planLanguage) { - this.planLanguage = planLanguage; - } - public Map<String, Input> getInputs() { - return inputs; - } - public void setInputs(Map<String, Input> inputs) { - this.inputs = inputs; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/ServiceTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/ServiceTemplate.java deleted file mode 100644 index c92e3c5b..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/ServiceTemplate.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.yamlmodel; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author 10090474 - * - */ -public class ServiceTemplate extends YAMLElement { - private Map<String, Plan> plans = new HashMap<>(); - - public Map<String, Plan> getPlans() { - return plans; - } - - public void setPlans(Map<String, Plan> plans) { - if (plans != null) { - this.plans = plans; - } - } -}
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/YAMLElement.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/YAMLElement.java deleted file mode 100644 index 0572f2fa..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/yamlmodel/YAMLElement.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.yamlmodel; - -public abstract class YAMLElement { - - private String description = ""; - - public void setDescription(String description) { - if (description != null) { - this.description = description; - } - } - - public String getDescription() { - return this.description; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - YAMLElement element = (YAMLElement) o; - - if (!description.equals(element.description)) return false; - - return true; - } - - @Override - public int hashCode() { - return description.hashCode(); - } -}
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/ToscaYamlModelParser.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/ToscaYamlModelParser.java deleted file mode 100644 index 632d60c4..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/ToscaYamlModelParser.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.zte; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.TemplateManager; -import org.openo.commontosca.catalog.model.common.TemplateDataHelper; -import org.openo.commontosca.catalog.model.entity.CapReqMapping; -import org.openo.commontosca.catalog.model.entity.InputParameter; -import org.openo.commontosca.catalog.model.entity.NodeTemplate; -import org.openo.commontosca.catalog.model.entity.OutputParameter; -import org.openo.commontosca.catalog.model.entity.RelationShip; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; -import org.openo.commontosca.catalog.model.parser.AbstractModelParser; -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlRequestParemeter; -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlResult; -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlResult.TopologyTemplate.Input; -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlResult.TopologyTemplate.NodeTemplate.Relationship; -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlResult.TopologyTemplate.Output; -import org.openo.commontosca.catalog.model.parser.yaml.zte.service.YamlParseServiceConsumer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ToscaYamlModelParser extends AbstractModelParser { - private static final Logger logger = LoggerFactory.getLogger(ToscaYamlModelParser.class); - - @Override - public String parse(String packageId, String fileLocation) throws CatalogResourceException { - logger.info("tosca-yaml-parser parse begin."); - ParseYamlResult result = getParseYamlResult(fileLocation); - - // service template - ServiceTemplate st = parseServiceTemplate( - result, packageId, parseServiceTemplateFileName(packageId, fileLocation)); - // workflow - ServiceTemplateOperation[] operations = parseOperations(fileLocation); - st.setOperations(operations); - // node templates - List<NodeTemplate> ntList = parseNodeTemplates(packageId, st.getServiceTemplateId(), result); - st.setType(getTemplateType(getSubstitutionType(result), ntList).toString()); - // save to db - TemplateManager.getInstance().addServiceTemplate( - TemplateDataHelper.convert2TemplateData(st, result.getRawData(), ntList)); - - // substitution - SubstitutionMapping stm = parseSubstitutionMapping(st.getServiceTemplateId(), result); - if (stm != null) { - TemplateManager.getInstance() - .addServiceTemplateMapping(TemplateDataHelper.convert2TemplateMappingData(stm)); - } - - return st.getServiceTemplateId(); - } - - private ParseYamlResult getParseYamlResult(String fileLocation) throws CatalogResourceException { - String destPath = copyTemporaryFile2HttpServer(fileLocation); - try { - String url = getUrlOnHttpServer(toTempFilePath(fileLocation)); - return YamlParseServiceConsumer.getServiceTemplates(comboRequest(url)); - } finally { - if (destPath != null && !destPath.isEmpty() && (new File(destPath)).exists()) { - (new File(destPath)).delete(); - } - } - } - - private ParseYamlRequestParemeter comboRequest(String fileLocation) { - ParseYamlRequestParemeter request = new ParseYamlRequestParemeter(); - request.setPath(fileLocation); - return request; - } - - private SubstitutionMapping parseSubstitutionMapping(String serviceTemplateId, - ParseYamlResult result) { - String type = getSubstitutionType(result); - if (ToolUtil.isTrimedEmptyString(type)) { - return null; - } - - org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlResult - .TopologyTemplate.SubstitutionMapping stm = - result.getTopologyTemplate().getSubstitutionMappings(); - return new SubstitutionMapping( - serviceTemplateId, type, - parseSubstitutionRequirements(stm.getRequirementList()), - parseSubstitutionCapabilities(stm.getCapabilityList())); - } - - /** - * @param requirementList - * @return - */ - private CapReqMapping[] parseSubstitutionRequirements(Map<String, String[]> requirementList) { - return parseMappings(requirementList); - } - - /** - * @param capabilityList - * @return - */ - private CapReqMapping[] parseSubstitutionCapabilities(Map<String, String[]> capabilityList) { - return parseMappings(capabilityList); - } - - private CapReqMapping[] parseMappings(Map<String, String[]> mappings) { - List<CapReqMapping> ret = new ArrayList<>(); - if (mappings != null) { - for (Entry<String, String[]> mapping : mappings.entrySet()) { - if (mapping.getValue().length >= 2) { - ret.add(new CapReqMapping( - mapping.getKey(), mapping.getValue()[0], mapping.getValue()[1])); - } - } - } - return ret.toArray(new CapReqMapping[0]); - } - - private ServiceTemplate parseServiceTemplate(ParseYamlResult result, String packageId, - String stDownloadUri) { - ServiceTemplate st = new ServiceTemplate(); - - st.setServiceTemplateId(ToolUtil.generateId()); - st.setId(parserId(result.getMetadata())); - st.setTemplateName(parserServiceTemplateName(result.getMetadata())); - st.setVendor(parserServiceTemplateVendor(result.getMetadata())); - st.setVersion(parserServiceTemplateVersion(result.getMetadata())); - st.setCsarId(packageId); - st.setDownloadUri(stDownloadUri); - st.setInputs(parseInputs(result)); - st.setOutputs(parseOutputs(result)); - return st; - } - - private InputParameter[] parseInputs(ParseYamlResult result) { - List<Input> inputList = result.getTopologyTemplate().getInputs(); - if (inputList == null) { - return new InputParameter[0]; - } - List<InputParameter> retList = new ArrayList<InputParameter>(); - for (Input input : inputList) { - retList.add(new InputParameter(input.getName(), input.getType(), - input.getDescription(), input.getDefault(), input.isRequired())); - } - return retList.toArray(new InputParameter[0]); - } - - private OutputParameter[] parseOutputs(ParseYamlResult result) { - List<Output> outputList = result.getTopologyTemplate().getOutputs(); - if (outputList == null || outputList.isEmpty()) { - return new OutputParameter[0]; - } - List<OutputParameter> retList = new ArrayList<OutputParameter>(); - for (Output output : outputList) { - retList - .add(new OutputParameter(output.getName(), output.getDescription(), output.getValue())); - } - return retList.toArray(new OutputParameter[0]); - } - - private List<NodeTemplate> parseNodeTemplates(String csarId, String templateId, - ParseYamlResult result) { - List<ParseYamlResult.TopologyTemplate.NodeTemplate> nodetemplateList = - result.getTopologyTemplate().getNodeTemplates(); - if (nodetemplateList == null) { - return null; - } - - List<NodeTemplate> retList = new ArrayList<>(); - for (ParseYamlResult.TopologyTemplate.NodeTemplate nodeTemplate : nodetemplateList) { - NodeTemplate ret = new NodeTemplate(); - ret.setId(nodeTemplate.getName()); - ret.setName(nodeTemplate.getName()); - ret.setType(nodeTemplate.getNodeType()); - ret.setProperties(nodeTemplate.getPropertyList()); - List<RelationShip> relationShipList = - parseNodeTemplateRelationShip(nodeTemplate.getRelationships()); - ret.setRelationShips(relationShipList); - - retList.add(ret); - } - - return retList; - } - - - private List<RelationShip> parseNodeTemplateRelationShip(List<Relationship> relationshipList) { - List<RelationShip> retList = new ArrayList<>(); - - if (relationshipList == null) { - return retList; - } - - for (Relationship relationship : relationshipList) { - RelationShip ret = new RelationShip(); - ret.setSourceNodeId(relationship.getSourceNodeName()); - ret.setSourceNodeName(relationship.getSourceNodeName()); - ret.setTargetNodeId(relationship.getTargetNodeName()); - ret.setTargetNodeName(relationship.getTargetNodeName()); - ret.setType(relationship.getType()); - retList.add(ret); - } - - return retList; - } - - private String getSubstitutionType(ParseYamlResult result) { - if (result.getTopologyTemplate().getSubstitutionMappings() == null) { - return null; - } - return result.getTopologyTemplate().getSubstitutionMappings().getNode_type(); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/EnumYamlServiceTemplateInfo.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/EnumYamlServiceTemplateInfo.java deleted file mode 100644 index a6a75ebf..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/EnumYamlServiceTemplateInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.zte.entity; - - -//public enum EnumYamlServiceTemplateInfo { -// ID { -// @Override -// public String getName() { -// return "id"; -// } -// }, -// VERSION { -// @Override -// public String getName() { -// return "version"; -// } -// }, -// PROVIDER { -// @Override -// public String getName() { -// return "vendor"; -// } -// }; -// -// public abstract String getName(); -//} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/ParseYamlRequestParemeter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/ParseYamlRequestParemeter.java deleted file mode 100644 index e598ef73..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/ParseYamlRequestParemeter.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.zte.entity; - -import java.util.List; - -public class ParseYamlRequestParemeter { - private String path = "E:\\NFVO\\130. yaml2xml\\0. tosca-parser\\sample\\ag-vnfd-floatingIp.zip"; - - private List<Extension> extension; - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public List<Extension> getExtension() { - return extension; - } - - public void setExtension(List<Extension> extension) { - this.extension = extension; - } - - public Extension createExtension() { - return new Extension(); - } - - public class Extension { - private String name; - private String value; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/ParseYamlResult.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/ParseYamlResult.java deleted file mode 100644 index 4fc2d825..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/entity/ParseYamlResult.java +++ /dev/null @@ -1,883 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.zte.entity; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import org.openo.commontosca.catalog.common.ToolUtil; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.annotations.SerializedName; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ParseYamlResult { - private String toscaDefinitionsVersion; - private String description; - private JsonObject nodeTypes; - private JsonObject capabilityTypes; - private JsonObject relationshipTypes; - private JsonObject policyTypes; - private TopologyTemplate topologyTemplate; - private Map<String, String> metadata; - private JsonObject plans; - - private String rawData; - - public String getToscaDefinitionsVersion() { - return toscaDefinitionsVersion; - } - - public void setToscaDefinitionsVersion(String toscaDefinitionsVersion) { - this.toscaDefinitionsVersion = toscaDefinitionsVersion; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public JsonObject getNodeTypes() { - return nodeTypes; - } - - public void setNodeTypes(JsonObject nodeTypes) { - this.nodeTypes = nodeTypes; - } - - public List<NodeType> getNodeTypeList() { - return jsonObject2NodeTypes(nodeTypes); - } - - private ArrayList<NodeType> jsonObject2NodeTypes(JsonObject nodeTypes) { - ArrayList<NodeType> nodeTypeList = new ArrayList<NodeType>(); - Iterator<Entry<String, JsonElement>> iterator = nodeTypes.entrySet().iterator(); - while (iterator.hasNext()) { - NodeType type = new NodeType(); - Entry<String, JsonElement> next = iterator.next(); - type.setType(next.getKey()); - type.setValue(new Gson().fromJson(next.getValue(), NodeType.NodeTypeValue.class)); - nodeTypeList.add(type); - } - return nodeTypeList; - } - - public JsonObject getCapabilityTypes() { - return capabilityTypes; - } - - public void setCapabilityTypes(JsonObject capabilityTypes) { - this.capabilityTypes = capabilityTypes; - } - - public JsonObject getRelationshipTypes() { - return relationshipTypes; - } - - public void setRelationshipTypes(JsonObject relationshipTypes) { - this.relationshipTypes = relationshipTypes; - } - - public List<RelationshipType> getRelationshipTypeList() { - return jsonObject2RelationshipTypes(relationshipTypes); - } - - private ArrayList<RelationshipType> jsonObject2RelationshipTypes(JsonObject relationshipTypes) { - ArrayList<RelationshipType> relationshipTypeList = new ArrayList<RelationshipType>(); - Iterator<Entry<String, JsonElement>> iterator = relationshipTypes.entrySet().iterator(); - while (iterator.hasNext()) { - RelationshipType type = new RelationshipType(); - Entry<String, JsonElement> next = iterator.next(); - type.setType(next.getKey()); - type.setValue(new Gson().fromJson(next.getValue(), RelationshipType.RelationshipValue.class)); - relationshipTypeList.add(type); - } - return relationshipTypeList; - } - - public JsonObject getPolicyTypes() { - return policyTypes; - } - - public void setPolicyTypes(JsonObject policyTypes) { - this.policyTypes = policyTypes; - } - - public TopologyTemplate getTopologyTemplate() { - return topologyTemplate; - } - - public void setTopologyTemplate(TopologyTemplate topologyTemplate) { - this.topologyTemplate = topologyTemplate; - } - - public Map<String, String> getMetadata() { - if (this.metadata == null) { - return new HashMap<>(); - } - return metadata; - } - - public void setMetadata(Map<String, String> metadata) { - this.metadata = metadata; - } - - public JsonObject getPlans() { - return plans; - } - - public void setPlans(JsonObject plans) { - this.plans = plans; - } - - public List<Plan> getPlanList() { - return jsonObject2PlanList(this.plans); - } - - private List<Plan> jsonObject2PlanList(JsonObject plans) { - if (plans == null) { - return new ArrayList<>(); - } - List<Plan> retList = new ArrayList<>(); - Iterator<Entry<String, JsonElement>> iterator = plans.entrySet().iterator(); - while (iterator.hasNext()) { - Plan ret = new Plan(); - Entry<String, JsonElement> next = iterator.next(); - ret.setName(next.getKey()); - ret.setValue(new Gson().fromJson(next.getValue(), Plan.PlanValue.class)); - retList.add(ret); - } - return retList; - } - - public class TopologyTemplate { - private String description; - private List<Input> inputs; - private List<Output> outputs; - private List<NodeTemplate> nodeTemplates; - private SubstitutionMapping substitutionMappings; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public List<Input> getInputs() { - return inputs; - } - - public void setInputs(List<Input> inputs) { - this.inputs = inputs; - } - - public List<Output> getOutputs() { - return outputs; - } - - public void setOutputs(List<Output> outputs) { - this.outputs = outputs; - } - - public List<NodeTemplate> getNodeTemplates() { - return nodeTemplates; - } - - public void setNodeTemplates(List<NodeTemplate> nodeTemplates) { - this.nodeTemplates = nodeTemplates; - } - - public SubstitutionMapping getSubstitutionMappings() { - return substitutionMappings; - } - - public void setSubstitutionMappings(SubstitutionMapping substitutionMappings) { - this.substitutionMappings = substitutionMappings; - } - - public class Input { - private String name; - private String type; - private String description; - private String defaultValue; - private boolean required; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getDefault() { - return defaultValue; - } - - public void setDefault(String defaultValue) { - this.defaultValue = defaultValue; - } - - public boolean isRequired() { - return required; - } - - public void setRequired(boolean required) { - this.required = required; - } - } - - public class Output { - private String name; - private String description; - private Object value; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - } - - public class NodeTemplate { - private String name; - private String nodeType; - private JsonObject properties; - private JsonObject[] requirements; - private JsonObject capabilities; - private List<Relationship> relationships; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNodeType() { - return nodeType; - } - - public void setNodeType(String nodeType) { - this.nodeType = nodeType; - } - - public JsonObject getProperties() { - return properties; - } - - public void setProperties(JsonObject properties) { - this.properties = properties; - } - - public Map<String, Object> getPropertyList() { - return jsonObject2Properties(properties); - } - - private Map<String, Object> jsonObject2Properties(JsonObject properties) { - Map<String, Object> ret = new HashMap<>(); - Iterator<Entry<String, JsonElement>> iterator = properties.entrySet().iterator(); - while (iterator.hasNext()) { - Entry<String, JsonElement> next = iterator.next(); - ret.put(next.getKey(), ToolUtil.getAsString(next.getValue())); - } - return ret; - } - - public JsonObject[] getRequirements() { - return requirements; - } - - public void setRequirements(JsonObject[] requirements) { - this.requirements = requirements; - } - - public JsonObject getCapabilities() { - return capabilities; - } - - public void setCapabilities(JsonObject capabilities) { - this.capabilities = capabilities; - } - - public List<Relationship> getRelationships() { - return relationships; - } - - public void setRelationships(List<Relationship> relationships) { - this.relationships = relationships; - } - - /** - * get scalable. - * @return NodeTemplateScalable - */ - public NodeTemplateScalable getScalable() { - if (capabilities == null) { - return null; - } - JsonElement scaleableJson = capabilities.get("scalable"); - if (scaleableJson == null || !scaleableJson.isJsonObject()) { - return null; - } - JsonElement propertyJson = scaleableJson.getAsJsonObject().get("properties"); - if (propertyJson == null || !propertyJson.isJsonObject()) { - return null; - } - - NodeTemplateScalable scalable = new NodeTemplateScalable(); - scalable.setMin_instances( - ToolUtil.getAsString(propertyJson.getAsJsonObject().get("min_instances"))); - scalable.setMax_instances( - ToolUtil.getAsString(propertyJson.getAsJsonObject().get("max_instances"))); - scalable.setDefault_instances( - ToolUtil.getAsString(propertyJson.getAsJsonObject().get("default_instances"))); - return scalable; - } - - public class Relationship { - private String targetNodeName; - private String type; - private String sourceNodeName; - - public String getTargetNodeName() { - return targetNodeName; - } - - public void setTargetNodeName(String targetNodeName) { - this.targetNodeName = targetNodeName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSourceNodeName() { - return sourceNodeName; - } - - public void setSourceNodeName(String sourceNodeName) { - this.sourceNodeName = sourceNodeName; - } - } - - public class NodeTemplateScalable { - private String minInstances; - private String maxInstances; - private String defaultInstances; - - public String getMin_instances() { - return minInstances; - } - - public void setMin_instances(String minInstances) { - this.minInstances = minInstances; - } - - public String getMax_instances() { - return maxInstances; - } - - public void setMax_instances(String maxInstances) { - this.maxInstances = maxInstances; - } - - public String getDefault_instances() { - return defaultInstances; - } - - public void setDefault_instances(String defaultInstances) { - this.defaultInstances = defaultInstances; - } - } - } - - public class SubstitutionMapping { - private String node_type; - private JsonObject requirements; - private JsonObject capabilities; - - public String getNode_type() { - return node_type; - } - - public void setNode_type(String node_type) { - this.node_type = node_type; - } - - public JsonObject getRequirements() { - return requirements; - } - - public void setRequirements(JsonObject requirements) { - this.requirements = requirements; - } - - public Map<String, String[]> getRequirementList() { - return jsonObjects2Requirements(this.requirements); - } - - private Map<String, String[]> jsonObjects2Requirements(JsonObject requirements) { - if (requirements == null) { - return new HashMap<String, String[]>(); - } - - Map<String, String[]> ret = new HashMap<String, String[]>(); - Iterator<Entry<String, JsonElement>> iterator = requirements.entrySet().iterator(); - while (iterator.hasNext()) { - Entry<String, JsonElement> next = iterator.next(); - if (next.getValue().isJsonPrimitive() || next.getValue().isJsonObject()) { - ret.put(next.getKey(), new String[] {ToolUtil.getAsString(next.getValue())}); - continue; - } - - if (next.getValue().isJsonArray()) { - String[] value = parseListValue((JsonArray) next.getValue()); - ret.put(next.getKey(), value); - } - } - - return ret; - } - - private String[] parseListValue(JsonArray jsonArray) { - String[] value = new String[jsonArray.size()]; - for (int i = 0, size = jsonArray.size(); i < size; i++) { - value[i] = ToolUtil.getAsString(jsonArray.get(i)); - } - return value; - } - - public JsonObject getCapabilities() { - return capabilities; - } - - public void setCapabilities(JsonObject capabilities) { - this.capabilities = capabilities; - } - - public Map<String, String[]> getCapabilityList() { - return jsonObject2Capabilities(this.capabilities); - } - - private Map<String, String[]> jsonObject2Capabilities(JsonObject capabilities) { - if (capabilities == null) { - return new HashMap<String, String[]>(); - } - - Map<String, String[]> ret = new HashMap<String, String[]>(); - Iterator<Entry<String, JsonElement>> iterator = capabilities.entrySet().iterator(); - while (iterator.hasNext()) { - Entry<String, JsonElement> next = iterator.next(); - if (next.getValue().isJsonPrimitive() || next.getValue().isJsonObject()) { - ret.put(next.getKey(), new String[] {ToolUtil.getAsString(next.getValue())}); - continue; - } - - if (next.getValue().isJsonArray()) { - String[] value = parseListValue((JsonArray) next.getValue()); - ret.put(next.getKey(), value); - } - } - - return ret; - } - } - } - - - public class RelationshipType { - private String type; - private RelationshipValue value; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public RelationshipValue getValue() { - return value; - } - - public void setValue(RelationshipValue value) { - this.value = value; - } - - public class RelationshipValue { - private String derivedFrom; - private String[] validTargetTypes; - - public String getDerivedFrom() { - return derivedFrom; - } - - public void setDerivedFrom(String derivedFrom) { - this.derivedFrom = derivedFrom; - } - - public String[] getValid_target_types() { - return validTargetTypes; - } - - public void setValid_target_types(String[] validTargetTypes) { - this.validTargetTypes = validTargetTypes; - } - } - } - - - public class NodeType { - private String type; - private NodeTypeValue value; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public NodeTypeValue getValue() { - return value; - } - - public void setValue(NodeTypeValue value) { - this.value = value; - } - - public class NodeTypeValue { - private String derivedFrom; - private JsonObject properties; - private JsonObject[] requirements; - private JsonObject capabilities; - - public String getDerivedFrom() { - return derivedFrom; - } - - public void setDerived_from(String derivedFrom) { - this.derivedFrom = derivedFrom; - } - - public JsonObject getProperties() { - return properties; - } - - public void setProperties(JsonObject properties) { - this.properties = properties; - } - - public List<NodeTypeProperty> getPropertyList() { - return jsonObject2Properties(properties); - } - - private List<NodeTypeProperty> jsonObject2Properties(JsonObject properties) { - List<NodeTypeProperty> propertieList = new ArrayList<NodeTypeProperty>(); - Iterator<Entry<String, JsonElement>> iterator = properties.entrySet().iterator(); - while (iterator.hasNext()) { - NodeTypeProperty type = new NodeTypeProperty(); - Entry<String, JsonElement> next = iterator.next(); - type.setKey(next.getKey()); - type.setValue(new Gson().fromJson(next.getValue(), JsonObject.class)); - propertieList.add(type); - } - return propertieList; - } - - public class NodeTypeProperty { - private String key; - private JsonObject value; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - /** - * get default value. - * @return default value - */ - public String getDefaultValue() { - JsonElement defaultValue = value.get("default"); - if (defaultValue == null || defaultValue.isJsonObject()) { - return ""; - } - - return ToolUtil.getAsString(defaultValue); - } - - public JsonObject getValue() { - return value; - } - - public void setValue(JsonObject value) { - this.value = value; - } - } - - public JsonObject[] getRequirements() { - return requirements; - } - - public void setRequirements(JsonObject[] requirements) { - this.requirements = requirements; - } - - public JsonObject getCapabilities() { - return capabilities; - } - - public void setCapabilities(JsonObject capabilities) { - this.capabilities = capabilities; - } - } - } - - public class Plan { - private String name; - private PlanValue value; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return value.getDescription(); - } - - public String getReference() { - return value.getReference(); - } - - public String getPlanLanguage() { - return value.getPlanLanguage(); - } - - public List<PlanValue.PlanInput> getInputList() { - return value.getInputList(); - } - - public PlanValue getValue() { - return value; - } - - public void setValue(PlanValue value) { - this.value = value; - } - - public class PlanValue { - private String description; - private String reference; - private String planLanguage; - private JsonObject inputs; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getReference() { - return reference; - } - - public void setReference(String reference) { - this.reference = reference; - } - - public String getPlanLanguage() { - return planLanguage; - } - - public void setPlanLanguage(String planLanguage) { - this.planLanguage = planLanguage; - } - - public JsonObject getInputs() { - return inputs; - } - - public void setInputs(JsonObject inputs) { - this.inputs = inputs; - } - - public List<PlanInput> getInputList() { - return jsonObject2PlanInputList(inputs); - - } - - private List<PlanInput> jsonObject2PlanInputList(JsonObject inputs) { - List<PlanInput> retList = new ArrayList<PlanInput>(); - Iterator<Entry<String, JsonElement>> iterator = inputs.entrySet().iterator(); - while (iterator.hasNext()) { - PlanInput ret = new PlanInput(); - Entry<String, JsonElement> next = iterator.next(); - ret.setName(next.getKey()); - ret.setValue(new Gson().fromJson(next.getValue(), PlanInput.PlanInputValue.class)); - retList.add(ret); - } - return retList; - } - - public class PlanInput { - private String name; - private PlanInputValue value; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return value.getType(); - } - - public String getDescription() { - return value.getDescription(); - } - - public String getDefault() { - return value.getDefaultValue(); - } - - public boolean isRequired() { - return value.isRequired(); - } - - public PlanInputValue getValue() { - return value; - } - - public void setValue(PlanInputValue value) { - this.value = value; - } - - public class PlanInputValue { - private String type; - private String description; - @SerializedName("default") - private String defaultValue; - private boolean required; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public boolean isRequired() { - return required; - } - - public void setRequired(boolean required) { - this.required = required; - } - } - } - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/IYamlParseRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/IYamlParseRest.java deleted file mode 100644 index 157a5073..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/IYamlParseRest.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.zte.service; - -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlRequestParemeter; - -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - - -@Path("/parse") -public interface IYamlParseRest { - - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - String parse(ParseYamlRequestParemeter request) throws Exception; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/YamlParseServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/YamlParseServiceConsumer.java deleted file mode 100644 index 2d9bd045..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/YamlParseServiceConsumer.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.parser.yaml.zte.service; - -import com.google.gson.Gson; -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; - -import org.glassfish.jersey.client.ClientConfig; -import org.openo.commontosca.catalog.common.MsbUtil; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlRequestParemeter; -import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlResult; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class YamlParseServiceConsumer { - private static final Logger logger = LoggerFactory.getLogger(YamlParseServiceConsumer.class); - /** - * get service template by template id from container service. - * - * @param request parse yaml request - * @return parase yaml result - * @throws CatalogResourceException e - */ - public static ParseYamlResult getServiceTemplates(ParseYamlRequestParemeter request) - throws CatalogResourceException { - logger.info("parseCsarPackage uri = " + request.getPath()); - - try { - ClientConfig config = new ClientConfig(); - IYamlParseRest yamlParseProxy = - ConsumerFactory.createConsumer(MsbUtil.getYamlParseBaseUrl(), config, - IYamlParseRest.class); - String jsonStr = yamlParseProxy.parse(request); - ParseYamlResult result = new Gson().fromJson(jsonStr, ParseYamlResult.class); - result.setRawData(jsonStr); - return result; - } catch (Exception e1) { - throw new CatalogResourceException("Call parser api failed.", e1); - } - - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Iwso2RestService.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Iwso2RestService.java deleted file mode 100644 index 8442d1f5..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Iwso2RestService.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2; - -import org.openo.commontosca.catalog.model.plan.wso2.entity.DeletePackageResponse; -import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessRequest; -import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessResponse; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("/openoapi/wso2bpel/v1") -public interface Iwso2RestService { - // /** - // * @param request - // * @return - // * @throws Exception - // */ - // @Path("/package") - // @POST - // @Consumes(MediaType.APPLICATION_JSON) - // @Produces(MediaType.APPLICATION_JSON) - // DeployPackageResponse deployPackage(FormDataMultiPart request) throws Exception; - - @Path("/package/{packageName}") - @DELETE - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - DeletePackageResponse deletePackage( - @PathParam("packageName") String packageName) throws Exception; - - @Path("process/instance") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - StartProcessResponse startProcess(StartProcessRequest request) - throws Exception; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/RestResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/RestResponse.java deleted file mode 100644 index d10e5825..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/RestResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class RestResponse { - - private Integer statusCode; - - private String result; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/RestfulClient.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/RestfulClient.java deleted file mode 100644 index aecd5e10..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/RestfulClient.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpHost; -import org.apache.http.HttpRequest; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -public class RestfulClient { - private static final String HTTP = "http"; - private static final Logger logger = LoggerFactory.getLogger(RestfulClient.class); - - enum HttpMethod { - GET, POST, PUT, DELETE - } - - /** - * execute http. - * @param method http method - * @param ip ip - * @param port port - * @param url url - * @param body http body - * @return RestResponse - */ - public static RestResponse executeHttp(HttpMethod method, String ip, int port, String url, - HttpEntity body) { - CloseableHttpClient httpclient = HttpClients.createDefault(); - HttpResponse httpResponse = null; - RestResponse result = new RestResponse(); - try { - // specify the host, protocol, and port - HttpHost target = new HttpHost(ip, port, HTTP); - // specify the get request - HttpRequest request = getRequest(method, url, body); - httpResponse = httpclient.execute(target, request); - HttpEntity entity = httpResponse.getEntity(); - if (entity != null) { - result.setStatusCode(httpResponse.getStatusLine().getStatusCode()); - result.setResult(EntityUtils.toString(entity)); - } - } catch (Exception e1) { - logger.error("send get rest request error:", e1.getMessage()); - } finally { - if (httpclient != null) { - try { - httpclient.close(); - } catch (IOException e2) { - logger.error("close httpclient error:", e2.getMessage()); - } - } - } - return result; - } - - private static HttpRequest getRequest(HttpMethod method, String url, HttpEntity body) { - HttpRequest request = null; - switch (method) { - case GET: - request = new HttpGet(url); - break; - case POST: - request = new HttpPost(url); - ((HttpPost) request).setEntity(body); - break; - case PUT: - request = new HttpPut(url); - ((HttpPut) request).setEntity(body); - break; - case DELETE: - request = new HttpDelete(url); - break; - default: - break; - } - return request; - } - - public static String get(String ip, int port, String url) { - return executeHttp(HttpMethod.GET, ip, port, url, null).getResult(); - } - - public static RestResponse delete(String ip, int port, String url) { - return executeHttp(HttpMethod.GET, ip, port, url, null); - } - - public static RestResponse post(String ip, int port, String url, HttpEntity requestBody) { - return executeHttp(HttpMethod.POST, ip, port, url, requestBody); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java deleted file mode 100644 index 67f9a9e3..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import org.apache.http.HttpEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.glassfish.jersey.client.ClientConfig; -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.model.common.TemplateUtils; -import org.openo.commontosca.catalog.model.plan.wso2.entity.DeletePackageResponse; -import org.openo.commontosca.catalog.model.plan.wso2.entity.DeployPackageResponse; -import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessRequest; -import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; -import com.google.gson.Gson; - - -public class Wso2ServiceConsumer { - public static final String WSO2_APP_URL = "/openoapi/wso2bpel/v1/package"; - private static final Logger logger = LoggerFactory.getLogger(Wso2ServiceConsumer.class); - - /** - * deploy package. - * @param zipFileLocation zip file location - * @param planFilePath plan file path - * @return DeployPackageResponse - * @throws CatalogResourceException e1 - */ - public static DeployPackageResponse deployPackage(String zipFileLocation, String planFilePath) - throws CatalogResourceException { - IpPort ipPort = getIpPort(Config.getConfigration().getMsbServerAddr()); - if (ipPort == null) { - throw new CatalogResourceException("getMsbServerAddr failed."); - } - ZipFile zf = null; - InputStream ins = null; - try { - zf = new ZipFile(zipFileLocation); - ins = getInputStream(zf, planFilePath); - RestResponse res = RestfulClient.post( - ipPort.getIp(), ipPort.getPort(), WSO2_APP_URL, - buildRequest(ins, planFilePath)); - - if (res.getStatusCode() == null || res.getResult() == null) { - throw new CatalogResourceException( - "Deploy Package return null. Response = " + res); - } - - if (200 == res.getStatusCode() || 201 == res.getStatusCode()) { - DeployPackageResponse response = - new Gson().fromJson(res.getResult(), DeployPackageResponse.class); - if (response.isSuccess()) { - return response; - } - } - - throw new CatalogResourceException( - "Deploy Package return failed. Response = " + res.getResult()); - } catch (FileNotFoundException e) { - throw new CatalogResourceException("buildRequest failed.", e); - } catch (IOException e) { - throw new CatalogResourceException("ZipFile failed.", e); - } finally { - TemplateUtils.closeInputStream(ins); - TemplateUtils.closeZipFile(zf); - } - } - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class IpPort { - private String ip; - private int port; - } - - private static IpPort getIpPort(String addr) { - Pattern p = Pattern.compile("//(.*?):(.*)"); - Matcher m = p.matcher(addr); - while(m.find()){ - return new IpPort(m.group(1), Integer.valueOf(m.group(2))); - } - return null; - } - - private static HttpEntity buildRequest(InputStream inputStream, String filePath) - throws FileNotFoundException { - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - builder.seContentType(ContentType.MULTIPART_FORM_DATA); - builder.addBinaryBody("file", inputStream, ContentType.APPLICATION_OCTET_STREAM, - new File(filePath).getName()); - return builder.build(); - } - - private static InputStream getInputStream(ZipFile zf, String planFilePath) - throws CatalogResourceException, IOException { - ZipEntry ze = TemplateUtils.getZipEntryZipFile(zf, planFilePath); - - if (ze == null) { - throw new CatalogResourceException("Can't file plan file in the csar. planFilePath = " + planFilePath); - } - return zf.getInputStream(ze); - } - - /** - * delet package. - * @param packageName package to delete according packageName - * @return DeletePackageResponse - * @throws CatalogResourceException e1 - */ - public static DeletePackageResponse deletePackage(String packageName) - throws CatalogResourceException { - try { - ClientConfig config = new ClientConfig(); - Iwso2RestService wso2Proxy = ConsumerFactory.createConsumer( - Config.getConfigration().getMsbServerAddr(), config, Iwso2RestService.class); - DeletePackageResponse response = wso2Proxy.deletePackage(packageName); - if (response.isSuccess()) { - return response; - } - throw new CatalogResourceException(response.toString()); - } catch (Exception e) { - throw new CatalogResourceException( - "Call Delete Package api failed. packageName = " + packageName, e); - } - } - - - /** - * start process. - * @param processId process id - * @param params params - * @return StartProcessResponse - * @throws CatalogResourceException e1 - */ - public static StartProcessResponse startProcess(String processId, Map<String, Object> params) - throws CatalogResourceException { - try { - ClientConfig config = new ClientConfig(); - Iwso2RestService wso2Proxy = ConsumerFactory.createConsumer( - Config.getConfigration().getMsbServerAddr(), config, Iwso2RestService.class); - StartProcessResponse response = - wso2Proxy.startProcess(new StartProcessRequest(processId, params)); - if (response.isSuccess()) { - return response; - } - throw new CatalogResourceException(response.toString()); - } catch (Exception e) { - throw new CatalogResourceException("Call Start Process api failed.", e); - } - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java deleted file mode 100644 index c3b04092..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class DeletePackageResponse { - private static final int STATUS_SUCCESS = 1; - - private int status; - private String message; - private String exception; - - public boolean isSuccess() { - return this.status == STATUS_SUCCESS; - } - - @Override - public String toString() { - return "DeletePackageResponse [status=" + status + ", message=" + message + ", exception=" - + exception + "]"; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java deleted file mode 100644 index d106b89d..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class DeployPackageResponse { - private static final int STATUS_SUCCESS = 1; - - private int status; - private String message; - private String packageName; - private String processId; - private String exception; - - public boolean isSuccess() { - return this.status == STATUS_SUCCESS; - } - - @Override - public String toString() { - return "DeployPackageResponse [status=" + status + ", message=" + message + ", packageName=" - + packageName + ", processId=" + processId + ", exception=" + exception + "]"; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessRequest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessRequest.java deleted file mode 100644 index 69ada249..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessRequest.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Map; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class StartProcessRequest { - private String processId; - private Map<String, Object> params; -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java deleted file mode 100644 index 7e01e770..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.plan.wso2.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class StartProcessResponse { - private static final int STATUS_SUCCESS = 1; - - private int status; - private String message; - private String response; - private String exception; - - public boolean isSuccess() { - return this.status == STATUS_SUCCESS; - } - - @Override - public String toString() { - return "StartProcessResponse [status=" + status + ", message=" + message + ", response=" - + response + ", exception=" + exception + "]"; - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/service/ModelService.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/service/ModelService.java deleted file mode 100644 index bdbafb87..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/service/ModelService.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.service; - -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.TemplateManager; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.plan.wso2.Wso2ServiceConsumer; -import org.openo.commontosca.catalog.model.wrapper.ServiceTemplateWrapper; -import org.openo.commontosca.catalog.resources.CatalogBadRequestException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ModelService { - private static final Logger logger = LoggerFactory.getLogger(ModelService.class); - - private static ModelService instance; - - public static ModelService getInstance() { - if (instance == null) { - instance = new ModelService(); - } - return instance; - } - - - /** - * delete service template according package id. - * - * @param packageId package id - * @throws CatalogBadRequestException e1 - * @throws CatalogResourceException e2 - */ - public void delete(String packageId) throws CatalogResourceException { - logger.info("delete package model data begin."); - - ServiceTemplate st = getServiceTemplateByCsarIdIgnoreError(packageId); - if (st == null) { - return; - } - - undeployOperationPackage(st.getOperations()); - - TemplateManager.getInstance().deleteServiceTemplateById(st.getServiceTemplateId()); - TemplateManager.getInstance().deleteServiceTemplateMapping(null, st.getServiceTemplateId()); - - logger.info("delete package model data end."); - } - - private void undeployOperationPackage(ServiceTemplateOperation[] operations) - throws CatalogResourceException { - if (operations != null && operations.length > 0) { - for (ServiceTemplateOperation op : operations) { - Wso2ServiceConsumer.deletePackage(op.getPackageName()); - } - } - } - - private ServiceTemplate getServiceTemplateByCsarIdIgnoreError(String packageId) { - try { - return ServiceTemplateWrapper.getInstance().getServiceTemplateByCsarId(packageId); - } catch (CatalogBadRequestException ignore) { - logger.info("delete package model data ignore.", ignore); - } catch (CatalogResourceException ignore) { - logger.info("delete package model data ignore.", ignore); - } - - return null; - } - - /** - * delete service template data only, not undeploy operation package. - * - * @param packageId package id - * @throws CatalogBadRequestException e1 - * @throws CatalogResourceException e2 - */ - public void deleteServiceTemplateData(String packageId) throws CatalogResourceException { - logger.info("delete service template data begin."); - - ServiceTemplate st = getServiceTemplateByCsarIdIgnoreError(packageId); - if (st == null) { - return; - } - - TemplateManager.getInstance().deleteServiceTemplateById(st.getServiceTemplateId()); - TemplateManager.getInstance().deleteServiceTemplateMapping(null, st.getServiceTemplateId()); - - logger.info("delete service template data end."); - } - - /** - * undeploy operation package of the service template. - * - * @param packageId package id - * @throws CatalogBadRequestException e1 - * @throws CatalogResourceException e2 - */ - public void undeployOperationPackage(String packageId) throws CatalogResourceException { - logger.info("undeploy operation package begin."); - - ServiceTemplate st = getServiceTemplateByCsarIdIgnoreError(packageId); - if (st == null) { - return; - } - - undeployOperationPackage(st.getOperations()); - - logger.info("undeploy operation package end."); - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/wrapper/ServiceTemplateWrapper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/wrapper/ServiceTemplateWrapper.java deleted file mode 100644 index 56db0aee..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/wrapper/ServiceTemplateWrapper.java +++ /dev/null @@ -1,378 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.model.wrapper; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.TemplateManager; -import org.openo.commontosca.catalog.entity.EnumOperationalState; -import org.openo.commontosca.catalog.model.common.TemplateDataHelper; -import org.openo.commontosca.catalog.model.entity.InputParameter; -import org.openo.commontosca.catalog.model.entity.NfvTemplate; -import org.openo.commontosca.catalog.model.entity.NodeTemplate; -import org.openo.commontosca.catalog.model.entity.Parameters; -import org.openo.commontosca.catalog.model.entity.QueryRawDataCondition; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateRawData; -import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; -import org.openo.commontosca.catalog.resources.CatalogBadRequestException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class ServiceTemplateWrapper { - private static ServiceTemplateWrapper instance; - private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateWrapper.class); - - /** - * get service template wrapper instance. - * @return ServiceTemplateWrapper instance - */ - public static ServiceTemplateWrapper getInstance() { - if (instance == null) { - instance = new ServiceTemplateWrapper(); - } - return instance; - } - - /** - * get service template by id. - * @param serviceTemplateId service template id - * @return service template - * @throws CatalogResourceException e1 - */ - public ServiceTemplate getServiceTemplateById(String serviceTemplateId) - throws CatalogResourceException { - logger.info("getServiceTemplateById. serviceTemplateId = " + serviceTemplateId); - - List<ServiceTemplateData> stdList = - TemplateManager.getInstance().queryServiceTemplateById(serviceTemplateId); - if (stdList == null || stdList.isEmpty()) { - throw new CatalogResourceException("Can't find this servcie template"); - } - - return TemplateDataHelper.convert2ServiceTemplate(stdList.get(0)); - } - - - /** - * get service templates. - * @param status usage status - * @param deletionPending package's deletionPending - * @return service template list - * @throws CatalogResourceException e - */ - public ServiceTemplate[] getServiceTemplates(EnumOperationalState status, boolean deletionPending) - throws CatalogResourceException { - PackageData pd = new PackageData(); - if (status != null) { - pd.setOperationalState(status.toString()); - } - pd.setDeletionPending(String.valueOf(deletionPending)); - - List<ServiceTemplateData> stdList = - TemplateManager.getInstance().queryServiceTemplateByCsarPackageInfo(pd); - - return TemplateDataHelper.convert2ServiceTemplates(stdList); - } - - public ServiceTemplate[] getServiceTemplates() throws CatalogResourceException { - return TemplateDataHelper.convert2ServiceTemplates( - TemplateManager.getInstance().queryServiceTemplate(null, null, null)); - } - - - /** - * get nesting service template. - * @param nodeTypeIds nodeType id list - * @return service template list - * @throws CatalogResourceException e - */ - public ServiceTemplate[] getNestingServiceTemplate(String[] nodeTypeIds) - throws CatalogResourceException { - ServiceTemplate[] sts = new ServiceTemplate[nodeTypeIds.length]; - for (int i = 0; i < nodeTypeIds.length; i++) { - SubstitutionMapping stm = getSubstitutionMappingsByNodeTypeId(nodeTypeIds[i]); - if (stm == null) { - sts[i] = null; - continue; - } - sts[i] = getServiceTemplate(stm, nodeTypeIds[i]); - } - - return sts; - } - - private ServiceTemplate getServiceTemplate(SubstitutionMapping stm, String nodeTypeId) { - try { - return getServiceTemplateById(stm.getServiceTemplateId()); - } catch (CatalogResourceException e) { - logger.warn("Get Nesting ServiceTemplate Failed. NodeTypeIds = " + nodeTypeId, e); - return null; - } - } - - /** - * get substitution mappings by nodeTpe id. - * @param nodeTypeId nodeType id - * @return SubstitutionMapping - * @throws CatalogResourceException e - */ - private SubstitutionMapping getSubstitutionMappingsByNodeTypeId(String nodeTypeId) - throws CatalogResourceException { - List<ServiceTemplateMappingData> stmDataList = - TemplateManager.getInstance().queryServiceTemplateMapping(nodeTypeId, null); - if (stmDataList == null || stmDataList.isEmpty()) { - return null; - } - - return TemplateDataHelper.convert2SubstitutionMapping(stmDataList.get(0)); - } - - - /** - * get service template raw data. - * @param queryCondition query raw data condition - * @return ServiceTemplateRawData - * @throws CatalogResourceException e1 - * @throws CatalogBadRequestException e2 - */ - public ServiceTemplateRawData getServiceTemplateRawData(QueryRawDataCondition queryCondition) - throws CatalogResourceException, CatalogBadRequestException { - ServiceTemplateData std = getServiceTemplateDataByCsarId(queryCondition.getCsarId()); - return new ServiceTemplateRawData(std.getRowData()); - } - - /** - * get service template data by package id. - * @param csarId package id - * @return ServiceTemplateData - * @throws CatalogBadRequestException e1 - * @throws CatalogResourceException e2 - */ - private ServiceTemplateData getServiceTemplateDataByCsarId(String csarId) - throws CatalogBadRequestException, CatalogResourceException { - if (ToolUtil.isTrimedEmptyString(csarId)) { - throw new CatalogBadRequestException("CsarId is null."); - } - PackageData pd = new PackageData(); - pd.setCsarId(csarId); - - List<ServiceTemplateData> stdList = - TemplateManager.getInstance().queryServiceTemplateByCsarPackageInfo(pd); - - if (stdList == null || stdList.isEmpty()) { - throw new CatalogResourceException("Can't find this servcie template"); - } - - return stdList.get(0); - } - - /** - * get service template by package id. - * @param packageId package id - * @return service template data - * @throws CatalogBadRequestException e1 - * @throws CatalogResourceException e2 - */ - public ServiceTemplate getServiceTemplateByCsarId(String packageId) - throws CatalogBadRequestException, CatalogResourceException { - ServiceTemplateData std = getServiceTemplateDataByCsarId(packageId); - ServiceTemplate st = TemplateDataHelper.convert2ServiceTemplate(std); - return st; - } - - /** - * get service template parameters. - * @param serviceTemplateId service template id - * @return service template parameters - * @throws CatalogResourceException e - */ - public Parameters getServiceTemplateParameters(String serviceTemplateId) - throws CatalogResourceException { - ServiceTemplate st = getServiceTemplateById(serviceTemplateId); - return new Parameters(st.getInputs(), st.getOutputs()); - } - - /** - * get template operation. - * @param serviceTemplateId service template id - * @return service template operations - */ - public ServiceTemplateOperation[] getTemplateOperations(String serviceTemplateId) - throws CatalogResourceException { - ServiceTemplate st = getServiceTemplateById(serviceTemplateId); - - if (st.getOperations() == null) { - return new ServiceTemplateOperation[0]; - } - return st.getOperations(); - } - - /** - * get parameters by operation name. - * @param serviceTemplateId service template id - * @param operationName operation name - * @return InputParameter list - * @throws CatalogResourceException e - */ - public InputParameter[] getParametersByOperationName(String serviceTemplateId, - String operationName) throws CatalogResourceException { - if (ToolUtil.isTrimedEmptyString(operationName)) { - throw new CatalogResourceException("Operation Name is null."); - } - - ServiceTemplateOperation[] operations = getTemplateOperations(serviceTemplateId); - for (int i = 0; i < operations.length; i++) { - if (operationName.equals(operations[i].getName())) { - return operations[i].getInputs(); - } - } - - throw new CatalogResourceException("Can't find this operation."); - } - - - /** - * get nodeTemplate by id. - * @param serviceTemplateId service template id - * @param nodeTemplateId node template id - * @return NodeTemplate - * @throws CatalogResourceException e1 - */ - public NodeTemplate getNodeTemplateById(String serviceTemplateId, String nodeTemplateId) - throws CatalogResourceException { - List<NodeTemplateData> ntdList = - TemplateManager.getInstance().queryNodeTemplateById(serviceTemplateId, nodeTemplateId); - - if (ntdList == null || ntdList.isEmpty()) { - throw new CatalogResourceException("Can't find this node template."); - } - - return TemplateDataHelper.convert2NodeTemplate(ntdList.get(0)); - } - - /** - * get node templates. - * @param serviceTemplateId service template id - * @param types type list - * @return NodeTemplate list - * @throws CatalogResourceException e - */ - public NodeTemplate[] getNodeTemplates(String serviceTemplateId, String[] types) - throws CatalogResourceException { - List<NodeTemplateData> ntdList = - TemplateManager.getInstance().queryNodeTemplateBySeriviceTemplateId(serviceTemplateId); - if (ntdList == null || ntdList.isEmpty()) { - return new NodeTemplate[0]; - } - - if (ToolUtil.isTrimedEmptyArray(types)) { // return all node templates - return TemplateDataHelper.convert2NodeTemplates(ntdList); - } - - List<NodeTemplate> ntList = new ArrayList<>(); - for (String type : types) { - if (!ToolUtil.isTrimedEmptyString(type)) { - List<NodeTemplateData> typedNtdList = filterNodeTemplateDataListByType(ntdList, type); - ntList.addAll(Arrays.asList(TemplateDataHelper.convert2NodeTemplates(typedNtdList))); - } - } - return ntList.toArray(new NodeTemplate[0]); - } - - /** - * filter node template data list by type. - * @param ntdList nodeTemplate list - * @param type node type - * @return node template data list - */ - private List<NodeTemplateData> filterNodeTemplateDataListByType(List<NodeTemplateData> ntdList, - String type) { - List<NodeTemplateData> retList = new ArrayList<>(); - for (NodeTemplateData ntd : ntdList) { - if (type.equals(ntd.getType())) { - retList.add(ntd); - } - } - return retList; - } - - - /** - * get nfv template. - * @param serviceTemlateId service template id - * @return NfvTemplate - * @throws CatalogResourceException e - */ - public NfvTemplate getNfvTemplate(String serviceTemlateId) throws CatalogResourceException { - NodeTemplate[] nts = getNodeTemplates(serviceTemlateId, null); - - List<NodeTemplate> vduNodes = new ArrayList<>(); - List<NodeTemplate> networkNodes = new ArrayList<>(); - List<NodeTemplate> vnfcNodes = new ArrayList<>(); - List<NodeTemplate> vnfNodes = new ArrayList<>(); - for (NodeTemplate nt : nts) { - if (isVduNode(nt.getType())) { - vduNodes.add(nt); - continue; - } - - if (isNetworkNode(nt.getType())) { - networkNodes.add(nt); - continue; - } - - if (isVnfcNode(nt.getType())) { - vnfcNodes.add(nt); - continue; - } - - if (isVnfNode(nt.getType())) { - vnfNodes.add(nt); - continue; - } - } - - return new NfvTemplate(vduNodes, networkNodes, vnfcNodes, vnfNodes); - } - - private boolean isVnfNode(String type) { - return type.toUpperCase().indexOf(".VNF") > 0; - } - - private boolean isVnfcNode(String type) { - return type.toUpperCase().indexOf(".VNFC") > 0; - } - - private boolean isNetworkNode(String type) { - return type.toUpperCase().indexOf(".VL") > 0 || type.toUpperCase().indexOf(".VIRTUALLINK") > 0; - } - - private boolean isVduNode(String type) { - return type.toUpperCase().indexOf(".VDU") > 0; - } - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/CatalogBadRequestException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/CatalogBadRequestException.java deleted file mode 100644 index 76c5e164..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/CatalogBadRequestException.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.resources; - -import org.openo.commontosca.catalog.db.exception.ErrorCodeException; - -public class CatalogBadRequestException extends ErrorCodeException { - private static final long serialVersionUID = 5699508780537383310L; - - - public CatalogBadRequestException(int errcode) { - super(errcode, ""); - } - - - public CatalogBadRequestException(int errcode, Throwable cause) { - super(cause, errcode); - } - - - public CatalogBadRequestException(int errcode, String message, Throwable cause) { - super(cause, errcode, message); - } - - - public CatalogBadRequestException() { - super(9999999, null); - } - - - public CatalogBadRequestException(String message) { - super(9999999, message); - } - - - public CatalogBadRequestException(Throwable cause) { - super(cause, 9999999); - } - - - public CatalogBadRequestException(String message, Throwable cause) { - super(cause, 9999999, message); - } - - - public CatalogBadRequestException(Throwable source, int errId, String debugMessage, - String[] arguments) { - super(source, errId, debugMessage, arguments); - } - - public CatalogBadRequestException(Throwable source, int category, int code, String debugMessage, - String[] arguments) { - super(source, category, code, debugMessage, arguments); - } - - public int getErrcode() { - return super.getErrorCode(); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/PackageResource.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/PackageResource.java deleted file mode 100644 index d697c704..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/PackageResource.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.resources; - -import com.codahale.metrics.annotation.Timed; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -import org.eclipse.jetty.http.HttpStatus; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; -import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; -import org.openo.commontosca.catalog.entity.response.PackageMeta; -import org.openo.commontosca.catalog.entity.response.UploadPackageResponse; -import org.openo.commontosca.catalog.wrapper.PackageWrapper; - -import java.io.InputStream; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * csar package service. - * - * @author 10189609 - * - */ -@Path("/") -@Api(tags = {"Package Resource"}) -public class PackageResource { - - @Path("/csars") - @GET - @ApiOperation(value = "get csar package list by condition", response = PackageMeta.class, - responseContainer = "List") - @Produces(MediaType.APPLICATION_JSON) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - response = String.class)}) - @Timed - public Response queryPackageListByCond( - @ApiParam(value = "csar name") @QueryParam("name") String name, @ApiParam( - value = "csar provider") @QueryParam("provider") String provider, @ApiParam( - value = "csar version") @QueryParam("version") String version, @ApiParam( - value = "delay to delete") @QueryParam("deletionPending") String deletionPending, - @ApiParam(value = "csar type") @QueryParam("type") String type) { - return PackageWrapper.getInstance().queryPackageListByCond(name, provider, version, - deletionPending, type); - } - - - @Path("/csars/{csarId}") - @GET - @ApiOperation(value = "get csar package list", response = PackageMeta.class, - responseContainer = "List") - @Produces(MediaType.APPLICATION_JSON) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - response = String.class)}) - @Timed - public Response queryPackageById( - @ApiParam(value = "csar id") @PathParam("csarId") String csarId) { - return PackageWrapper.getInstance().queryPackageById(csarId); - } - - // @Path("/csars/ftp") - // @POST - // @ApiOperation(value = "upload csar package", response = UploadPackageResponse.class) - // @Consumes(MediaType.APPLICATION_JSON) - // @Produces(MediaType.APPLICATION_JSON) - // @ApiResponses(value = { - // @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = - // String.class), - // @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, message = - // "Unprocessable MicroServiceInfo Entity ", response = String.class), - // @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - // response = String.class)}) - // @Timed - // public Response uploadPackageFromFtp(UploadPackageFromFtpRequest request) throws Exception { - // return PackageWrapper.getInstance().uploadPackageFromFtp(request); - // } - - @Path("/csars") - @POST - @ApiOperation(value = "upload csar package", response = UploadPackageResponse.class) - @Consumes(MediaType.MULTIPART_FORM_DATA) - @Produces(MediaType.APPLICATION_JSON) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - response = String.class)}) - @Timed - public Response uploadPackage( - @ApiParam(value = "file inputstream", - required = true) @FormDataParam("file") InputStream uploadedInputStream, - @ApiParam(value = "file detail", - required = false) @FormDataParam("file") FormDataContentDisposition fileDetail, - @ApiParam(value = "http header") @Context HttpHeaders head) throws Exception { - return PackageWrapper.getInstance().uploadPackage(uploadedInputStream, fileDetail, head); - } - - @Path("/csars/{csarId}") - @DELETE - @ApiOperation(value = "delete a package") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - response = String.class)}) - @Timed - public Response delPackage(@ApiParam(value = "csar Id") @PathParam("csarId") String csarId) { - return PackageWrapper.getInstance().delPackage(csarId); - } - - // @Path("/csars") - // @DELETE - // @ApiOperation(value = "delete a package by serviceTemplateId") - // @ApiResponses(value = { - // @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = - // String.class), - // @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, message = - // "Unprocessable MicroServiceInfo Entity ", response = String.class), - // @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - // response = String.class)}) - // @Timed - // public Response delPackageByServiceTemplateId( - // @ApiParam(value = "serviceTemplateId") @QueryParam("serviceTemplateId") String - // serviceTemplateId) { - // return PackageWrapper.getInstance().delPackageByServiceTemplateId(serviceTemplateId); - // } - - @Path("/csars/{csarId}") - @PUT - @ApiOperation(value = "update csar package status") - @Produces(MediaType.APPLICATION_JSON) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - response = String.class)}) - @Timed - public Response updatePackageStatus( - @ApiParam(value = "csar Id", required = true) @PathParam("csarId") String csarId, - @ApiParam(value = "csar operational status", - required = false) @QueryParam("operationalState") String operationalState, - @ApiParam(value = "csar usage status", - required = false) @QueryParam("usageState") String usageState, - @ApiParam(value = "csar onboard status", - required = false) @QueryParam("onBoardState") String onBoardState, - @ApiParam(value = "csar process status", - required = false) @QueryParam("processState") String processState, - @ApiParam(value = "csar deletionPending status", - required = false) @QueryParam("deletionPending") String deletionPending) { - return PackageWrapper.getInstance().updatePackageStatus(csarId, operationalState, usageState, - onBoardState, processState, deletionPending); - } - - @Path("/csars/{csarId}/files") - @GET - @ApiOperation(value = "get csar file uri by csarId", response = CsarFileUriResponse.class) - @Produces(MediaType.APPLICATION_JSON) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - response = String.class)}) - @Timed - public Response getCsarFileUri( - @ApiParam(value = "csar Id", required = true) @PathParam("csarId") String csarId, - @ApiParam(value = "csar file path", - required = true) @QueryParam("relativePath") String relativePath) { - return PackageWrapper.getInstance().getCsarFileUri(csarId, relativePath); - } - - // @Path("/csars/{csarId}/plans") - // @GET - // @ApiOperation(value = "get plans of package by csarId", response = FileLink.class, - // responseContainer = "List") - // @Produces(MediaType.APPLICATION_JSON) - // @ApiResponses(value = { - // @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = - // String.class), - // @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, message = - // "Unprocessable MicroServiceInfo Entity ", response = String.class), - // @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "resource grant error", - // response = String.class)}) - // @Timed - // public Response getCsarPlanUri( - // @ApiParam(value = "csar Id", required = true) @PathParam("csarId") String csarId - // ) { - // return PackageWrapper.getInstance().getCsarPlansUri(csarId); - // } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/RestUtils.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/RestUtils.java deleted file mode 100644 index b5745b11..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/RestUtils.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.resources; - -import org.openo.commontosca.catalog.common.CommonErrorResponse; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; - -import javax.ws.rs.BadRequestException; -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.core.Response; - -public class RestUtils { - public static InternalServerErrorException newInternalServerErrorException( - CatalogResourceException e1) { - return new InternalServerErrorException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) - .entity(new CommonErrorResponse(e1.getErrcode() + "", e1.getMessage())).build(), e1); - } - - public static BadRequestException newBadRequestException(CatalogBadRequestException e1) { - return new BadRequestException(Response.status(Response.Status.BAD_REQUEST) - .entity(new CommonErrorResponse(e1.getErrcode() + "", e1.getMessage())).build(), e1); - } -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/TemplateResource.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/TemplateResource.java deleted file mode 100644 index 1e0e2c66..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/TemplateResource.java +++ /dev/null @@ -1,453 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.resources; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.eclipse.jetty.http.HttpStatus; -import org.openo.commontosca.catalog.common.CommonErrorResponse; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.entity.EnumOperationalState; -import org.openo.commontosca.catalog.model.entity.InputParameter; -import org.openo.commontosca.catalog.model.entity.NodeTemplate; -import org.openo.commontosca.catalog.model.entity.Parameters; -import org.openo.commontosca.catalog.model.entity.QueryRawDataCondition; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateRawData; -import org.openo.commontosca.catalog.model.parser.AbstractModelParser; -import org.openo.commontosca.catalog.model.parser.yaml.zte.ToscaYamlModelParser; -import org.openo.commontosca.catalog.model.service.ModelService; -import org.openo.commontosca.catalog.model.wrapper.ServiceTemplateWrapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.codahale.metrics.annotation.Timed; - -/** - * model template service. - * - */ -@Path("/servicetemplates") -@Api(tags = {"Model Resource"}) -public class TemplateResource { - - private static final Logger logger = LoggerFactory.getLogger(TemplateResource.class); - - /** - * Query service template by service template id. - * @param servicetemplateid service template id - * @return Response - */ - @Path("/{servicetemplateid}") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query service template by service template id", - response = ServiceTemplate.class) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getServiceTemplateById(@ApiParam( - value = "service template id") @PathParam("servicetemplateid") String servicetemplateid) { - try { - ServiceTemplate st = - ServiceTemplateWrapper.getInstance().getServiceTemplateById(servicetemplateid); - return Response.status(Response.Status.OK).entity(st).build(); - } catch (CatalogResourceException e1) { - logger.error("getServiceTemplateById failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - } - - - /** - * Query service template by filter conditions. - * @param status template status - * @param deletionPending delay to delete - * @return Response - */ - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query service template by filter conditions", - response = ServiceTemplate.class, responseContainer = "List") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getServiceTemplates( - @ApiParam(value = "template status") @QueryParam("status") EnumOperationalState status, - @ApiParam(value = "delay to delete") @QueryParam("deletionPending") boolean deletionPending) { - try { - ServiceTemplate[] sts = - ServiceTemplateWrapper.getInstance().getServiceTemplates(status, deletionPending); - return Response.status(Response.Status.OK).entity(sts).build(); - } catch (CatalogResourceException e1) { - logger.error("getServiceTemplates failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - - } - - /** - * Query nesting service template of a node type. - * @param nodeTypeIds node type ids - * @return Response - */ - @Path("/nesting") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query nesting service template of a node type", - response = ServiceTemplate.class, responseContainer = "List") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getNestingServiceTemplate(@ApiParam(value = "Node type ids splited by ','. Such as 'tosca.nodes.nfv.VDU,tosca.nodes.nfv.VL'.", - required = true) @QueryParam("nodeTypeIds") String nodeTypeIds) { - try { - if (ToolUtil.isTrimedEmptyString(nodeTypeIds)) { - throw new CatalogBadRequestException("nodeTypeIds is null."); - } - String[] tmpNodeTypeIds = nodeTypeIds.split(","); - ServiceTemplate[] sts = ServiceTemplateWrapper.getInstance() - .getNestingServiceTemplate(ToolUtil.trimedStringArray(tmpNodeTypeIds)); - return Response.status(Response.Status.OK).entity(sts).build(); - } catch (CatalogResourceException e1) { - logger.error("getNestingServiceTemplate failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } catch (CatalogBadRequestException e2) { - logger.error("getNestingServiceTemplate failed.", e2); - throw RestUtils.newBadRequestException(e2); - } - } - - /** - * Query raw data of a service template by csar id. - * @param queryCondition query condition - * @return Response - */ - @Path("/queryingrawdata") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query raw data of a service template by csar id", - response = ServiceTemplateRawData.class) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getServiceTemplateRawData( - @ApiParam(value = "Query Service Template Raw Data Condition", - required = true) QueryRawDataCondition queryCondition) { - try { - ServiceTemplateRawData stRowData = - ServiceTemplateWrapper.getInstance().getServiceTemplateRawData(queryCondition); - return Response.status(Response.Status.OK).entity(stRowData).build(); - } catch (CatalogResourceException e1) { - logger.error("getServiceTemplateRawData failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } catch (CatalogBadRequestException e2) { - logger.error("getServiceTemplateRawData failed.", e2); - throw RestUtils.newBadRequestException(e2); - } - } - - - /** - * Query operation list of service template. - * @param serviceTemplateId service template id - * @return Response - */ - @Path("/{serviceTemplateId}/operations") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query operation list of service template", - response = ServiceTemplateOperation.class, responseContainer = "List") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getServiceTemplateOperations(@ApiParam(value = "Service Template Id", - required = true) @PathParam("serviceTemplateId") String serviceTemplateId) { - try { - ServiceTemplateOperation[] operations = - ServiceTemplateWrapper.getInstance().getTemplateOperations(serviceTemplateId); - return Response.status(Response.Status.OK).entity(operations).build(); - } catch (CatalogResourceException e1) { - logger.error("getServiceTemplateOperations failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - - } - - /** - * Query input parameters of a specified operation. - * @param serviceTemplateId service template id - * @param operationName operation name - * @return Response - */ - @Path("/{serviceTemplateId}/operations/{operationName}/parameters") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query input parameters of a specified operation", - response = InputParameter.class, responseContainer = "List") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getParametersByOperationName( - @ApiParam(value = "Service Template Id", - required = true) @PathParam("serviceTemplateId") String serviceTemplateId, - @ApiParam(value = "Operation Name", - required = true) @PathParam("operationName") String operationName) { - try { - InputParameter[] inputs = ServiceTemplateWrapper.getInstance() - .getParametersByOperationName(serviceTemplateId, operationName); - return Response.status(Response.Status.OK).entity(inputs).build(); - } catch (CatalogResourceException e1) { - logger.error("getParametersByOperationId failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - - } - - /** - * Query input parameters of service template. - * @param servicetemplateid service template id - * @return Response - */ - @Path("/{servicetemplateid}/parameters") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query input parameters of service template", response = Parameters.class) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getServiceTemplateParameters(@ApiParam(value = "service template id", - required = true) @PathParam("servicetemplateid") String servicetemplateid) { - try { - Parameters parameters = - ServiceTemplateWrapper.getInstance().getServiceTemplateParameters(servicetemplateid); - return Response.status(Response.Status.OK).entity(parameters).build(); - } catch (CatalogResourceException e1) { - logger.error("getServiceTemplateParameters failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - - } - - /** - * Query node template list of a specified service template. - * @param serviceTemplateId service template id - * @param types node type - * @return Response - */ - @Path("/{serviceTemplateId}/nodetemplates") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query node template list of a specified service template", - response = NodeTemplate.class, responseContainer = "List") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getNodeTemplatesByType( - @ApiParam(value = "Service Template Id", - required = true) @PathParam("serviceTemplateId") String serviceTemplateId, - @ApiParam(value = "The type of node template") @QueryParam("types") String types) { - try { - String[] tmpTypes = getSplitedTypes(types); - NodeTemplate[] nts = ServiceTemplateWrapper.getInstance().getNodeTemplates(serviceTemplateId, - ToolUtil.trimedStringArray(tmpTypes)); - return Response.status(Response.Status.OK).entity(nts).build(); - } catch (CatalogResourceException e1) { - logger.error("getNodeTemplateList failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - - } - - - private String[] getSplitedTypes(String types) { - if (ToolUtil.isTrimedEmptyString(types)) { - return new String[0]; - } - - return types.split(","); - } - - /** - * Query node template by node template id. - * @param serviceTemplateId service template id - * @param nodeTemplateId node template id - * @return Response - */ - @Path("/{serviceTemplateId}/nodetemplates/{nodeTemplateId}") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Query node template by node template id", response = NodeTemplate.class) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response getNodeTemplateById( - @ApiParam(value = "Service Template Id", - required = true) @PathParam("serviceTemplateId") String serviceTemplateId, - @ApiParam(value = "Node Template Id", - required = true) @PathParam("nodeTemplateId") String nodeTemplateId) { - try { - NodeTemplate nt = ServiceTemplateWrapper.getInstance().getNodeTemplateById(serviceTemplateId, - nodeTemplateId); - return Response.status(Response.Status.OK).entity(nt).build(); - } catch (CatalogResourceException e1) { - logger.error("getNodeTemplateById failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - - } - - // /** - // * @param servicetemplateid - // * @return - // */ - // @Path("/{servicetemplateid}/nfvtemplate") - // @POST - // @Consumes(MediaType.APPLICATION_JSON) - // @Produces(MediaType.APPLICATION_JSON) - // @ApiOperation(value = - // "Query node template detail of a specified service template", response = - // NfvTemplate.class) - // @ApiResponses(value = { - // @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = - // "microservice not found", response = String.class), - // @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, message = - // "Unprocessable MicroServiceInfo Entity ", response = String.class), - // @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = - // "server internal error", response = CommonErrorResponse.class) }) - // @Timed - // public Response getNfvTemplate( - // @ApiParam(value = "service template id", required = true) - // @PathParam("servicetemplateid") String servicetemplateid) { - // try { - // NfvTemplate nfvTemplate = ServiceTemplateWrapper.getInstance() - // .getNfvTemplate(servicetemplateid); - // return Response.status(Response.Status.OK).entity(nfvTemplate) - // .build(); - // } catch (CatalogResourceException e) { - // logger.error("getNfvTemplate failed.", e); - // throw RestUtils.newInternalServerErrorException(e); - // } - // - // } - - /** - * test function. - * @return Response - */ - @Path("/test") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "test", response = String.class, responseContainer = "List") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = CommonErrorResponse.class)}) - @Timed - public Response test() { - try { - AbstractModelParser parser1 = new ToscaYamlModelParser(); - parser1.parse("pk11111", "C:\\Users\\10090474\\Downloads\\OpenO.csar"); - -// AbstractModelParser parser = new AriaModelParser(); -// parser.parse("pk11111", "/home/b/common-tosca-aria/blueprints/tosca/node-cellar.yaml"); - - ModelService.getInstance().delete("pk11111"); - - String[] strs = {"111", "222", null, null, "555"}; - return Response.status(Response.Status.OK).entity(strs).build(); - } catch (CatalogResourceException e1) { - logger.error("test failed.", e1); - throw RestUtils.newInternalServerErrorException(e1); - } - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java deleted file mode 100644 index 1f1e245f..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java +++ /dev/null @@ -1,484 +0,0 @@ -/** - * Copyright 2016-2017 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.wrapper; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.openo.commontosca.catalog.cometd.CometdException; -import org.openo.commontosca.catalog.cometd.CometdService; -import org.openo.commontosca.catalog.common.CommonConstant; -import org.openo.commontosca.catalog.common.HttpServerPathConfig; -import org.openo.commontosca.catalog.common.RestUtil; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.PackageManager; -import org.openo.commontosca.catalog.entity.request.PackageBasicInfo; -import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; -import org.openo.commontosca.catalog.entity.response.PackageMeta; -import org.openo.commontosca.catalog.entity.response.UploadPackageResponse; -import org.openo.commontosca.catalog.filemanage.FileManagerFactory; -import org.openo.commontosca.catalog.model.parser.ModelParserFactory; -import org.openo.commontosca.catalog.model.service.ModelService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PackageWrapper { - private static PackageWrapper packageWrapper; - private static final Logger LOG = LoggerFactory.getLogger(PackageWrapper.class); - - /** - * get PackageWrapper instance. - * @return package wrapper instance - */ - public static PackageWrapper getInstance() { - if (packageWrapper == null) { - packageWrapper = new PackageWrapper(); - } - return packageWrapper; - } - - /** - * query package by id. - * @param csarId package id - * @return Response - */ - public Response queryPackageById(String csarId) { - PackageData dbResult = new PackageData(); - PackageMeta result = new PackageMeta(); - dbResult = PackageWrapperUtil.getPackageInfoById(csarId); - result = PackageWrapperUtil.packageData2PackageMeta(dbResult); - return Response.ok(result).build(); - } - - /** - * upload package. - * @param uploadedInputStream inputStream - * @param fileDetail package detail - * @param head http header - * @return Response - * @throws Exception e - */ - public Response uploadPackage(InputStream uploadedInputStream, - FormDataContentDisposition fileDetail, HttpHeaders head) throws Exception { - int fileSize = 0; - if (uploadedInputStream == null) { - LOG.info("the uploadStream is null"); - return Response.serverError().build(); - } - if (fileDetail == null) { - LOG.info("the fileDetail is null"); - return Response.serverError().build(); - } - LOG.info("the fileDetail = " + ToolUtil.objectToString(fileDetail)); - String contentRange = null; - String fileName = ""; - fileName = ToolUtil.processFileName(fileDetail.getFileName()); - String tempDirName = null; - tempDirName = ToolUtil.getTempDir(CommonConstant.CATALOG_CSAR_DIR_NAME, fileName); - if (head != null) { - contentRange = head.getHeaderString(CommonConstant.HTTP_HEADER_CONTENT_RANGE); - } - LOG.info("store package chunk file, fileName:" + fileName + ",contentRange:" + contentRange); - if (ToolUtil.isEmptyString(contentRange)) { - fileSize = uploadedInputStream.available(); - contentRange = "0-" + fileSize + "/" + fileSize; - } - String fileLocation = - ToolUtil.storeChunkFileInLocal(tempDirName, fileName, uploadedInputStream); - LOG.info("the fileLocation when upload package is :" + fileLocation); - uploadedInputStream.close(); - - Boolean isEnd = PackageWrapperUtil.isUploadEnd(contentRange, fileName); - PackageData packateDbData = new PackageData(); - UploadPackageResponse result = new UploadPackageResponse(); - if (isEnd) { - PackageBasicInfo basicInfo = new PackageBasicInfo(); - basicInfo = PackageWrapperUtil.getPacageBasicInfo(fileLocation); - if (null == basicInfo.getType() || null == basicInfo.getProvider() - || null == basicInfo.getVersion()) { - LOG.error( - "Package basicInfo is incorrect ! basicIonfo = " + ToolUtil.objectToString(basicInfo)); - return Response.serverError().build(); - } - String path = - basicInfo.getType().toString() + File.separator + basicInfo.getProvider() + File.separator - + fileName.replace(".csar", "") + File.separator + basicInfo.getVersion(); - LOG.info("dest path is : " + path); - PackageMeta packageMeta = new PackageMeta(); - packageMeta = PackageWrapperUtil.getPackageMeta(fileName, fileLocation, basicInfo); - String dowloadUri = File.separator + path + File.separator; - packageMeta.setDownloadUri(dowloadUri); - LOG.info("packageMeta = " + ToolUtil.objectToString(packageMeta)); - - String serviceTemplateId = null; - PackageData packageData = PackageWrapperUtil.getPackageData(packageMeta); - String destPath = File.separator + path; - boolean uploadResult = FileManagerFactory.createFileManager().upload(tempDirName, destPath); - if (uploadResult == true) { - List<PackageData> existPackageDatas = - PackageManager.getInstance().queryPackage(packageData.getName(), - packageData.getProvider(), packageData.getVersion(), null, packageData.getType()); - if (null != existPackageDatas && existPackageDatas.size() > 0 - && existPackageDatas.get(0).getOnBoardState().equals("onBoarded")) { - LOG.error("Package onboarded. Can not be reupload! onBoardState = " - + existPackageDatas.get(0).getOnBoardState()); - return Response.serverError().build(); - } - packateDbData = PackageManager.getInstance().addPackage(packageData); - LOG.info("Store package data to database succed ! packateDbData = " - + ToolUtil.objectToString(packateDbData)); - try { - //undeploy operation package of the old csar. - if (null != existPackageDatas && existPackageDatas.size() > 0) { - LOG.info("undeploy operation package of the old csar package."); - for (int i = 0; i < existPackageDatas.size(); i++) { - ModelService.getInstance().undeployOperationPackage(existPackageDatas.get(i).getCsarId()); - } - } - - String tempCsarPath = tempDirName + File.separator + fileName; - serviceTemplateId = ModelParserFactory.getInstance().parse(packateDbData.getCsarId(), - tempCsarPath, PackageWrapperUtil.getPackageFormat(packateDbData.getFormat())); - LOG.info("Package parse success ! serviceTemplateId = " + serviceTemplateId); - } catch (Exception e1) { - LOG.error("Parse package error ! Delete the package data from database"); - //String packagePath = PackageWrapperUtil.getPackagePath(packageData.getCsarId()); - //FileManagerFactory.createFileManager().delete(packagePath); - //if (tempDirName != null) { - //ToolUtil.deleteDir(new File(tempDirName)); - //} - PackageManager.getInstance().deletePackage(packateDbData.getCsarId()); - throw new Exception(e1); - } - - if (null != packateDbData && null == serviceTemplateId) { - LOG.info("Service template Id is null !"); - PackageManager.getInstance().deletePackage(packateDbData.getCsarId()); - } - //delete the redundant package data and template data while reupload the same package success. - if (null != existPackageDatas && existPackageDatas.size() > 0) { - LOG.warn("The package already exist ! Begin to delete the orgin data and reupload !"); - for (int i = 0; i < existPackageDatas.size(); i++) { - this.delPackageTemplateData(existPackageDatas.get(i).getCsarId()); - } - } - LOG.info("upload package file end, fileName:" + fileName); - result.setCsarId(packateDbData.getCsarId()); - if (tempDirName != null) { - ToolUtil.deleteDir(new File(tempDirName)); - } - } - } - return Response.ok(result).build(); - } - - - private void delPackageTemplateData(String csarId) { - String packagePath = PackageWrapperUtil.getPackagePath(csarId); - if (packagePath == null) { - LOG.error("package path is null! "); - return; - } - // delete template data from db - try { - ModelService.getInstance().deleteServiceTemplateData(csarId); - } catch (CatalogResourceException e2) { - LOG.error("delete template data from db error! csarId = " + csarId, e2); - return; - } - //delete package data from database - try { - PackageManager.getInstance().deletePackage(csarId); - } catch (CatalogResourceException e1) { - LOG.error("delete package by csarId from db error ! " + e1.getMessage(), e1); - return; - } - } - - /** - * delete package by package id. - * @param csarId package id - * @return Response - */ - public Response delPackage(String csarId) { - LOG.info("delete package info.csarId:" + csarId); - if (ToolUtil.isEmptyString(csarId)) { - LOG.error("delete package fail, csarid is null"); - return Response.serverError().build(); - } - try { - DelCsarThread thread = new DelCsarThread(csarId, false); - PackageData packageData = new PackageData(); - packageData.setProcessState(CommonConstant.PACKAGE_STATUS_DELETING); - PackageManager.getInstance().updatePackage(packageData, csarId); - new Thread(thread).start(); - return Response.noContent().build(); - } catch (Exception e1) { - LOG.error("delete fail." + e1.getMessage()); - PackageData packageData = new PackageData(); - packageData.setProcessState(CommonConstant.PACKAGE_STATUS_DELETE_FAIL); - try { - PackageManager.getInstance().updatePackage(packageData, csarId); - } catch (CatalogResourceException e2) { - LOG.error("Update package data failed." + e2.getMessage(), e2); - } - return RestUtil.getRestException(e1.getMessage()); - } - } - - private void publishDeletionPendingStatusCometdMessage(String csarid) { - try { - Map<String, Object> cometdMessage = new HashMap<String, Object>(); - cometdMessage.put("csarid", csarid); - cometdMessage.put("status", "deletionPending"); - CometdService.getInstance().publish(CommonConstant.COMETD_CHANNEL_PACKAGE_DELETE, - cometdMessage); - } catch (CometdException e1) { - LOG.error("publish delfinish cometdmsg fail.", e1); - } - } - - class DelCsarThread implements Runnable { - private String csarid; - private boolean isInstanceTemplate = false; - - public DelCsarThread(String csarid, boolean isInstanceTemplate) { - this.csarid = csarid; - this.isInstanceTemplate = isInstanceTemplate; - } - - @Override - public void run() { - try { - if (!ToolUtil.isEmptyString(csarid)) { - delCsarData(csarid); - } - } catch (Exception e1) { - LOG.error("del instance csar fail. " + e1.getMessage(), e1); - updatePackageStatus(csarid, null, null, null, CommonConstant.PACKAGE_STATUS_DELETE_FAIL, - null); - publishDelFinishCometdMessage(csarid, "false"); - } - } - - private void delCsarData(String csarId) { - updatePackageStatus(csarId, null, null, null, CommonConstant.PACKAGE_STATUS_DELETING, null); - String packagePath = PackageWrapperUtil.getPackagePath(csarId); - if (packagePath == null) { - LOG.error("package path is null! "); - return; - } - boolean delFileFromHttp = FileManagerFactory.createFileManager().delete(packagePath); - // delete template data from db - try { - ModelService.getInstance().delete(csarId); - } catch (CatalogResourceException e2) { - LOG.error("delete template data from db error! csarId = " + csarId, e2); - publishDelFinishCometdMessage(csarId, "Delete template data failed! " + e2.getMessage()); - return; - } - //delete package data from database - try { - PackageManager.getInstance().deletePackage(csarId); - } catch (CatalogResourceException e1) { - LOG.error("delete package by csarId from db error ! " + e1.getMessage(), e1); - publishDelFinishCometdMessage(csarId, "Delete package data failed! " + e1.getMessage()); - return; - } - publishDelFinishCometdMessage(csarId, "true"); - } - - private void publishDelFinishCometdMessage(String csarId, String csarDelStatus) { - if (isInstanceTemplate) { - LOG.info("delete instance Template finish. csarid:{}", csarId); - return; - } - try { - Map<String, Object> cometdMessage = new HashMap<String, Object>(); - cometdMessage.put("csarid", csarId); - cometdMessage.put("status", csarDelStatus); - CometdService.getInstance().publish(CommonConstant.COMETD_CHANNEL_PACKAGE_DELETE, - cometdMessage); - } catch (CometdException e1) { - LOG.error("publish delfinish cometdmsg fail." + e1.getMessage(), e1); - } - } - } - - /** - * update package status. - * @param csarId package id - * @param operationalState package operational state - * @param usageState package usage state - * @param onBoardState package onboard state - * @param processState package process state - * @param deletionPending package deletionPending status - * @return Response - */ - public Response updatePackageStatus(String csarId, String operationalState, String usageState, - String onBoardState, String processState, String deletionPending) { - LOG.info("update package status info.csarId:" + csarId + " operationalState:" + operationalState - + "usageState:" + usageState + "onBoardState:" + onBoardState + "processState:" - + processState + "deletionPending" + deletionPending); - if (ToolUtil.isEmptyString(csarId)) { - LOG.error("update csar status fail, csarid is null"); - return Response.serverError().build(); - } - try { - // UpdatePackageResponse result = new UpdatePackageResponse(); - PackageData packageInfo = new PackageData(); - if (operationalState != null) { - packageInfo.setOperationalState(operationalState); - } - if (usageState != null) { - packageInfo.setUsageState(usageState); - } - if (onBoardState != null) { - packageInfo.setOnBoardState(onBoardState); - } - if (processState != null) { - packageInfo.setProcessState(processState); - } - if (deletionPending != null) { - packageInfo.setDeletionPending(deletionPending); - } - SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String currentTime = sdf1.format(new Date()); - packageInfo.setModifyTime(currentTime); - PackageManager.getInstance().updatePackage(packageInfo, csarId); - // ArrayList<PackageData> pacackgeList = PackageWrapperUtil.getPackageInfoById(csarId); - // String finalUsageState = pacackgeList.get(0).getUsageState(); - // result.setUsageState(finalUsageState); - return Response.ok().build(); - } catch (CatalogResourceException e1) { - LOG.error("update package status by csarId from db error ! " + e1.getMessage()); - return RestUtil.getRestException(e1.getMessage()); - } - } - - /** - * download package by package id. - * @param csarId package id - * @return Response - */ - public Response downloadCsarPackagesById(String csarId) { - PackageData packageData = PackageWrapperUtil.getPackageInfoById(csarId); - String packageName = null; - packageName = packageData.getName(); - String path = ToolUtil.getCatalogueCsarPath() + File.separator + packageName; - File csarFile = new File(path); - if (!csarFile.exists()) { - return Response.status(Status.NOT_FOUND).build(); - } - - try { - InputStream fis = new BufferedInputStream(new FileInputStream(path)); - return Response.ok(fis) - .header("Content-Disposition", "attachment; filename=\"" + csarFile.getName() + "\"") - .build(); - } catch (Exception e1) { - LOG.error("download vnf package fail.", e1); - return RestUtil.getRestException(e1.getMessage()); - } - } - - /** - * query package list by condition. - * @param name package name - * @param provider package provider - * @param version package version - * @param deletionPending package deletionPending - * @param type package type - * @return Response - */ - public Response queryPackageListByCond(String name, String provider, String version, - String deletionPending, String type) { - ArrayList<PackageData> dbresult = new ArrayList<PackageData>(); - ArrayList<PackageMeta> result = new ArrayList<PackageMeta>(); - LOG.info("query package info.name:" + name + " provider:" + provider + " version" + version - + " deletionPending" + deletionPending + " type:" + type); - try { - dbresult = - PackageManager.getInstance().queryPackage(name, provider, version, deletionPending, type); - result = PackageWrapperUtil.packageDataList2PackageMetaList(dbresult); - return Response.ok(result).build(); - } catch (CatalogResourceException e1) { - LOG.error("query package by csarId from db error ! " + e1.getMessage()); - return RestUtil.getRestException(e1.getMessage()); - } - } - - /** - * get package file uri. - * @param csarId package id - * @param relativePath file relative path - * @return Response - */ - public Response getCsarFileUri(String csarId, String relativePath) { - try { - CsarFileUriResponse result = getCsarFileDownloadUri(csarId, relativePath); - return Response.ok(result).build(); - } catch (CatalogResourceException e1) { - LOG.error("Query CSAR package by ID failed ! csarId = " + csarId); - } - - return Response.serverError().build(); - } - - /** - * get package file download uri. - * @param csarId package id - * @param relativePath package file relative path - * @return CsarFileUriResponse - * @throws CatalogResourceException e - */ - public CsarFileUriResponse getCsarFileDownloadUri(String csarId, String relativePath) - throws CatalogResourceException { - CsarFileUriResponse result = new CsarFileUriResponse(); - String downloadUrl = null; - String downloadUri = null; - String localPath = null; - ArrayList<PackageData> packageList = PackageManager.getInstance().queryPackageByCsarId(csarId); - if (packageList != null && packageList.size() != 0) { - String packageName = packageList.get(0).getName(); - String relativeUri = packageList.get(0).getDownloadUri() + packageName; - downloadUri = relativeUri + relativePath; - downloadUrl = PackageWrapperUtil.getUrl(downloadUri); - String httpUri = HttpServerPathConfig.getHttpServerPath() + downloadUri; - localPath = PackageWrapperUtil.getLocalPath(httpUri); - } - result.setDownloadUri(downloadUrl); - result.setLocalPath(localPath); - return result; - } - - -} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java deleted file mode 100644 index abb890c2..00000000 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java +++ /dev/null @@ -1,456 +0,0 @@ -/** - * Copyright 2016-2017 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.wrapper; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; - -import org.openo.commontosca.catalog.common.CommonConstant; -import org.openo.commontosca.catalog.common.FileUtil; -import org.openo.commontosca.catalog.common.HttpServerAddrConfig; -import org.openo.commontosca.catalog.common.MsbAddrConfig; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.PackageManager; -import org.openo.commontosca.catalog.entity.CsarPackage; -import org.openo.commontosca.catalog.entity.EnumOnboardState; -import org.openo.commontosca.catalog.entity.EnumOperationalState; -import org.openo.commontosca.catalog.entity.EnumProcessState; -import org.openo.commontosca.catalog.entity.EnumType; -import org.openo.commontosca.catalog.entity.EnumUsageState; -import org.openo.commontosca.catalog.entity.request.PackageBasicInfo; -import org.openo.commontosca.catalog.entity.response.PackageMeta; -import org.openo.commontosca.catalog.ftp.Ftp; -import org.openo.commontosca.catalog.ftp.FtpUtil; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.externalservice.entity.lifecycle.InstanceEntity; -import org.openo.commontosca.catalog.model.externalservice.lifecycle.LifeCycleServiceConsumer; -import org.openo.commontosca.catalog.model.parser.EnumPackageFormat; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.List; - -import javax.ws.rs.NotFoundException; - -public class PackageWrapperUtil { - private static final Logger LOG = LoggerFactory.getLogger(PackageWrapperUtil.class); - - - /** - * change json to object list. - * @param packageJson json - * @return package list - */ - public static List<CsarPackage> formJson2Packages(String packageJson) { - List<CsarPackage> packageList = - new Gson().fromJson(packageJson, new TypeToken<List<CsarPackage>>() {}.getType()); - if (null == packageList || packageList.size() == 0) { - throw new NotFoundException("Package do not exist"); - } - return packageList; - } - - public static long getPacakgeSize(String fileLocation) { - File file = new File(fileLocation); - return file.length(); - } - - /** - * change package metadata to fix database. - * @param meta package metadata - * @return package data in database - */ - public static PackageData getPackageData(PackageMeta meta) { - PackageData packageData = new PackageData(); - packageData.setCreateTime(meta.getCreateTime()); - packageData.setDeletionPending(String.valueOf(meta.isDeletionPending())); - packageData.setDownloadUri(meta.getDownloadUri()); - packageData.setFormat(meta.getFormat()); - packageData.setModifyTime(meta.getModifyTime()); - packageData.setName(meta.getName()); - packageData.setCsarId(meta.getCsarId()); - packageData.setOperationalState(meta.getOperationalState().toString()); - packageData.setProvider(meta.getProvider()); - String fileSize = meta.getSize(); - packageData.setSize(fileSize); - packageData.setType(meta.getType()); - packageData.setUsageState(meta.getUsageState().toString()); - packageData.setVersion(meta.getVersion()); - packageData.setOnBoardState(meta.getOnBoardState()); - packageData.setProcessState(meta.getProcessState().toString()); - return packageData; - } - - /** - * judge wether is the end of upload package. - * @param contentRange package sise range - * @param csarName package name - * @return boolean - */ - public static boolean isUploadEnd(String contentRange, String csarName) { - String range = contentRange; - range = range.replace("bytes", "").trim(); - range = range.substring(0, range.indexOf("/")); - String size = - contentRange.substring(contentRange.indexOf("/") + 1, contentRange.length()).trim(); - int fileSize = Integer.parseInt(size); - String[] ranges = range.split("-"); - int startPosition = Integer.parseInt(ranges[0]); - if (startPosition == 0) { - // delPackageBySync(csarName); - } - // index start from 0 - int endPosition = Integer.parseInt(ranges[1]) + 1; - if (endPosition >= fileSize) { - return true; - } - return false; - } - - /** - * get package detail by package id. - * @param csarId package id - * @return package detail - */ - public static PackageData getPackageInfoById(String csarId) { - PackageData result = new PackageData(); - ArrayList<PackageData> packageDataList = new ArrayList<PackageData>(); - try { - packageDataList = PackageManager.getInstance().queryPackageByCsarId(csarId); - if (packageDataList != null && packageDataList.size() > 0) { - result = PackageManager.getInstance().queryPackageByCsarId(csarId).get(0); - } - } catch (CatalogResourceException e1) { - LOG.error("query package by csarId from db error ! " + e1.getMessage()); - } - return result; - } - - /** - * get package metadata from basic info. - * @param fileName package name - * @param fileLocation the location of package - * @param basic basic infomation of package. include version, type and provider - * @return package metadata - */ - public static PackageMeta getPackageMeta(String fileName, String fileLocation, - PackageBasicInfo basic) { - PackageMeta packageMeta = new PackageMeta(); - long size = getPacakgeSize(fileLocation); - packageMeta.setFormat(basic.getFormat()); - String packageId = ToolUtil.generateId(); - packageMeta.setName(fileName.replace(CommonConstant.CSAR_SUFFIX, "")); - packageMeta.setCsarId(packageId); - packageMeta.setType(basic.getType().toString()); - packageMeta.setVersion(basic.getVersion()); - packageMeta.setProvider(basic.getProvider()); - packageMeta.setDeletionPending(false); - String sizeStr = ToolUtil.getFormatFileSize(size); - packageMeta.setSize(sizeStr); - SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String currentTime = sdf1.format(new Date()); - packageMeta.setCreateTime(currentTime); - packageMeta.setModifyTime(currentTime); - packageMeta.setOperationalState(EnumOperationalState.Disabled); - packageMeta.setUsageState(EnumUsageState.NotInUse); - packageMeta.setOnBoardState(EnumOnboardState.nonOnBoarded.getValue()); - packageMeta.setProcessState(EnumProcessState.normal); - return packageMeta; - } - - /** - * get downloadUri from package metadata. - * @param csarId package id - * @return download uri - */ - public static String getPackagePath(String csarId) { - ArrayList<PackageData> packageList = new ArrayList<PackageData>(); - String downloadUri = null; - try { - packageList = PackageManager.getInstance().queryPackageByCsarId(csarId); - downloadUri = packageList.get(0).getDownloadUri(); - } catch (CatalogResourceException e1) { - LOG.error("Query CSAR package by ID failed ! csarId = " + csarId); - } - return downloadUri; - } - - - /** - * convert instance to hashset. - * @param instancelist instance list - * @return HashSet - */ - public static HashSet<String> instanceConvertToHashSet(ArrayList<InstanceEntity> instancelist) { - HashSet<String> result = new HashSet<String>(); - if (instancelist != null) { - for (InstanceEntity instance : instancelist) { - result.add(instance.getServiceTemplateId()); - } - } - return result; - } - - /** - * get ftp detail information. - * @param ftpUrl ftp url - * @return ftp detail - */ - public static Ftp getFtpDetail(String ftpUrl) { - Ftp ftp = new Ftp(); - int index1 = ftpUrl.indexOf("ftp://"); - int index2 = ftpUrl.indexOf("@"); - String userPassSubString = ftpUrl.substring(index1, index2); - int index3 = userPassSubString.indexOf(":"); - String userName = userPassSubString.substring(0, index3); - String pass = userPassSubString.substring(index3 + 1); - String subString1 = ftpUrl.substring(index2 + 1); - int index4 = subString1.indexOf("/"); - String ipPortSubString = subString1.substring(0, index4); - int index5 = ipPortSubString.indexOf(":"); - String ip = ipPortSubString.substring(0, index5); - String port = ipPortSubString.substring(index5 + 1); - int index6 = ftpUrl.lastIndexOf("/"); - String path = ftpUrl.substring(0, index6); - ftp.setIpAddr(ip); - ftp.setPath(path); - ftp.setPort(Integer.valueOf(port)); - ftp.setPwd(pass); - ftp.setUserName(userName); - return ftp; - } - - /** - * get package name from ftpUrl. - * @param ftpUrl ftp url - * @return package name - */ - public static String getPackageName(String ftpUrl) { - int index = ftpUrl.lastIndexOf("/"); - String packageName = ftpUrl.substring(index); - return packageName; - } - - /** - * download package from ftp. - * @param ftpUrl ftp url - * @param tempDirName temp directory - */ - public static void downPackageFromFtp(String ftpUrl, String tempDirName) { - Ftp ftp = new Ftp(); - ftp = PackageWrapperUtil.getFtpDetail(ftpUrl); - String remoteBaseDir = ftp.getPath(); - try { - FtpUtil.startDown(ftp, tempDirName, remoteBaseDir); - } catch (Exception e1) { - LOG.error("Down package from ftp failed !"); - } - } - - /** - * translate package data from database to package metadata. - * @param dbResult data from database - * @return package metadata list - */ - public static ArrayList<PackageMeta> packageDataList2PackageMetaList( - ArrayList<PackageData> dbResult) { - ArrayList<PackageMeta> metas = new ArrayList<PackageMeta>(); - PackageMeta meta = new PackageMeta(); - if (dbResult.size() > 0) { - for (int i = 0; i < dbResult.size(); i++) { - PackageData data = dbResult.get(i); - meta = packageData2PackageMeta(data); - metas.add(meta); - } - } - return metas; - } - - /** - * get onboarded enum value. - * @param value onboard value - * @return enum - */ - public static EnumOnboardState getEnumByValue(String value) { - if (value == "non-onBoarded") { - return EnumOnboardState.nonOnBoarded; - } else { - return EnumOnboardState.onBoarded; - } - } - - public static PackageMeta packageData2PackageMeta(PackageData packageData) { - PackageMeta meta = new PackageMeta(); - meta.setCsarId(packageData.getCsarId()); - meta.setCreateTime(packageData.getCreateTime()); - meta.setDeletionPending(Boolean.valueOf(packageData.getDeletionPending())); - String packageUri = - packageData.getDownloadUri() + packageData.getName() + CommonConstant.CSAR_SUFFIX; - String packageUrl = getUrl(packageUri); - meta.setDownloadUri(packageUrl); - meta.setFormat(packageData.getFormat()); - meta.setModifyTime(packageData.getModifyTime()); - meta.setName(packageData.getName()); - meta.setOperationalState(EnumOperationalState.valueOf(packageData.getOperationalState())); - meta.setProvider(packageData.getProvider()); - meta.setSize(packageData.getSize()); - meta.setType(packageData.getType()); - meta.setUsageState(EnumUsageState.valueOf(packageData.getUsageState())); - meta.setVersion(packageData.getVersion()); - meta.setOnBoardState(packageData.getOnBoardState()); - String processState = packageData.getProcessState(); - if (processState.equals("deletefail")) { - processState = "deleteFailed"; - } - meta.setProcessState(EnumProcessState.valueOf(processState)); - return meta; - } - - /** - * add msb address as prefix to uri. - * @param uri uri - * @return url - */ - public static String getUrl(String uri) { - String url = null; -// if ((MsbAddrConfig.getMsbAddress().endsWith("/")) && uri.startsWith("/")) { -// url = MsbAddrConfig.getMsbAddress() + uri.substring(1); -// } -// url = MsbAddrConfig.getMsbAddress() + uri; - if ((getDownloadUriHead().endsWith("/")) && uri.startsWith("/")) { - url = getDownloadUriHead() + uri.substring(1); - } - url = getDownloadUriHead() + uri; - String urlresult = url.replace("\\", "/"); - return urlresult; - } - - public static String getDownloadUriHead() { - return MsbAddrConfig.getMsbAddress() + "/files/catalog-http"; - } - - /** - * get local path. - * @param uri uri - * @return local path - */ - public static String getLocalPath(String uri) { - File srcDir = new File(uri); - String localPath = srcDir.getAbsolutePath(); - return localPath.replace("\\", "/"); - } - - /** - * get package basic information. - * @param fileLocation package location - * @return package basic information - */ - public static PackageBasicInfo getPacageBasicInfo(String fileLocation) { - PackageBasicInfo basicInfo = new PackageBasicInfo(); - String unzipDir = ToolUtil.getUnzipDir(fileLocation); - boolean isXmlCsar = false; - try { - String tempfolder = unzipDir; - ArrayList<String> unzipFiles = FileUtil.unzip(fileLocation, tempfolder); - if (unzipFiles.isEmpty()) { - isXmlCsar = true; - } - for (String unzipFile : unzipFiles) { - if (unzipFile.endsWith(CommonConstant.CSAR_META)) { - basicInfo = readCsarMeta(unzipFile); - } - if (ToolUtil.isYamlFile(new File(unzipFile))) { - isXmlCsar = false; - } - } - } catch (IOException e1) { - LOG.error("judge package type error ! " + e1.getMessage()); - } - if (isXmlCsar) { - basicInfo.setFormat(CommonConstant.PACKAGE_XML_FORMAT); - } else { - basicInfo.setFormat(CommonConstant.PACKAGE_YAML_FORMAT); - } - return basicInfo; - } - - private static PackageBasicInfo readCsarMeta(String unzipFile) { - PackageBasicInfo basicInfo = new PackageBasicInfo(); - File file = new File(unzipFile); - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader(file)); - String tempString = null; - while ((tempString = reader.readLine()) != null) { - if (!tempString.equals("")) { - int count1 = tempString.indexOf(":"); - String meta = tempString.substring(0, count1).trim(); - if (meta.equalsIgnoreCase(CommonConstant.CSAR_TYPE_META)) { - int count = tempString.indexOf(":") + 1; - basicInfo.setType(EnumType.valueOf(tempString.substring(count).trim())); - } - if (meta.equalsIgnoreCase(CommonConstant.CSAR_PROVIDER_META)) { - int count = tempString.indexOf(":") + 1; - basicInfo.setProvider(tempString.substring(count).trim()); - } - if (meta.equalsIgnoreCase(CommonConstant.CSAR_VERSION_META)) { - int count = tempString.indexOf(":") + 1; - basicInfo.setVersion(tempString.substring(count).trim()); - } - } - } - reader.close(); - } catch (IOException e2) { - e2.printStackTrace(); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e1) { - LOG.error("close reader failed ! " + e1.getMessage()); - } - } - } - return basicInfo; - } - - /** - * get package format enum. - * @param format package format - * @return package format enum - */ - public static EnumPackageFormat getPackageFormat(String format) { - if (format.equals("xml")) { - return EnumPackageFormat.TOSCA_XML; - } else if (format.equals("yml") || format.equals("yaml")) { - return EnumPackageFormat.TOSCA_YAML; - } else { - return null; - } - } -} diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF b/catalog-core/catalog-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF deleted file mode 100644 index eaf90a94..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Created-By: 1.7.0_72 (Oracle Corporation) - diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/WEB-INF/web.xml b/catalog-core/catalog-mgr/src/main/resources/api-doc/WEB-INF/web.xml deleted file mode 100644 index 2a5346c4..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<web-app xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee - http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" - version="3.0" - metadata-complete="true"> - - <description> - ZENAP API-DOC. - </description> - <display-name>ZENAP API-DOC</display-name> - <!-- Define example filters --> - - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - <welcome-file>index.xhtml</welcome-file> - <welcome-file>index.htm</welcome-file> - <welcome-file>index.jsp</welcome-file> - </welcome-file-list> - -</web-app> - diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/css/reset.css b/catalog-core/catalog-mgr/src/main/resources/api-doc/css/reset.css deleted file mode 100644 index d4945322..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/css/reset.css +++ /dev/null @@ -1,140 +0,0 @@ -/**
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
-html,
-body,
-div,
-span,
-applet,
-object,
-iframe,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-p,
-blockquote,
-pre,
-a,
-abbr,
-acronym,
-address,
-big,
-cite,
-code,
-del,
-dfn,
-em,
-img,
-ins,
-kbd,
-q,
-s,
-samp,
-small,
-strike,
-strong,
-sub,
-sup,
-tt,
-var,
-b,
-u,
-i,
-center,
-dl,
-dt,
-dd,
-ol,
-ul,
-li,
-fieldset,
-form,
-label,
-legend,
-table,
-caption,
-tbody,
-tfoot,
-thead,
-tr,
-th,
-td,
-article,
-aside,
-canvas,
-details,
-embed,
-figure,
-figcaption,
-footer,
-header,
-hgroup,
-menu,
-nav,
-output,
-ruby,
-section,
-summary,
-time,
-mark,
-audio,
-video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-/* HTML5 display-role reset for older browsers */
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-menu,
-nav,
-section {
- display: block;
-}
-body {
- line-height: 1;
-}
-ol,
-ul {
- list-style: none;
-}
-blockquote,
-q {
- quotes: none;
-}
-blockquote:before,
-blockquote:after,
-q:before,
-q:after {
- content: '';
- content: none;
-}
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/css/screen.css b/catalog-core/catalog-mgr/src/main/resources/api-doc/css/screen.css deleted file mode 100644 index caeace3d..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/css/screen.css +++ /dev/null @@ -1,1271 +0,0 @@ -/**
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
-.swagger-section pre code {
- display: block;
- padding: 0.5em;
- background: #F0F0F0;
-}
-.swagger-section pre code,
-.swagger-section pre .subst,
-.swagger-section pre .tag .title,
-.swagger-section pre .lisp .title,
-.swagger-section pre .clojure .built_in,
-.swagger-section pre .nginx .title {
- color: black;
-}
-.swagger-section pre .string,
-.swagger-section pre .title,
-.swagger-section pre .constant,
-.swagger-section pre .parent,
-.swagger-section pre .tag .value,
-.swagger-section pre .rules .value,
-.swagger-section pre .rules .value .number,
-.swagger-section pre .preprocessor,
-.swagger-section pre .ruby .symbol,
-.swagger-section pre .ruby .symbol .string,
-.swagger-section pre .aggregate,
-.swagger-section pre .template_tag,
-.swagger-section pre .django .variable,
-.swagger-section pre .smalltalk .class,
-.swagger-section pre .addition,
-.swagger-section pre .flow,
-.swagger-section pre .stream,
-.swagger-section pre .bash .variable,
-.swagger-section pre .apache .tag,
-.swagger-section pre .apache .cbracket,
-.swagger-section pre .tex .command,
-.swagger-section pre .tex .special,
-.swagger-section pre .erlang_repl .function_or_atom,
-.swagger-section pre .markdown .header {
- color: #800;
-}
-.swagger-section pre .comment,
-.swagger-section pre .annotation,
-.swagger-section pre .template_comment,
-.swagger-section pre .diff .header,
-.swagger-section pre .chunk,
-.swagger-section pre .markdown .blockquote {
- color: #888;
-}
-.swagger-section pre .number,
-.swagger-section pre .date,
-.swagger-section pre .regexp,
-.swagger-section pre .literal,
-.swagger-section pre .smalltalk .symbol,
-.swagger-section pre .smalltalk .char,
-.swagger-section pre .go .constant,
-.swagger-section pre .change,
-.swagger-section pre .markdown .bullet,
-.swagger-section pre .markdown .link_url {
- color: #080;
-}
-.swagger-section pre .label,
-.swagger-section pre .javadoc,
-.swagger-section pre .ruby .string,
-.swagger-section pre .decorator,
-.swagger-section pre .filter .argument,
-.swagger-section pre .localvars,
-.swagger-section pre .array,
-.swagger-section pre .attr_selector,
-.swagger-section pre .important,
-.swagger-section pre .pseudo,
-.swagger-section pre .pi,
-.swagger-section pre .doctype,
-.swagger-section pre .deletion,
-.swagger-section pre .envvar,
-.swagger-section pre .shebang,
-.swagger-section pre .apache .sqbracket,
-.swagger-section pre .nginx .built_in,
-.swagger-section pre .tex .formula,
-.swagger-section pre .erlang_repl .reserved,
-.swagger-section pre .prompt,
-.swagger-section pre .markdown .link_label,
-.swagger-section pre .vhdl .attribute,
-.swagger-section pre .clojure .attribute,
-.swagger-section pre .coffeescript .property {
- color: #8888ff;
-}
-.swagger-section pre .keyword,
-.swagger-section pre .id,
-.swagger-section pre .phpdoc,
-.swagger-section pre .title,
-.swagger-section pre .built_in,
-.swagger-section pre .aggregate,
-.swagger-section pre .css .tag,
-.swagger-section pre .javadoctag,
-.swagger-section pre .phpdoc,
-.swagger-section pre .yardoctag,
-.swagger-section pre .smalltalk .class,
-.swagger-section pre .winutils,
-.swagger-section pre .bash .variable,
-.swagger-section pre .apache .tag,
-.swagger-section pre .go .typename,
-.swagger-section pre .tex .command,
-.swagger-section pre .markdown .strong,
-.swagger-section pre .request,
-.swagger-section pre .status {
- font-weight: bold;
-}
-.swagger-section pre .markdown .emphasis {
- font-style: italic;
-}
-.swagger-section pre .nginx .built_in {
- font-weight: normal;
-}
-.swagger-section pre .coffeescript .javascript,
-.swagger-section pre .javascript .xml,
-.swagger-section pre .tex .formula,
-.swagger-section pre .xml .javascript,
-.swagger-section pre .xml .vbscript,
-.swagger-section pre .xml .css,
-.swagger-section pre .xml .cdata {
- opacity: 0.5;
-}
-.swagger-section .swagger-ui-wrap {
- line-height: 1;
- font-family: "Droid Sans", sans-serif;
- max-width: 960px;
- margin-left: auto;
- margin-right: auto;
-}
-.swagger-section .swagger-ui-wrap b,
-.swagger-section .swagger-ui-wrap strong {
- font-family: "Droid Sans", sans-serif;
- font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap q,
-.swagger-section .swagger-ui-wrap blockquote {
- quotes: none;
-}
-.swagger-section .swagger-ui-wrap p {
- line-height: 1.4em;
- padding: 0 0 10px;
- color: #333333;
-}
-.swagger-section .swagger-ui-wrap q:before,
-.swagger-section .swagger-ui-wrap q:after,
-.swagger-section .swagger-ui-wrap blockquote:before,
-.swagger-section .swagger-ui-wrap blockquote:after {
- content: none;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu h1,
-.swagger-section .swagger-ui-wrap .heading_with_menu h2,
-.swagger-section .swagger-ui-wrap .heading_with_menu h3,
-.swagger-section .swagger-ui-wrap .heading_with_menu h4,
-.swagger-section .swagger-ui-wrap .heading_with_menu h5,
-.swagger-section .swagger-ui-wrap .heading_with_menu h6 {
- display: block;
- clear: none;
- float: left;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -ms-box-sizing: border-box;
- box-sizing: border-box;
- width: 60%;
-}
-.swagger-section .swagger-ui-wrap table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-.swagger-section .swagger-ui-wrap table thead tr th {
- padding: 5px;
- font-size: 0.9em;
- color: #666666;
- border-bottom: 1px solid #999999;
-}
-.swagger-section .swagger-ui-wrap table tbody tr:last-child td {
- border-bottom: none;
-}
-.swagger-section .swagger-ui-wrap table tbody tr.offset {
- background-color: #f0f0f0;
-}
-.swagger-section .swagger-ui-wrap table tbody tr td {
- padding: 6px;
- font-size: 0.9em;
- border-bottom: 1px solid #cccccc;
- vertical-align: top;
- line-height: 1.3em;
-}
-.swagger-section .swagger-ui-wrap ol {
- margin: 0px 0 10px;
- padding: 0 0 0 18px;
- list-style-type: decimal;
-}
-.swagger-section .swagger-ui-wrap ol li {
- padding: 5px 0px;
- font-size: 0.9em;
- color: #333333;
-}
-.swagger-section .swagger-ui-wrap ol,
-.swagger-section .swagger-ui-wrap ul {
- list-style: none;
-}
-.swagger-section .swagger-ui-wrap h1 a,
-.swagger-section .swagger-ui-wrap h2 a,
-.swagger-section .swagger-ui-wrap h3 a,
-.swagger-section .swagger-ui-wrap h4 a,
-.swagger-section .swagger-ui-wrap h5 a,
-.swagger-section .swagger-ui-wrap h6 a {
- text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap h1 a:hover,
-.swagger-section .swagger-ui-wrap h2 a:hover,
-.swagger-section .swagger-ui-wrap h3 a:hover,
-.swagger-section .swagger-ui-wrap h4 a:hover,
-.swagger-section .swagger-ui-wrap h5 a:hover,
-.swagger-section .swagger-ui-wrap h6 a:hover {
- text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap h1 span.divider,
-.swagger-section .swagger-ui-wrap h2 span.divider,
-.swagger-section .swagger-ui-wrap h3 span.divider,
-.swagger-section .swagger-ui-wrap h4 span.divider,
-.swagger-section .swagger-ui-wrap h5 span.divider,
-.swagger-section .swagger-ui-wrap h6 span.divider {
- color: #aaaaaa;
-}
-.swagger-section .swagger-ui-wrap a {
- color: #547f00;
-}
-.swagger-section .swagger-ui-wrap a img {
- border: none;
-}
-.swagger-section .swagger-ui-wrap article,
-.swagger-section .swagger-ui-wrap aside,
-.swagger-section .swagger-ui-wrap details,
-.swagger-section .swagger-ui-wrap figcaption,
-.swagger-section .swagger-ui-wrap figure,
-.swagger-section .swagger-ui-wrap footer,
-.swagger-section .swagger-ui-wrap header,
-.swagger-section .swagger-ui-wrap hgroup,
-.swagger-section .swagger-ui-wrap menu,
-.swagger-section .swagger-ui-wrap nav,
-.swagger-section .swagger-ui-wrap section,
-.swagger-section .swagger-ui-wrap summary {
- display: block;
-}
-.swagger-section .swagger-ui-wrap pre {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- background-color: #fcf6db;
- border: 1px solid #e5e0c6;
- padding: 10px;
-}
-.swagger-section .swagger-ui-wrap pre code {
- line-height: 1.6em;
- background: none;
-}
-.swagger-section .swagger-ui-wrap .content > .content-type > div > label {
- clear: both;
- display: block;
- color: #0F6AB4;
- font-size: 1.1em;
- margin: 0;
- padding: 15px 0 5px;
-}
-.swagger-section .swagger-ui-wrap .content pre {
- font-size: 12px;
- margin-top: 5px;
- padding: 5px;
-}
-.swagger-section .swagger-ui-wrap .icon-btn {
- cursor: pointer;
-}
-.swagger-section .swagger-ui-wrap .info_title {
- padding-bottom: 10px;
- font-weight: bold;
- font-size: 25px;
-}
-.swagger-section .swagger-ui-wrap p.big,
-.swagger-section .swagger-ui-wrap div.big p {
- font-size: 1em;
- margin-bottom: 10px;
-}
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,
-.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input {
- width: 500px !important;
-}
-.swagger-section .swagger-ui-wrap .info_license {
- padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_tos {
- padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .message-fail {
- color: #cc0000;
-}
-.swagger-section .swagger-ui-wrap .info_url {
- padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_email {
- padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_name {
- padding-bottom: 5px;
-}
-.swagger-section .swagger-ui-wrap .info_description {
- padding-bottom: 10px;
- font-size: 15px;
-}
-.swagger-section .swagger-ui-wrap .markdown ol li,
-.swagger-section .swagger-ui-wrap .markdown ul li {
- padding: 3px 0px;
- line-height: 1.4em;
- color: #333333;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
- display: block;
- padding: 4px;
- width: auto;
- clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
- font-size: 1.3em;
-}
-.swagger-section .swagger-ui-wrap table.fullwidth {
- width: 100%;
-}
-.swagger-section .swagger-ui-wrap .model-signature {
- font-family: "Droid Sans", sans-serif;
- font-size: 1em;
- line-height: 1.5em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav a {
- text-decoration: none;
- color: #AAA;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover {
- text-decoration: underline;
- color: black;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected {
- color: black;
- text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propType {
- color: #5555aa;
-}
-.swagger-section .swagger-ui-wrap .model-signature pre:hover {
- background-color: #ffffdd;
-}
-.swagger-section .swagger-ui-wrap .model-signature pre {
- font-size: .85em;
- line-height: 1.2em;
- overflow: auto;
- max-height: 200px;
- cursor: pointer;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
- display: block;
- margin: 0;
- padding: 0;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
- padding-right: 0;
- border-right: none;
-}
-.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li {
- float: left;
- margin: 0 5px 5px 0;
- padding: 2px 5px 2px 0;
- border-right: 1px solid #ddd;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propOpt {
- color: #555;
-}
-.swagger-section .swagger-ui-wrap .model-signature .snippet small {
- font-size: 0.75em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propOptKey {
- font-style: italic;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .strong {
- font-weight: bold;
- color: #000;
- font-size: .9em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description div {
- font-size: 0.9em;
- line-height: 1.5em;
- margin-left: 1em;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .stronger {
- font-weight: bold;
- color: #000;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper {
- border-spacing: 0;
- position: absolute;
- background-color: #ffffff;
- border: 1px solid #bbbbbb;
- display: none;
- font-size: 11px;
- max-width: 400px;
- line-height: 30px;
- color: black;
- padding: 5px;
- margin-left: 10px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th {
- text-align: center;
- background-color: #eeeeee;
- border: 1px solid #bbbbbb;
- font-size: 11px;
- color: #666666;
- font-weight: bold;
- padding: 5px;
- line-height: 15px;
-}
-.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
- font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .model-signature .propName {
- font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .model-signature .signature-container {
- clear: both;
-}
-.swagger-section .swagger-ui-wrap .body-textarea {
- width: 300px;
- height: 100px;
- border: 1px solid #aaa;
-}
-.swagger-section .swagger-ui-wrap .markdown p code,
-.swagger-section .swagger-ui-wrap .markdown li code {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- background-color: #f0f0f0;
- color: black;
- padding: 1px 3px;
-}
-.swagger-section .swagger-ui-wrap .required {
- font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap input.parameter {
- width: 300px;
- border: 1px solid #aaa;
-}
-.swagger-section .swagger-ui-wrap h1 {
- color: black;
- font-size: 1.5em;
- line-height: 1.3em;
- padding: 10px 0 10px 0;
- font-family: "Droid Sans", sans-serif;
- font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-section .swagger-ui-wrap .heading_with_menu ul {
- display: block;
- clear: none;
- float: right;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -ms-box-sizing: border-box;
- box-sizing: border-box;
- margin-top: 10px;
-}
-.swagger-section .swagger-ui-wrap h2 {
- color: black;
- font-size: 1.3em;
- padding: 10px 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap h2 a {
- color: black;
-}
-.swagger-section .swagger-ui-wrap h2 span.sub {
- font-size: 0.7em;
- color: #999999;
- font-style: italic;
-}
-.swagger-section .swagger-ui-wrap h2 span.sub a {
- color: #777777;
-}
-.swagger-section .swagger-ui-wrap span.weak {
- color: #666666;
-}
-.swagger-section .swagger-ui-wrap .message-success {
- color: #89BF04;
-}
-.swagger-section .swagger-ui-wrap caption,
-.swagger-section .swagger-ui-wrap th,
-.swagger-section .swagger-ui-wrap td {
- text-align: left;
- font-weight: normal;
- vertical-align: middle;
-}
-.swagger-section .swagger-ui-wrap .code {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
- font-family: "Droid Sans", sans-serif;
- height: 250px;
- padding: 4px;
- display: block;
- clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
- display: block;
- clear: both;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
- display: block;
- float: left;
- clear: none;
- margin: 0;
- padding: 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
- display: block;
- float: left;
- clear: none;
- margin: 0 5px 0 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
- color: black;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
- display: block;
- clear: both;
- width: auto;
- padding: 0 0 3px;
- color: #666666;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
- padding-left: 3px;
- color: #888888;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
- margin-left: 0;
- font-style: italic;
- font-size: 0.9em;
- margin: 0;
-}
-.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons {
- margin: 0;
- padding: 0;
-}
-.swagger-section .swagger-ui-wrap span.blank,
-.swagger-section .swagger-ui-wrap span.empty {
- color: #888888;
- font-style: italic;
-}
-.swagger-section .swagger-ui-wrap .markdown h3 {
- color: #547f00;
-}
-.swagger-section .swagger-ui-wrap .markdown h4 {
- color: #666666;
-}
-.swagger-section .swagger-ui-wrap .markdown pre {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- background-color: #fcf6db;
- border: 1px solid #e5e0c6;
- padding: 10px;
- margin: 0 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap .markdown pre code {
- line-height: 1.6em;
-}
-.swagger-section .swagger-ui-wrap div.gist {
- margin: 20px 0 25px 0 !important;
-}
-.swagger-section .swagger-ui-wrap ul#resources {
- font-family: "Droid Sans", sans-serif;
- font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource {
- border-bottom: 1px solid #dddddd;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
-.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
- color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
-.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
- color: #555555;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child {
- border-bottom: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading {
- border: 1px solid transparent;
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
- overflow: hidden;
- padding: 0;
- display: block;
- clear: none;
- float: right;
- margin: 14px 10px 0 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
- float: left;
- clear: none;
- margin: 0;
- padding: 2px 10px;
- border-right: 1px solid #dddddd;
- color: #666666;
- font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
- color: #aaaaaa;
- text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
- text-decoration: underline;
- color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
- text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
- padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
- padding-right: 0;
- border-right: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
- padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
- color: #999999;
- padding-left: 0;
- display: block;
- clear: none;
- float: left;
- font-family: "Droid Sans", sans-serif;
- font-weight: bold;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
- color: #999999;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
- color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
- margin: 0 0 10px;
- padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
- margin: 0;
- padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
- display: block;
- clear: none;
- float: left;
- width: auto;
- margin: 0;
- padding: 0;
- line-height: 1.1em;
- color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
- padding-left: 10px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
- color: black;
- text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
- text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
- text-transform: uppercase;
- text-decoration: none;
- color: white;
- display: inline-block;
- width: 50px;
- font-size: 0.7em;
- text-align: center;
- padding: 7px 0 4px;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- -o-border-radius: 2px;
- -ms-border-radius: 2px;
- -khtml-border-radius: 2px;
- border-radius: 2px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
- margin: 0;
- padding: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
- overflow: hidden;
- padding: 0;
- display: block;
- clear: none;
- float: right;
- margin: 6px 10px 0 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
- float: left;
- clear: none;
- margin: 0;
- padding: 2px 10px;
- font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
- text-decoration: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
- color: black;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
- border-top: none;
- padding: 10px;
- -moz-border-radius-bottomleft: 6px;
- -webkit-border-bottom-left-radius: 6px;
- -o-border-bottom-left-radius: 6px;
- -ms-border-bottom-left-radius: 6px;
- -khtml-border-bottom-left-radius: 6px;
- border-bottom-left-radius: 6px;
- -moz-border-radius-bottomright: 6px;
- -webkit-border-bottom-right-radius: 6px;
- -o-border-bottom-right-radius: 6px;
- -ms-border-bottom-right-radius: 6px;
- -khtml-border-bottom-right-radius: 6px;
- border-bottom-right-radius: 6px;
- margin: 0 0 20px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
- font-size: 1.1em;
- margin: 0;
- padding: 15px 0 5px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
- padding: 4px 0 0 10px;
- display: inline-block;
- font-size: 0.9em;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
- display: block;
- clear: none;
- float: left;
- padding: 6px 8px;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber {
- background-image: url('../images/throbber.gif');
- width: 128px;
- height: 16px;
- display: block;
- clear: none;
- float: right;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
- outline: 2px solid black;
- outline-color: #cc0000;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- padding: 10px;
- font-size: 0.9em;
- max-height: 400px;
- overflow-y: auto;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
- background-color: #f9f2e9;
- border: 1px solid #f0e0ca;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
- background-color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #f0e0ca;
- color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
- color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
- background-color: #faf5ee;
- border: 1px solid #f0e0ca;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
- color: #c5862b;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
- color: #dcb67f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
- background-color: #fcffcd;
- border: 1px solid black;
- border-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
- text-transform: uppercase;
- background-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #ffd20f;
- color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
- color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
- background-color: #fcffcd;
- border: 1px solid black;
- border-color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
- color: #ffd20f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
- color: #6fc992;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
- background-color: #f5e8e8;
- border: 1px solid #e8c6c7;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
- text-transform: uppercase;
- background-color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #e8c6c7;
- color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
- color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
- background-color: #f7eded;
- border: 1px solid #e8c6c7;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
- color: #a41e22;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
- color: #c8787a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
- background-color: #e7f6ec;
- border: 1px solid #c3e8d1;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
- background-color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #c3e8d1;
- color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
- color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
- background-color: #ebf7f0;
- border: 1px solid #c3e8d1;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
- color: #10a54a;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
- color: #6fc992;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
- background-color: #FCE9E3;
- border: 1px solid #F5D5C3;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
- background-color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #f0cecb;
- color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
- color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
- background-color: #faf0ef;
- border: 1px solid #f0cecb;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
- color: #D38042;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
- color: #dcb67f;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
- background-color: #e7f0f7;
- border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
- background-color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #c3d9ec;
- color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
- color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
- background-color: #ebf3f9;
- border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
- color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
- color: #6fa5d2;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
- background-color: #e7f0f7;
- border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
- background-color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #c3d9ec;
- color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
- color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
- background-color: #ebf3f9;
- border: 1px solid #c3d9ec;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
- color: #0f6ab4;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
- color: #6fa5d2;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
- border-top: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
- padding-right: 0;
- border-right: none;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
- text-decoration: underline;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
- padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
-.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
- padding-left: 0;
-}
-.swagger-section .swagger-ui-wrap p#colophon {
- margin: 0 15px 40px 15px;
- padding: 10px 0;
- font-size: 0.8em;
- border-top: 1px solid #dddddd;
- font-family: "Droid Sans", sans-serif;
- color: #999999;
- font-style: italic;
-}
-.swagger-section .swagger-ui-wrap p#colophon a {
- text-decoration: none;
- color: #547f00;
-}
-.swagger-section .swagger-ui-wrap h3 {
- color: black;
- font-size: 1.1em;
- padding: 10px 0 10px 0;
-}
-.swagger-section .swagger-ui-wrap .markdown ol,
-.swagger-section .swagger-ui-wrap .markdown ul {
- font-family: "Droid Sans", sans-serif;
- margin: 5px 0 10px;
- padding: 0 0 0 18px;
- list-style-type: disc;
-}
-.swagger-section .swagger-ui-wrap form.form_box {
- background-color: #ebf3f9;
- border: 1px solid #c3d9ec;
- padding: 10px;
-}
-.swagger-section .swagger-ui-wrap form.form_box label {
- color: #0f6ab4 !important;
-}
-.swagger-section .swagger-ui-wrap form.form_box input[type=submit] {
- display: block;
- padding: 10px;
-}
-.swagger-section .swagger-ui-wrap form.form_box p.weak {
- font-size: 0.8em;
-}
-.swagger-section .swagger-ui-wrap form.form_box p {
- font-size: 0.9em;
- padding: 0 0 15px;
- color: #7e7b6d;
-}
-.swagger-section .swagger-ui-wrap form.form_box p a {
- color: #646257;
-}
-.swagger-section .swagger-ui-wrap form.form_box p strong {
- color: black;
-}
-.swagger-section .title {
- font-style: bold;
-}
-.swagger-section .secondary_form {
- display: none;
-}
-.swagger-section .main_image {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-.swagger-section .oauth_body {
- margin-left: 100px;
- margin-right: 100px;
-}
-.swagger-section .oauth_submit {
- text-align: center;
-}
-.swagger-section .api-popup-dialog {
- z-index: 10000;
- position: absolute;
- width: 500px;
- background: #FFF;
- padding: 20px;
- border: 1px solid #ccc;
- border-radius: 5px;
- display: none;
- font-size: 13px;
- color: #777;
-}
-.swagger-section .api-popup-dialog .api-popup-title {
- font-size: 24px;
- padding: 10px 0;
-}
-.swagger-section .api-popup-dialog .api-popup-title {
- font-size: 24px;
- padding: 10px 0;
-}
-.swagger-section .api-popup-dialog p.error-msg {
- padding-left: 5px;
- padding-bottom: 5px;
-}
-.swagger-section .api-popup-dialog button.api-popup-authbtn {
- height: 30px;
-}
-.swagger-section .api-popup-dialog button.api-popup-cancel {
- height: 30px;
-}
-.swagger-section .api-popup-scopes {
- padding: 10px 20px;
-}
-.swagger-section .api-popup-scopes li {
- padding: 5px 0;
- line-height: 20px;
-}
-.swagger-section .api-popup-scopes .api-scope-desc {
- padding-left: 20px;
- font-style: italic;
-}
-.swagger-section .api-popup-scopes li input {
- position: relative;
- top: 2px;
-}
-.swagger-section .api-popup-actions {
- padding-top: 10px;
-}
-.swagger-section .access {
- float: right;
-}
-.swagger-section .auth {
- float: right;
-}
-.swagger-section #api_information_panel {
- position: absolute;
- background: #FFF;
- border: 1px solid #ccc;
- border-radius: 5px;
- display: none;
- font-size: 13px;
- max-width: 300px;
- line-height: 30px;
- color: black;
- padding: 5px;
-}
-.swagger-section #api_information_panel p .api-msg-enabled {
- color: green;
-}
-.swagger-section #api_information_panel p .api-msg-disabled {
- color: red;
-}
-.swagger-section .api-ic {
- height: 18px;
- vertical-align: middle;
- display: inline-block;
- background: url(../images/explorer_icons.png) no-repeat;
-}
-.swagger-section .ic-info {
- background-position: 0 0;
- width: 18px;
- margin-top: -7px;
- margin-left: 4px;
-}
-.swagger-section .ic-warning {
- background-position: -60px 0;
- width: 18px;
- margin-top: -7px;
- margin-left: 4px;
-}
-.swagger-section .ic-error {
- background-position: -30px 0;
- width: 18px;
- margin-top: -7px;
- margin-left: 4px;
-}
-.swagger-section .ic-off {
- background-position: -90px 0;
- width: 58px;
- margin-top: -4px;
- cursor: pointer;
-}
-.swagger-section .ic-on {
- background-position: -160px 0;
- width: 58px;
- margin-top: -4px;
- cursor: pointer;
-}
-.swagger-section #header {
- background-color: #89bf04;
- padding: 14px;
-}
-.swagger-section #header a#logo {
- font-size: 1.5em;
- font-weight: bold;
- text-decoration: none;
- background: transparent url(../images/logo_small.png) no-repeat left center;
- padding: 20px 0 20px 40px;
- color: white;
-}
-.swagger-section #header form#api_selector {
- display: block;
- clear: none;
- float: right;
-}
-.swagger-section #header form#api_selector .input {
- display: block;
- clear: none;
- float: left;
- margin: 0 10px 0 0;
-}
-.swagger-section #header form#api_selector .input input#input_apiKey {
- width: 200px;
-}
-.swagger-section #header form#api_selector .input input#input_baseUrl {
- width: 400px;
-}
-.swagger-section #header form#api_selector .input a#explore {
- display: block;
- text-decoration: none;
- font-weight: bold;
- padding: 6px 8px;
- font-size: 0.9em;
- color: white;
- background-color: #547f00;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- -o-border-radius: 4px;
- -ms-border-radius: 4px;
- -khtml-border-radius: 4px;
- border-radius: 4px;
-}
-.swagger-section #header form#api_selector .input a#explore:hover {
- background-color: #547f00;
-}
-.swagger-section #header form#api_selector .input input {
- font-size: 0.9em;
- padding: 3px;
- margin: 0;
-}
-.swagger-section #content_message {
- margin: 10px 15px;
- font-style: italic;
- color: #999999;
-}
-.swagger-section #message-bar {
- min-height: 30px;
- text-align: center;
- padding-top: 10px;
-}
diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/css/typography.css b/catalog-core/catalog-mgr/src/main/resources/api-doc/css/typography.css deleted file mode 100644 index d051d368..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/css/typography.css +++ /dev/null @@ -1,41 +0,0 @@ -/**
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/* droid-sans-regular - latin */
-@font-face {
- font-family: 'Droid Sans';
- font-style: normal;
- font-weight: 400;
- src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */
- src: local('Droid Sans'), local('DroidSans'),
- url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
- url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
- url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */
- url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
- url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */
-}
-/* droid-sans-700 - latin */
-@font-face {
- font-family: 'Droid Sans';
- font-style: normal;
- font-weight: 700;
- src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */
- src: local('Droid Sans Bold'), local('DroidSans-Bold'),
- url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
- url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
- url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */
- url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
- url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */
-}
diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot Binary files differdeleted file mode 100644 index 2250b71a..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg deleted file mode 100644 index a54bbbbf..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg +++ /dev/null @@ -1,411 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns="http://www.w3.org/2000/svg"> -<defs > -<font id="DroidSans" horiz-adv-x="1123" ><font-face - font-family="Droid Sans" - units-per-em="2048" - panose-1="2 11 8 6 3 8 4 2 2 4" - ascent="1907" - descent="-492" - alphabetic="0" /> -<glyph unicode=" " glyph-name="space" horiz-adv-x="532" /> -<glyph unicode="!" glyph-name="exclam" horiz-adv-x="586" d="M416 485H172L121 1462H467L416 485ZM117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131 -66T117 143Z" /> -<glyph unicode=""" glyph-name="quotedbl" horiz-adv-x="967" d="M412 1462L371 934H174L133 1462H412ZM834 1462L793 934H596L555 1462H834Z" /> -<glyph unicode="#" glyph-name="numbersign" horiz-adv-x="1323" d="M999 844L952 612H1210V406H913L836 0H616L694 406H500L424 0H209L283 406H45V612H322L369 844H117V1053H406L483 1460H702L625 1053H823L901 1460H1116L1038 1053H1278V844H999ZM539 612H735L782 -844H586L539 612Z" /> -<glyph unicode="$" glyph-name="dollar" horiz-adv-x="1128" d="M1061 457Q1061 382 1035 318T956 206T825 127T645 86V-119H508V82Q442 84 386 90T281 107T188 133T100 168V432Q142 411 191 392T294 358T401 331T508 317V635Q500 638 491 642Q483 645 475 648T461 -653Q370 688 302 726T189 811T121 915T98 1044Q98 1119 126 1180T208 1287T337 1361T508 1399V1556H645V1405Q732 1400 823 1380T1014 1317L913 1083Q848 1109 778 1129T645 1155V862L684 848Q779 813 850 776T968 693T1038 590T1061 457ZM760 451Q760 475 754 -493T733 526T698 553T645 580V328Q704 337 732 367T760 451ZM399 1051Q399 1004 425 973T508 920V1153Q454 1147 427 1123T399 1051Z" /> -<glyph unicode="%" glyph-name="percent" horiz-adv-x="1804" d="M315 1024Q315 897 337 835T410 772Q459 772 482 834T506 1024Q506 1274 410 1274Q360 1274 338 1213T315 1024ZM758 1026Q758 918 738 832T674 687T565 597T408 565Q323 565 259 596T151 687T85 -832T63 1026Q63 1134 83 1219T145 1362T253 1452T408 1483Q494 1483 559 1452T669 1363T735 1219T758 1026ZM1425 1462L614 0H375L1186 1462H1425ZM1298 440Q1298 313 1320 251T1393 188Q1442 188 1465 250T1489 440Q1489 690 1393 690Q1343 690 1321 629T1298 -440ZM1741 442Q1741 334 1721 249T1657 104T1548 14T1391 -18Q1306 -18 1242 13T1135 104T1069 248T1047 442Q1047 550 1067 635T1129 778T1236 868T1391 899Q1477 899 1542 868T1652 779T1718 635T1741 442Z" /> -<glyph unicode="&" glyph-name="ampersand" horiz-adv-x="1479" d="M1475 0H1098L1001 100Q921 45 825 13T612 -20Q492 -20 395 10T228 94T120 225T82 395Q82 472 100 532T153 642T235 731T344 807Q306 853 280 895T237 979T214 1062T207 1149Q207 1227 237 -1288T322 1393T452 1460T618 1483Q704 1483 776 1462T901 1401T984 1301T1014 1165Q1014 1096 992 1039T931 932T842 842T731 766L991 498Q1026 564 1052 637T1098 784H1415Q1400 727 1380 664T1332 538T1270 411T1192 291L1475 0ZM403 424Q403 380 419 345T463 -286T530 249T614 236Q674 236 725 251T819 295L510 625Q459 583 431 535T403 424ZM731 1124Q731 1155 721 1176T695 1212T658 1232T616 1239Q594 1239 572 1233T531 1214T501 1178T489 1122Q489 1070 512 1024T575 932Q652 976 691 1020T731 1124Z" /> -<glyph unicode="'" glyph-name="quotesingle" horiz-adv-x="545" d="M412 1462L371 934H174L133 1462H412Z" /> -<glyph unicode="(" glyph-name="parenleft" horiz-adv-x="694" d="M82 561Q82 686 100 807T155 1043T248 1263T383 1462H633Q492 1269 420 1038T348 563Q348 444 366 326T420 95T509 -124T631 -324H383Q305 -234 249 -131T155 84T100 317T82 561Z" /> -<glyph unicode=")" glyph-name="parenright" horiz-adv-x="694" d="M612 561Q612 437 594 317T539 85T446 -131T311 -324H63Q132 -230 185 -124T274 95T328 326T346 563Q346 807 274 1038T61 1462H311Q389 1369 445 1264T539 1044T594 808T612 561Z" /> -<glyph unicode="*" glyph-name="asterisk" horiz-adv-x="1116" d="M688 1556L647 1188L1020 1292L1053 1040L713 1016L936 719L709 598L553 911L416 600L180 719L401 1016L63 1042L102 1292L467 1188L426 1556H688Z" /> -<glyph unicode="+" glyph-name="plus" horiz-adv-x="1128" d="M455 612H88V831H455V1200H674V831H1040V612H674V248H455V612Z" /> -<glyph unicode="," glyph-name="comma" horiz-adv-x="594" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215Z" /> -<glyph unicode="-" glyph-name="hyphen" horiz-adv-x="659" d="M61 424V674H598V424H61Z" /> -<glyph unicode="." glyph-name="period" horiz-adv-x="584" d="M117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131 66T117 143Z" /> -<glyph unicode="/" glyph-name="slash" horiz-adv-x="846" d="M836 1462L291 0H14L559 1462H836Z" /> -<glyph unicode="0" glyph-name="zero" horiz-adv-x="1128" d="M1065 731Q1065 554 1038 415T950 179T794 31T563 -20Q436 -20 342 31T186 179T94 415T63 731Q63 908 90 1048T178 1285T333 1433T563 1485Q689 1485 783 1434T940 1286T1034 1049T1065 731ZM371 731Q371 -481 414 355T563 229Q667 229 712 354T758 731Q758 982 713 1108T563 1235Q510 1235 474 1203T414 1108T381 951T371 731Z" /> -<glyph unicode="1" glyph-name="one" horiz-adv-x="1128" d="M817 0H508V846Q508 872 508 908T510 984T513 1064T516 1137Q511 1131 499 1119T472 1093T441 1063T410 1036L242 901L92 1087L563 1462H817V0Z" /> -<glyph unicode="2" glyph-name="two" horiz-adv-x="1128" d="M1063 0H82V215L426 586Q491 656 544 715T635 830T694 944T715 1069Q715 1143 671 1184T551 1225Q472 1225 399 1186T246 1075L78 1274Q123 1315 172 1352T280 1419T410 1465T569 1483Q674 1483 757 -1454T900 1372T990 1242T1022 1071Q1022 985 992 907T910 753T790 603T643 451L467 274V260H1063V0Z" /> -<glyph unicode="3" glyph-name="three" horiz-adv-x="1128" d="M1006 1135Q1006 1059 982 999T915 893T815 817T690 770V764Q867 742 958 657T1049 426Q1049 330 1015 249T909 107T729 14T473 -20Q355 -20 251 -1T57 59V322Q102 298 152 280T252 250T350 231T442 -225Q528 225 585 241T676 286T724 355T739 444Q739 489 721 525T661 587T552 627T387 641H283V858H385Q477 858 538 874T635 919T687 986T702 1067Q702 1145 654 1189T500 1233Q452 1233 411 1224T334 1200T269 1168T215 1133L59 1339Q101 1370 150 1396T258 1441T383 -1472T526 1483Q634 1483 722 1460T874 1392T971 1283T1006 1135Z" /> -<glyph unicode="4" glyph-name="four" horiz-adv-x="1128" d="M1085 303H909V0H608V303H4V518L625 1462H909V543H1085V303ZM608 543V791Q608 804 608 828T610 884T612 948T615 1011T618 1063T621 1096H612Q594 1054 572 1007T520 913L276 543H608Z" /> -<glyph unicode="5" glyph-name="five" horiz-adv-x="1128" d="M598 934Q692 934 773 905T914 820T1008 681T1042 489Q1042 370 1005 276T896 116T718 15T473 -20Q418 -20 364 -15T261 -1T167 24T86 59V326Q121 306 167 289T262 259T362 239T457 231Q591 231 661 -286T731 463Q731 571 663 627T451 684Q425 684 396 681T338 673T283 663T238 651L115 717L170 1462H942V1200H438L414 913Q446 920 488 927T598 934Z" /> -<glyph unicode="6" glyph-name="six" horiz-adv-x="1128" d="M76 621Q76 726 87 830T128 1029T208 1207T336 1349T522 1444T776 1479Q797 1479 822 1478T872 1476T922 1471T965 1464V1217Q927 1226 885 1231T799 1237Q664 1237 577 1204T439 1110T367 966T340 -780H352Q372 816 400 847T467 901T552 937T659 950Q754 950 830 919T958 829T1039 684T1067 487Q1067 368 1034 274T938 115T788 15T590 -20Q482 -20 388 18T225 136T116 335T76 621ZM584 227Q625 227 658 242T716 289T754 369T768 483Q768 590 724 651T588 713Q542 -713 504 695T439 648T398 583T383 510Q383 459 395 409T433 318T496 252T584 227Z" /> -<glyph unicode="7" glyph-name="seven" horiz-adv-x="1128" d="M207 0L727 1200H55V1460H1063V1266L530 0H207Z" /> -<glyph unicode="8" glyph-name="eight" horiz-adv-x="1128" d="M565 1481Q656 1481 737 1459T879 1393T976 1283T1012 1128Q1012 1062 992 1009T937 912T854 834T750 772Q808 741 863 703T962 618T1031 511T1057 379Q1057 288 1021 214T920 88T765 8T565 -20Q447 --20 355 7T200 84T105 207T72 371Q72 446 94 506T154 614T243 699T352 764Q303 795 260 831T186 912T136 1011T117 1130Q117 1217 153 1282T252 1392T395 1459T565 1481ZM358 389Q358 349 371 316T409 258T473 221T561 207Q666 207 718 256T770 387Q770 429 753 -462T708 524T645 577T575 623L553 637Q509 615 473 590T412 534T372 467T358 389ZM563 1255Q530 1255 502 1245T453 1216T420 1169T408 1106Q408 1064 420 1034T454 980T504 938T565 901Q596 917 624 936T673 979T708 1035T721 1106Q721 1141 709 1169T676 1216T626 -1245T563 1255Z" /> -<glyph unicode="9" glyph-name="nine" horiz-adv-x="1128" d="M1055 838Q1055 733 1044 629T1003 429T923 252T795 109T609 15T354 -20Q333 -20 308 -19T258 -17T208 -13T166 -6V242Q203 232 245 227T332 221Q467 221 554 254T692 348T764 493T791 678H778Q758 -642 730 611T664 557T578 521T471 508Q376 508 300 539T172 629T91 774T63 971Q63 1090 96 1184T192 1343T342 1444T541 1479Q649 1479 743 1441T906 1323T1015 1123T1055 838ZM547 1231Q506 1231 472 1216T414 1170T376 1090T362 975Q362 869 407 807T543 745Q589 -745 627 763T692 810T733 875T748 948Q748 999 736 1049T698 1140T635 1206T547 1231Z" /> -<glyph unicode=":" glyph-name="colon" horiz-adv-x="584" d="M117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131 66T117 143ZM117 969Q117 1016 -130 1048T168 1101T224 1130T293 1139Q328 1139 359 1130T415 1101T453 1049T467 969Q467 924 453 892T415 839T360 809T293 799Q256 799 224 808T168 838T131 891T117 969Z" /> -<glyph unicode=";" glyph-name="semicolon" horiz-adv-x="594" d="M444 238L459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444ZM117 969Q117 1016 130 1048T168 1101T224 1130T293 1139Q328 1139 359 1130T415 -1101T453 1049T467 969Q467 924 453 892T415 839T360 809T293 799Q256 799 224 808T168 838T131 891T117 969Z" /> -<glyph unicode="<" glyph-name="less" horiz-adv-x="1128" d="M1040 203L88 641V784L1040 1280V1040L397 723L1040 442V203Z" /> -<glyph unicode="=" glyph-name="equal" horiz-adv-x="1128" d="M88 807V1024H1040V807H88ZM88 418V637H1040V418H88Z" /> -<glyph unicode=">" glyph-name="greater" horiz-adv-x="1128" d="M88 442L731 723L88 1040V1280L1040 784V641L88 203V442Z" /> -<glyph unicode="?" glyph-name="question" horiz-adv-x="940" d="M264 485V559Q264 610 274 651T306 730T362 803T444 877Q486 910 515 936T562 987T588 1041T596 1106Q596 1163 558 1200T440 1237Q371 1237 292 1208T127 1137L25 1358Q68 1383 118 1405T223 1445T334 -1473T444 1483Q546 1483 628 1459T767 1387T854 1273T885 1120Q885 1057 871 1008T830 916T761 834T664 750Q622 717 596 693T554 646T534 601T528 545V485H264ZM231 143Q231 190 244 222T282 275T338 304T408 313Q443 313 474 304T530 275T568 223T582 143Q582 -98 568 66T530 13T475 -17T408 -27Q371 -27 339 -18T282 13T245 66T231 143Z" /> -<glyph unicode="@" glyph-name="at" horiz-adv-x="1774" d="M1673 752Q1673 657 1651 564T1582 398T1467 279T1303 233Q1265 233 1232 242T1170 269T1122 310T1090 362H1075Q1056 337 1031 314T975 272T907 244T825 233Q742 233 678 261T569 342T502 468T479 631Q479 -734 510 820T599 968T740 1065T926 1100Q971 1100 1019 1095T1111 1082T1195 1064T1262 1044L1241 625Q1239 603 1239 582T1239 555Q1239 513 1245 486T1262 444T1286 422T1315 416Q1350 416 1376 443T1419 516T1445 623T1454 754Q1454 882 1416 982T1311 1151T1150 -1256T948 1292Q795 1292 679 1241T484 1099T365 882T324 608Q324 470 359 364T463 185T633 75T866 37Q922 37 981 44T1098 63T1213 92T1321 129V-63Q1227 -105 1113 -129T868 -154Q687 -154 545 -103T304 46T154 283T102 602Q102 726 129 839T207 1050T331 1227T499 -1363T706 1450T948 1481Q1106 1481 1239 1431T1468 1286T1619 1056T1673 752ZM711 627Q711 515 749 466T850 416Q892 416 922 435T972 490T1002 575T1016 686L1028 907Q1008 912 981 915T926 918Q867 918 826 893T760 827T723 734T711 627Z" /> -<glyph unicode="A" glyph-name="A" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 608H846Z" /> -<glyph unicode="B" glyph-name="B" horiz-adv-x="1315" d="M184 1462H612Q750 1462 854 1443T1028 1380T1133 1266T1169 1092Q1169 1030 1154 976T1110 881T1040 813T944 776V766Q999 754 1046 732T1129 670T1185 570T1206 424Q1206 324 1171 246T1071 113T912 -29T700 0H184V1462ZM494 883H655Q713 883 752 893T815 925T849 977T860 1051Q860 1135 808 1171T641 1208H494V883ZM494 637V256H676Q737 256 778 270T845 310T882 373T893 455Q893 496 882 529T845 587T775 624T668 637H494Z" /> -<glyph unicode="C" glyph-name="C" horiz-adv-x="1305" d="M805 1225Q716 1225 648 1191T533 1092T462 935T438 727Q438 610 459 519T525 366T639 271T805 238Q894 238 983 258T1178 315V55Q1130 35 1083 21T987 -2T887 -15T776 -20Q607 -20 483 34T278 186T158 -422T119 729Q119 895 164 1033T296 1272T511 1427T805 1483Q914 1483 1023 1456T1233 1380L1133 1128Q1051 1167 968 1196T805 1225Z" /> -<glyph unicode="D" glyph-name="D" horiz-adv-x="1434" d="M1315 745Q1315 560 1265 421T1119 188T885 47T569 0H184V1462H612Q773 1462 902 1416T1124 1280T1265 1055T1315 745ZM1001 737Q1001 859 977 947T906 1094T792 1180T637 1208H494V256H608Q804 256 902 -376T1001 737Z" /> -<glyph unicode="E" glyph-name="E" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0Z" /> -<glyph unicode="F" glyph-name="F" horiz-adv-x="1124" d="M489 0H184V1462H1022V1208H489V831H985V578H489V0Z" /> -<glyph unicode="G" glyph-name="G" horiz-adv-x="1483" d="M739 821H1319V63Q1261 44 1202 29T1080 3T947 -14T799 -20Q635 -20 509 28T296 172T164 408T119 733Q119 905 169 1044T316 1280T556 1430T883 1483Q1000 1483 1112 1458T1317 1393L1214 1145Q1146 1179 -1061 1202T881 1225Q779 1225 698 1190T558 1089T469 932T438 727Q438 619 459 530T527 375T645 274T819 238Q885 238 930 244T1016 258V563H739V821Z" /> -<glyph unicode="H" glyph-name="H" horiz-adv-x="1485" d="M1300 0H991V631H494V0H184V1462H494V889H991V1462H1300V0Z" /> -<glyph unicode="I" glyph-name="I" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0Z" /> -<glyph unicode="J" glyph-name="J" horiz-adv-x="678" d="M-2 -430Q-67 -430 -116 -424T-199 -408V-150Q-162 -158 -122 -164T-33 -170Q13 -170 52 -160T121 -126T167 -60T184 43V1462H494V53Q494 -73 458 -164T356 -314T199 -402T-2 -430Z" /> -<glyph unicode="K" glyph-name="K" horiz-adv-x="1298" d="M1298 0H946L610 608L494 522V0H184V1462H494V758L616 965L950 1462H1294L827 803L1298 0Z" /> -<glyph unicode="L" glyph-name="L" horiz-adv-x="1096" d="M184 0V1462H494V256H1026V0H184Z" /> -<glyph unicode="M" glyph-name="M" horiz-adv-x="1870" d="M772 0L451 1147H442Q448 1055 452 969Q454 932 455 893T458 816T460 743T461 680V0H184V1462H606L922 344H928L1264 1462H1686V0H1397V692Q1397 718 1397 751T1399 821T1401 896T1404 970Q1408 1054 -1411 1145H1403L1057 0H772Z" /> -<glyph unicode="N" glyph-name="N" horiz-adv-x="1604" d="M1419 0H1026L451 1106H442Q448 1029 452 953Q456 888 458 817T461 688V0H184V1462H575L1149 367H1155Q1152 443 1148 517Q1147 549 1146 582T1143 649T1142 714T1141 770V1462H1419V0Z" /> -<glyph unicode="O" glyph-name="O" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 733ZM438 -733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733Z" /> -<glyph unicode="P" glyph-name="P" horiz-adv-x="1225" d="M494 774H555Q686 774 752 826T819 995Q819 1104 760 1156T573 1208H494V774ZM1133 1006Q1133 910 1104 822T1009 667T834 560T565 520H494V0H184V1462H590Q731 1462 833 1431T1002 1341T1101 1198T1133 1006Z" /> -<glyph unicode="Q" glyph-name="Q" horiz-adv-x="1548" d="M1430 733Q1430 614 1411 510T1352 319T1253 166T1112 55L1473 -348H1075L807 -18Q800 -18 794 -19Q789 -20 784 -20T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 -1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733Z" -/> -<glyph unicode="R" glyph-name="R" horiz-adv-x="1290" d="M494 813H578Q707 813 763 864T819 1016Q819 1120 759 1164T573 1208H494V813ZM494 561V0H184V1462H584Q865 1462 999 1354T1133 1024Q1133 949 1113 888T1060 780T983 697T891 637Q1002 459 1090 319Q1128 -259 1163 202T1227 100T1273 28L1290 0H946L629 561H494Z" /> -<glyph unicode="S" glyph-name="S" horiz-adv-x="1073" d="M985 406Q985 308 952 230T854 96T696 10T481 -20Q375 -20 277 2T94 68V356Q142 333 191 312T290 273T391 246T492 236Q543 236 579 247T638 279T671 328T682 391Q682 432 665 463T616 522T540 576T440 -631Q394 655 337 689T230 773T145 895T111 1067Q111 1165 143 1242T236 1373T381 1455T573 1483Q626 1483 676 1476T776 1456T876 1424T979 1380L879 1139Q834 1160 795 1176T719 1203T647 1219T575 1225Q497 1225 456 1184T414 1073Q414 1036 426 1008T466 954T537 -903T643 844Q718 804 781 763T889 671T960 556T985 406Z" /> -<glyph unicode="T" glyph-name="T" horiz-adv-x="1124" d="M717 0H408V1204H41V1462H1083V1204H717V0Z" /> -<glyph unicode="U" glyph-name="U" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292Z" /> -<glyph unicode="V" glyph-name="V" horiz-adv-x="1249" d="M936 1462H1249L793 0H455L0 1462H313L561 582Q566 565 574 525T592 437T611 341T625 260Q630 293 639 341T658 436T677 524T692 582L936 1462Z" /> -<glyph unicode="W" glyph-name="W" horiz-adv-x="1898" d="M1546 0H1194L1014 721Q1010 736 1005 763T992 824T978 895T965 967T955 1031T948 1079Q946 1061 942 1032T931 968T919 896T906 825T893 763T883 719L705 0H352L0 1462H305L471 664Q474 648 479 618T492 -549T506 469T521 387T534 313T543 256Q546 278 551 312T563 384T576 464T590 540T601 603T610 643L813 1462H1085L1288 643Q1291 631 1296 604T1308 541T1322 464T1335 385T1347 312T1356 256Q1359 278 1364 312T1377 387T1391 469T1406 549T1418 617T1427 664L1593 -1462H1898L1546 0Z" /> -<glyph unicode="X" glyph-name="X" horiz-adv-x="1284" d="M1284 0H930L631 553L332 0H0L444 754L31 1462H373L647 936L915 1462H1249L831 737L1284 0Z" /> -<glyph unicode="Y" glyph-name="Y" horiz-adv-x="1196" d="M598 860L862 1462H1196L752 569V0H444V559L0 1462H336L598 860Z" /> -<glyph unicode="Z" glyph-name="Z" horiz-adv-x="1104" d="M1055 0H49V201L668 1206H68V1462H1036V1262L418 256H1055V0Z" /> -<glyph unicode="[" glyph-name="bracketleft" horiz-adv-x="678" d="M627 -324H143V1462H627V1251H403V-113H627V-324Z" /> -<glyph unicode="\" glyph-name="backslash" horiz-adv-x="846" d="M289 1462L834 0H557L12 1462H289Z" /> -<glyph unicode="]" glyph-name="bracketright" horiz-adv-x="678" d="M51 -113H274V1251H51V1462H535V-324H51V-113Z" /> -<glyph unicode="^" glyph-name="asciicircum" horiz-adv-x="1090" d="M8 520L446 1470H590L1085 520H846L524 1163Q455 1002 384 839T244 520H8Z" /> -<glyph unicode="_" glyph-name="underscore" horiz-adv-x="842" d="M846 -324H-4V-184H846V-324Z" /> -<glyph unicode="`" glyph-name="grave" horiz-adv-x="1182" d="M645 1241Q611 1269 564 1310T470 1396T386 1480T332 1548V1569H674Q690 1535 711 1495T756 1414T803 1335T848 1268V1241H645Z" /> -<glyph unicode="a" glyph-name="a" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190 1040Q274 -1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518Z" /> -<glyph unicode="b" glyph-name="b" horiz-adv-x="1245" d="M756 1139Q842 1139 913 1102T1035 992T1114 811T1143 561Q1143 417 1115 309T1034 127T909 17T748 -20Q692 -20 649 -8T571 24T512 69T465 123H444L393 0H160V1556H465V1194Q465 1161 463 1123T459 1051Q456 -1012 453 973H465Q486 1008 513 1038T575 1090T656 1126T756 1139ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z" /> -<glyph unicode="c" glyph-name="c" horiz-adv-x="1022" d="M625 -20Q505 -20 409 13T244 115T139 293T102 553Q102 720 139 832T245 1013T410 1110T625 1139Q711 1139 796 1118T956 1059L868 827Q802 856 741 874T625 893Q514 893 464 809T414 555Q414 387 464 -307T621 227Q708 227 779 249T924 307V53Q887 35 852 21T782 -2T708 -15T625 -20Z" /> -<glyph unicode="d" glyph-name="d" horiz-adv-x="1245" d="M489 -20Q403 -20 332 17T210 126T131 307T102 557Q102 701 130 809T211 991T337 1102T498 1139Q552 1139 597 1127T678 1092T742 1040T793 975H803Q797 1014 792 1054Q787 1088 784 1126T780 1198V1556H1085V0H852L793 -145H780Q759 111 732 81T670 28T590 -7T489 -20ZM600 223Q654 223 692 241T753 297T788 391T801 522V555Q801 636 791 699T758 804T696 869T598 891Q502 891 457 805T412 553Q412 388 457 306T600 223Z" /> -<glyph unicode="e" glyph-name="e" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139 810 1106T962 -1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20Z" /> -<glyph unicode="f" glyph-name="f" horiz-adv-x="793" d="M741 889H514V0H209V889H41V1036L209 1118V1200Q209 1307 235 1377T309 1490T425 1549T578 1567Q670 1567 733 1553T840 1520L768 1296Q737 1307 703 1316T623 1325Q563 1325 539 1287T514 1188V1118H741V889Z" /> -<glyph unicode="g" glyph-name="g" horiz-adv-x="1130" d="M1085 1116V950L922 899Q942 865 950 829T958 750Q958 665 931 595T851 474T718 397T532 369Q509 369 482 371T442 377Q422 360 411 342T399 297Q399 276 412 264T446 244T495 234T553 231H727Q808 231 -872 213T980 156T1049 60T1073 -80Q1073 -175 1035 -251T922 -381T734 -463T475 -492Q361 -492 276 -471T134 -409T49 -311T20 -182Q20 -121 41 -76T97 1T176 53T268 84Q247 93 227 109T190 146T163 192T152 246Q152 278 161 304T189 352T234 395T295 436Q207 474 -156 558T104 756Q104 846 132 917T214 1037T348 1113T532 1139Q552 1139 577 1137T626 1131T672 1123T705 1116H1085ZM285 -158Q285 -183 295 -206T330 -248T393 -276T489 -287Q645 -287 724 -243T803 -125Q803 -62 754 -41T602 -20H461Q434 -20 403 -26T346 -49T303 --91T285 -158ZM395 752Q395 661 429 611T532 561Q604 561 636 611T668 752Q668 842 637 895T532 948Q395 948 395 752Z" /> -<glyph unicode="h" glyph-name="h" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 788 834T672 895Q613 895 573 871T509 800T475 684T465 526V0H160V1556H465V1239Q465 1197 463 1151T458 1065Q454 1019 451 975H467Q516 1062 592 1100T764 1139Q847 1139 914 -1116T1030 1042T1104 915T1130 729V0Z" /> -<glyph unicode="i" glyph-name="i" horiz-adv-x="625" d="M147 1407Q147 1450 160 1478T195 1524T248 1549T313 1556Q347 1556 377 1549T429 1525T465 1479T479 1407Q479 1365 466 1336T430 1290T377 1265T313 1257Q279 1257 249 1264T196 1289T160 1336T147 1407ZM465 -0H160V1118H465V0Z" /> -<glyph unicode="j" glyph-name="j" horiz-adv-x="625" d="M102 -492Q54 -492 3 -485T-82 -467V-227Q-51 -237 -24 -241T37 -246Q62 -246 84 -239T123 -212T150 -160T160 -76V1118H465V-121Q465 -198 446 -265T383 -383T270 -463T102 -492ZM147 1407Q147 1450 160 -1478T195 1524T248 1549T313 1556Q347 1556 377 1549T429 1525T465 1479T479 1407Q479 1365 466 1336T430 1290T377 1265T313 1257Q279 1257 249 1264T196 1289T160 1336T147 1407Z" /> -<glyph unicode="k" glyph-name="k" horiz-adv-x="1208" d="M453 608L565 778L838 1118H1182L778 633L1208 0H856L584 430L465 348V0H160V1556H465V862L449 608H453Z" /> -<glyph unicode="l" glyph-name="l" horiz-adv-x="625" d="M465 0H160V1556H465V0Z" /> -<glyph unicode="m" glyph-name="m" horiz-adv-x="1929" d="M1120 0H815V653Q815 774 779 834T666 895Q608 895 570 871T508 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 508 1049T582 1100T667 1129T758 1139Q873 1139 953 1100T1077 975H1102Q1126 -1018 1160 1049T1235 1100T1321 1129T1413 1139Q1593 1139 1684 1042T1776 729V0H1470V653Q1470 774 1434 834T1321 895Q1212 895 1166 809T1120 561V0Z" /> -<glyph unicode="n" glyph-name="n" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 789 834T672 895Q612 895 572 871T509 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 509 1049T585 1100T672 1129T766 1139Q848 1139 915 1116T1030 1042T1104 -915T1130 729V0Z" /> -<glyph unicode="o" glyph-name="o" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 131T140 313T102 -561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561Z" /> -<glyph unicode="p" glyph-name="p" horiz-adv-x="1245" d="M748 -20Q693 -20 650 -8T572 24T512 69T465 123H449Q453 88 457 57Q460 31 462 4T465 -39V-492H160V1118H408L451 973H465Q486 1007 513 1037T575 1089T656 1125T756 1139Q843 1139 914 1102T1036 992T1115 -811T1143 561Q1143 418 1114 310T1033 128T908 17T748 -20ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z" /> -<glyph unicode="q" glyph-name="q" horiz-adv-x="1245" d="M602 219Q657 219 694 237T755 293T789 386T801 518V555Q801 636 792 699T759 804T697 869T600 891Q504 891 459 805T414 553Q414 385 459 302T602 219ZM489 -20Q402 -20 331 17T209 126T130 307T102 -557Q102 700 130 808T211 990T337 1101T498 1139Q554 1139 599 1127T680 1092T745 1040T795 975H803L827 1118H1085V-492H780V-23Q780 -4 782 24T787 80Q790 112 793 145H780Q760 111 733 81T671 28T590 -7T489 -20Z" /> -<glyph unicode="r" glyph-name="r" horiz-adv-x="889" d="M743 1139Q755 1139 769 1139T797 1137T822 1134T840 1130V844Q832 846 818 848T789 851T758 853T733 854Q674 854 625 839T540 791T485 703T465 569V0H160V1118H391L436 950H451Q475 993 503 1028T565 -1087T643 1125T743 1139Z" /> -<glyph unicode="s" glyph-name="s" horiz-adv-x="985" d="M905 332Q905 244 873 178T782 68T639 2T451 -20Q396 -20 349 -17T260 -5T179 15T100 45V297Q142 276 188 259T281 230T370 210T451 203Q492 203 521 210T568 231T595 263T604 303Q604 324 598 340T568 -375T501 417T381 475Q308 508 255 540T167 613T115 704T98 827Q98 905 128 963T213 1061T345 1119T518 1139Q618 1139 708 1116T893 1047L801 831Q725 867 656 890T518 913Q456 913 429 891T401 831Q401 811 408 796T436 764T495 728T594 680Q665 649 722 619T820 -549T883 458T905 332Z" /> -<glyph unicode="t" glyph-name="t" horiz-adv-x="848" d="M614 223Q659 223 699 233T782 258V31Q739 9 676 -5T537 -20Q464 -20 401 -3T292 56T220 170T193 350V889H47V1018L215 1120L303 1356H498V1118H770V889H498V350Q498 285 530 254T614 223Z" /> -<glyph unicode="u" glyph-name="u" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891Z" /> -<glyph unicode="v" glyph-name="v" horiz-adv-x="1104" d="M395 0L0 1118H319L504 481Q521 424 533 363T549 252H555Q558 305 570 364T600 481L784 1118H1104L709 0H395Z" /> -<glyph unicode="w" glyph-name="w" horiz-adv-x="1651" d="M1014 0L928 391Q924 408 918 439T903 510T887 594T869 683Q849 786 825 905H819Q796 786 777 682Q769 638 761 593T744 509T730 437T719 387L629 0H301L0 1118H303L416 623Q425 584 434 530T452 420T468 -315T479 236H485Q486 255 489 285T498 351T508 422T519 491T529 547T537 582L659 1118H995L1112 582Q1117 560 1125 514T1141 416T1156 314T1163 236H1169Q1172 261 1179 310T1196 415T1215 528T1235 623L1352 1118H1651L1346 0H1014Z" /> -<glyph unicode="x" glyph-name="x" horiz-adv-x="1122" d="M389 571L29 1118H375L561 782L750 1118H1096L731 571L1112 0H766L561 362L356 0H10L389 571Z" /> -<glyph unicode="y" glyph-name="y" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91 -238 123 -242T190 --246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118Z" /> -<glyph unicode="z" glyph-name="z" horiz-adv-x="936" d="M877 0H55V180L512 885H86V1118H858V920L416 233H877V0Z" /> -<glyph unicode="{" glyph-name="braceleft" horiz-adv-x="745" d="M287 367T222 408T31 449V688Q93 688 141 697T223 728T272 784T287 866V1184Q287 1258 306 1310T374 1396T509 1446T725 1462V1237Q685 1236 653 1230T598 1209T563 1166T551 1096V797Q545 610 -317 575V563Q432 546 493 491T551 342V43Q551 0 563 -27T597 -69T652 -91T725 -98V-324Q594 -324 509 -308T375 -259T306 -172T287 -45V270Q287 367 222 408Z" /> -<glyph unicode="|" glyph-name="bar" horiz-adv-x="1128" d="M455 1550H674V-465H455V1550Z" /> -<glyph unicode="}" glyph-name="braceright" horiz-adv-x="745" d="M469 -45Q469 -119 450 -172T382 -258T247 -308T31 -324V-98Q71 -97 103 -91T157 -70T192 -27T205 43V342Q202 436 263 491T438 563V575Q211 610 205 797V1096Q205 1139 193 1166T158 1208T103 -1230T31 1237V1462Q162 1462 247 1446T381 1397T450 1311T469 1184V866Q468 818 484 784T533 729T614 698T725 688V449Q600 449 535 408T469 270V-45Z" /> -<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1128" d="M528 616Q491 632 463 643T411 660T366 669T322 672Q293 672 262 663T201 637T143 598T88 551V782Q139 836 202 863T344 891Q374 891 399 889T453 879T517 860T600 827Q638 811 666 801T719 -784T764 775T807 772Q836 772 867 781T928 807T986 845T1040 893V662Q939 553 784 553Q754 553 729 555T675 564T611 583T528 616Z" /> -<glyph unicode=" " glyph-name="nbspace" horiz-adv-x="532" /> -<glyph unicode="¡" glyph-name="exclamdown" horiz-adv-x="586" d="M168 606H412L463 -369H117L168 606ZM467 948Q467 901 454 869T416 816T360 787T291 778Q256 778 225 787T169 816T131 868T117 948Q117 993 131 1025T169 1078T224 1108T291 1118Q328 1118 -360 1109T416 1079T453 1026T467 948Z" /> -<glyph unicode="¢" glyph-name="cent" horiz-adv-x="1128" d="M543 -20V186Q451 199 377 236T251 340T171 506T143 743Q143 884 171 985T251 1155T378 1260T543 1311V1483H721V1319Q759 1318 797 1313T870 1299T937 1281T993 1260L907 1034Q886 1044 860 -1053T805 1070T750 1082T698 1087Q632 1087 586 1067T511 1006T468 901T455 750Q455 579 512 500T698 420Q774 420 844 438T965 481V242Q914 213 852 198T721 180V-20H543Z" /> -<glyph unicode="£" glyph-name="sterling" horiz-adv-x="1128" d="M680 1483Q790 1483 879 1459T1049 1401L956 1171Q885 1200 827 1217T705 1235Q638 1235 601 1197T563 1063V870H897V651H563V508Q563 453 550 413T514 343T466 294T412 260H1090V0H82V248Q124 -266 157 287T214 337T250 407T262 506V651H84V870H262V1065Q262 1178 293 1257T380 1387T512 1460T680 1483Z" /> -<glyph unicode="¤" glyph-name="currency" horiz-adv-x="1128" d="M168 723Q168 777 182 826T221 920L92 1047L240 1194L367 1067Q410 1092 461 1106T563 1120Q617 1120 665 1107T760 1065L887 1194L1036 1051L907 922Q932 880 946 829T961 723Q961 667 947 -618T907 524L1032 399L887 254L760 379Q716 356 667 342T563 328Q507 328 458 340T365 379L240 256L94 401L221 526Q168 617 168 723ZM375 723Q375 684 390 650T430 590T490 550T563 535Q603 535 638 549T699 589T741 649T756 723Q756 763 741 797T700 857T638 -898T563 913Q524 913 490 898T431 858T390 798T375 723Z" /> -<glyph unicode="¥" glyph-name="yen" horiz-adv-x="1128" d="M565 860L809 1462H1122L760 715H954V537H709V399H954V221H709V0H422V221H174V399H422V537H174V715H365L8 1462H324L565 860Z" /> -<glyph unicode="¦" glyph-name="brokenbar" horiz-adv-x="1128" d="M455 1550H674V735H455V1550ZM455 350H674V-465H455V350Z" /> -<glyph unicode="§" glyph-name="section" horiz-adv-x="995" d="M121 805Q121 849 131 886T160 955T203 1012T254 1055Q191 1095 156 1154T121 1288Q121 1353 150 1406T232 1498T360 1556T526 1577Q628 1577 716 1554T889 1493L807 1303Q739 1335 669 1360T520 -1386Q439 1386 402 1363T365 1292Q365 1267 377 1246T415 1206T481 1167T578 1124Q649 1096 707 1062T807 987T872 895T895 782Q895 682 861 621T770 522Q832 482 863 430T895 303Q895 229 864 170T776 68T638 3T455 -20Q345 -20 261 0T106 59V266Q145 246 190 -229T281 198T371 176T455 168Q511 168 548 177T607 202T639 239T649 285Q649 310 642 329T612 368T549 408T442 457Q366 489 306 521T205 593T143 685T121 805ZM344 827Q344 764 400 716T575 616L590 610Q605 621 619 635T644 668T661 708T668 756Q668 788 658 -815T621 867T550 917T434 967Q416 960 400 947T372 915T352 875T344 827Z" /> -<glyph unicode="¨" glyph-name="dieresis" horiz-adv-x="1182" d="M248 1405Q248 1440 259 1465T288 1507T332 1532T387 1540Q416 1540 441 1532T486 1508T516 1466T528 1405Q528 1371 517 1346T486 1305T442 1280T387 1272Q358 1272 333 1280T289 1304T259 -1346T248 1405ZM651 1405Q651 1440 662 1465T692 1507T737 1532T793 1540Q821 1540 846 1532T891 1508T922 1466T934 1405Q934 1371 923 1346T892 1305T847 1280T793 1272Q733 1272 692 1305T651 1405Z" /> -<glyph unicode="©" glyph-name="copyright" horiz-adv-x="1704" d="M895 1010Q798 1010 745 936T692 731Q692 596 740 524T895 451Q952 451 1018 466T1141 510V319Q1084 292 1025 277T889 262Q782 262 702 296T569 392T488 540T461 733Q461 836 487 921T565 -1068T697 1164T881 1198Q964 1198 1041 1176T1186 1120L1112 952Q999 1010 895 1010ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 -200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM242 731Q242 604 290 493T420 300T614 169T852 121Q979 121 1090 169T1283 299T1414 493T1462 731Q1462 858 1414 969T1284 1162T1090 1293T852 1341Q725 1341 614 1293T421 -1163T290 969T242 731Z" /> -<glyph unicode="ª" glyph-name="ordfeminine" horiz-adv-x="743" d="M520 764L489 874Q449 816 393 784T268 752Q218 752 178 765T108 806T63 876T47 975Q47 1035 68 1076T130 1144T230 1184T365 1202L455 1206Q455 1269 426 1296T342 1323Q302 1323 253 -1306T152 1262L86 1397Q148 1429 222 1454T387 1479Q455 1479 505 1460T589 1405T638 1319T655 1206V764H520ZM373 1081Q335 1078 312 1068T275 1044T257 1012T252 977Q252 939 271 921T317 903Q349 903 374 914T418 944T445 991T455 1051V1087L373 1081Z" /> -<glyph unicode="«" glyph-name="guillemotleft" horiz-adv-x="1198" d="M82 573L391 1028L610 909L393 561L610 213L391 94L82 547V573ZM588 573L897 1028L1116 909L899 561L1116 213L897 94L588 547V573Z" /> -<glyph unicode="¬" glyph-name="logicalnot" horiz-adv-x="1128" d="M1040 248H821V612H88V831H1040V248Z" /> -<glyph unicode="­" glyph-name="uni00AD" horiz-adv-x="659" d="M61 424V674H598V424H61Z" /> -<glyph unicode="®" glyph-name="registered" horiz-adv-x="1704" d="M1157 905Q1157 811 1119 756T1014 672L1251 272H997L819 610H772V272H543V1188H807Q989 1188 1073 1118T1157 905ZM772 778H803Q869 778 897 806T926 901Q926 936 919 959T896 995T857 -1014T801 1020H772V778ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 -199T203 351T127 531T100 731ZM242 731Q242 604 290 493T420 300T614 169T852 121Q979 121 1090 169T1283 299T1414 493T1462 731Q1462 858 1414 969T1284 1162T1090 1293T852 1341Q725 1341 614 1293T421 1163T290 969T242 731Z" /> -<glyph unicode="¯" glyph-name="overscore" horiz-adv-x="1024" d="M1030 1556H-6V1757H1030V1556Z" /> -<glyph unicode="°" glyph-name="degree" horiz-adv-x="877" d="M92 1137Q92 1208 119 1271T193 1381T303 1455T438 1483Q510 1483 573 1456T683 1381T757 1271T784 1137Q784 1065 757 1002T684 893T574 820T438 793Q366 793 303 819T193 892T119 1002T92 -1137ZM283 1137Q283 1106 295 1078T328 1029T377 996T438 983Q470 983 498 995T548 1029T581 1078T594 1137Q594 1169 582 1197T548 1247T499 1281T438 1294Q406 1294 378 1282T328 1248T295 1198T283 1137Z" /> -<glyph unicode="±" glyph-name="plusminus" horiz-adv-x="1128" d="M455 674H88V893H455V1262H674V893H1040V674H674V309H455V674ZM88 0V219H1040V0H88Z" /> -<glyph unicode="²" glyph-name="twosuperior" horiz-adv-x="776" d="M702 586H55V754L279 973Q325 1018 355 1051T404 1111T430 1161T438 1212Q438 1250 414 1270T350 1290Q310 1290 267 1270T170 1202L47 1354Q112 1411 193 1447T383 1483Q449 1483 503 -1467T596 1419T656 1341T678 1233Q678 1187 666 1147T626 1065T557 980T455 881L350 786H702V586Z" /> -<glyph unicode="³" glyph-name="threesuperior" horiz-adv-x="776" d="M666 1249Q666 1180 626 1130T496 1051V1038Q547 1028 584 1007T645 959T682 898T694 829Q694 708 606 639T332 569Q256 569 190 586T59 639V829Q125 789 191 764T330 739Q404 739 438 -766T473 846Q473 867 465 886T438 919T387 943T307 952H195V1112H287Q339 1112 371 1121T421 1145T445 1180T451 1221Q451 1259 426 1284T350 1309Q303 1309 261 1290T162 1231L61 1372Q123 1419 198 1450T377 1481Q439 1481 492 1465T583 1418T644 1345T666 1249Z" -/> -<glyph unicode="´" glyph-name="acute" horiz-adv-x="1182" d="M332 1241V1268Q353 1297 377 1335T424 1413T469 1494T506 1569H848V1548Q837 1530 816 1506T768 1453T710 1396T648 1338T587 1285T535 1241H332Z" /> -<glyph unicode="µ" glyph-name="mu" horiz-adv-x="1290" d="M465 465Q465 344 502 284T621 223Q679 223 718 247T781 318T815 434T825 592V1118H1130V0H897L854 150H842Q807 65 755 23T627 -20Q573 -20 528 3T455 70Q457 28 460 -15Q462 -52 463 -94T465 --172V-492H160V1118H465V465Z" /> -<glyph unicode="¶" glyph-name="paragraph" horiz-adv-x="1341" d="M1167 -260H1006V1356H840V-260H678V559Q617 541 532 541Q437 541 360 566T228 651T143 806T113 1042Q113 1189 145 1287T237 1446T380 1531T563 1556H1167V-260Z" /> -<glyph unicode="·" glyph-name="middot" horiz-adv-x="584" d="M117 723Q117 770 130 802T168 855T224 884T293 893Q328 893 359 884T415 855T453 803T467 723Q467 678 453 646T415 593T360 563T293 553Q256 553 224 562T168 592T131 645T117 723Z" /> -<glyph unicode="¸" glyph-name="cedilla" horiz-adv-x="420" d="M418 -250Q418 -307 403 -352T351 -428T256 -475T109 -492Q64 -492 28 -486T-37 -471V-303Q-22 -307 -4 -310T34 -317T72 -322T106 -324Q135 -324 156 -311T178 -262Q178 -225 141 -197T12 --154L90 0H283L256 -61Q287 -71 316 -88T367 -128T404 -182T418 -250Z" /> -<glyph unicode="¹" glyph-name="onesuperior" horiz-adv-x="776" d="M584 586H346V1032Q346 1052 346 1082T348 1144T351 1201T354 1239Q348 1231 339 1221T319 1199T298 1178T279 1161L201 1100L92 1227L393 1462H584V586Z" /> -<glyph unicode="º" glyph-name="ordmasculine" horiz-adv-x="754" d="M696 1116Q696 1029 674 962T609 848T508 777T375 752Q306 752 248 776T147 847T81 961T57 1116Q57 1203 79 1270T143 1384T244 1455T379 1479Q447 1479 504 1455T605 1385T672 1271T696 -1116ZM260 1116Q260 1016 287 966T377 915Q437 915 464 965T492 1116Q492 1216 465 1265T377 1315Q315 1315 288 1266T260 1116Z" /> -<glyph unicode="»" glyph-name="guillemotright" horiz-adv-x="1198" d="M1118 547L809 94L590 213L807 561L590 909L809 1028L1118 573V547ZM612 547L303 94L84 213L301 561L84 909L303 1028L612 573V547Z" /> -<glyph unicode="¼" glyph-name="onequarter" horiz-adv-x="1804" d="M1370 1462L559 0H320L1131 1462H1370ZM794 586H556V1032Q556 1052 556 1082T558 1144T561 1201T564 1239Q558 1231 549 1221T529 1199T508 1178T489 1161L411 1100L302 1227L603 1462H794V586ZM1682 -152H1557V1H1319V152H936V306L1321 883H1557V320H1682V152ZM1319 320V484Q1319 526 1320 572T1325 668Q1320 655 1311 634T1290 590T1268 546T1248 511L1121 320H1319Z" /> -<glyph unicode="½" glyph-name="onehalf" horiz-adv-x="1804" d="M1370 1462L559 0H320L1131 1462H1370ZM794 586H556V1032Q556 1052 556 1082T558 1144T561 1201T564 1239Q558 1231 549 1221T529 1199T508 1178T489 1161L411 1100L302 1227L603 1462H794V586ZM1716 -1H1069V169L1293 388Q1339 433 1369 466T1418 526T1444 576T1452 627Q1452 665 1428 685T1364 705Q1324 705 1281 685T1184 617L1061 769Q1126 826 1207 862T1397 898Q1463 898 1517 882T1610 834T1670 756T1692 648Q1692 602 1680 562T1640 480T1571 395T1469 -296L1364 201H1716V1Z" /> -<glyph unicode="¾" glyph-name="threequarters" horiz-adv-x="1804" d="M1441 1462L630 0H391L1202 1462H1441ZM1712 152H1587V1H1349V152H966V306L1351 883H1587V320H1712V152ZM1349 320V484Q1349 526 1350 572T1355 668Q1350 655 1341 634T1320 590T1298 -546T1278 511L1151 320H1349ZM697 1249Q697 1180 657 1130T527 1051V1038Q578 1028 615 1007T676 959T713 898T725 829Q725 708 637 639T363 569Q287 569 221 586T90 639V829Q156 789 222 764T361 739Q435 739 469 766T504 846Q504 867 496 886T469 919T418 943T338 -952H226V1112H318Q370 1112 402 1121T452 1145T476 1180T482 1221Q482 1259 457 1284T381 1309Q334 1309 292 1290T193 1231L92 1372Q154 1419 229 1450T408 1481Q470 1481 523 1465T614 1418T675 1345T697 1249Z" /> -<glyph unicode="¿" glyph-name="questiondown" horiz-adv-x="940" d="M686 606V532Q686 481 676 440T644 361T588 288T506 215Q464 182 435 156T388 105T362 51T354 -14Q354 -71 393 -108T510 -145Q579 -145 659 -116T823 -45L926 -266Q883 -292 832 -314T727 --354T616 -381T506 -391Q404 -391 323 -367T184 -296T97 -182T66 -29Q66 34 79 83T121 175T190 258T287 342Q328 375 354 399T396 446T416 492T422 547V606H686ZM719 948Q719 901 706 869T668 816T612 787T543 778Q508 778 477 787T421 816T383 868T369 948Q369 -993 383 1025T421 1078T476 1108T543 1118Q580 1118 612 1109T668 1079T705 1026T719 948Z" /> -<glyph unicode="À" glyph-name="Agrave" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 -608H846ZM632 1579Q598 1607 551 1648T457 1734T373 1818T319 1886V1907H661Q677 1873 698 1833T743 1752T790 1673T835 1606V1579H632Z" /> -<glyph unicode="Á" glyph-name="Aacute" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 -608H846ZM494 1579V1606Q515 1635 539 1673T586 1751T631 1832T668 1907H1010V1886Q999 1868 978 1844T930 1791T872 1734T810 1676T749 1623T697 1579H494Z" /> -<glyph unicode="Â" glyph-name="Acircumflex" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 -928L489 608H846ZM879 1579Q828 1613 773 1656T666 1755Q612 1699 560 1656T457 1579H254V1606Q280 1635 311 1673T375 1751T438 1832T490 1907H846Q867 1873 897 1833T959 1752T1024 1673T1082 1606V1579H879Z" /> -<glyph unicode="Ã" glyph-name="Atilde" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 -608H846ZM504 1684Q473 1684 455 1658T424 1577H275Q281 1657 301 1715T353 1811T430 1867T527 1886Q568 1886 607 1870T684 1835T760 1799T834 1782Q865 1782 883 1808T914 1888H1063Q1057 1809 1037 1751T983 1655T907 1598T811 1579Q771 1579 731 1595T653 1631T578 -1667T504 1684Z" /> -<glyph unicode="Ä" glyph-name="Adieresis" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 -608H846ZM324 1743Q324 1778 335 1803T364 1845T408 1870T463 1878Q492 1878 517 1870T562 1846T592 1804T604 1743Q604 1709 593 1684T562 1643T518 1618T463 1610Q434 1610 409 1618T365 1642T335 1684T324 1743ZM727 1743Q727 1778 738 1803T768 1845T813 1870T869 -1878Q897 1878 922 1870T967 1846T998 1804T1010 1743Q1010 1709 999 1684T968 1643T923 1618T869 1610Q809 1610 768 1643T727 1743Z" /> -<glyph unicode="Å" glyph-name="Aring" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 -608H846ZM918 1567Q918 1511 899 1467T845 1391T764 1344T664 1327Q609 1327 563 1343T485 1390T434 1465T416 1565Q416 1620 434 1664T484 1738T563 1785T664 1802Q717 1802 763 1786T843 1739T898 1665T918 1567ZM760 1565Q760 1610 733 1635T664 1661Q622 1661 -595 1636T568 1565Q568 1520 592 1494T664 1468Q706 1468 733 1494T760 1565Z" /> -<glyph unicode="Æ" glyph-name="AE" horiz-adv-x="1888" d="M1767 0H926V348H465L315 0H0L655 1462H1767V1208H1235V887H1731V633H1235V256H1767V0ZM578 608H926V1198H829L578 608Z" /> -<glyph unicode="Ç" glyph-name="Ccedilla" horiz-adv-x="1305" d="M805 1225Q716 1225 648 1191T533 1092T462 935T438 727Q438 610 459 519T525 366T639 271T805 238Q894 238 983 258T1178 315V55Q1130 35 1083 21T987 -2T887 -15T776 -20Q607 -20 483 34T278 -186T158 422T119 729Q119 895 164 1033T296 1272T511 1427T805 1483Q914 1483 1023 1456T1233 1380L1133 1128Q1051 1167 968 1196T805 1225ZM926 -250Q926 -307 911 -352T859 -428T764 -475T617 -492Q572 -492 536 -486T471 -471V-303Q486 -307 504 -310T542 -317T580 --322T614 -324Q643 -324 664 -311T686 -262Q686 -225 649 -197T520 -154L598 0H791L764 -61Q795 -71 824 -88T875 -128T912 -182T926 -250Z" /> -<glyph unicode="È" glyph-name="Egrave" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM572 1579Q538 1607 491 1648T397 1734T313 1818T259 1886V1907H601Q617 1873 638 1833T683 1752T730 1673T775 1606V1579H572Z" /> -<glyph unicode="É" glyph-name="Eacute" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM424 1579V1606Q445 1635 469 1673T516 1751T561 1832T598 1907H940V1886Q929 1868 908 1844T860 1791T802 1734T740 1676T679 -1623T627 1579H424Z" /> -<glyph unicode="Ê" glyph-name="Ecircumflex" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM832 1579Q781 1613 726 1656T619 1755Q565 1699 513 1656T410 1579H207V1606Q233 1635 264 1673T328 1751T391 1832T443 -1907H799Q820 1873 850 1833T912 1752T977 1673T1035 1606V1579H832Z" /> -<glyph unicode="Ë" glyph-name="Edieresis" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM273 1743Q273 1778 284 1803T313 1845T357 1870T412 1878Q441 1878 466 1870T511 1846T541 1804T553 1743Q553 1709 542 1684T511 -1643T467 1618T412 1610Q383 1610 358 1618T314 1642T284 1684T273 1743ZM676 1743Q676 1778 687 1803T717 1845T762 1870T818 1878Q846 1878 871 1870T916 1846T947 1804T959 1743Q959 1709 948 1684T917 1643T872 1618T818 1610Q758 1610 717 1643T676 1743Z" -/> -<glyph unicode="Ì" glyph-name="Igrave" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM355 1579Q321 1607 274 1648T180 1734T96 1818T42 1886V1907H384Q400 1873 421 1833T466 1752T513 1673T558 1606V1579H355Z" -/> -<glyph unicode="Í" glyph-name="Iacute" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM237 1579V1606Q258 1635 282 1673T329 1751T374 1832T411 1907H753V1886Q742 1868 721 1844T673 1791T615 1734T553 -1676T492 1623T440 1579H237Z" /> -<glyph unicode="Î" glyph-name="Icircumflex" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM609 1579Q558 1613 503 1656T396 1755Q342 1699 290 1656T187 1579H-16V1606Q10 1635 41 1673T105 1751T168 -1832T220 1907H576Q597 1873 627 1833T689 1752T754 1673T812 1606V1579H609Z" /> -<glyph unicode="Ï" glyph-name="Idieresis" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM54 1743Q54 1778 65 1803T94 1845T138 1870T193 1878Q222 1878 247 1870T292 1846T322 1804T334 1743Q334 1709 -323 1684T292 1643T248 1618T193 1610Q164 1610 139 1618T95 1642T65 1684T54 1743ZM457 1743Q457 1778 468 1803T498 1845T543 1870T599 1878Q627 1878 652 1870T697 1846T728 1804T740 1743Q740 1709 729 1684T698 1643T653 1618T599 1610Q539 1610 498 1643T457 -1743Z" /> -<glyph unicode="Ð" glyph-name="Eth" horiz-adv-x="1434" d="M47 850H184V1462H612Q773 1462 902 1416T1124 1280T1265 1055T1315 745Q1315 560 1265 421T1119 188T885 47T569 0H184V596H47V850ZM1001 737Q1001 859 977 947T906 1094T792 1180T637 1208H494V850H731V596H494V256H608Q804 -256 902 376T1001 737Z" /> -<glyph unicode="Ñ" glyph-name="Ntilde" horiz-adv-x="1604" d="M1419 0H1026L451 1106H442Q448 1029 452 953Q456 888 458 817T461 688V0H184V1462H575L1149 367H1155Q1152 443 1148 517Q1147 549 1146 582T1143 649T1142 714T1141 770V1462H1419V0ZM623 -1684Q592 1684 574 1658T543 1577H394Q400 1657 420 1715T472 1811T549 1867T646 1886Q687 1886 726 1870T803 1835T879 1799T953 1782Q984 1782 1002 1808T1033 1888H1182Q1176 1809 1156 1751T1102 1655T1026 1598T930 1579Q890 1579 850 1595T772 1631T697 1667T623 -1684Z" /> -<glyph unicode="Ò" glyph-name="Ograve" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 -733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM729 1579Q695 1607 648 1648T554 1734T470 1818T416 1886V1907H758Q774 -1873 795 1833T840 1752T887 1673T932 1606V1579H729Z" /> -<glyph unicode="Ó" glyph-name="Oacute" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 -733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM590 1579V1606Q611 1635 635 1673T682 1751T727 1832T764 1907H1106V1886Q1095 -1868 1074 1844T1026 1791T968 1734T906 1676T845 1623T793 1579H590Z" /> -<glyph unicode="Ô" glyph-name="Ocircumflex" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 -1043T1430 733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM975 1579Q924 1613 869 1656T762 1755Q708 1699 -656 1656T553 1579H350V1606Q376 1635 407 1673T471 1751T534 1832T586 1907H942Q963 1873 993 1833T1055 1752T1120 1673T1178 1606V1579H975Z" /> -<glyph unicode="Õ" glyph-name="Otilde" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 -733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM612 1684Q581 1684 563 1658T532 1577H383Q389 1657 409 1715T461 -1811T538 1867T635 1886Q676 1886 715 1870T792 1835T868 1799T942 1782Q973 1782 991 1808T1022 1888H1171Q1165 1809 1145 1751T1091 1655T1015 1598T919 1579Q879 1579 839 1595T761 1631T686 1667T612 1684Z" /> -<glyph unicode="Ö" glyph-name="Odieresis" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 -733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM428 1743Q428 1778 439 1803T468 1845T512 1870T567 1878Q596 -1878 621 1870T666 1846T696 1804T708 1743Q708 1709 697 1684T666 1643T622 1618T567 1610Q538 1610 513 1618T469 1642T439 1684T428 1743ZM831 1743Q831 1778 842 1803T872 1845T917 1870T973 1878Q1001 1878 1026 1870T1071 1846T1102 1804T1114 1743Q1114 -1709 1103 1684T1072 1643T1027 1618T973 1610Q913 1610 872 1643T831 1743Z" /> -<glyph unicode="×" glyph-name="multiply" horiz-adv-x="1128" d="M408 723L109 1024L260 1178L561 879L866 1178L1020 1028L715 723L1016 420L866 268L561 569L260 270L111 422L408 723Z" /> -<glyph unicode="Ø" glyph-name="Oslash" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q595 -20 467 41L395 -76L227 18L309 152Q212 252 166 400T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q867 1485 944 1469T1087 -1421L1157 1532L1323 1436L1243 1307Q1337 1208 1383 1063T1430 733ZM438 733Q438 553 485 438L942 1184Q873 1227 776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM1110 733Q1110 904 1067 1020L612 279Q646 260 686 250T774 240Q863 240 926 274T1030 -371T1090 526T1110 733Z" /> -<glyph unicode="Ù" glyph-name="Ugrave" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM706 -1579Q672 1607 625 1648T531 1734T447 1818T393 1886V1907H735Q751 1873 772 1833T817 1752T864 1673T909 1606V1579H706Z" /> -<glyph unicode="Ú" glyph-name="Uacute" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM570 -1579V1606Q591 1635 615 1673T662 1751T707 1832T744 1907H1086V1886Q1075 1868 1054 1844T1006 1791T948 1734T886 1676T825 1623T773 1579H570Z" /> -<glyph unicode="Û" glyph-name="Ucircumflex" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM942 -1579Q891 1613 836 1656T729 1755Q675 1699 623 1656T520 1579H317V1606Q343 1635 374 1673T438 1751T501 1832T553 1907H909Q930 1873 960 1833T1022 1752T1087 1673T1145 1606V1579H942Z" /> -<glyph unicode="Ü" glyph-name="Udieresis" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM393 -1743Q393 1778 404 1803T433 1845T477 1870T532 1878Q561 1878 586 1870T631 1846T661 1804T673 1743Q673 1709 662 1684T631 1643T587 1618T532 1610Q503 1610 478 1618T434 1642T404 1684T393 1743ZM796 1743Q796 1778 807 1803T837 1845T882 1870T938 1878Q966 -1878 991 1870T1036 1846T1067 1804T1079 1743Q1079 1709 1068 1684T1037 1643T992 1618T938 1610Q878 1610 837 1643T796 1743Z" /> -<glyph unicode="Ý" glyph-name="Yacute" horiz-adv-x="1196" d="M598 860L862 1462H1196L752 569V0H444V559L0 1462H336L598 860ZM422 1579V1606Q443 1635 467 1673T514 1751T559 1832T596 1907H938V1886Q927 1868 906 1844T858 1791T800 1734T738 1676T677 -1623T625 1579H422Z" /> -<glyph unicode="Þ" glyph-name="Thorn" horiz-adv-x="1225" d="M1133 770Q1133 676 1108 590T1024 438T870 333T633 293H494V0H184V1462H494V1233H655Q779 1233 869 1200T1017 1107T1104 961T1133 770ZM494 543H578Q699 543 759 595T819 770Q819 878 766 -929T598 981H494V543Z" /> -<glyph unicode="ß" glyph-name="germandbls" horiz-adv-x="1395" d="M1188 1241Q1188 1177 1167 1129T1114 1042T1045 975T976 922T923 877T901 834Q901 814 913 797T952 760T1020 715T1118 651Q1167 620 1205 588T1269 517T1309 432T1323 326Q1323 154 1206 -67T862 -20Q764 -20 692 -6T559 43V285Q583 269 617 254T690 226T768 207T842 199Q922 199 966 229T1010 322Q1010 349 1003 370T976 412T918 457T821 516Q758 552 716 584T647 647T609 713T598 788Q598 841 618 880T670 950T737 1007T805 1059T856 1117T877 1188Q877 -1251 827 1290T680 1329Q572 1329 519 1281T465 1128V0H160V1139Q160 1248 197 1328T302 1462T467 1541T680 1567Q795 1567 889 1546T1049 1483T1152 1380T1188 1241Z" /> -<glyph unicode="à" glyph-name="agrave" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190 -1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM808 1241Q774 1269 727 1310T633 1396T549 1480T495 1548V1569H837Q853 -1535 874 1495T919 1414T966 1335T1011 1268V1241H808Z" /> -<glyph unicode="á" glyph-name="aacute" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190 -1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM441 1241V1268Q462 1297 486 1335T533 1413T578 1494T615 -1569H957V1548Q946 1530 925 1506T877 1453T819 1396T757 1338T696 1285T644 1241H441Z" /> -<glyph unicode="â" glyph-name="acircumflex" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 -838L190 1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM801 1496Q750 1530 695 1573T588 1672Q534 1616 -482 1573T379 1496H176V1523Q202 1552 233 1590T297 1668T360 1749T412 1824H768Q789 1790 819 1750T881 1669T946 1590T1004 1523V1496H801Z" /> -<glyph unicode="ã" glyph-name="atilde" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190 -1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM681 1346Q650 1346 632 1320T601 1239H452Q458 1319 478 -1377T530 1473T607 1529T704 1548Q745 1548 784 1532T861 1497T937 1461T1011 1444Q1042 1444 1060 1470T1091 1550H1240Q1234 1471 1214 1413T1160 1317T1084 1260T988 1241Q948 1241 908 1257T830 1293T755 1329T681 1346Z" /> -<glyph unicode="ä" glyph-name="adieresis" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 -838L190 1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM254 1405Q254 1440 265 1465T294 1507T338 1532T393 -1540Q422 1540 447 1532T492 1508T522 1466T534 1405Q534 1371 523 1346T492 1305T448 1280T393 1272Q364 1272 339 1280T295 1304T265 1346T254 1405ZM657 1405Q657 1440 668 1465T698 1507T743 1532T799 1540Q827 1540 852 1532T897 1508T928 1466T940 1405Q940 -1371 929 1346T898 1305T853 1280T799 1272Q739 1272 698 1305T657 1405Z" /> -<glyph unicode="å" glyph-name="aring" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190 -1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM842 1479Q842 1423 823 1379T769 1303T688 1256T588 1239Q533 -1239 487 1255T409 1302T358 1377T340 1477Q340 1532 358 1576T408 1650T487 1697T588 1714Q641 1714 687 1698T767 1651T822 1577T842 1479ZM684 1477Q684 1522 657 1547T588 1573Q546 1573 519 1548T492 1477Q492 1432 516 1406T588 1380Q630 1380 657 1406T684 -1477Z" /> -<glyph unicode="æ" glyph-name="ae" horiz-adv-x="1806" d="M1268 -20Q1137 -20 1030 30T854 186Q811 132 769 94T678 30T568 -8T424 -20Q356 -20 295 1T187 66T113 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 -894T289 838L190 1040Q274 1087 376 1114T590 1141Q804 1141 913 1010Q1039 1139 1227 1139Q1338 1139 1427 1106T1579 1007T1674 848T1708 631V483H1026Q1028 419 1046 368T1098 281T1179 226T1288 207Q1382 207 1469 228T1645 295V59Q1605 38 1565 24T1479 -1T1382 --15T1268 -20ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM1229 922Q1147 922 1094 865T1032 686H1421Q1420 737 1408 780T1373 854T1313 904T1229 922Z" /> -<glyph unicode="ç" glyph-name="ccedilla" horiz-adv-x="1022" d="M625 -20Q505 -20 409 13T244 115T139 293T102 553Q102 720 139 832T245 1013T410 1110T625 1139Q711 1139 796 1118T956 1059L868 827Q802 856 741 874T625 893Q514 893 464 809T414 555Q414 -387 464 307T621 227Q708 227 779 249T924 307V53Q887 35 852 21T782 -2T708 -15T625 -20ZM778 -250Q778 -307 763 -352T711 -428T616 -475T469 -492Q424 -492 388 -486T323 -471V-303Q338 -307 356 -310T394 -317T432 -322T466 -324Q495 -324 516 -311T538 -262Q538 --225 501 -197T372 -154L450 0H643L616 -61Q647 -71 676 -88T727 -128T764 -182T778 -250Z" /> -<glyph unicode="è" glyph-name="egrave" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139 -810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM834 1241Q800 1269 753 1310T659 1396T575 1480T521 1548V1569H863Q879 1535 900 -1495T945 1414T992 1335T1037 1268V1241H834Z" /> -<glyph unicode="é" glyph-name="eacute" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139 -810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM447 1241V1268Q468 1297 492 1335T539 1413T584 1494T621 1569H963V1548Q952 1530 -931 1506T883 1453T825 1396T763 1338T702 1285T650 1241H447Z" /> -<glyph unicode="ê" glyph-name="ecircumflex" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 -1139 810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM819 1241Q768 1275 713 1318T606 1417Q552 1361 500 1318T397 1241H194V1268Q220 -1297 251 1335T315 1413T378 1494T430 1569H786Q807 1535 837 1495T899 1414T964 1335T1022 1268V1241H819Z" /> -<glyph unicode="ë" glyph-name="edieresis" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139 -810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM266 1405Q266 1440 277 1465T306 1507T350 1532T405 1540Q434 1540 459 1532T504 -1508T534 1466T546 1405Q546 1371 535 1346T504 1305T460 1280T405 1272Q376 1272 351 1280T307 1304T277 1346T266 1405ZM669 1405Q669 1440 680 1465T710 1507T755 1532T811 1540Q839 1540 864 1532T909 1508T940 1466T952 1405Q952 1371 941 1346T910 1305T865 -1280T811 1272Q751 1272 710 1305T669 1405Z" /> -<glyph unicode="ì" glyph-name="igrave" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM269 1241Q235 1269 188 1310T94 1396T10 1480T-44 1548V1569H298Q314 1535 335 1495T380 1414T427 1335T472 1268V1241H269Z" /> -<glyph unicode="í" glyph-name="iacute" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM145 1241V1268Q166 1297 190 1335T237 1413T282 1494T319 1569H661V1548Q650 1530 629 1506T581 1453T523 1396T461 1338T400 1285T348 1241H145Z" /> -<glyph unicode="î" glyph-name="icircumflex" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM521 1241Q470 1275 415 1318T308 1417Q254 1361 202 1318T99 1241H-104V1268Q-78 1297 -47 1335T17 1413T80 1494T132 1569H488Q509 1535 539 1495T601 1414T666 -1335T724 1268V1241H521Z" /> -<glyph unicode="ï" glyph-name="idieresis" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM-32 1405Q-32 1440 -21 1465T8 1507T52 1532T107 1540Q136 1540 161 1532T206 1508T236 1466T248 1405Q248 1371 237 1346T206 1305T162 1280T107 1272Q78 1272 53 -1280T9 1304T-21 1346T-32 1405ZM371 1405Q371 1440 382 1465T412 1507T457 1532T513 1540Q541 1540 566 1532T611 1508T642 1466T654 1405Q654 1371 643 1346T612 1305T567 1280T513 1272Q453 1272 412 1305T371 1405Z" /> -<glyph unicode="ð" glyph-name="eth" horiz-adv-x="1182" d="M457 1309Q423 1330 384 1354T303 1401L399 1571Q472 1537 536 1503T657 1430L883 1569L983 1415L809 1309Q881 1240 935 1162T1024 993T1078 798T1096 573Q1096 431 1060 321T957 135T795 20T582 --20Q471 -20 378 14T218 113T112 272T74 489Q74 611 106 705T197 863T337 961T516 995Q612 995 680 964T780 883L801 885Q773 973 723 1050T606 1184L375 1040L274 1196L457 1309ZM784 532Q784 579 773 622T737 698T675 750T586 770Q478 770 432 700T385 487Q385 -424 396 372T432 283T495 226T586 205Q692 205 738 286T784 532Z" /> -<glyph unicode="ñ" glyph-name="ntilde" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 789 834T672 895Q612 895 572 871T509 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 509 1049T585 1100T672 1129T766 1139Q848 1139 915 1116T1030 -1042T1104 915T1130 729V0ZM477 1346Q446 1346 428 1320T397 1239H248Q254 1319 274 1377T326 1473T403 1529T500 1548Q541 1548 580 1532T657 1497T733 1461T807 1444Q838 1444 856 1470T887 1550H1036Q1030 1471 1010 1413T956 1317T880 1260T784 1241Q744 1241 -704 1257T626 1293T551 1329T477 1346Z" /> -<glyph unicode="ò" glyph-name="ograve" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 -131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM841 1241Q807 1269 760 1310T666 1396T582 1480T528 1548V1569H870Q886 1535 907 1495T952 1414T999 1335T1044 1268V1241H841Z" /> -<glyph unicode="ó" glyph-name="oacute" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 -131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM434 1241V1268Q455 1297 479 1335T526 1413T571 1494T608 1569H950V1548Q939 1530 918 1506T870 1453T812 1396T750 1338T689 1285T637 1241H434Z" -/> -<glyph unicode="ô" glyph-name="ocircumflex" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 -131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM821 1241Q770 1275 715 1318T608 1417Q554 1361 502 1318T399 1241H196V1268Q222 1297 253 1335T317 1413T380 1494T432 1569H788Q809 1535 839 -1495T901 1414T966 1335T1024 1268V1241H821Z" /> -<glyph unicode="õ" glyph-name="otilde" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 -131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM444 1346Q413 1346 395 1320T364 1239H215Q221 1319 241 1377T293 1473T370 1529T467 1548Q508 1548 547 1532T624 1497T700 1461T774 1444Q805 -1444 823 1470T854 1550H1003Q997 1471 977 1413T923 1317T847 1260T751 1241Q711 1241 671 1257T593 1293T518 1329T444 1346Z" /> -<glyph unicode="ö" glyph-name="odieresis" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 -131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM266 1405Q266 1440 277 1465T306 1507T350 1532T405 1540Q434 1540 459 1532T504 1508T534 1466T546 1405Q546 1371 535 1346T504 1305T460 1280T405 -1272Q376 1272 351 1280T307 1304T277 1346T266 1405ZM669 1405Q669 1440 680 1465T710 1507T755 1532T811 1540Q839 1540 864 1532T909 1508T940 1466T952 1405Q952 1371 941 1346T910 1305T865 1280T811 1272Q751 1272 710 1305T669 1405Z" /> -<glyph unicode="÷" glyph-name="divide" horiz-adv-x="1128" d="M88 612V831H1040V612H88ZM424 373Q424 415 435 444T465 490T509 516T563 524Q591 524 616 516T660 491T690 444T702 373Q702 333 691 304T660 257T616 230T563 221Q535 221 510 229T465 256T435 -304T424 373ZM424 1071Q424 1113 435 1142T465 1189T509 1215T563 1223Q591 1223 616 1215T660 1189T690 1142T702 1071Q702 1031 691 1003T660 956T616 929T563 920Q535 920 510 928T465 955T435 1002T424 1071Z" /> -<glyph unicode="ø" glyph-name="oslash" horiz-adv-x="1227" d="M1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q553 -20 501 -10T401 18L344 -76L182 14L250 125Q181 199 142 308T102 561Q102 700 137 808T239 989T401 1101T616 1139Q678 1139 735 -1126T844 1090L893 1169L1053 1073L991 975Q1054 903 1089 799T1124 561ZM414 561Q414 475 426 410L709 868Q669 893 612 893Q507 893 461 811T414 561ZM813 561Q813 625 807 674L539 240Q556 232 574 229T614 225Q719 225 766 310T813 561Z" /> -<glyph unicode="ù" glyph-name="ugrave" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM839 -1241Q805 1269 758 1310T664 1396T580 1480T526 1548V1569H868Q884 1535 905 1495T950 1414T997 1335T1042 1268V1241H839Z" /> -<glyph unicode="ú" glyph-name="uacute" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM461 -1241V1268Q482 1297 506 1335T553 1413T598 1494T635 1569H977V1548Q966 1530 945 1506T897 1453T839 1396T777 1338T716 1285T664 1241H461Z" /> -<glyph unicode="û" glyph-name="ucircumflex" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM842 -1241Q791 1275 736 1318T629 1417Q575 1361 523 1318T420 1241H217V1268Q243 1297 274 1335T338 1413T401 1494T453 1569H809Q830 1535 860 1495T922 1414T987 1335T1045 1268V1241H842Z" /> -<glyph unicode="ü" glyph-name="udieresis" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM295 -1405Q295 1440 306 1465T335 1507T379 1532T434 1540Q463 1540 488 1532T533 1508T563 1466T575 1405Q575 1371 564 1346T533 1305T489 1280T434 1272Q405 1272 380 1280T336 1304T306 1346T295 1405ZM698 1405Q698 1440 709 1465T739 1507T784 1532T840 1540Q868 -1540 893 1532T938 1508T969 1466T981 1405Q981 1371 970 1346T939 1305T894 1280T840 1272Q780 1272 739 1305T698 1405Z" /> -<glyph unicode="ý" glyph-name="yacute" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91 -238 -123 -242T190 -246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118ZM393 1241V1268Q414 1297 438 1335T485 1413T530 1494T567 1569H909V1548Q898 1530 877 1506T829 1453T771 1396T709 1338T648 1285T596 1241H393Z" /> -<glyph unicode="þ" glyph-name="thorn" horiz-adv-x="1245" d="M465 973Q485 1008 512 1038T576 1090T656 1126T756 1139Q842 1139 913 1102T1035 992T1114 811T1143 561Q1143 418 1115 310T1036 128T914 17T756 -20Q701 -20 656 -10T576 20T513 64T465 117H451Q454 -85 458 55Q461 29 463 3T465 -39V-492H160V1556H465V1165Q465 1141 463 1108T458 1045Q454 1010 451 973H465ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z" -/> -<glyph unicode="ÿ" glyph-name="ydieresis" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91 --238 123 -242T190 -246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118ZM466 1405Q466 1440 477 1465T506 1507T550 1532T605 1540Q634 1540 659 1532T704 1508T734 1466T746 1405Q746 1371 735 1346T704 1305T660 1280T605 1272Q576 1272 551 1280T507 -1304T477 1346T466 1405ZM869 1405Q869 1440 880 1465T910 1507T955 1532T1011 1540Q1039 1540 1064 1532T1109 1508T1140 1466T1152 1405Q1152 1371 1141 1346T1110 1305T1065 1280T1011 1272Q951 1272 910 1305T869 1405Z" /> -<glyph unicode="–" glyph-name="endash" horiz-adv-x="1024" d="M82 436V666H942V436H82Z" /> -<glyph unicode="—" glyph-name="emdash" horiz-adv-x="2048" d="M82 436V666H1966V436H82Z" /> -<glyph unicode="‘" glyph-name="quoteleft" horiz-adv-x="440" d="M37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H418Q403 1401 389 1335T361 1204T336 1076T317 961H37Z" /> -<glyph unicode="’" glyph-name="quoteright" horiz-adv-x="440" d="M403 1462L418 1440Q404 1385 385 1325T342 1202T293 1078T242 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H403Z" /> -<glyph unicode="‚" glyph-name="quotesinglbase" horiz-adv-x="594" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215Z" /> -<glyph unicode="“" glyph-name="quotedblleft" horiz-adv-x="907" d="M489 983Q503 1037 523 1098T566 1221T615 1344T666 1462H885Q870 1401 856 1335T828 1204T803 1076T784 961H504L489 983ZM23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H418Q403 -1401 389 1335T361 1204T336 1076T317 961H37L23 983Z" /> -<glyph unicode="”" glyph-name="quotedblright" horiz-adv-x="907" d="M418 1440Q404 1385 385 1325T342 1202T293 1078T242 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H403L418 1440ZM885 1440Q871 1385 852 1325T809 1202T760 1078T709 961H489Q504 -1021 518 1087T546 1219T571 1347T590 1462H870L885 1440Z" /> -<glyph unicode="„" glyph-name="quotedblbase" horiz-adv-x="1061" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215ZM926 215Q912 161 893 100T850 -23T801 -146T750 -264H530Q545 -203 -559 -137T587 -6T612 122T631 238H911L926 215Z" /> -<glyph unicode="•" glyph-name="bullet" horiz-adv-x="770" d="M98 748Q98 834 120 894T180 992T271 1047T385 1065Q444 1065 496 1048T588 992T649 894T672 748Q672 663 650 603T588 505T497 448T385 430Q324 430 272 448T181 504T120 603T98 748Z" /> -<glyph unicode="‹" glyph-name="guilsinglleft" horiz-adv-x="692" d="M82 573L391 1028L610 909L393 561L610 213L391 94L82 547V573Z" /> -<glyph unicode="›" glyph-name="guilsinglright" horiz-adv-x="692" d="M610 547L301 94L82 213L299 561L82 909L301 1028L610 573V547Z" /> -</font> -</defs> -</svg> diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf Binary files differdeleted file mode 100644 index 523cb92d..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff Binary files differdeleted file mode 100644 index 67e3e25f..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 Binary files differdeleted file mode 100644 index 1e726a7c..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot Binary files differdeleted file mode 100644 index ac2698e8..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg deleted file mode 100644 index d9f2a214..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg +++ /dev/null @@ -1,403 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns="http://www.w3.org/2000/svg"> -<defs > -<font id="DroidSans" horiz-adv-x="1062" ><font-face - font-family="Droid Sans" - units-per-em="2048" - panose-1="2 11 6 6 3 8 4 2 2 4" - ascent="1907" - descent="-492" - alphabetic="0" /> -<glyph unicode=" " glyph-name="space" horiz-adv-x="532" /> -<glyph unicode="!" glyph-name="exclam" horiz-adv-x="551" d="M336 414H215L164 1462H387L336 414ZM147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157 -47T147 111Z" /> -<glyph unicode=""" glyph-name="quotedbl" horiz-adv-x="823" d="M330 1462L289 934H174L133 1462H330ZM690 1462L649 934H535L494 1462H690Z" /> -<glyph unicode="#" glyph-name="numbersign" horiz-adv-x="1323" d="M983 893L920 565H1200V428H893L811 0H664L748 428H457L375 0H231L309 428H51V565H336L401 893H127V1030H426L508 1462H655L573 1030H866L950 1462H1094L1010 1030H1272V893H983ZM483 565H774L838 -893H547L483 565Z" /> -<glyph unicode="$" glyph-name="dollar" horiz-adv-x="1128" d="M985 446Q985 376 960 319T889 220T776 151T625 111V-119H487V102Q437 102 386 106T287 120T197 142T123 172V344Q156 328 199 312T291 282T389 261T487 252V686Q398 716 333 749T224 824T160 922T139 -1051Q139 1118 163 1173T233 1270T343 1338T487 1374V1554H625V1378Q725 1373 809 1352T961 1300L895 1155Q839 1180 769 1200T625 1227V805Q713 774 780 741T893 667T962 572T985 446ZM809 446Q809 479 799 506T768 556T711 598T625 635V262Q718 276 763 325T809 -446ZM315 1049Q315 1013 323 985T352 933T405 890T487 854V1223Q398 1207 357 1163T315 1049Z" /> -<glyph unicode="%" glyph-name="percent" horiz-adv-x="1690" d="M250 1026Q250 861 285 779T401 696Q557 696 557 1026Q557 1354 401 1354Q321 1354 286 1273T250 1026ZM705 1026Q705 918 687 832T632 687T538 597T401 565Q328 565 272 596T178 687T121 832T102 -1026Q102 1134 119 1219T173 1362T266 1452T401 1483Q476 1483 532 1452T627 1363T685 1219T705 1026ZM1133 440Q1133 275 1168 193T1284 111Q1440 111 1440 440Q1440 768 1284 768Q1204 768 1169 687T1133 440ZM1587 440Q1587 332 1570 247T1515 102T1421 12T1284 --20Q1210 -20 1154 11T1061 102T1004 246T985 440Q985 548 1002 633T1056 776T1149 866T1284 897Q1359 897 1415 866T1510 777T1567 633T1587 440ZM1331 1462L520 0H362L1174 1462H1331Z" /> -<glyph unicode="&" glyph-name="ampersand" horiz-adv-x="1438" d="M422 1165Q422 1131 430 1099T454 1034T497 968T559 897Q618 932 661 963T732 1026T774 1093T788 1169Q788 1205 776 1235T740 1288T683 1322T608 1335Q522 1335 472 1291T422 1165ZM557 -141Q615 141 664 152T755 184T833 231T901 289L514 696Q462 663 422 632T355 564T313 486T299 387Q299 333 316 288T367 210T448 159T557 141ZM109 381Q109 459 129 520T187 631T281 724T408 809Q377 845 347 883T295 965T258 1058T244 1165Q244 1240 269 1299T341 -1400T457 1463T614 1485Q697 1485 762 1464T873 1401T943 1300T967 1165Q967 1101 942 1047T875 946T779 860T664 784L1016 412Q1043 441 1064 471T1103 535T1133 608T1157 694H1341Q1326 628 1306 573T1259 468T1200 377T1128 293L1405 0H1180L1012 172Q963 127 -915 92T813 32T697 -6T557 -20Q452 -20 369 6T228 84T140 210T109 381Z" /> -<glyph unicode="'" glyph-name="quotesingle" horiz-adv-x="463" d="M330 1462L289 934H174L133 1462H330Z" /> -<glyph unicode="(" glyph-name="parenleft" horiz-adv-x="616" d="M82 561Q82 686 100 807T155 1043T248 1263T383 1462H555Q415 1269 343 1038T270 563Q270 444 288 326T342 95T431 -124T553 -324H383Q305 -234 249 -131T155 84T100 317T82 561Z" /> -<glyph unicode=")" glyph-name="parenright" horiz-adv-x="616" d="M535 561Q535 437 517 317T462 85T368 -131T233 -324H63Q132 -230 185 -124T274 95T328 326T346 563Q346 807 274 1038T61 1462H233Q311 1369 367 1264T461 1044T517 808T535 561Z" /> -<glyph unicode="*" glyph-name="asterisk" horiz-adv-x="1128" d="M664 1556L621 1163L1018 1274L1044 1081L666 1053L911 727L733 631L557 989L399 631L215 727L457 1053L82 1081L111 1274L502 1163L459 1556H664Z" /> -<glyph unicode="+" glyph-name="plus" horiz-adv-x="1128" d="M489 647H102V797H489V1186H639V797H1026V647H639V262H489V647Z" /> -<glyph unicode="," glyph-name="comma" horiz-adv-x="512" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362Z" /> -<glyph unicode="-" glyph-name="hyphen" horiz-adv-x="659" d="M82 465V633H578V465H82Z" /> -<glyph unicode="." glyph-name="period" horiz-adv-x="549" d="M147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157 47T147 111Z" /> -<glyph unicode="/" glyph-name="slash" horiz-adv-x="764" d="M743 1462L199 0H20L565 1462H743Z" /> -<glyph unicode="0" glyph-name="zero" horiz-adv-x="1128" d="M1032 733Q1032 556 1007 416T925 179T779 31T563 -20Q445 -20 358 31T213 179T127 416T98 733Q98 910 123 1050T204 1286T348 1434T563 1485Q682 1485 770 1435T916 1288T1003 1051T1032 733ZM283 -733Q283 583 298 471T346 285T432 173T563 135Q640 135 694 172T782 283T832 469T848 733Q848 883 833 995T783 1181T694 1292T563 1329Q486 1329 433 1292T346 1181T298 995T283 733Z" /> -<glyph unicode="1" glyph-name="one" horiz-adv-x="1128" d="M711 0H535V913Q535 956 535 1005T537 1102T540 1195T543 1274Q526 1256 513 1243T487 1218T458 1193T422 1161L274 1040L178 1163L561 1462H711V0Z" /> -<glyph unicode="2" glyph-name="two" horiz-adv-x="1128" d="M1008 0H96V156L446 537Q521 618 580 685T680 816T744 944T766 1085Q766 1144 749 1189T701 1265T626 1313T530 1329Q435 1329 359 1291T213 1192L111 1311Q151 1347 197 1378T296 1433T408 1469T532 -1483Q628 1483 705 1456T837 1379T920 1256T950 1092Q950 1007 924 930T851 779T740 629T600 473L319 174V166H1008V0Z" /> -<glyph unicode="3" glyph-name="three" horiz-adv-x="1128" d="M961 1120Q961 1047 938 987T874 883T774 811T645 770V764Q822 742 914 652T1006 416Q1006 320 974 240T875 102T708 12T469 -20Q360 -20 264 -3T82 59V229Q169 183 270 158T465 133Q557 133 624 -153T734 210T798 301T819 422Q819 490 793 538T717 618T598 665T438 680H305V831H438Q519 831 582 851T687 908T752 996T774 1108Q774 1160 756 1201T705 1270T626 1314T524 1329Q417 1329 336 1296T180 1208L88 1333Q126 1364 172 1391T274 1438T391 1471T524 -1483Q632 1483 713 1456T850 1381T933 1266T961 1120Z" /> -<glyph unicode="4" glyph-name="four" horiz-adv-x="1128" d="M1087 328H874V0H698V328H23V487L686 1470H874V494H1087V328ZM698 494V850Q698 906 699 967T703 1087T707 1197T711 1282H702Q695 1262 685 1238T662 1189T636 1141T612 1102L201 494H698Z" /> -<glyph unicode="5" glyph-name="five" horiz-adv-x="1128" d="M545 897Q644 897 729 870T878 788T978 654T1014 469Q1014 355 980 264T879 110T714 14T487 -20Q436 -20 387 -15T292 -1T205 24T131 59V231Q164 208 208 190T302 160T400 142T492 135Q571 135 633 -153T738 211T804 309T827 449Q827 592 739 667T483 743Q456 743 425 741T362 734T302 726T252 717L162 774L217 1462H907V1296H375L336 877Q368 883 420 890T545 897Z" /> -<glyph unicode="6" glyph-name="six" horiz-adv-x="1128" d="M113 625Q113 730 123 834T160 1033T233 1211T350 1353T520 1448T752 1483Q771 1483 794 1482T840 1479T885 1473T924 1464V1309Q889 1321 845 1327T758 1333Q668 1333 600 1312T481 1251T398 1158T343 -1039T312 899T299 745H311Q331 781 359 812T426 866T511 902T618 915Q713 915 790 886T921 799T1004 660T1034 471Q1034 357 1003 266T914 112T774 14T590 -20Q490 -20 403 19T251 138T150 339T113 625ZM588 133Q648 133 697 153T783 215T838 320T858 471Q858 541 -842 596T792 691T710 751T594 772Q527 772 472 749T377 688T317 602T295 506Q295 439 313 373T368 253T460 167T588 133Z" /> -<glyph unicode="7" glyph-name="seven" horiz-adv-x="1128" d="M281 0L844 1296H90V1462H1030V1317L475 0H281Z" /> -<glyph unicode="8" glyph-name="eight" horiz-adv-x="1128" d="M565 1485Q649 1485 723 1463T854 1397T944 1287T977 1133Q977 1066 957 1012T902 915T819 837T715 774Q773 743 828 705T927 620T997 513T1024 381Q1024 289 991 215T897 88T752 8T565 -20Q455 -20 -370 7T226 84T137 208T106 373Q106 448 128 508T189 616T279 701T389 766Q340 797 297 833T223 915T173 1014T154 1135Q154 1222 187 1287T278 1397T409 1463T565 1485ZM285 371Q285 318 301 274T351 198T437 149T561 131Q631 131 684 148T774 198T828 277T846 -379Q846 431 827 473T771 551T683 619T569 682L539 696Q413 636 349 559T285 371ZM563 1333Q457 1333 395 1280T332 1126Q332 1069 349 1028T398 955T472 898T567 848Q615 870 657 896T731 955T781 1030T799 1126Q799 1227 736 1280T563 1333Z" /> -<glyph unicode="9" glyph-name="nine" horiz-adv-x="1128" d="M1028 838Q1028 733 1018 629T981 429T908 252T791 109T621 15T389 -20Q370 -20 347 -19T301 -16T256 -10T217 -2V154Q252 141 296 135T383 129Q518 129 605 176T743 303T815 491T842 717H829Q809 -681 781 650T715 596T629 560T522 547Q427 547 350 576T219 663T136 802T106 991Q106 1105 137 1196T226 1351T366 1449T551 1483Q652 1483 739 1444T890 1325T991 1124T1028 838ZM553 1329Q493 1329 444 1309T358 1247T303 1142T283 991Q283 921 299 866T349 771T431 -711T547 690Q615 690 670 713T764 774T824 860T846 956Q846 1023 828 1089T773 1209T681 1296T553 1329Z" /> -<glyph unicode=":" glyph-name="colon" horiz-adv-x="549" d="M147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157 47T147 111ZM147 987Q147 1026 157 -1052T184 1095T224 1119T274 1126Q300 1126 323 1119T364 1096T391 1053T401 987Q401 950 391 924T364 881T324 856T274 848Q247 848 224 856T184 881T157 924T147 987Z" /> -<glyph unicode=";" glyph-name="semicolon" horiz-adv-x="549" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362ZM147 987Q147 1026 157 1052T184 1095T224 1119T274 1126Q300 1126 323 1119T364 -1096T391 1053T401 987Q401 950 391 924T364 881T324 856T274 848Q247 848 224 856T184 881T157 924T147 987Z" /> -<glyph unicode="<" glyph-name="less" horiz-adv-x="1128" d="M1026 238L102 662V764L1026 1245V1085L291 721L1026 399V238Z" /> -<glyph unicode="=" glyph-name="equal" horiz-adv-x="1128" d="M102 852V1001H1026V852H102ZM102 442V592H1026V442H102Z" /> -<glyph unicode=">" glyph-name="greater" horiz-adv-x="1128" d="M102 399L838 721L102 1085V1245L1026 764V662L102 238V399Z" /> -<glyph unicode="?" glyph-name="question" horiz-adv-x="872" d="M281 414V451Q281 508 288 554T315 640T368 718T451 799Q499 840 533 873T588 941T620 1015T631 1108Q631 1156 616 1195T573 1263T502 1307T403 1323Q320 1323 245 1297T100 1237L37 1382Q118 -1424 212 1453T403 1483Q496 1483 570 1458T697 1384T777 1267T805 1110Q805 1043 792 991T751 893T684 806T590 717Q538 672 505 639T453 574T427 509T420 432V414H281ZM233 111Q233 149 243 175T270 218T310 242T360 250Q386 250 409 243T450 219T477 176T487 -111Q487 74 477 48T450 4T410 -21T360 -29Q333 -29 310 -21T270 4T243 47T233 111Z" /> -<glyph unicode="@" glyph-name="at" horiz-adv-x="1774" d="M1665 731Q1665 669 1656 607T1628 488T1581 383T1514 298T1428 242T1321 221Q1276 221 1240 236T1177 276T1135 333T1112 401H1108Q1090 364 1063 331T1001 274T921 235T823 221Q746 221 687 249T586 -327T524 449T502 606Q502 707 531 791T616 936T751 1031T928 1065Q973 1065 1018 1061T1104 1050T1179 1035T1237 1018L1214 602Q1213 580 1213 567T1212 545T1212 533T1212 526Q1212 473 1222 439T1250 385T1288 358T1333 350Q1379 350 1414 380T1472 463T1508 -585T1520 733Q1520 875 1477 985T1358 1172T1178 1287T950 1327Q781 1327 652 1272T436 1117T303 881T258 582Q258 431 297 314T413 117T603 -4T864 -45Q925 -45 984 -38T1099 -19T1205 8T1298 41V-100Q1212 -138 1104 -160T866 -182Q687 -182 547 -131T309 17T160 -255T109 575Q109 763 168 925T336 1207T601 1394T950 1462Q1106 1462 1237 1412T1463 1267T1612 1037T1665 731ZM662 602Q662 469 712 410T848 350Q903 350 942 372T1006 436T1044 535T1061 662L1075 915Q1047 923 1009 929T928 936Q854 936 804 907T722 831T676 -724T662 602Z" /> -<glyph unicode="A" glyph-name="A" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836Z" /> -<glyph unicode="B" glyph-name="B" horiz-adv-x="1272" d="M199 1462H598Q726 1462 823 1443T986 1380T1085 1266T1118 1092Q1118 1030 1099 976T1042 881T951 813T827 776V766Q896 754 956 732T1062 670T1133 570T1159 424Q1159 324 1127 246T1033 113T883 29T684 -0H199V1462ZM385 842H629Q713 842 770 857T862 901T912 975T928 1079Q928 1199 851 1251T608 1303H385V842ZM385 686V158H651Q739 158 798 178T894 234T947 320T963 432Q963 488 947 535T893 615T793 667T639 686H385Z" /> -<glyph unicode="C" glyph-name="C" horiz-adv-x="1235" d="M793 1319Q686 1319 599 1279T451 1162T356 977T322 731Q322 590 351 481T440 296T587 182T793 143Q882 143 962 160T1120 201V39Q1081 24 1042 13T961 -6T870 -16T762 -20Q598 -20 478 34T280 187T163 -425T125 733Q125 899 168 1037T296 1274T506 1428T793 1483Q901 1483 999 1461T1176 1397L1098 1241Q1035 1273 961 1296T793 1319Z" /> -<glyph unicode="D" glyph-name="D" horiz-adv-x="1401" d="M1276 745Q1276 560 1228 421T1089 188T866 47T565 0H199V1462H606Q759 1462 883 1416T1094 1280T1228 1055T1276 745ZM1079 739Q1079 885 1046 991T950 1167T795 1269T586 1303H385V160H547Q811 160 -945 306T1079 739Z" /> -<glyph unicode="E" glyph-name="E" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0Z" /> -<glyph unicode="F" glyph-name="F" horiz-adv-x="1006" d="M385 0H199V1462H958V1298H385V782H920V618H385V0Z" /> -<glyph unicode="G" glyph-name="G" horiz-adv-x="1413" d="M782 772H1266V55Q1211 37 1155 23T1040 0T916 -15T776 -20Q619 -20 498 32T294 182T168 419T125 733Q125 905 172 1044T311 1280T535 1430T840 1483Q951 1483 1053 1461T1243 1397L1171 1235Q1135 1252 -1094 1267T1008 1293T918 1312T825 1319Q703 1319 609 1279T452 1162T355 977T322 731Q322 601 349 493T437 307T592 186T821 143Q865 143 901 145T969 152T1027 161T1081 172V608H782V772Z" /> -<glyph unicode="H" glyph-name="H" horiz-adv-x="1436" d="M1237 0H1051V682H385V0H199V1462H385V846H1051V1462H1237V0Z" /> -<glyph unicode="I" glyph-name="I" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0Z" /> -<glyph unicode="J" glyph-name="J" horiz-adv-x="555" d="M-29 -389Q-80 -389 -118 -383T-184 -365V-205Q-150 -214 -111 -219T-27 -225Q10 -225 47 -216T115 -181T165 -112T184 0V1462H371V20Q371 -85 342 -162T260 -289T134 -364T-29 -389Z" /> -<glyph unicode="K" glyph-name="K" horiz-adv-x="1186" d="M1186 0H975L524 698L385 584V0H199V1462H385V731L506 899L958 1462H1167L647 825L1186 0Z" /> -<glyph unicode="L" glyph-name="L" horiz-adv-x="1006" d="M199 0V1462H385V166H958V0H199Z" /> -<glyph unicode="M" glyph-name="M" horiz-adv-x="1782" d="M803 0L360 1280H352Q358 1206 362 1133Q366 1070 368 1001T371 874V0H199V1462H475L887 270H893L1307 1462H1583V0H1397V887Q1397 939 1399 1006T1404 1134Q1408 1205 1411 1278H1403L956 0H803Z" /> -<glyph unicode="N" glyph-name="N" horiz-adv-x="1493" d="M1294 0H1079L360 1210H352Q358 1133 362 1057Q366 992 368 921T371 793V0H199V1462H412L1128 258H1135Q1132 334 1128 408Q1127 440 1126 473T1123 540T1121 605T1120 662V1462H1294V0Z" /> -<glyph unicode="O" glyph-name="O" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 733ZM322 -733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733Z" /> -<glyph unicode="P" glyph-name="P" horiz-adv-x="1180" d="M1075 1034Q1075 943 1048 859T957 711T791 608T535 569H385V0H199V1462H561Q695 1462 792 1434T952 1351T1045 1216T1075 1034ZM385 727H514Q607 727 676 743T791 794T860 886T883 1024Q883 1166 801 -1234T545 1303H385V727Z" /> -<glyph unicode="Q" glyph-name="Q" horiz-adv-x="1518" d="M1393 733Q1393 602 1369 489T1297 286T1178 129T1014 25Q1057 -69 1125 -140T1284 -272L1163 -414Q1060 -341 974 -242T836 -16Q819 -18 799 -19T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 -905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 -1165T348 980T322 733Z" /> -<glyph unicode="R" glyph-name="R" horiz-adv-x="1208" d="M385 604V0H199V1462H555Q821 1462 948 1359T1075 1047Q1075 960 1051 895T986 784T893 706T786 655L1184 0H965L614 604H385ZM385 762H549Q639 762 702 779T805 831T864 917T883 1038Q883 1110 863 1160T801 -1242T696 1288T545 1303H385V762Z" /> -<glyph unicode="S" glyph-name="S" horiz-adv-x="1063" d="M969 391Q969 294 935 218T836 88T680 8T473 -20Q362 -20 266 -3T104 49V227Q138 211 181 196T273 168T372 149T473 141Q633 141 709 201T786 373Q786 427 772 467T721 540T623 605T469 674Q380 709 315 -750T207 844T144 962T123 1112Q123 1200 155 1269T245 1385T383 1458T561 1483Q680 1483 775 1461T944 1403L877 1247Q812 1276 730 1297T559 1319Q437 1319 370 1263T303 1110Q303 1053 318 1012T368 937T460 874T602 811Q693 775 761 737T876 651T945 540T969 -391Z" /> -<glyph unicode="T" glyph-name="T" horiz-adv-x="1063" d="M625 0H438V1298H20V1462H1042V1298H625V0Z" /> -<glyph unicode="U" glyph-name="U" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245Z" /> -<glyph unicode="V" glyph-name="V" horiz-adv-x="1163" d="M965 1462H1163L674 0H487L0 1462H197L492 535Q521 444 542 360T580 201Q595 275 618 359T672 541L965 1462Z" /> -<glyph unicode="W" glyph-name="W" horiz-adv-x="1810" d="M809 1462H1006L1235 606Q1250 550 1264 494T1291 386T1313 286T1329 201Q1333 239 1339 284T1353 378T1370 479T1391 580L1591 1462H1790L1423 0H1235L981 938Q967 989 954 1043T930 1144Q918 1199 907 -1251Q896 1200 885 1145Q875 1098 863 1042T836 932L594 0H406L20 1462H217L440 573Q452 527 462 478T480 379T496 285T508 201Q513 238 520 287T538 390T559 499T584 604L809 1462Z" /> -<glyph unicode="X" glyph-name="X" horiz-adv-x="1120" d="M1120 0H909L555 635L188 0H0L453 764L31 1462H229L561 903L895 1462H1085L664 770L1120 0Z" /> -<glyph unicode="Y" glyph-name="Y" horiz-adv-x="1079" d="M539 723L879 1462H1079L633 569V0H446V559L0 1462H203L539 723Z" /> -<glyph unicode="Z" glyph-name="Z" horiz-adv-x="1104" d="M1022 0H82V145L793 1296H102V1462H1001V1317L291 166H1022V0Z" /> -<glyph unicode="[" glyph-name="bracketleft" horiz-adv-x="621" d="M569 -324H164V1462H569V1313H346V-174H569V-324Z" /> -<glyph unicode="\" glyph-name="backslash" horiz-adv-x="764" d="M201 1462L745 0H567L23 1462H201Z" /> -<glyph unicode="]" glyph-name="bracketright" horiz-adv-x="621" d="M51 -174H274V1313H51V1462H457V-324H51V-174Z" /> -<glyph unicode="^" glyph-name="asciicircum" horiz-adv-x="1090" d="M41 549L500 1473H602L1049 549H888L551 1284L202 549H41Z" /> -<glyph unicode="_" glyph-name="underscore" horiz-adv-x="842" d="M846 -324H-4V-184H846V-324Z" /> -<glyph unicode="`" glyph-name="grave" horiz-adv-x="1182" d="M786 1241H666Q631 1269 590 1310T511 1396T441 1480T393 1548V1569H612Q628 1535 649 1495T694 1414T741 1335T786 1268V1241Z" /> -<glyph unicode="a" glyph-name="a" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 374 943T236 -885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127Z" /> -<glyph unicode="b" glyph-name="b" horiz-adv-x="1200" d="M670 1118Q764 1118 841 1082T972 975T1057 797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20Q611 -20 563 -7T477 27T409 78T356 139H344L307 0H174V1556H356V1180Q356 1145 355 1106T352 1032Q350 -992 348 954H356Q379 989 408 1019T475 1071T562 1105T670 1118ZM635 967Q555 967 502 942T416 864T370 734T356 551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" /> -<glyph unicode="c" glyph-name="c" horiz-adv-x="948" d="M594 -20Q493 -20 405 11T252 111T150 286T113 543Q113 700 151 809T255 987T411 1087T602 1118Q680 1118 754 1101T879 1059L825 905Q802 915 774 924T716 941T657 953T602 958Q445 958 373 858T301 545Q301 -334 373 237T594 139Q675 139 740 157T860 201V39Q806 10 745 -5T594 -20Z" /> -<glyph unicode="d" glyph-name="d" horiz-adv-x="1200" d="M852 147H844Q822 113 793 83T725 29T638 -7T530 -20Q437 -20 360 16T228 123T143 301T113 547Q113 688 143 794T228 973T360 1081T530 1118Q589 1118 637 1105T723 1070T792 1019T844 958H856Q853 992 -850 1023Q848 1049 846 1076T844 1120V1556H1026V0H879L852 147ZM565 131Q641 131 693 154T778 224T826 341T844 506V547Q844 648 831 726T785 858T698 939T563 967Q428 967 365 858T301 545Q301 336 364 234T565 131Z" /> -<glyph unicode="e" glyph-name="e" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704 144T788 158T867 -182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967Z" /> -<glyph unicode="f" glyph-name="f" horiz-adv-x="674" d="M651 961H406V0H223V961H29V1036L223 1104V1200Q223 1307 245 1377T310 1490T415 1549T555 1567Q614 1567 663 1556T752 1530L705 1389Q674 1400 638 1408T561 1417Q521 1417 492 1408T444 1374T416 1309T406 -1202V1098H651V961Z" /> -<glyph unicode="g" glyph-name="g" horiz-adv-x="1061" d="M1020 1098V985L823 958Q851 923 870 869T889 745Q889 669 866 605T795 493T677 420T514 393Q492 393 470 393T434 397Q417 387 401 375T371 346T349 310T340 266Q340 239 352 223T384 197T433 185T492 -182H668Q761 182 825 159T929 95T988 1T1006 -115Q1006 -203 974 -273T874 -391T705 -466T463 -492Q356 -492 276 -471T143 -410T64 -314T37 -186Q37 -126 56 -81T109 -2T185 52T276 84Q234 103 207 144T180 238Q180 299 212 343T313 430Q270 448 235 479T175 551T137 -640T123 739Q123 828 148 898T222 1017T344 1092T514 1118Q551 1118 590 1113T657 1098H1020ZM209 -180Q209 -217 222 -249T264 -304T342 -340T463 -354Q649 -354 741 -297T834 -131Q834 -85 822 -56T783 -11T710 12T600 18H424Q389 18 351 10T282 -20T230 -80T209 --180ZM301 745Q301 630 355 574T508 518Q608 518 659 573T711 748Q711 871 659 929T506 987Q407 987 354 927T301 745Z" /> -<glyph unicode="h" glyph-name="h" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1556H356V1094L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860Z" /> -<glyph unicode="i" glyph-name="i" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM160 1395Q160 1455 190 1482T266 1509Q288 1509 307 1503T341 1482T364 1447T373 1395Q373 1337 342 1309T266 1280Q221 1280 191 1308T160 1395Z" /> -<glyph unicode="j" glyph-name="j" horiz-adv-x="530" d="M66 -492Q18 -492 -13 -485T-68 -467V-319Q-42 -329 -15 -334T47 -340Q74 -340 97 -333T137 -306T164 -254T174 -170V1098H356V-158Q356 -235 339 -296T286 -401T196 -468T66 -492ZM160 1395Q160 1455 -190 1482T266 1509Q288 1509 307 1503T341 1482T364 1447T373 1395Q373 1337 342 1309T266 1280Q221 1280 191 1308T160 1395Z" /> -<glyph unicode="k" glyph-name="k" horiz-adv-x="1016" d="M342 567L477 737L770 1098H981L580 623L1008 0H799L463 504L354 422V0H174V1556H354V842L338 567H342Z" /> -<glyph unicode="l" glyph-name="l" horiz-adv-x="530" d="M356 0H174V1556H356V0Z" /> -<glyph unicode="m" glyph-name="m" horiz-adv-x="1835" d="M1489 0V707Q1489 837 1439 902T1284 967Q1211 967 1160 944T1077 875T1029 762T1014 606V0H831V707Q831 837 782 902T627 967Q550 967 498 941T415 864T370 739T356 569V0H174V1098H322L348 950H358Q382 -993 415 1024T487 1077T571 1108T662 1118Q782 1118 861 1074T979 936H987Q1013 983 1049 1017T1129 1073T1221 1107T1319 1118Q1494 1118 1582 1023T1671 717V0H1489Z" /> -<glyph unicode="n" glyph-name="n" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1098H322L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860Z" /> -<glyph unicode="o" glyph-name="o" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301 551Q301 -342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551Z" /> -<glyph unicode="p" glyph-name="p" horiz-adv-x="1200" d="M670 -20Q611 -20 563 -7T477 27T409 78T356 139H344Q347 105 350 74Q352 48 354 21T356 -23V-492H174V1098H322L348 950H356Q379 985 408 1015T475 1068T562 1104T670 1118Q764 1118 841 1082T972 975T1057 -797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20ZM635 967Q559 967 507 944T422 874T374 757T356 592V551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" /> -<glyph unicode="q" glyph-name="q" horiz-adv-x="1200" d="M565 131Q641 131 693 154T778 224T826 341T844 506V547Q844 648 831 726T785 858T698 939T563 967Q428 967 365 858T301 545Q301 336 364 234T565 131ZM530 -20Q437 -20 360 16T228 123T143 301T113 -547Q113 688 143 794T228 973T360 1081T530 1118Q589 1118 637 1105T723 1069T791 1016T844 950H852L879 1098H1026V-492H844V-23Q844 -4 846 25T850 81Q853 113 856 147H844Q822 113 793 83T725 29T638 -7T530 -20Z" /> -<glyph unicode="r" glyph-name="r" horiz-adv-x="817" d="M649 1118Q678 1118 714 1116T776 1108L752 940Q724 945 695 948T639 952Q576 952 524 927T435 854T377 740T356 592V0H174V1098H322L344 897H352Q377 940 405 980T469 1050T549 1099T649 1118Z" /> -<glyph unicode="s" glyph-name="s" horiz-adv-x="924" d="M831 301Q831 221 802 161T719 61T587 0T414 -20Q305 -20 227 -3T90 49V215Q121 199 159 184T239 156T325 137T414 129Q479 129 524 140T598 171T640 221T653 287Q653 318 643 343T607 392T534 442T416 -498Q344 529 287 559T189 626T128 711T106 827Q106 897 133 951T211 1043T331 1099T487 1118Q584 1118 664 1097T817 1042L754 895Q689 924 621 945T481 967Q379 967 330 934T281 838Q281 803 292 777T332 728T407 682T524 629Q596 599 652 569T749 502T810 416T831 -301Z" /> -<glyph unicode="t" glyph-name="t" horiz-adv-x="694" d="M506 129Q524 129 546 131T590 136T628 143T655 150V12Q642 6 622 0T578 -10T528 -17T477 -20Q415 -20 362 -4T271 51T210 156T188 324V961H33V1042L188 1120L266 1350H371V1098H647V961H371V324Q371 227 -402 178T506 129Z" /> -<glyph unicode="u" glyph-name="u" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885Z" /> -<glyph unicode="v" glyph-name="v" horiz-adv-x="981" d="M375 0L0 1098H188L387 487Q398 454 413 402T443 296T470 194T487 121H494Q499 146 511 194T538 296T568 402T594 487L793 1098H981L606 0H375Z" /> -<glyph unicode="w" glyph-name="w" horiz-adv-x="1528" d="M1008 0L840 616Q836 634 830 656T818 704T806 755T793 806Q779 864 764 926H758Q744 863 731 805Q720 755 708 702T684 612L512 0H301L20 1098H211L342 514Q352 469 362 417T381 313T397 216T408 141H414Q419 -167 427 210T446 302T468 398T489 479L668 1098H864L1036 479Q1045 445 1056 399T1079 306T1099 214T1112 141H1118Q1121 167 1127 210T1143 306T1162 412T1184 514L1321 1098H1507L1223 0H1008Z" /> -<glyph unicode="x" glyph-name="x" horiz-adv-x="1024" d="M408 563L55 1098H262L512 688L762 1098H969L614 563L987 0H780L512 436L242 0H35L408 563Z" /> -<glyph unicode="y" glyph-name="y" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130 -492 92 -487T27 --475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098Z" /> -<glyph unicode="z" glyph-name="z" horiz-adv-x="903" d="M821 0H82V125L618 961H115V1098H803V952L279 137H821V0Z" /> -<glyph unicode="{" glyph-name="braceleft" horiz-adv-x="725" d="M500 -16Q500 -64 512 -94T546 -142T601 -166T674 -174V-324Q597 -323 532 -307T419 -255T344 -164T317 -31V303Q317 406 252 449T61 492V647Q186 647 251 690T317 836V1169Q317 1247 344 1302T418 -1392T531 1444T674 1462V1313Q634 1312 602 1306T547 1282T512 1234T500 1155V823Q500 718 441 657T266 575V563Q381 543 440 482T500 315V-16Z" /> -<glyph unicode="|" glyph-name="bar" horiz-adv-x="1128" d="M489 1556H639V-492H489V1556Z" /> -<glyph unicode="}" glyph-name="braceright" horiz-adv-x="725" d="M225 315Q225 421 284 482T459 563V575Q344 595 285 656T225 823V1155Q225 1203 213 1233T179 1281T124 1305T51 1313V1462Q128 1461 193 1445T306 1393T381 1302T408 1169V836Q408 784 424 748T473 -690T554 657T664 647V492Q539 492 474 449T408 303V-31Q408 -109 381 -164T307 -254T194 -306T51 -324V-174Q91 -173 123 -167T178 -143T213 -95T225 -16V315Z" /> -<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1128" d="M530 651Q493 667 466 678T416 695T373 704T330 707Q302 707 272 698T213 672T155 633T102 586V748Q202 856 350 856Q379 856 404 854T456 845T517 826T598 793Q635 777 662 766T713 749T757 -740T799 737Q827 737 857 746T916 772T974 811T1026 858V696Q927 588 778 588Q749 588 724 590T672 599T611 618T530 651Z" /> -<glyph unicode=" " glyph-name="nbspace" horiz-adv-x="532" /> -<glyph unicode="¡" glyph-name="exclamdown" horiz-adv-x="551" d="M213 676H334L385 -373H162L213 676ZM401 979Q401 941 392 915T365 872T324 848T274 840Q248 840 225 847T185 871T157 914T147 979Q147 1016 157 1042T184 1085T225 1110T274 1118Q301 -1118 324 1110T364 1085T391 1042T401 979Z" /> -<glyph unicode="¢" glyph-name="cent" horiz-adv-x="1128" d="M886 212T831 197T700 180V-20H563V186Q476 199 407 236T289 340T214 506T188 743Q188 884 214 985T289 1155T407 1260T563 1311V1483H700V1319Q772 1316 840 1300T954 1260L901 1106Q878 1116 -850 1125T792 1142T733 1154T678 1159Q521 1159 449 1058T377 745Q377 535 449 438T670 340Q751 340 816 358T936 401V240Q886 212 831 197Z" /> -<glyph unicode="£" glyph-name="sterling" horiz-adv-x="1128" d="M666 1481Q772 1481 859 1459T1012 1401L946 1257Q890 1286 820 1307T674 1329Q626 1329 585 1316T514 1273T468 1196T451 1083V788H827V651H451V440Q451 378 440 334T409 257T364 204T311 -166H1059V0H68V154Q112 165 148 185T211 240T253 322T268 438V651H70V788H268V1112Q268 1199 297 1267T379 1383T505 1456T666 1481Z" /> -<glyph unicode="¤" glyph-name="currency" horiz-adv-x="1128" d="M186 723Q186 782 203 835T252 936L123 1065L221 1163L348 1034Q395 1066 449 1084T563 1102Q623 1102 676 1084T776 1034L905 1163L1004 1067L874 938Q905 892 923 838T942 723Q942 663 -925 608T874 508L1001 381L905 285L776 412Q730 381 677 364T563 346Q503 346 448 364T348 414L221 287L125 383L252 510Q221 555 204 609T186 723ZM324 723Q324 673 342 630T393 554T469 502T563 483Q614 483 658 502T736 553T788 629T807 723Q807 774 788 818T736 -896T659 948T563 967Q513 967 470 948T394 896T343 819T324 723Z" /> -<glyph unicode="¥" glyph-name="yen" horiz-adv-x="1128" d="M563 723L909 1462H1100L715 694H954V557H653V399H954V262H653V0H475V262H174V399H475V557H174V694H408L29 1462H221L563 723Z" /> -<glyph unicode="¦" glyph-name="brokenbar" horiz-adv-x="1128" d="M489 1556H639V776H489V1556ZM489 289H639V-492H489V289Z" /> -<glyph unicode="§" glyph-name="section" horiz-adv-x="995" d="M137 809Q137 860 150 901T185 975T237 1029T297 1067Q222 1105 180 1162T137 1303Q137 1364 164 1413T242 1496T362 1548T518 1567Q615 1567 693 1547T844 1495L788 1356Q723 1384 653 1403T512 -1423Q413 1423 362 1394T311 1307Q311 1280 323 1257T363 1212T439 1167T557 1114Q629 1086 685 1054T781 982T841 895T862 784Q862 732 850 690T818 613T771 555T717 514Q786 476 824 422T862 289Q862 218 833 163T749 69T618 10T444 -10Q336 -10 258 6T121 55V213Q152 -198 190 183T270 157T356 138T444 131Q513 131 559 143T633 174T672 219T684 272Q684 301 676 323T642 368T569 415T446 471Q373 502 316 533T218 603T158 692T137 809ZM291 831Q291 794 305 763T350 702T432 646T555 588L590 573Q610 586 630 604T667 645T694 -696T705 758Q705 796 692 828T647 889T560 947T424 1006Q399 998 376 983T333 945T303 893T291 831Z" /> -<glyph unicode="¨" glyph-name="dieresis" horiz-adv-x="1182" d="M307 1395Q307 1449 335 1473T403 1497Q442 1497 471 1473T500 1395Q500 1342 471 1317T403 1292Q363 1292 335 1317T307 1395ZM682 1395Q682 1449 710 1473T778 1497Q797 1497 814 1491T845 -1473T866 1441T874 1395Q874 1342 845 1317T778 1292Q738 1292 710 1317T682 1395Z" /> -<glyph unicode="©" glyph-name="copyright" horiz-adv-x="1704" d="M891 1053Q830 1053 783 1031T704 968T656 866T639 731Q639 653 653 593T698 492T776 430T891 408Q914 408 941 411T996 421T1053 435T1106 453V322Q1082 311 1058 302T1007 286T950 276T885 -272Q783 272 707 305T581 399T505 545T479 733Q479 834 506 917T585 1061T714 1154T891 1188Q954 1188 1020 1172T1145 1126L1083 999Q1031 1025 983 1039T891 1053ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 -1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM209 731Q209 598 259 481T397 277T602 139T852 88Q985 88 1102 138T1306 276T1444 481T1495 -731Q1495 864 1445 981T1307 1185T1102 1323T852 1374Q719 1374 602 1324T398 1186T260 981T209 731Z" /> -<glyph unicode="ª" glyph-name="ordfeminine" horiz-adv-x="678" d="M487 797L459 879Q441 857 422 840T379 810T327 791T264 784Q221 784 185 797T123 835T83 899T68 989Q68 1091 138 1145T352 1204L451 1208V1239Q451 1311 421 1339T334 1368Q286 1368 -241 1354T154 1317L106 1417Q157 1443 215 1461T334 1479Q459 1479 518 1426T578 1251V797H487ZM377 1110Q326 1107 292 1098T238 1074T208 1038T199 987Q199 936 224 914T291 891Q325 891 354 901T404 934T438 988T451 1065V1114L377 1110Z" /> -<glyph unicode="«" glyph-name="guillemotleft" horiz-adv-x="997" d="M82 553L391 967L508 889L270 541L508 193L391 115L82 526V553ZM489 553L799 967L915 889L678 541L915 193L799 115L489 526V553Z" /> -<glyph unicode="¬" glyph-name="logicalnot" horiz-adv-x="1128" d="M1026 797V262H877V647H102V797H1026Z" /> -<glyph unicode="­" glyph-name="uni00AD" horiz-adv-x="659" d="M82 465V633H578V465H82Z" /> -<glyph unicode="®" glyph-name="registered" horiz-adv-x="1704" d="M743 768H815Q906 768 945 804T985 909Q985 983 944 1012T813 1042H743V768ZM1145 913Q1145 865 1132 828T1096 762T1045 713T985 680Q1052 570 1105 483Q1128 446 1149 411T1186 347T1213 -302L1223 285H1044L838 637H743V285H586V1178H819Q987 1178 1066 1113T1145 913ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 -200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM209 731Q209 598 259 481T397 277T602 139T852 88Q985 88 1102 138T1306 276T1444 481T1495 731Q1495 864 1445 981T1307 1185T1102 1323T852 1374Q719 1374 602 1324T398 1186T260 -981T209 731Z" /> -<glyph unicode="¯" glyph-name="overscore" horiz-adv-x="1024" d="M1030 1556H-6V1696H1030V1556Z" /> -<glyph unicode="°" glyph-name="degree" horiz-adv-x="877" d="M123 1167Q123 1232 148 1289T215 1390T315 1458T438 1483Q503 1483 560 1458T661 1390T729 1290T754 1167Q754 1102 729 1045T661 946T561 879T438 854Q373 854 316 878T216 945T148 1045T123 -1167ZM246 1167Q246 1128 261 1094T302 1033T363 992T438 977Q478 977 513 992T574 1033T616 1093T631 1167Q631 1207 616 1242T575 1304T513 1346T438 1362Q398 1362 363 1347T302 1305T261 1243T246 1167Z" /> -<glyph unicode="±" glyph-name="plusminus" horiz-adv-x="1128" d="M489 647H102V797H489V1186H639V797H1026V647H639V262H489V647ZM102 0V150H1026V0H102Z" /> -<glyph unicode="²" glyph-name="twosuperior" horiz-adv-x="678" d="M621 586H49V698L258 926Q315 988 351 1030T407 1106T434 1169T442 1233Q442 1298 409 1330T322 1362Q271 1362 225 1337T133 1274L55 1368Q109 1416 175 1448T324 1481Q384 1481 432 1465T515 -1417T567 1340T586 1237Q586 1187 572 1144T530 1059T464 971T373 870L225 713H621V586Z" /> -<glyph unicode="³" glyph-name="threesuperior" horiz-adv-x="678" d="M590 1255Q590 1177 550 1124T440 1047Q528 1024 572 971T616 840Q616 780 596 730T535 645T430 589T281 569Q211 569 150 581T31 625V758Q94 724 160 705T279 686Q377 686 421 727T465 -842Q465 916 412 949T262 983H164V1096H262Q354 1096 396 1135T438 1239Q438 1271 428 1294T401 1333T360 1355T309 1362Q250 1362 202 1342T102 1284L33 1380Q62 1403 92 1421T157 1453T229 1473T311 1481Q380 1481 432 1464T520 1417T572 1346T590 1255Z" /> -<glyph unicode="´" glyph-name="acute" horiz-adv-x="1182" d="M393 1268Q415 1297 438 1335T485 1413T530 1494T567 1569H786V1548Q770 1521 739 1481T669 1396T590 1311T514 1241H393V1268Z" /> -<glyph unicode="µ" glyph-name="mu" horiz-adv-x="1217" d="M356 391Q356 261 409 196T573 131Q655 131 710 157T798 233T846 358T860 528V1098H1042V0H895L868 147H858Q810 64 738 22T563 -20Q491 -20 438 3T350 68Q351 30 353 -10Q355 -45 355 -87T356 --172V-492H174V1098H356V391Z" /> -<glyph unicode="¶" glyph-name="paragraph" horiz-adv-x="1341" d="M1126 -260H1006V1397H799V-260H678V559Q617 541 532 541Q437 541 360 566T228 651T143 806T113 1042Q113 1189 145 1287T237 1446T380 1531T563 1556H1126V-260Z" /> -<glyph unicode="·" glyph-name="middot" horiz-adv-x="549" d="M147 723Q147 761 157 787T184 830T224 854T274 862Q300 862 323 855T364 831T391 788T401 723Q401 686 391 660T364 617T324 592T274 584Q247 584 224 592T184 617T157 660T147 723Z" /> -<glyph unicode="¸" glyph-name="cedilla" horiz-adv-x="420" d="M408 -287Q408 -384 338 -438T117 -492Q95 -492 73 -489T35 -483V-375Q50 -378 74 -379T115 -381Q186 -381 226 -360T266 -289Q266 -265 253 -248T217 -217T163 -195T94 -176L184 0H305L248 --115Q282 -123 311 -136T361 -169T395 -219T408 -287Z" /> -<glyph unicode="¹" glyph-name="onesuperior" horiz-adv-x="678" d="M307 1462H442V586H297V1102Q297 1127 297 1157T299 1217T302 1275T305 1325Q291 1308 272 1288T231 1251L137 1178L63 1274L307 1462Z" /> -<glyph unicode="º" glyph-name="ordmasculine" horiz-adv-x="717" d="M651 1133Q651 1050 631 985T572 876T479 808T356 784Q293 784 240 807T148 875T88 985T66 1133Q66 1216 86 1280T145 1389T237 1456T360 1479Q422 1479 475 1456T568 1389T629 1281T651 -1133ZM197 1133Q197 1014 234 954T358 893Q443 893 480 953T518 1133Q518 1253 481 1310T358 1368Q272 1368 235 1311T197 1133Z" /> -<glyph unicode="»" glyph-name="guillemotright" horiz-adv-x="997" d="M918 526L608 115L492 193L729 541L492 889L608 967L918 553V526ZM510 526L201 115L84 193L322 541L84 889L201 967L510 553V526Z" /> -<glyph unicode="¼" glyph-name="onequarter" horiz-adv-x="1509" d="M307 1462H442V586H297V1102Q297 1127 297 1157T299 1217T302 1275T305 1325Q291 1308 272 1288T231 1251L137 1178L63 1274L307 1462ZM1202 1462L391 0H234L1045 1462H1202ZM1419 193H1294V1H1151V193H776V304L1153 -883H1294V320H1419V193ZM1151 320V515Q1151 557 1152 606T1157 705Q1152 694 1142 676T1121 636T1098 595T1077 560L922 320H1151Z" /> -<glyph unicode="½" glyph-name="onehalf" horiz-adv-x="1509" d="M544 1462H679V586H534V1102Q534 1127 534 1157T536 1217T539 1275T542 1325Q528 1308 509 1288T468 1251L374 1178L300 1274L544 1462ZM1181 1462L370 0H213L1024 1462H1181ZM1440 1H868V113L1077 -341Q1134 403 1170 445T1226 521T1253 584T1261 648Q1261 713 1228 745T1141 777Q1090 777 1044 752T952 689L874 783Q928 831 994 863T1143 896Q1203 896 1251 880T1334 832T1386 755T1405 652Q1405 602 1391 559T1349 474T1283 386T1192 285L1044 128H1440V1Z" -/> -<glyph unicode="¾" glyph-name="threequarters" horiz-adv-x="1509" d="M590 1255Q590 1177 550 1124T440 1047Q528 1024 572 971T616 840Q616 780 596 730T535 645T430 589T281 569Q211 569 150 581T31 625V758Q94 724 160 705T279 686Q377 686 421 727T465 -842Q465 916 412 949T262 983H164V1096H262Q354 1096 396 1135T438 1239Q438 1271 428 1294T401 1333T360 1355T309 1362Q250 1362 202 1342T102 1284L33 1380Q62 1403 92 1421T157 1453T229 1473T311 1481Q380 1481 432 1464T520 1417T572 1346T590 1255ZM1296 -1462L485 0H328L1139 1462H1296ZM1486 193H1361V1H1218V193H843V304L1220 883H1361V320H1486V193ZM1218 320V515Q1218 557 1219 606T1224 705Q1219 694 1209 676T1188 636T1165 595T1144 560L989 320H1218Z" /> -<glyph unicode="¿" glyph-name="questiondown" horiz-adv-x="872" d="M592 676V639Q592 581 584 536T557 450T505 371T422 291Q374 250 340 217T285 149T253 75T242 -18Q242 -66 257 -105T300 -173T371 -217T469 -233Q553 -233 628 -208T772 -147L836 -293Q754 --335 660 -364T469 -393Q376 -393 302 -368T176 -294T96 -177T68 -20Q68 48 81 100T121 197T188 284T283 373Q335 418 368 451T420 516T446 580T453 657V676H592ZM639 979Q639 941 630 915T603 872T562 848T512 840Q486 840 463 847T423 871T395 914T385 979Q385 -1016 395 1042T422 1085T463 1110T512 1118Q539 1118 562 1110T602 1085T629 1042T639 979Z" /> -<glyph unicode="À" glyph-name="Agrave" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM719 -1579H599Q564 1607 523 1648T444 1734T374 1818T326 1886V1907H545Q561 1873 582 1833T627 1752T674 1673T719 1606V1579Z" /> -<glyph unicode="Á" glyph-name="Aacute" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM534 -1606Q556 1635 579 1673T626 1751T671 1832T708 1907H927V1886Q911 1859 880 1819T810 1734T731 1649T655 1579H534V1606Z" /> -<glyph unicode="Â" glyph-name="Acircumflex" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM953 -1579H832Q781 1613 727 1661T621 1765Q567 1710 514 1662T410 1579H289V1606Q315 1635 349 1673T416 1751T479 1832T525 1907H717Q733 1873 762 1833T825 1752T893 1673T953 1606V1579Z" /> -<glyph unicode="Ã" glyph-name="Atilde" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM772 -1581Q732 1581 693 1598T615 1637T542 1676T475 1694Q430 1694 406 1668T368 1579H264Q269 1639 285 1688T328 1771T392 1824T475 1843Q517 1843 557 1826T636 1787T708 1749T772 1731Q817 1731 840 1757T878 1845H983Q978 1785 962 1737T919 1654T855 1600T772 -1581Z" /> -<glyph unicode="Ä" glyph-name="Adieresis" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM340 -1733Q340 1787 368 1811T436 1835Q475 1835 504 1811T533 1733Q533 1680 504 1655T436 1630Q396 1630 368 1655T340 1733ZM715 1733Q715 1787 743 1811T811 1835Q830 1835 847 1829T878 1811T899 1779T907 1733Q907 1680 878 1655T811 1630Q771 1630 743 1655T715 -1733Z" /> -<glyph unicode="Å" glyph-name="Aring" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM848 -1583Q848 1532 831 1492T783 1423T710 1381T619 1366Q569 1366 528 1380T458 1423T412 1490T396 1581Q396 1632 412 1671T457 1739T528 1781T619 1796Q667 1796 709 1782T782 1740T830 1673T848 1583ZM731 1581Q731 1634 700 1664T619 1694Q569 1694 538 1664T506 -1581Q506 1528 534 1498T619 1468Q668 1468 699 1498T731 1581Z" /> -<glyph unicode="Æ" glyph-name="AE" horiz-adv-x="1745" d="M1622 0H862V453H387L184 0H-2L653 1462H1622V1298H1049V846H1583V684H1049V164H1622V0ZM459 618H862V1298H754L459 618Z" /> -<glyph unicode="Ç" glyph-name="Ccedilla" horiz-adv-x="1235" d="M793 1319Q686 1319 599 1279T451 1162T356 977T322 731Q322 590 351 481T440 296T587 182T793 143Q882 143 962 160T1120 201V39Q1081 24 1042 13T961 -6T870 -16T762 -20Q598 -20 478 34T280 -187T163 425T125 733Q125 899 168 1037T296 1274T506 1428T793 1483Q901 1483 999 1461T1176 1397L1098 1241Q1035 1273 961 1296T793 1319ZM916 -287Q916 -384 846 -438T625 -492Q603 -492 581 -489T543 -483V-375Q558 -378 582 -379T623 -381Q694 -381 734 -360T774 --289Q774 -265 761 -248T725 -217T671 -195T602 -176L692 0H813L756 -115Q790 -123 819 -136T869 -169T903 -219T916 -287Z" /> -<glyph unicode="È" glyph-name="Egrave" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM713 1579H593Q558 1607 517 1648T438 1734T368 1818T320 1886V1907H539Q555 1873 576 1833T621 1752T668 1673T713 1606V1579Z" /> -<glyph unicode="É" glyph-name="Eacute" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM456 1606Q478 1635 501 1673T548 1751T593 1832T630 1907H849V1886Q833 1859 802 1819T732 1734T653 1649T577 1579H456V1606Z" /> -<glyph unicode="Ê" glyph-name="Ecircumflex" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM907 1579H786Q735 1613 681 1661T575 1765Q521 1710 468 1662T364 1579H243V1606Q269 1635 303 1673T370 1751T433 1832T479 -1907H671Q687 1873 716 1833T779 1752T847 1673T907 1606V1579Z" /> -<glyph unicode="Ë" glyph-name="Edieresis" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM296 1733Q296 1787 324 1811T392 1835Q431 1835 460 1811T489 1733Q489 1680 460 1655T392 1630Q352 1630 324 1655T296 1733ZM671 -1733Q671 1787 699 1811T767 1835Q786 1835 803 1829T834 1811T855 1779T863 1733Q863 1680 834 1655T767 1630Q727 1630 699 1655T671 1733Z" /> -<glyph unicode="Ì" glyph-name="Igrave" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM455 1579H335Q300 1607 259 1648T180 1734T110 1818T62 1886V1907H281Q297 1873 318 1833T363 1752T410 1673T455 -1606V1579Z" /> -<glyph unicode="Í" glyph-name="Iacute" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM257 1606Q279 1635 302 1673T349 1751T394 1832T431 1907H650V1886Q634 1859 603 1819T533 1734T454 1649T378 -1579H257V1606Z" /> -<glyph unicode="Î" glyph-name="Icircumflex" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM681 1579H560Q509 1613 455 1661T349 1765Q295 1710 242 1662T138 1579H17V1606Q43 1635 77 1673T144 1751T207 -1832T253 1907H445Q461 1873 490 1833T553 1752T621 1673T681 1606V1579Z" /> -<glyph unicode="Ï" glyph-name="Idieresis" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM64 1733Q64 1787 92 1811T160 1835Q199 1835 228 1811T257 1733Q257 1680 228 1655T160 1630Q120 1630 92 1655T64 -1733ZM439 1733Q439 1787 467 1811T535 1835Q554 1835 571 1829T602 1811T623 1779T631 1733Q631 1680 602 1655T535 1630Q495 1630 467 1655T439 1733Z" /> -<glyph unicode="Ð" glyph-name="Eth" horiz-adv-x="1401" d="M47 805H199V1462H606Q759 1462 883 1416T1094 1280T1228 1055T1276 745Q1276 560 1228 421T1089 188T866 47T565 0H199V643H47V805ZM1079 739Q1079 885 1046 991T950 1167T795 1269T586 1303H385V805H721V643H385V160H547Q811 -160 945 306T1079 739Z" /> -<glyph unicode="Ñ" glyph-name="Ntilde" horiz-adv-x="1493" d="M1294 0H1079L360 1210H352Q358 1133 362 1057Q366 992 368 921T371 793V0H199V1462H412L1128 258H1135Q1132 334 1128 408Q1127 440 1126 473T1123 540T1121 605T1120 662V1462H1294V0ZM905 -1581Q865 1581 826 1598T748 1637T675 1676T608 1694Q563 1694 539 1668T501 1579H397Q402 1639 418 1688T461 1771T525 1824T608 1843Q650 1843 690 1826T769 1787T841 1749T905 1731Q950 1731 973 1757T1011 1845H1116Q1111 1785 1095 1737T1052 1654T988 1600T905 -1581Z" /> -<glyph unicode="Ò" glyph-name="Ograve" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 -733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM870 1579H750Q715 1607 674 1648T595 1734T525 1818T477 1886V1907H696Q712 -1873 733 1833T778 1752T825 1673T870 1606V1579Z" /> -<glyph unicode="Ó" glyph-name="Oacute" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 -733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM651 1606Q673 1635 696 1673T743 1751T788 1832T825 1907H1044V1886Q1028 -1859 997 1819T927 1734T848 1649T772 1579H651V1606Z" /> -<glyph unicode="Ô" glyph-name="Ocircumflex" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 -1043T1393 733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM1096 1579H975Q924 1613 870 1661T764 1765Q710 -1710 657 1662T553 1579H432V1606Q458 1635 492 1673T559 1751T622 1832T668 1907H860Q876 1873 905 1833T968 1752T1036 1673T1096 1606V1579Z" /> -<glyph unicode="Õ" glyph-name="Otilde" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 -733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM891 1581Q851 1581 812 1598T734 1637T661 1676T594 1694Q549 -1694 525 1668T487 1579H383Q388 1639 404 1688T447 1771T511 1824T594 1843Q636 1843 676 1826T755 1787T827 1749T891 1731Q936 1731 959 1757T997 1845H1102Q1097 1785 1081 1737T1038 1654T974 1600T891 1581Z" /> -<glyph unicode="Ö" glyph-name="Odieresis" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 -733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM477 1733Q477 1787 505 1811T573 1835Q612 1835 641 1811T670 -1733Q670 1680 641 1655T573 1630Q533 1630 505 1655T477 1733ZM852 1733Q852 1787 880 1811T948 1835Q967 1835 984 1829T1015 1811T1036 1779T1044 1733Q1044 1680 1015 1655T948 1630Q908 1630 880 1655T852 1733Z" /> -<glyph unicode="×" glyph-name="multiply" horiz-adv-x="1128" d="M459 723L141 1042L246 1147L563 829L885 1147L989 1044L668 723L987 403L885 301L563 618L246 303L143 406L459 723Z" /> -<glyph unicode="Ø" glyph-name="Oslash" horiz-adv-x="1520" d="M1300 1454L1208 1305Q1299 1206 1346 1061T1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q571 -20 438 51L360 -76L223 2L313 147Q216 247 171 396T125 735Q125 905 163 1043T280 -1280T479 1431T762 1485Q856 1485 936 1464T1083 1405L1163 1532L1300 1454ZM322 733Q322 602 345 498T416 315L995 1260Q947 1289 890 1305T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM1196 733Q1196 990 1108 1141L530 201Q577 173 634 158T760 143Q874 -143 956 183T1092 300T1171 486T1196 733Z" /> -<glyph unicode="Ù" glyph-name="Ugrave" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM847 -1579H727Q692 1607 651 1648T572 1734T502 1818T454 1886V1907H673Q689 1873 710 1833T755 1752T802 1673T847 1606V1579Z" /> -<glyph unicode="Ú" glyph-name="Uacute" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM590 -1606Q612 1635 635 1673T682 1751T727 1832T764 1907H983V1886Q967 1859 936 1819T866 1734T787 1649T711 1579H590V1606Z" /> -<glyph unicode="Û" glyph-name="Ucircumflex" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 -512V1464H1245ZM1043 1579H922Q871 1613 817 1661T711 1765Q657 1710 604 1662T500 1579H379V1606Q405 1635 439 1673T506 1751T569 1832T615 1907H807Q823 1873 852 1833T915 1752T983 1673T1043 1606V1579Z" /> -<glyph unicode="Ü" glyph-name="Udieresis" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM432 -1733Q432 1787 460 1811T528 1835Q567 1835 596 1811T625 1733Q625 1680 596 1655T528 1630Q488 1630 460 1655T432 1733ZM807 1733Q807 1787 835 1811T903 1835Q922 1835 939 1829T970 1811T991 1779T999 1733Q999 1680 970 1655T903 1630Q863 1630 835 1655T807 -1733Z" /> -<glyph unicode="Ý" glyph-name="Yacute" horiz-adv-x="1079" d="M539 723L879 1462H1079L633 569V0H446V559L0 1462H203L539 723ZM442 1606Q464 1635 487 1673T534 1751T579 1832T616 1907H835V1886Q819 1859 788 1819T718 1734T639 1649T563 1579H442V1606Z" /> -<glyph unicode="Þ" glyph-name="Thorn" horiz-adv-x="1180" d="M1075 782Q1075 691 1048 607T957 459T791 356T535 317H385V0H199V1462H385V1210H561Q695 1210 792 1182T952 1099T1045 964T1075 782ZM385 475H514Q607 475 676 491T791 542T860 634T883 772Q883 -915 801 983T545 1051H385V475Z" /> -<glyph unicode="ß" glyph-name="germandbls" horiz-adv-x="1233" d="M1010 1260Q1010 1203 989 1159T936 1078T867 1011T798 954T745 899T723 842Q723 821 730 805T756 769T811 725T903 662Q959 625 1003 589T1077 512T1124 423T1141 313Q1141 226 1113 163T1035 -60T914 0T758 -20Q661 -20 592 -3T469 49V215Q495 199 527 184T596 156T670 137T745 129Q801 129 841 141T908 176T946 231T958 303Q958 339 950 368T920 426T862 483T770 547Q707 587 665 621T596 688T558 757T547 834Q547 888 567 927T619 998T686 1057T753 1113T804 -1175T825 1253Q825 1295 809 1326T762 1377T691 1407T598 1417Q549 1417 505 1408T428 1374T376 1309T356 1202V0H174V1200Q174 1304 205 1374T293 1487T428 1548T598 1567Q690 1567 766 1548T896 1491T980 1395T1010 1260Z" /> -<glyph unicode="à" glyph-name="agrave" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 -374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM934 1241H814Q779 -1269 738 1310T659 1396T589 1480T541 1548V1569H760Q776 1535 797 1495T842 1414T889 1335T934 1268V1241Z" /> -<glyph unicode="á" glyph-name="aacute" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 -374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM446 1268Q468 1297 -491 1335T538 1413T583 1494T620 1569H839V1548Q823 1521 792 1481T722 1396T643 1311T567 1241H446V1268Z" /> -<glyph unicode="â" glyph-name="acircumflex" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 -967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM1148 1241H1027Q976 -1275 922 1323T816 1427Q762 1372 709 1324T605 1241H484V1268Q510 1297 544 1335T611 1413T674 1494T720 1569H912Q928 1535 957 1495T1020 1414T1088 1335T1148 1268V1241Z" /> -<glyph unicode="ã" glyph-name="atilde" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 -374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM955 1243Q915 1243 -876 1260T798 1299T725 1338T658 1356Q613 1356 589 1330T551 1241H447Q452 1301 468 1350T511 1433T575 1486T658 1505Q700 1505 740 1488T819 1449T891 1411T955 1393Q1000 1393 1023 1419T1061 1507H1166Q1161 1447 1145 1399T1102 1316T1038 1262T955 1243Z" -/> -<glyph unicode="ä" glyph-name="adieresis" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 -967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM529 1395Q529 -1449 557 1473T625 1497Q664 1497 693 1473T722 1395Q722 1342 693 1317T625 1292Q585 1292 557 1317T529 1395ZM904 1395Q904 1449 932 1473T1000 1497Q1019 1497 1036 1491T1067 1473T1088 1441T1096 1395Q1096 1342 1067 1317T1000 1292Q960 1292 932 1317T904 -1395Z" /> -<glyph unicode="å" glyph-name="aring" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 -374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM1039 1458Q1039 -1407 1022 1367T974 1298T901 1256T810 1241Q760 1241 719 1255T649 1298T603 1365T587 1456Q587 1507 603 1546T648 1614T719 1656T810 1671Q858 1671 900 1657T973 1615T1021 1548T1039 1458ZM922 1456Q922 1509 891 1539T810 1569Q760 1569 729 1539T697 1456Q697 -1403 725 1373T810 1343Q859 1343 890 1373T922 1456Z" /> -<glyph unicode="æ" glyph-name="ae" horiz-adv-x="1706" d="M94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q659 1118 742 1076T868 940Q919 1025 1002 -1071T1188 1118Q1285 1118 1362 1083T1493 983T1575 828T1604 627V514H932Q937 321 1010 230T1231 139Q1280 139 1322 144T1404 158T1480 182T1554 215V53Q1515 34 1478 20T1401 -3T1319 -16T1227 -20Q1089 -20 988 37T825 209Q791 155 753 113T668 41T562 -4T430 --20Q359 -20 298 -1T191 59T120 161T94 307ZM283 305Q283 213 331 170T459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305ZM1184 967Q1074 967 1011 889T936 662H1407Q1407 730 1394 786T1354 883T1284 945T1184 -967Z" /> -<glyph unicode="ç" glyph-name="ccedilla" horiz-adv-x="948" d="M594 -20Q493 -20 405 11T252 111T150 286T113 543Q113 700 151 809T255 987T411 1087T602 1118Q680 1118 754 1101T879 1059L825 905Q802 915 774 924T716 941T657 953T602 958Q445 958 373 -858T301 545Q301 334 373 237T594 139Q675 139 740 157T860 201V39Q806 10 745 -5T594 -20ZM730 -287Q730 -384 660 -438T439 -492Q417 -492 395 -489T357 -483V-375Q372 -378 396 -379T437 -381Q508 -381 548 -360T588 -289Q588 -265 575 -248T539 -217T485 -195T416 --176L506 0H627L570 -115Q604 -123 633 -136T683 -169T717 -219T730 -287Z" /> -<glyph unicode="è" glyph-name="egrave" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704 -144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM934 1241H814Q779 1269 738 1310T659 1396T589 1480T541 1548V1569H760Q776 1535 797 1495T842 1414T889 -1335T934 1268V1241Z" /> -<glyph unicode="é" glyph-name="eacute" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704 -144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM475 1268Q497 1297 520 1335T567 1413T612 1494T649 1569H868V1548Q852 1521 821 1481T751 1396T672 1311T596 -1241H475V1268Z" /> -<glyph unicode="ê" glyph-name="ecircumflex" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 -704 144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM1144 1241H1023Q972 1275 918 1323T812 1427Q758 1372 705 1324T601 1241H480V1268Q506 1297 540 -1335T607 1413T670 1494T716 1569H908Q924 1535 953 1495T1016 1414T1084 1335T1144 1268V1241Z" /> -<glyph unicode="ë" glyph-name="edieresis" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 -704 144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM525 1395Q525 1449 553 1473T621 1497Q660 1497 689 1473T718 1395Q718 1342 689 1317T621 1292Q581 -1292 553 1317T525 1395ZM900 1395Q900 1449 928 1473T996 1497Q1015 1497 1032 1491T1063 1473T1084 1441T1092 1395Q1092 1342 1063 1317T996 1292Q956 1292 928 1317T900 1395Z" /> -<glyph unicode="ì" glyph-name="igrave" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM359 1241H239Q204 1269 163 1310T84 1396T14 1480T-34 1548V1569H185Q201 1535 222 1495T267 1414T314 1335T359 1268V1241Z" /> -<glyph unicode="í" glyph-name="iacute" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM185 1268Q207 1297 230 1335T277 1413T322 1494T359 1569H578V1548Q562 1521 531 1481T461 1396T382 1311T306 1241H185V1268Z" /> -<glyph unicode="î" glyph-name="icircumflex" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM597 1241H476Q425 1275 371 1323T265 1427Q211 1372 158 1324T54 1241H-67V1268Q-41 1297 -7 1335T60 1413T123 1494T169 1569H361Q377 1535 406 1495T469 1414T537 -1335T597 1268V1241Z" /> -<glyph unicode="ï" glyph-name="idieresis" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM-18 1395Q-18 1449 10 1473T78 1497Q117 1497 146 1473T175 1395Q175 1342 146 1317T78 1292Q38 1292 10 1317T-18 1395ZM357 1395Q357 1449 385 1473T453 1497Q472 -1497 489 1491T520 1473T541 1441T549 1395Q549 1342 520 1317T453 1292Q413 1292 385 1317T357 1395Z" /> -<glyph unicode="ð" glyph-name="eth" horiz-adv-x="1182" d="M1069 573Q1069 431 1036 321T940 135T788 20T588 -20Q484 -20 397 13T246 109T147 265T111 477Q111 596 142 688T233 843T376 938T565 971Q667 971 744 942T864 852L872 856Q841 974 781 1070T631 -1247L375 1094L301 1208L518 1339Q478 1367 436 1394T346 1448L416 1571Q481 1539 542 1503T662 1423L889 1561L963 1448L768 1331Q835 1266 890 1188T985 1017T1047 813T1069 573ZM881 526Q881 582 864 635T812 730T722 796T592 821Q515 821 461 798T371 731T320 -622T303 471Q303 395 319 333T371 225T461 156T592 131Q746 131 813 230T881 526Z" /> -<glyph unicode="ñ" glyph-name="ntilde" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1098H322L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860ZM1015 -1243Q975 1243 936 1260T858 1299T785 1338T718 1356Q673 1356 649 1330T611 1241H507Q512 1301 528 1350T571 1433T635 1486T718 1505Q760 1505 800 1488T879 1449T951 1411T1015 1393Q1060 1393 1083 1419T1121 1507H1226Q1221 1447 1205 1399T1162 1316T1098 -1262T1015 1243Z" /> -<glyph unicode="ò" glyph-name="ograve" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301 -551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM1002 1241H882Q847 1269 806 1310T727 1396T657 1480T609 1548V1569H828Q844 1535 865 1495T910 1414T957 1335T1002 1268V1241Z" /> -<glyph unicode="ó" glyph-name="oacute" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301 -551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM473 1268Q495 1297 518 1335T565 1413T610 1494T647 1569H866V1548Q850 1521 819 1481T749 1396T670 1311T594 1241H473V1268Z" /> -<glyph unicode="ô" glyph-name="ocircumflex" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 -551ZM301 551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM1173 1241H1052Q1001 1275 947 1323T841 1427Q787 1372 734 1324T630 1241H509V1268Q535 1297 569 1335T636 1413T699 1494T745 1569H937Q953 -1535 982 1495T1045 1414T1113 1335T1173 1268V1241Z" /> -<glyph unicode="õ" glyph-name="otilde" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301 -551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM992 1243Q952 1243 913 1260T835 1299T762 1338T695 1356Q650 1356 626 1330T588 1241H484Q489 1301 505 1350T548 1433T612 1486T695 1505Q737 1505 777 -1488T856 1449T928 1411T992 1393Q1037 1393 1060 1419T1098 1507H1203Q1198 1447 1182 1399T1139 1316T1075 1262T992 1243Z" /> -<glyph unicode="ö" glyph-name="odieresis" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 -551ZM301 551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM556 1395Q556 1449 584 1473T652 1497Q691 1497 720 1473T749 1395Q749 1342 720 1317T652 1292Q612 1292 584 1317T556 1395ZM931 1395Q931 -1449 959 1473T1027 1497Q1046 1497 1063 1491T1094 1473T1115 1441T1123 1395Q1123 1342 1094 1317T1027 1292Q987 1292 959 1317T931 1395Z" /> -<glyph unicode="÷" glyph-name="divide" horiz-adv-x="1128" d="M102 647V797H1026V647H102ZM449 373Q449 408 458 431T482 470T518 491T563 498Q586 498 607 492T644 470T669 432T678 373Q678 340 669 317T644 278T607 255T563 248Q539 248 519 255T483 -277T458 316T449 373ZM449 1071Q449 1106 458 1129T482 1168T518 1189T563 1196Q586 1196 607 1190T644 1168T669 1130T678 1071Q678 1038 669 1015T644 976T607 953T563 946Q539 946 519 953T483 975T458 1014T449 1071Z" /> -<glyph unicode="ø" glyph-name="oslash" horiz-adv-x="1182" d="M1071 551Q1071 414 1038 308T942 129T790 18T590 -20Q465 -20 367 33L299 -76L168 -2L248 129Q185 201 150 307T115 551Q115 687 148 792T244 970T395 1080T596 1118Q659 1118 715 1104T821 -1061L889 1169L1020 1096L940 967Q1002 894 1036 790T1071 551ZM303 551Q303 467 312 402T344 285L741 932Q712 949 675 958T592 967Q438 967 371 864T303 551ZM883 551Q883 710 844 809L446 164Q477 147 513 139T594 131Q748 131 815 236T883 551Z" /> -<glyph unicode="ù" glyph-name="ugrave" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM949 -1241H829Q794 1269 753 1310T674 1396T604 1480T556 1548V1569H775Q791 1535 812 1495T857 1414T904 1335T949 1268V1241Z" /> -<glyph unicode="ú" glyph-name="uacute" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM489 -1268Q511 1297 534 1335T581 1413T626 1494T663 1569H882V1548Q866 1521 835 1481T765 1396T686 1311T610 1241H489V1268Z" /> -<glyph unicode="û" glyph-name="ucircumflex" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM930 -1241H809Q758 1275 704 1323T598 1427Q544 1372 491 1324T387 1241H266V1268Q292 1297 326 1335T393 1413T456 1494T502 1569H694Q710 1535 739 1495T802 1414T870 1335T930 1268V1241Z" /> -<glyph unicode="ü" glyph-name="udieresis" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM309 -1395Q309 1449 337 1473T405 1497Q444 1497 473 1473T502 1395Q502 1342 473 1317T405 1292Q365 1292 337 1317T309 1395ZM684 1395Q684 1449 712 1473T780 1497Q799 1497 816 1491T847 1473T868 1441T876 1395Q876 1342 847 1317T780 1292Q740 1292 712 1317T684 -1395Z" /> -<glyph unicode="ý" glyph-name="yacute" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130 --492 92 -487T27 -475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098ZM407 1268Q429 1297 452 1335T499 1413T544 1494T581 1569H800V1548Q784 1521 753 1481T683 1396T604 1311T528 1241H407V1268Z" /> -<glyph unicode="þ" glyph-name="thorn" horiz-adv-x="1200" d="M356 950Q379 985 408 1015T475 1068T562 1104T670 1118Q764 1118 841 1082T972 975T1057 797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20Q611 -20 563 -7T477 27T409 78T356 139H344Q347 -105 350 74Q352 48 354 21T356 -23V-492H174V1556H356V1098L348 950H356ZM635 967Q559 967 507 944T422 874T374 757T356 592V551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" /> -<glyph unicode="ÿ" glyph-name="ydieresis" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130 --492 92 -487T27 -475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098ZM484 1395Q484 1449 512 1473T580 1497Q619 1497 648 1473T677 1395Q677 1342 648 1317T580 1292Q540 1292 512 1317T484 1395ZM859 1395Q859 -1449 887 1473T955 1497Q974 1497 991 1491T1022 1473T1043 1441T1051 1395Q1051 1342 1022 1317T955 1292Q915 1292 887 1317T859 1395Z" /> -<glyph unicode="–" glyph-name="endash" horiz-adv-x="1024" d="M82 465V633H942V465H82Z" /> -<glyph unicode="—" glyph-name="emdash" horiz-adv-x="2048" d="M82 465V633H1966V465H82Z" /> -<glyph unicode="‘" glyph-name="quoteleft" horiz-adv-x="358" d="M37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H336Q321 1401 307 1335T279 1204T255 1076T236 961H37Z" /> -<glyph unicode="’" glyph-name="quoteright" horiz-adv-x="358" d="M322 1462L336 1440Q322 1385 303 1325T260 1202T211 1078T160 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H322Z" /> -<glyph unicode="‚" glyph-name="quotesinglbase" horiz-adv-x="512" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362Z" /> -<glyph unicode="“" glyph-name="quotedblleft" horiz-adv-x="743" d="M422 961L408 983Q422 1037 441 1098T484 1221T533 1344T584 1462H721Q706 1401 692 1335T664 1204T640 1076T621 961H422ZM37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H336Q321 -1401 307 1335T279 1204T255 1076T236 961H37Z" /> -<glyph unicode="”" glyph-name="quotedblright" horiz-adv-x="743" d="M322 1462L336 1440Q322 1385 303 1325T260 1202T211 1078T160 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H322ZM707 1462L721 1440Q707 1385 688 1325T645 1202T596 1078T545 -961H408Q422 1021 436 1087T464 1219T489 1347T508 1462H707Z" /> -<glyph unicode="„" glyph-name="quotedblbase" horiz-adv-x="897" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362ZM748 238L762 215Q748 161 729 100T686 -23T637 -146T586 -264H449Q463 --203 477 -137T505 -6T530 122T549 238H748Z" /> -<glyph unicode="•" glyph-name="bullet" horiz-adv-x="770" d="M150 748Q150 819 168 869T217 950T292 996T385 1010Q434 1010 477 996T552 951T602 869T621 748Q621 678 603 628T552 547T477 500T385 485Q335 485 292 500T218 546T168 628T150 748Z" /> -<glyph unicode="‹" glyph-name="guilsinglleft" horiz-adv-x="590" d="M82 553L391 967L508 889L270 541L508 193L391 115L82 526V553Z" /> -<glyph unicode="›" glyph-name="guilsinglright" horiz-adv-x="590" d="M508 526L199 115L82 193L319 541L82 889L199 967L508 553V526Z" /> -</font> -</defs> -</svg> diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf Binary files differdeleted file mode 100644 index 76aede27..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff Binary files differdeleted file mode 100644 index abf19899..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 Binary files differdeleted file mode 100644 index 9f93f74c..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/explorer_icons.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/explorer_icons.png Binary files differdeleted file mode 100644 index ed9d2fff..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/explorer_icons.png +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/logo_small.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/logo_small.png Binary files differdeleted file mode 100644 index 5496a655..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/logo_small.png +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/pet_store_api.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/pet_store_api.png Binary files differdeleted file mode 100644 index f9f9cd4a..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/pet_store_api.png +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/throbber.gif b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/throbber.gif Binary files differdeleted file mode 100644 index 06393889..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/throbber.gif +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/wordnik_api.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/wordnik_api.png Binary files differdeleted file mode 100644 index dca4f145..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/images/wordnik_api.png +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/index.html b/catalog-core/catalog-mgr/src/main/resources/api-doc/index.html deleted file mode 100644 index 3ceebeb4..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/index.html +++ /dev/null @@ -1,115 +0,0 @@ -<!--
-
- Copyright 2016 ZTE Corporation.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<!DOCTYPE html>
-<html>
-<head>
- <title>Swagger UI</title>
- <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
- <link href='css/screen.css' media='print' rel='stylesheet' type='text/css'/>
- <script type="text/javascript" src="lib/shred.bundle.js"></script>
- <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
- <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
- <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
- <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
- <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
- <script src='lib/underscore-min.js' type='text/javascript'></script>
- <script src='lib/backbone-min.js' type='text/javascript'></script>
- <script src='lib/swagger-client.js' type='text/javascript'></script>
- <script src='swagger-ui.js' type='text/javascript'></script>
- <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
- <script src='lib/marked.js' type='text/javascript'></script>
-
- <!-- enabling this will enable oauth2 implicit scope support -->
- <script src='lib/swagger-oauth.js' type='text/javascript'></script>
- <script type="text/javascript">
- $(function () {
- var url = window.location.search.match(/url=([^&]+)/);
- if (url && url.length > 1) {
- url = decodeURIComponent(url[1]);
- } else {
- url = "/openoapi/catalog/v1/swagger.json";
- }
- window.swaggerUi = new SwaggerUi({
- url: url,
- dom_id: "swagger-ui-container",
- supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
- onComplete: function(swaggerApi, swaggerUi){
- if(typeof initOAuth == "function") {
- /*
- initOAuth({
- clientId: "your-client-id",
- realm: "your-realms",
- appName: "your-app-name"
- });
- */
- }
- $('pre code').each(function(i, e) {
- hljs.highlightBlock(e)
- });
- },
- onFailure: function(data) {
- log("Unable to Load SwaggerUI");
- },
- docExpansion: "none",
- sorter : "alpha"
- });
-
- function addApiKeyAuthorization() {
- var key = $('#input_apiKey')[0].value;
- log("key: " + key);
- if(key && key.trim() != "") {
- log("added key " + key);
- window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query"));
- }
- }
-
- $('#input_apiKey').change(function() {
- addApiKeyAuthorization();
- });
-
- // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
- /*
- var apiKey = "myApiKeyXXXX123456789";
- $('#input_apiKey').val(apiKey);
- addApiKeyAuthorization();
- */
-
- window.swaggerUi.load();
- });
- </script>
-</head>
-
-<body class="swagger-section">
-<div id='header'>
- <div class="swagger-ui-wrap">
- <a id="logo" >OPEN-O Catalog</a>
- <form id='api_selector'>
- <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
- <div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
- <div class='input'><a id="explore" href="#">Explore</a></div>
- </form>
- </div>
-</div>
-
-<div id="message-bar" class="swagger-ui-wrap"> </div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-</body>
-</html>
diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/backbone-min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/backbone-min.js deleted file mode 100644 index 3df984d6..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/backbone-min.js +++ /dev/null @@ -1,30 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// Backbone.js 1.1.2
-
-(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h<u;h++){t=o[h];if(a=this._events[t]){this._events[t]=s=[];if(e||r){for(l=0,f=a.length;l<f;l++){n=a[l];if(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context){s.push(n)}}}if(!s.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)f(i,e);if(r)f(r,arguments);return this},stopListening:function(t,e,r){var s=this._listeningTo;if(!s)return this;var n=!e&&!r;if(!r&&typeof e==="object")r=this;if(t)(s={})[t._listenId]=t;for(var a in s){t=s[a];t.off(e,r,this);if(n||i.isEmpty(t._events))delete this._listeningTo[a]}return this}};var l=/\s+/;var c=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(l.test(i)){var n=i.split(l);for(var a=0,o=n.length;a<o;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var f=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,o);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e);return}};var d={listenTo:"on",listenToOnce:"once"};i.each(d,function(t,e){u[e]=function(e,r,s){var n=this._listeningTo||(this._listeningTo={});var a=e._listenId||(e._listenId=i.uniqueId("l"));n[a]=e;if(!s&&typeof r==="object")s=this;e[t](r,s,this);return this}});u.bind=u.on;u.unbind=u.off;i.extend(e,u);var p=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(p.prototype,u,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,r){var s,n,a,o,h,u,l,c;if(t==null)return this;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;a=r.unset;h=r.silent;o=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=i.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in n)this.id=n[this.idAttribute];for(s in n){e=n[s];if(!i.isEqual(c[s],e))o.push(s);if(!i.isEqual(l[s],e)){this.changed[s]=e}else{delete this.changed[s]}a?delete c[s]:c[s]=e}if(!h){if(o.length)this._pending=r;for(var f=0,d=o.length;f<d;f++){this.trigger("change:"+o[f],this,c[o[f]],r)}}if(u)return this;if(!h){while(this._pending){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e,r=false;var s=this._changing?this._previousAttributes:this.attributes;for(var n in t){if(i.isEqual(s[n],e=t[n]))continue;(r||(r={}))[n]=e}return r},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var r=t.success;t.success=function(i){if(!e.set(e.parse(i,t),t))return false;if(r)r(e,i,t);e.trigger("sync",e,i,t)};q(this,t);return this.sync("read",this,t)},save:function(t,e,r){var s,n,a,o=this.attributes;if(t==null||typeof t==="object"){s=t;r=e}else{(s={})[t]=e}r=i.extend({validate:true},r);if(s&&!r.wait){if(!this.set(s,r))return false}else{if(!this._validate(s,r))return false}if(s&&r.wait){this.attributes=i.extend({},o,s)}if(r.parse===void 0)r.parse=true;var h=this;var u=r.success;r.success=function(t){h.attributes=o;var e=h.parse(t,r);if(r.wait)e=i.extend(s||{},e);if(i.isObject(e)&&!h.set(e,r)){return false}if(u)u(h,t,r);h.trigger("sync",h,t,r)};q(this,r);n=this.isNew()?"create":r.patch?"patch":"update";if(n==="patch")r.attrs=s;a=this.sync(n,this,r);if(s&&r.wait)this.attributes=o;return a},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var s=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(t.wait||e.isNew())s();if(r)r(e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};if(this.isNew()){t.success();return false}q(this,t);var n=this.sync("delete",this,t);if(!t.wait)s();return n},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;return t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var v=["keys","values","pairs","invert","pick","omit"];i.each(v,function(t){p.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.attributes);return i[t].apply(i,e)}});var g=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,remove:false};i.extend(g.prototype,u,{model:p,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,y))},remove:function(t,e){var r=!i.isArray(t);t=r?[t]:i.clone(t);e||(e={});var s,n,a,o;for(s=0,n=t.length;s<n;s++){o=t[s]=this.get(t[s]);if(!o)continue;delete this._byId[o.id];delete this._byId[o.cid];a=this.indexOf(o);this.models.splice(a,1);this.length--;if(!e.silent){e.index=a;o.trigger("remove",o,this,e)}this._removeReference(o,e)}return r?t[0]:t},set:function(t,e){e=i.defaults({},e,m);if(e.parse)t=this.parse(t,e);var r=!i.isArray(t);t=r?t?[t]:[]:i.clone(t);var s,n,a,o,h,u,l;var c=e.at;var f=this.model;var d=this.comparator&&c==null&&e.sort!==false;var v=i.isString(this.comparator)?this.comparator:null;var g=[],y=[],_={};var b=e.add,w=e.merge,x=e.remove;var E=!d&&b&&x?[]:false;for(s=0,n=t.length;s<n;s++){h=t[s]||{};if(h instanceof p){a=o=h}else{a=h[f.prototype.idAttribute||"id"]}if(u=this.get(a)){if(x)_[u.cid]=true;if(w){h=h===o?o.attributes:h;if(e.parse)h=u.parse(h,e);u.set(h,e);if(d&&!l&&u.hasChanged(v))l=true}t[s]=u}else if(b){o=t[s]=this._prepareModel(h,e);if(!o)continue;g.push(o);this._addReference(o,e)}o=u||o;if(E&&(o.isNew()||!_[o.id]))E.push(o);_[o.id]=true}if(x){for(s=0,n=this.length;s<n;++s){if(!_[(o=this.models[s]).cid])y.push(o)}if(y.length)this.remove(y,e)}if(g.length||E&&E.length){if(d)l=true;this.length+=g.length;if(c!=null){for(s=0,n=g.length;s<n;s++){this.models.splice(c+s,0,g[s])}}else{if(E)this.models.length=0;var k=E||g;for(s=0,n=k.length;s<n;s++){this.models.push(k[s])}}}if(l)this.sort({silent:true});if(!e.silent){for(s=0,n=g.length;s<n;s++){(o=g[s]).trigger("add",o,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}return r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,s=this.models.length;r<s;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){if(i.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(i.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(i.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var r=this;t.success=function(i){var s=t.reset?"reset":"set";r[s](i,t);if(e)e(r,i,t);r.trigger("sync",r,i,t)};q(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var r=this;var s=e.success;e.success=function(t,i){if(e.wait)r.add(t,e);if(s)s(t,i,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof p)return t;e=e?i.clone(e):{};e.collection=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_addReference:function(t,e){this._byId[t.cid]=t;if(t.id!=null)this._byId[t.id]=t;if(!t.collection)t.collection=this;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];i.each(_,function(t){g.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.models);return i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){g.prototype[t]=function(e,r){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,r)}});var w=e.View=function(t){this.cid=i.uniqueId("view");t||(t={});i.extend(this,i.pick(t,E));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];i.extend(w.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,i){if(this.$el)this.undelegateEvents();this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0];if(i!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=i.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[t[e]];if(!r)continue;var s=e.match(x);var n=s[1],a=s[2];r=i.bind(r,this);n+=".delegateEvents"+this.cid;if(a===""){this.$el.on(n,r)}else{this.$el.on(n,a,r)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");var r=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow;this.navigate(r)}if(this._hasPushState){e.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!n){e.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=r;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){this.fragment=this.getFragment(null,true);this.location.replace(this.root+"#"+this.fragment);return true}else if(this._hasPushState&&this.atRoot()&&o.hash){this.fragment=this.getHash().replace(R,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);N.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return i.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!N.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new N;var U=function(t,e){var r=this;var s;if(t&&i.has(t,"constructor")){s=t.constructor}else{s=function(){return r.apply(this,arguments)}}i.extend(s,r,e);var n=function(){this.constructor=s};n.prototype=r.prototype;s.prototype=new n;if(t)i.extend(s.prototype,t);s.__super__=r.prototype;return s};p.extend=g.extend=$.extend=w.extend=N.extend=U;var M=function(){throw new Error('A "url" property or function must be specified')};var q=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}};return e});
-
-// From http://stackoverflow.com/a/19431552
-// Compatibility override - Backbone 1.1 got rid of the 'options' binding
-// automatically to views in the constructor - we need to keep that.
-Backbone.View = (function(View) {
- return View.extend({
- constructor: function(options) {
- this.options = options || {};
- View.apply(this, arguments);
- }
- });
-})(Backbone.View);
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/handlebars-2.0.0.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/handlebars-2.0.0.js deleted file mode 100644 index 8004191c..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/handlebars-2.0.0.js +++ /dev/null @@ -1,43 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*!
-
- handlebars v2.0.0
-
-Copyright (C) 2011-2014 by Yehuda Katz
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-@license
-*/
-!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function d(a){return a instanceof h?a.toString():null==a?"":a?(a=""+a,k.test(a)?a.replace(j,b):a):a+""}function e(a){return a||0===a?n(a)&&0===a.length?!0:!1:!0}function f(a,b){return(a?a+".":"")+b}var g={},h=a,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/;g.extend=c;var l=Object.prototype.toString;g.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;g.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};return g.isArray=n,g.escapeExpression=d,g.isEmpty=e,g.appendContextPath=f,g}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=new Error,b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new g("Missing helper: '"+arguments[arguments.length-1].name+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse,e=c.fn;if(b===!0)return e(this);if(b===!1||null==b)return d(this);if(k(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var e={},f=a,g=b,h="2.0.0";e.VERSION=h;var i=6;e.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};e.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";e.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};e.logger=o;var p=o.log;e.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};return e.createFrame=q,e}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=f(this,a,e,b,c):d||(d=this.programs[a]=f(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=i(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return f(d,b,a[b],c,e)},e}function f(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function g(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function h(){return""}function i(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;return j.checkRevision=d,j.template=e,j.program=f,j.invokePartial=g,j.noop=h,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e),g=function(a){"use strict";function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d){b.call(this,d),this.type="program",this.statements=a,this.strip=c},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!c),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,c,d,e,f){b.call(this,f),this.type="partial",this.partialName=a,this.context=c,this.hash=d,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,c,d,e,f){b.call(this,f),this.type="block",this.mustache=a,this.program=c,this.inverse=d,this.strip=e,d&&!c&&(this.isInverse=!0)},RawBlockNode:function(a,c,f,g){if(b.call(this,g),a.sexpr.id.original!==f)throw new d(a.sexpr.id.original+" doesn't match "+f,this);c=new e.ContentNode(c,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([c],{},g)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.original=this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new d("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,c){b.call(this,c),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};return c=e}(c),h=function(){"use strict";var a,b=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return d.prepareProgram(f[g-1].statements,!0),f[g-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[g]),{},this._$);break;case 3:this.$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=new d.ContentNode(f[g],this._$);break;case 8:this.$=new d.CommentNode(f[g],this._$);break;case 9:this.$=new d.RawBlockNode(f[g-2],f[g-1],f[g],this._$);break;case 10:this.$=new d.MustacheNode(f[g-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 14:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 15:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 16:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 17:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 18:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 19:this.$=new d.PartialNode(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),this._$);break;case 20:this.$=new d.PartialNode(f[g-2],void 0,f[g-1],d.stripFlags(f[g-3],f[g]),this._$);break;case 21:this.$=new d.SexprNode([f[g-2]].concat(f[g-1]),f[g],this._$);break;case 22:this.$=new d.SexprNode([f[g]],null,this._$);break;case 23:this.$=f[g];break;case 24:this.$=new d.StringNode(f[g],this._$);break;case 25:this.$=new d.NumberNode(f[g],this._$);break;case 26:this.$=new d.BooleanNode(f[g],this._$);break;case 27:this.$=f[g];break;case 28:f[g-1].isHelper=!0,this.$=f[g-1];break;case 29:this.$=new d.HashNode(f[g],this._$);break;case 30:this.$=[f[g-2],f[g]];break;case 31:this.$=new d.PartialNameNode(f[g],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[g],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[g],this._$));break;case 34:this.$=new d.DataNode(f[g],this._$);break;case 35:this.$=new d.IdNode(f[g],this._$);break;case 36:f[g-2].push({part:f[g],separator:f[g-1]}),this.$=f[g-2];break;case 37:this.$=[{part:f[g]}];break;case 38:this.$=[];break;case 39:f[g-1].push(f[g]);break;case 48:this.$=[];break;case 49:f[g-1].push(f[g]);break;case 52:this.$=[f[g]];break;case 53:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();return a=b}(),i=function(a){"use strict";function b(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(b.length-3)}}function c(a,b,c,d,i,k){if(a.sexpr.id.original!==d.path.original)throw new j(a.sexpr.id.original+" doesn't match "+d.path.original,a);var l=c&&c.program,m={left:a.strip.left,right:d.strip.right,openStandalone:f(b.statements),closeStandalone:e((l||b).statements)};if(a.strip.right&&g(b.statements,null,!0),l){var n=c.strip;n.left&&h(b.statements,null,!0),n.right&&g(l.statements,null,!0),d.strip.left&&h(l.statements,null,!0),e(b.statements)&&f(l.statements)&&(h(b.statements),g(l.statements))}else d.strip.left&&h(b.statements,null,!0);return i?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function d(a,b){for(var c=0,d=a.length;d>c;c++){var i=a[c],j=i.strip;if(j){var k=e(a,c,b,"partial"===i.type),l=f(a,c,b),m=j.openStandalone&&k,n=j.closeStandalone&&l,o=j.inlineStandalone&&k&&l;j.right&&g(a,c,!0),j.left&&h(a,c,!0),o&&(g(a,c),h(a,c)&&"partial"===i.type&&(i.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(g((i.program||i.inverse).statements),h(a,c)),n&&(g(a,c),h((i.inverse||i.program).statements))}}return a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.string!==e,d.leftStripped}}var i={},j=a;return i.stripFlags=b,i.prepareBlock=c,i.prepareProgram=d,i}(c),j=function(a,b,c,d){"use strict";function e(a){return a.constructor===h.ProgramNode?a:(g.yy=k,g.parse(a))}var f={},g=a,h=b,i=c,j=d.extend;f.parser=g;var k={};return j(k,i,h),f.parse=e,f}(h,g,i,b),k=function(a,b){"use strict";function c(){}function d(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function e(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,f=function(a,b){return e||(e=d()),e.call(this,a,b)};return f._setup=function(a){return e||(e=d()),e._setup(a)},f._child=function(a,b,c){return e||(e=d()),e._child(a,b,c)},f}function f(a,b){if(a===b)return!0;if(i(a)&&i(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!f(a[c],b[c]))return!1;return!0}}var g={},h=a,i=b.isArray,j=[].slice;return g.Compiler=c,c.prototype={compiler:c,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!f(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;
-this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;for(this.opcode("pushHash"),b=0,c=d.length;c>b;b++)this.pushParam(d[b][1]);for(;b--;)this.opcode("assignToHash",d[b][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.accept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new h("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.ID(e),this.opcode("invokeHelper",d.length,e.original,e.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:j.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},g.precompile=d,g.compile=e,g}(c,b),l=function(a,b){"use strict";function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=b;d.prototype={nameLookup:function(a,b){return d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, "'+a+'")'},compilerInfo:function(){var a=f,b=g[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var e,f,g,i=a.opcodes;for(f=0,g=i.length;g>f;f++)e=i[f],this[e.opcode].apply(this,e.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new h("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(f=0,g=l.length;g>f;f++)l[f]&&(k[f]=l[f]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n "+f+"}"},mergeSource:function(a){for(var b,c,d="",e=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h=this.source[f];h.appendToBuffer?b=b?b+"\n + "+h.content:h.content:(b&&(d?d+="buffer += "+b+";\n ":(c=!0,d=b+";\n "),b=void 0),d+=h+"\n ",this.environment.isSimple||(e=!1))}return e?(b||!d)&&(d+="return "+(b||'""')+";\n"):(a+=", buffer = "+(c?"":this.initializeBuffer()),d+=b?"return buffer + "+b+";\n":"return buffer;\n"),a&&(d="var "+a.substring(2)+(c?"":";\n ")+d),d},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendingContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")})},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var b,c,d,e=this.popStack();this.trackIds&&(d=this.popStack()),this.stringParams&&(c=this.popStack(),b=this.popStack());var f=this.hash;b&&f.contexts.push("'"+a+"': "+b),c&&f.types.push("'"+a+"': "+c),d&&f.ids.push("'"+a+"': "+d),f.values.push("'"+a+"': ("+e+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context,!this.precompile),this.context.environments[h]=c,this.useDepths=this.useDepths||d.useDepths):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=(b.depths.list,this.useDepths),d=[b.index,"data"];return c&&d.push("depths"),"this.program("+d.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){{var b,d,e,f="";this.isInline()}if(!this.isInline())throw new h("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof c)f=b=g.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+g+")",b=this.topStack()}var j=a.call(this,b);e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new h("Invalid stack pop");this.stackSlot--}return d},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof c?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var d,e,f,g={},h=[],i=[],j=[];g.name=this.quotedString(a),g.hash=this.popStack(),this.trackIds&&(g.hashIds=this.popStack()),this.stringParams&&(g.hashTypes=this.popStack(),g.hashContexts=this.popStack()),e=this.popStack(),f=this.popStack(),(f||e)&&(f||(f="this.noop"),e||(e="this.noop"),g.fn=f,g.inverse=e);for(var k=b;k--;)d=this.popStack(),c[k]=d,this.trackIds&&(j[k]=this.popStack()),this.stringParams&&(i[k]=this.popStack(),h[k]=this.popStack());return this.trackIds&&(g.ids="["+j.join(",")+"]"),this.stringParams&&(g.types="["+i.join(",")+"]",g.contexts="["+h.join(",")+"]"),this.options.data&&(g.data="data"),g},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=d.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},e=d}(d,c),m=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,g["default"]=g,f=g}(f,g,j,k,l);return m});
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/highlight.7.3.pack.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/highlight.7.3.pack.js deleted file mode 100644 index 7e93f450..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/highlight.7.3.pack.js +++ /dev/null @@ -1,16 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o<p.length;o++){if(e[p[o]]||p[o]=="no-highlight"){return p[o]}}}function c(q){var o=[];(function p(r,s){for(var t=r.firstChild;t;t=t.nextSibling){if(t.nodeType==3){s+=t.nodeValue.length}else{if(t.nodeName=="BR"){s+=1}else{if(t.nodeType==1){o.push({event:"start",offset:s,node:t});s=p(t,s);o.push({event:"stop",offset:s,node:t})}}}}return s})(q,0);return o}function j(x,v,w){var p=0;var y="";var r=[];function t(){if(x.length&&v.length){if(x[0].offset!=v[0].offset){return(x[0].offset<v[0].offset)?x:v}else{return v[0].event=="start"?x:v}}else{return x.length?x:v}}function s(A){function z(B){return" "+B.nodeName+'="'+l(B.value)+'"'}return"<"+A.nodeName+Array.prototype.map.call(A.attributes,z).join("")+">"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q<r.length){y+=s(r[q]);q++}}}}return y+l(w.substr(p))}function f(q){function o(s,r){return RegExp(s,"m"+(q.cI?"i":"")+(r?"g":""))}function p(y,w){if(y.compiled){return}y.compiled=true;var s=[];if(y.k){var r={};function z(A,t){t.split(" ").forEach(function(B){var C=B.split("|");r[C[0]]=[A,C[1]?Number(C[1]):1];s.push(C[0])})}y.lR=o(y.l||hljs.IR,true);if(typeof y.k=="string"){z("keyword",y.k)}else{for(var x in y.k){if(!y.k.hasOwnProperty(x)){continue}z(x,y.k[x])}}y.k=r}if(w){if(y.bWK){y.b="\\b("+s.join("|")+")\\s"}y.bR=o(y.b?y.b:"\\B|\\b");if(!y.e&&!y.eW){y.e="\\B|\\b"}if(y.e){y.eR=o(y.e)}y.tE=y.e||"";if(y.eW&&w.tE){y.tE+=(y.e?"|":"")+w.tE}}if(y.i){y.iR=o(y.i)}if(y.r===undefined){y.r=1}if(!y.c){y.c=[]}for(var v=0;v<y.c.length;v++){if(y.c[v]=="self"){y.c[v]=y}p(y.c[v],y)}if(y.starts){p(y.starts,w)}var u=[];for(var v=0;v<y.c.length;v++){u.push(y.c[v].b)}if(y.tE){u.push(y.tE)}if(y.i){u.push(y.i)}y.t=u.length?o(u.join("|"),true):{exec:function(t){return null}}}p(q)}function d(D,E){function o(r,M){for(var L=0;L<M.c.length;L++){var K=M.c[L].bR.exec(r);if(K&&K.index==0){return M.c[L]}}}function s(K,r){if(K.e&&K.eR.test(r)){return K}if(K.eW){return s(K.parent,r)}}function t(r,K){return K.i&&K.iR.test(r)}function y(L,r){var K=F.cI?r[0].toLowerCase():r[0];return L.k.hasOwnProperty(K)&&L.k[K]}function G(){var K=l(w);if(!A.k){return K}var r="";var N=0;A.lR.lastIndex=0;var L=A.lR.exec(K);while(L){r+=K.substr(N,L.index-N);var M=y(A,L);if(M){v+=M[1];r+='<span class="'+M[0]+'">'+L[0]+"</span>"}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+="</span>"}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"<br>")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery-1.8.0.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery-1.8.0.min.js deleted file mode 100644 index fcdf2c43..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery-1.8.0.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
-(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bX(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bV.length;while(e--){b=bV[e]+c;if(b in a)return b}return d}function bY(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function bZ(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bY(c)&&(e[f]=p._data(c,"olddisplay",cb(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b$(a,b,c){var d=bO.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function b_(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bU[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bU[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bU[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bU[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bU[e]+"Width"))||0));return f}function ca(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bP.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+b_(a,b,c||(f?"border":"content"),e)+"px"}function cb(a){if(bR[a])return bR[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cz(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cu;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cz(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cz(a,c,d,e,"*",g)),h}function cA(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cB(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cC(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cK(){try{return new a.XMLHttpRequest}catch(b){}}function cL(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cT(){return setTimeout(function(){cM=b},0),cM=p.now()}function cU(a,b){p.each(b,function(b,c){var d=(cS[b]||[]).concat(cS["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cV(a,b,c){var d,e=0,f=0,g=cR.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cM||cT(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cM||cT(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cW(k,j.opts.specialEasing);for(;e<g;e++){d=cR[e].call(j,a,k,j.opts);if(d)return d}return cU(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cW(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cX(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bY(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cb(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cO.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cY(a,b,c,d,e){return new cY.prototype.init(a,b,c,d,e)}function cZ(a,b){var c,d={height:a},e=0;for(;e<4;e+=2-b)c=bU[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function c_(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=r.test("Â ")?/^[\s\xA0]+|[\s\xA0]+$/g:/^\s+|\s+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":a.toString().replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||f.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete"||e.readyState!=="loading"&&e.addEventListener)setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){p.isFunction(c)&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")===0&&(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)(d=p._data(g[h],a+"queueHooks"))&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,k,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=[].slice.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click")){g=p(this),g.context=this;for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){i={},k=[],g[0]=f;for(d=0;d<q;d++)l=o[d],m=l.selector,i[m]===b&&(i[m]=g.is(m)),i[m]&&k.push(l);k.length&&u.push({elem:f,matches:k})}}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){j=u[d],c.currentTarget=j.elem;for(e=0;e<j.matches.length&&!c.isImmediatePropagationStopped();e++){l=j.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,h=((p.event.special[l.origType]||{}).handle||l.handler).apply(j.elem,r),h!==b&&(c.result=h,h===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{ready:{setup:p.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)Z(a,b[e],c,d)}function be(a,b,c,d,e,f){var g,h=$.setFilters[b.toLowerCase()];return h||Z.error(b),(a||!(g=e))&&bd(a||"*",d,g=[],e),g.length>0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;a<c;a++)arguments[a]===b&&(g[a]=b)};for(;p<q;p++){s.exec(""),a=f[p],j=[],i=0,k=e;while(g=s.exec(a)){n=s.lastIndex=g.index+g[0].length;if(n>i){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="<a name='"+q+"'></a><div name='"+q+"'></div>",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},odd:function(a,b,c){var d=[],e=c?0:1,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},lt:function(a,b,c){return c?a.slice(+b):a.slice(0,+b)},gt:function(a,b,c){return c?a.slice(0,+b+1):a.slice(+b+1)},eq:function(a,b,c){var d=a.splice(+b,1);return c?a:d}}};$.setFilters.nth=$.setFilters.eq,$.filters=$.pseudos,X||($.attrHandle={href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}}),V&&($.order.push("NAME"),$.find.NAME=function(a,b){if(typeof b.getElementsByName!==j)return b.getElementsByName(a)}),Y&&($.order.splice(1,0,"CLASS"),$.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!==j&&!c)return b.getElementsByClassName(a)});try{n.call(i.childNodes,0)[0].nodeType}catch(_){n=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}var ba=Z.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},bb=Z.contains=i.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc=Z.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=bc(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=bc(b);return c};Z.attr=function(a,b){var c,d=ba(a);return d||(b=b.toLowerCase()),$.attrHandle[b]?$.attrHandle[b](a):U||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},Z.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},[0,0].sort(function(){return l=0}),i.compareDocumentPosition?e=function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:(e=function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return f(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)g.unshift(j),j=j.parentNode;c=e.length,d=g.length;for(var l=0;l<c&&l<d;l++)if(e[l]!==g[l])return f(e[l],g[l]);return l===c?f(a,g[l],-1):f(e[l],b,1)},f=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),Z.uniqueSort=function(a){var b,c=1;if(e){k=l,a.sort(e);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1)}return a};var bl=Z.compile=function(a,b,c){var d,e,f,g=O[a];if(g&&g.context===b)return g;e=bg(a,b,c);for(f=0;d=e[f];f++)e[f]=bj(d,b,c);return g=O[a]=bk(e),g.context=b,g.runs=g.dirruns=0,P.push(a),P.length>$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j<k;j++){p=$.order[j];if(s=L[p].exec(m)){h=$.find[p]((s[1]||"").replace(K,""),q,g);if(h==null)continue;m===r&&(a=a.slice(0,a.length-r.length)+m.replace(L[p],""),a||o.apply(e,n.call(h,0)));break}}}if(a){i=bl(a,b,g),d=i.dirruns++,h==null&&(h=$.find.TAG("*",G.test(a)&&b.parentNode||b));for(j=0;l=h[j];j++)c=i.runs++,i(l,b)&&e.push(l)}return e};h.querySelectorAll&&function(){var a,b=bm,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[],f=[":active"],g=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector||i.msMatchesSelector;T(function(a){a.innerHTML="<select><option selected></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=(c[0]||c).ownerDocument||c[0]||c,typeof c.createDocumentFragment=="undefined"&&(c=e),a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cS[c]=cS[c]||[],cS[c].unshift(b)},prefilter:function(a,b){b?cR.unshift(a):cR.push(a)}}),p.Tween=cY,cY.prototype={constructor:cY,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cY.propHooks[this.prop];return a&&a.get?a.get(this):cY.propHooks._default.get(this)},run:function(a){var b,c=cY.propHooks[this.prop];return this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration),this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cY.propHooks._default.set(this),this}},cY.prototype.init.prototype=cY.prototype,cY.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cY.propHooks.scrollTop=cY.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(cZ(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bY).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cV(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cQ.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:cZ("show"),slideUp:cZ("hide"),slideToggle:cZ("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cY.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cN&&(cN=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cN),cN=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c$=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j,k,l,m=this[0],n=m&&m.ownerDocument;if(!n)return;return(e=n.body)===m?p.offset.bodyOffset(m):(d=n.documentElement,p.contains(d,m)?(c=m.getBoundingClientRect(),f=c_(n),g=d.clientTop||e.clientTop||0,h=d.clientLeft||e.clientLeft||0,i=f.pageYOffset||d.scrollTop,j=f.pageXOffset||d.scrollLeft,k=c.top+i-g,l=c.left+j-h,{top:k,left:l}):{top:0,left:0})},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js deleted file mode 100644 index a9756be3..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js +++ /dev/null @@ -1,25 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
-/*
- * jQuery hashchange event - v1.2 - 2/11/2010
- * http://benalman.com/projects/jquery-hashchange-plugin/
- *
- * Copyright (c) 2010 "Cowboy" Ben Alman
- * Dual licensed under the MIT and GPL licenses.
- * http://benalman.com/about/license/
- */
-(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.slideto.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.slideto.min.js deleted file mode 100644 index 6c79a233..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.slideto.min.js +++ /dev/null @@ -1,16 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-(function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery);
diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.wiggle.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.wiggle.min.js deleted file mode 100644 index 35e7be63..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.wiggle.min.js +++ /dev/null @@ -1,23 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
-jQuery Wiggle
-Author: WonderGroup, Jordan Thomas
-URL: http://labs.wondergroup.com/demos/mini-ui/index.html
-License: MIT (http://en.wikipedia.org/wiki/MIT_License)
-*/
-jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
-if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/marked.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/marked.js deleted file mode 100644 index 7940c03c..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/marked.js +++ /dev/null @@ -1,1281 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-;(function() {
-
-/**
- * Block-Level Grammar
- */
-
-var block = {
- newline: /^\n+/,
- code: /^( {4}[^\n]+\n*)+/,
- fences: noop,
- hr: /^( *[-*_]){3,} *(?:\n+|$)/,
- heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
- nptable: noop,
- lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
- blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
- list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
- html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
- table: noop,
- paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
- text: /^[^\n]+/
-};
-
-block.bullet = /(?:[*+-]|\d+\.)/;
-block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
-block.item = replace(block.item, 'gm')
- (/bull/g, block.bullet)
- ();
-
-block.list = replace(block.list)
- (/bull/g, block.bullet)
- ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')
- ('def', '\\n+(?=' + block.def.source + ')')
- ();
-
-block.blockquote = replace(block.blockquote)
- ('def', block.def)
- ();
-
-block._tag = '(?!(?:'
- + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
- + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
- + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';
-
-block.html = replace(block.html)
- ('comment', /<!--[\s\S]*?-->/)
- ('closed', /<(tag)[\s\S]+?<\/\1>/)
- ('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)
- (/tag/g, block._tag)
- ();
-
-block.paragraph = replace(block.paragraph)
- ('hr', block.hr)
- ('heading', block.heading)
- ('lheading', block.lheading)
- ('blockquote', block.blockquote)
- ('tag', '<' + block._tag)
- ('def', block.def)
- ();
-
-/**
- * Normal Block Grammar
- */
-
-block.normal = merge({}, block);
-
-/**
- * GFM Block Grammar
- */
-
-block.gfm = merge({}, block.normal, {
- fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
- paragraph: /^/
-});
-
-block.gfm.paragraph = replace(block.paragraph)
- ('(?!', '(?!'
- + block.gfm.fences.source.replace('\\1', '\\2') + '|'
- + block.list.source.replace('\\1', '\\3') + '|')
- ();
-
-/**
- * GFM + Tables Block Grammar
- */
-
-block.tables = merge({}, block.gfm, {
- nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
- table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
-});
-
-/**
- * Block Lexer
- */
-
-function Lexer(options) {
- this.tokens = [];
- this.tokens.links = {};
- this.options = options || marked.defaults;
- this.rules = block.normal;
-
- if (this.options.gfm) {
- if (this.options.tables) {
- this.rules = block.tables;
- } else {
- this.rules = block.gfm;
- }
- }
-}
-
-/**
- * Expose Block Rules
- */
-
-Lexer.rules = block;
-
-/**
- * Static Lex Method
- */
-
-Lexer.lex = function(src, options) {
- var lexer = new Lexer(options);
- return lexer.lex(src);
-};
-
-/**
- * Preprocessing
- */
-
-Lexer.prototype.lex = function(src) {
- src = src
- .replace(/\r\n|\r/g, '\n')
- .replace(/\t/g, ' ')
- .replace(/\u00a0/g, ' ')
- .replace(/\u2424/g, '\n');
-
- return this.token(src, true);
-};
-
-/**
- * Lexing
- */
-
-Lexer.prototype.token = function(src, top, bq) {
- var src = src.replace(/^ +$/gm, '')
- , next
- , loose
- , cap
- , bull
- , b
- , item
- , space
- , i
- , l;
-
- while (src) {
- // newline
- if (cap = this.rules.newline.exec(src)) {
- src = src.substring(cap[0].length);
- if (cap[0].length > 1) {
- this.tokens.push({
- type: 'space'
- });
- }
- }
-
- // code
- if (cap = this.rules.code.exec(src)) {
- src = src.substring(cap[0].length);
- cap = cap[0].replace(/^ {4}/gm, '');
- this.tokens.push({
- type: 'code',
- text: !this.options.pedantic
- ? cap.replace(/\n+$/, '')
- : cap
- });
- continue;
- }
-
- // fences (gfm)
- if (cap = this.rules.fences.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'code',
- lang: cap[2],
- text: cap[3]
- });
- continue;
- }
-
- // heading
- if (cap = this.rules.heading.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'heading',
- depth: cap[1].length,
- text: cap[2]
- });
- continue;
- }
-
- // table no leading pipe (gfm)
- if (top && (cap = this.rules.nptable.exec(src))) {
- src = src.substring(cap[0].length);
-
- item = {
- type: 'table',
- header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
- align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
- cells: cap[3].replace(/\n$/, '').split('\n')
- };
-
- for (i = 0; i < item.align.length; i++) {
- if (/^ *-+: *$/.test(item.align[i])) {
- item.align[i] = 'right';
- } else if (/^ *:-+: *$/.test(item.align[i])) {
- item.align[i] = 'center';
- } else if (/^ *:-+ *$/.test(item.align[i])) {
- item.align[i] = 'left';
- } else {
- item.align[i] = null;
- }
- }
-
- for (i = 0; i < item.cells.length; i++) {
- item.cells[i] = item.cells[i].split(/ *\| */);
- }
-
- this.tokens.push(item);
-
- continue;
- }
-
- // lheading
- if (cap = this.rules.lheading.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'heading',
- depth: cap[2] === '=' ? 1 : 2,
- text: cap[1]
- });
- continue;
- }
-
- // hr
- if (cap = this.rules.hr.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'hr'
- });
- continue;
- }
-
- // blockquote
- if (cap = this.rules.blockquote.exec(src)) {
- src = src.substring(cap[0].length);
-
- this.tokens.push({
- type: 'blockquote_start'
- });
-
- cap = cap[0].replace(/^ *> ?/gm, '');
-
- // Pass `top` to keep the current
- // "toplevel" state. This is exactly
- // how markdown.pl works.
- this.token(cap, top, true);
-
- this.tokens.push({
- type: 'blockquote_end'
- });
-
- continue;
- }
-
- // list
- if (cap = this.rules.list.exec(src)) {
- src = src.substring(cap[0].length);
- bull = cap[2];
-
- this.tokens.push({
- type: 'list_start',
- ordered: bull.length > 1
- });
-
- // Get each top-level item.
- cap = cap[0].match(this.rules.item);
-
- next = false;
- l = cap.length;
- i = 0;
-
- for (; i < l; i++) {
- item = cap[i];
-
- // Remove the list item's bullet
- // so it is seen as the next token.
- space = item.length;
- item = item.replace(/^ *([*+-]|\d+\.) +/, '');
-
- // Outdent whatever the
- // list item contains. Hacky.
- if (~item.indexOf('\n ')) {
- space -= item.length;
- item = !this.options.pedantic
- ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
- : item.replace(/^ {1,4}/gm, '');
- }
-
- // Determine whether the next list item belongs here.
- // Backpedal if it does not belong in this list.
- if (this.options.smartLists && i !== l - 1) {
- b = block.bullet.exec(cap[i + 1])[0];
- if (bull !== b && !(bull.length > 1 && b.length > 1)) {
- src = cap.slice(i + 1).join('\n') + src;
- i = l - 1;
- }
- }
-
- // Determine whether item is loose or not.
- // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
- // for discount behavior.
- loose = next || /\n\n(?!\s*$)/.test(item);
- if (i !== l - 1) {
- next = item.charAt(item.length - 1) === '\n';
- if (!loose) loose = next;
- }
-
- this.tokens.push({
- type: loose
- ? 'loose_item_start'
- : 'list_item_start'
- });
-
- // Recurse.
- this.token(item, false, bq);
-
- this.tokens.push({
- type: 'list_item_end'
- });
- }
-
- this.tokens.push({
- type: 'list_end'
- });
-
- continue;
- }
-
- // html
- if (cap = this.rules.html.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: this.options.sanitize
- ? 'paragraph'
- : 'html',
- pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',
- text: cap[0]
- });
- continue;
- }
-
- // def
- if ((!bq && top) && (cap = this.rules.def.exec(src))) {
- src = src.substring(cap[0].length);
- this.tokens.links[cap[1].toLowerCase()] = {
- href: cap[2],
- title: cap[3]
- };
- continue;
- }
-
- // table (gfm)
- if (top && (cap = this.rules.table.exec(src))) {
- src = src.substring(cap[0].length);
-
- item = {
- type: 'table',
- header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
- align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
- cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
- };
-
- for (i = 0; i < item.align.length; i++) {
- if (/^ *-+: *$/.test(item.align[i])) {
- item.align[i] = 'right';
- } else if (/^ *:-+: *$/.test(item.align[i])) {
- item.align[i] = 'center';
- } else if (/^ *:-+ *$/.test(item.align[i])) {
- item.align[i] = 'left';
- } else {
- item.align[i] = null;
- }
- }
-
- for (i = 0; i < item.cells.length; i++) {
- item.cells[i] = item.cells[i]
- .replace(/^ *\| *| *\| *$/g, '')
- .split(/ *\| */);
- }
-
- this.tokens.push(item);
-
- continue;
- }
-
- // top-level paragraph
- if (top && (cap = this.rules.paragraph.exec(src))) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'paragraph',
- text: cap[1].charAt(cap[1].length - 1) === '\n'
- ? cap[1].slice(0, -1)
- : cap[1]
- });
- continue;
- }
-
- // text
- if (cap = this.rules.text.exec(src)) {
- // Top-level should never reach here.
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'text',
- text: cap[0]
- });
- continue;
- }
-
- if (src) {
- throw new
- Error('Infinite loop on byte: ' + src.charCodeAt(0));
- }
- }
-
- return this.tokens;
-};
-
-/**
- * Inline-Level Grammar
- */
-
-var inline = {
- escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
- autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
- url: noop,
- tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
- link: /^!?\[(inside)\]\(href\)/,
- reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
- nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
- strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
- em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
- code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
- br: /^ {2,}\n(?!\s*$)/,
- del: noop,
- text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
-};
-
-inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
-inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
-
-inline.link = replace(inline.link)
- ('inside', inline._inside)
- ('href', inline._href)
- ();
-
-inline.reflink = replace(inline.reflink)
- ('inside', inline._inside)
- ();
-
-/**
- * Normal Inline Grammar
- */
-
-inline.normal = merge({}, inline);
-
-/**
- * Pedantic Inline Grammar
- */
-
-inline.pedantic = merge({}, inline.normal, {
- strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
- em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
-});
-
-/**
- * GFM Inline Grammar
- */
-
-inline.gfm = merge({}, inline.normal, {
- escape: replace(inline.escape)('])', '~|])')(),
- url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
- del: /^~~(?=\S)([\s\S]*?\S)~~/,
- text: replace(inline.text)
- (']|', '~]|')
- ('|', '|https?://|')
- ()
-});
-
-/**
- * GFM + Line Breaks Inline Grammar
- */
-
-inline.breaks = merge({}, inline.gfm, {
- br: replace(inline.br)('{2,}', '*')(),
- text: replace(inline.gfm.text)('{2,}', '*')()
-});
-
-/**
- * Inline Lexer & Compiler
- */
-
-function InlineLexer(links, options) {
- this.options = options || marked.defaults;
- this.links = links;
- this.rules = inline.normal;
- this.renderer = this.options.renderer || new Renderer;
- this.renderer.options = this.options;
-
- if (!this.links) {
- throw new
- Error('Tokens array requires a `links` property.');
- }
-
- if (this.options.gfm) {
- if (this.options.breaks) {
- this.rules = inline.breaks;
- } else {
- this.rules = inline.gfm;
- }
- } else if (this.options.pedantic) {
- this.rules = inline.pedantic;
- }
-}
-
-/**
- * Expose Inline Rules
- */
-
-InlineLexer.rules = inline;
-
-/**
- * Static Lexing/Compiling Method
- */
-
-InlineLexer.output = function(src, links, options) {
- var inline = new InlineLexer(links, options);
- return inline.output(src);
-};
-
-/**
- * Lexing/Compiling
- */
-
-InlineLexer.prototype.output = function(src) {
- var out = ''
- , link
- , text
- , href
- , cap;
-
- while (src) {
- // escape
- if (cap = this.rules.escape.exec(src)) {
- src = src.substring(cap[0].length);
- out += cap[1];
- continue;
- }
-
- // autolink
- if (cap = this.rules.autolink.exec(src)) {
- src = src.substring(cap[0].length);
- if (cap[2] === '@') {
- text = cap[1].charAt(6) === ':'
- ? this.mangle(cap[1].substring(7))
- : this.mangle(cap[1]);
- href = this.mangle('mailto:') + text;
- } else {
- text = escape(cap[1]);
- href = text;
- }
- out += this.renderer.link(href, null, text);
- continue;
- }
-
- // url (gfm)
- if (!this.inLink && (cap = this.rules.url.exec(src))) {
- src = src.substring(cap[0].length);
- text = escape(cap[1]);
- href = text;
- out += this.renderer.link(href, null, text);
- continue;
- }
-
- // tag
- if (cap = this.rules.tag.exec(src)) {
- if (!this.inLink && /^<a /i.test(cap[0])) {
- this.inLink = true;
- } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
- this.inLink = false;
- }
- src = src.substring(cap[0].length);
- out += this.options.sanitize
- ? escape(cap[0])
- : cap[0];
- continue;
- }
-
- // link
- if (cap = this.rules.link.exec(src)) {
- src = src.substring(cap[0].length);
- this.inLink = true;
- out += this.outputLink(cap, {
- href: cap[2],
- title: cap[3]
- });
- this.inLink = false;
- continue;
- }
-
- // reflink, nolink
- if ((cap = this.rules.reflink.exec(src))
- || (cap = this.rules.nolink.exec(src))) {
- src = src.substring(cap[0].length);
- link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
- link = this.links[link.toLowerCase()];
- if (!link || !link.href) {
- out += cap[0].charAt(0);
- src = cap[0].substring(1) + src;
- continue;
- }
- this.inLink = true;
- out += this.outputLink(cap, link);
- this.inLink = false;
- continue;
- }
-
- // strong
- if (cap = this.rules.strong.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.strong(this.output(cap[2] || cap[1]));
- continue;
- }
-
- // em
- if (cap = this.rules.em.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.em(this.output(cap[2] || cap[1]));
- continue;
- }
-
- // code
- if (cap = this.rules.code.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.codespan(escape(cap[2], true));
- continue;
- }
-
- // br
- if (cap = this.rules.br.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.br();
- continue;
- }
-
- // del (gfm)
- if (cap = this.rules.del.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.del(this.output(cap[1]));
- continue;
- }
-
- // text
- if (cap = this.rules.text.exec(src)) {
- src = src.substring(cap[0].length);
- out += escape(this.smartypants(cap[0]));
- continue;
- }
-
- if (src) {
- throw new
- Error('Infinite loop on byte: ' + src.charCodeAt(0));
- }
- }
-
- return out;
-};
-
-/**
- * Compile Link
- */
-
-InlineLexer.prototype.outputLink = function(cap, link) {
- var href = escape(link.href)
- , title = link.title ? escape(link.title) : null;
-
- return cap[0].charAt(0) !== '!'
- ? this.renderer.link(href, title, this.output(cap[1]))
- : this.renderer.image(href, title, escape(cap[1]));
-};
-
-/**
- * Smartypants Transformations
- */
-
-InlineLexer.prototype.smartypants = function(text) {
- if (!this.options.smartypants) return text;
- return text
- // em-dashes
- .replace(/--/g, '\u2014')
- // opening singles
- .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
- // closing singles & apostrophes
- .replace(/'/g, '\u2019')
- // opening doubles
- .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
- // closing doubles
- .replace(/"/g, '\u201d')
- // ellipses
- .replace(/\.{3}/g, '\u2026');
-};
-
-/**
- * Mangle Links
- */
-
-InlineLexer.prototype.mangle = function(text) {
- var out = ''
- , l = text.length
- , i = 0
- , ch;
-
- for (; i < l; i++) {
- ch = text.charCodeAt(i);
- if (Math.random() > 0.5) {
- ch = 'x' + ch.toString(16);
- }
- out += '&#' + ch + ';';
- }
-
- return out;
-};
-
-/**
- * Renderer
- */
-
-function Renderer(options) {
- this.options = options || {};
-}
-
-Renderer.prototype.code = function(code, lang, escaped) {
- if (this.options.highlight) {
- var out = this.options.highlight(code, lang);
- if (out != null && out !== code) {
- escaped = true;
- code = out;
- }
- }
-
- if (!lang) {
- return '<pre><code>'
- + (escaped ? code : escape(code, true))
- + '\n</code></pre>';
- }
-
- return '<pre><code class="'
- + this.options.langPrefix
- + escape(lang, true)
- + '">'
- + (escaped ? code : escape(code, true))
- + '\n</code></pre>\n';
-};
-
-Renderer.prototype.blockquote = function(quote) {
- return '<blockquote>\n' + quote + '</blockquote>\n';
-};
-
-Renderer.prototype.html = function(html) {
- return html;
-};
-
-Renderer.prototype.heading = function(text, level, raw) {
- return '<h'
- + level
- + ' id="'
- + this.options.headerPrefix
- + raw.toLowerCase().replace(/[^\w]+/g, '-')
- + '">'
- + text
- + '</h'
- + level
- + '>\n';
-};
-
-Renderer.prototype.hr = function() {
- return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
-};
-
-Renderer.prototype.list = function(body, ordered) {
- var type = ordered ? 'ol' : 'ul';
- return '<' + type + '>\n' + body + '</' + type + '>\n';
-};
-
-Renderer.prototype.listitem = function(text) {
- return '<li>' + text + '</li>\n';
-};
-
-Renderer.prototype.paragraph = function(text) {
- return '<p>' + text + '</p>\n';
-};
-
-Renderer.prototype.table = function(header, body) {
- return '<table>\n'
- + '<thead>\n'
- + header
- + '</thead>\n'
- + '<tbody>\n'
- + body
- + '</tbody>\n'
- + '</table>\n';
-};
-
-Renderer.prototype.tablerow = function(content) {
- return '<tr>\n' + content + '</tr>\n';
-};
-
-Renderer.prototype.tablecell = function(content, flags) {
- var type = flags.header ? 'th' : 'td';
- var tag = flags.align
- ? '<' + type + ' style="text-align:' + flags.align + '">'
- : '<' + type + '>';
- return tag + content + '</' + type + '>\n';
-};
-
-// span level renderer
-Renderer.prototype.strong = function(text) {
- return '<strong>' + text + '</strong>';
-};
-
-Renderer.prototype.em = function(text) {
- return '<em>' + text + '</em>';
-};
-
-Renderer.prototype.codespan = function(text) {
- return '<code>' + text + '</code>';
-};
-
-Renderer.prototype.br = function() {
- return this.options.xhtml ? '<br/>' : '<br>';
-};
-
-Renderer.prototype.del = function(text) {
- return '<del>' + text + '</del>';
-};
-
-Renderer.prototype.link = function(href, title, text) {
- if (this.options.sanitize) {
- try {
- var prot = decodeURIComponent(unescape(href))
- .replace(/[^\w:]/g, '')
- .toLowerCase();
- } catch (e) {
- return '';
- }
- if (prot.indexOf('javascript:') === 0) {
- return '';
- }
- }
- var out = '<a href="' + href + '"';
- if (title) {
- out += ' title="' + title + '"';
- }
- out += '>' + text + '</a>';
- return out;
-};
-
-Renderer.prototype.image = function(href, title, text) {
- var out = '<img src="' + href + '" alt="' + text + '"';
- if (title) {
- out += ' title="' + title + '"';
- }
- out += this.options.xhtml ? '/>' : '>';
- return out;
-};
-
-/**
- * Parsing & Compiling
- */
-
-function Parser(options) {
- this.tokens = [];
- this.token = null;
- this.options = options || marked.defaults;
- this.options.renderer = this.options.renderer || new Renderer;
- this.renderer = this.options.renderer;
- this.renderer.options = this.options;
-}
-
-/**
- * Static Parse Method
- */
-
-Parser.parse = function(src, options, renderer) {
- var parser = new Parser(options, renderer);
- return parser.parse(src);
-};
-
-/**
- * Parse Loop
- */
-
-Parser.prototype.parse = function(src) {
- this.inline = new InlineLexer(src.links, this.options, this.renderer);
- this.tokens = src.reverse();
-
- var out = '';
- while (this.next()) {
- out += this.tok();
- }
-
- return out;
-};
-
-/**
- * Next Token
- */
-
-Parser.prototype.next = function() {
- return this.token = this.tokens.pop();
-};
-
-/**
- * Preview Next Token
- */
-
-Parser.prototype.peek = function() {
- return this.tokens[this.tokens.length - 1] || 0;
-};
-
-/**
- * Parse Text Tokens
- */
-
-Parser.prototype.parseText = function() {
- var body = this.token.text;
-
- while (this.peek().type === 'text') {
- body += '\n' + this.next().text;
- }
-
- return this.inline.output(body);
-};
-
-/**
- * Parse Current Token
- */
-
-Parser.prototype.tok = function() {
- switch (this.token.type) {
- case 'space': {
- return '';
- }
- case 'hr': {
- return this.renderer.hr();
- }
- case 'heading': {
- return this.renderer.heading(
- this.inline.output(this.token.text),
- this.token.depth,
- this.token.text);
- }
- case 'code': {
- return this.renderer.code(this.token.text,
- this.token.lang,
- this.token.escaped);
- }
- case 'table': {
- var header = ''
- , body = ''
- , i
- , row
- , cell
- , flags
- , j;
-
- // header
- cell = '';
- for (i = 0; i < this.token.header.length; i++) {
- flags = { header: true, align: this.token.align[i] };
- cell += this.renderer.tablecell(
- this.inline.output(this.token.header[i]),
- { header: true, align: this.token.align[i] }
- );
- }
- header += this.renderer.tablerow(cell);
-
- for (i = 0; i < this.token.cells.length; i++) {
- row = this.token.cells[i];
-
- cell = '';
- for (j = 0; j < row.length; j++) {
- cell += this.renderer.tablecell(
- this.inline.output(row[j]),
- { header: false, align: this.token.align[j] }
- );
- }
-
- body += this.renderer.tablerow(cell);
- }
- return this.renderer.table(header, body);
- }
- case 'blockquote_start': {
- var body = '';
-
- while (this.next().type !== 'blockquote_end') {
- body += this.tok();
- }
-
- return this.renderer.blockquote(body);
- }
- case 'list_start': {
- var body = ''
- , ordered = this.token.ordered;
-
- while (this.next().type !== 'list_end') {
- body += this.tok();
- }
-
- return this.renderer.list(body, ordered);
- }
- case 'list_item_start': {
- var body = '';
-
- while (this.next().type !== 'list_item_end') {
- body += this.token.type === 'text'
- ? this.parseText()
- : this.tok();
- }
-
- return this.renderer.listitem(body);
- }
- case 'loose_item_start': {
- var body = '';
-
- while (this.next().type !== 'list_item_end') {
- body += this.tok();
- }
-
- return this.renderer.listitem(body);
- }
- case 'html': {
- var html = !this.token.pre && !this.options.pedantic
- ? this.inline.output(this.token.text)
- : this.token.text;
- return this.renderer.html(html);
- }
- case 'paragraph': {
- return this.renderer.paragraph(this.inline.output(this.token.text));
- }
- case 'text': {
- return this.renderer.paragraph(this.parseText());
- }
- }
-};
-
-/**
- * Helpers
- */
-
-function escape(html, encode) {
- return html
- .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''');
-}
-
-function unescape(html) {
- return html.replace(/&([#\w]+);/g, function(_, n) {
- n = n.toLowerCase();
- if (n === 'colon') return ':';
- if (n.charAt(0) === '#') {
- return n.charAt(1) === 'x'
- ? String.fromCharCode(parseInt(n.substring(2), 16))
- : String.fromCharCode(+n.substring(1));
- }
- return '';
- });
-}
-
-function replace(regex, opt) {
- regex = regex.source;
- opt = opt || '';
- return function self(name, val) {
- if (!name) return new RegExp(regex, opt);
- val = val.source || val;
- val = val.replace(/(^|[^\[])\^/g, '$1');
- regex = regex.replace(name, val);
- return self;
- };
-}
-
-function noop() {}
-noop.exec = noop;
-
-function merge(obj) {
- var i = 1
- , target
- , key;
-
- for (; i < arguments.length; i++) {
- target = arguments[i];
- for (key in target) {
- if (Object.prototype.hasOwnProperty.call(target, key)) {
- obj[key] = target[key];
- }
- }
- }
-
- return obj;
-}
-
-
-/**
- * Marked
- */
-
-function marked(src, opt, callback) {
- if (callback || typeof opt === 'function') {
- if (!callback) {
- callback = opt;
- opt = null;
- }
-
- opt = merge({}, marked.defaults, opt || {});
-
- var highlight = opt.highlight
- , tokens
- , pending
- , i = 0;
-
- try {
- tokens = Lexer.lex(src, opt)
- } catch (e) {
- return callback(e);
- }
-
- pending = tokens.length;
-
- var done = function(err) {
- if (err) {
- opt.highlight = highlight;
- return callback(err);
- }
-
- var out;
-
- try {
- out = Parser.parse(tokens, opt);
- } catch (e) {
- err = e;
- }
-
- opt.highlight = highlight;
-
- return err
- ? callback(err)
- : callback(null, out);
- };
-
- if (!highlight || highlight.length < 3) {
- return done();
- }
-
- delete opt.highlight;
-
- if (!pending) return done();
-
- for (; i < tokens.length; i++) {
- (function(token) {
- if (token.type !== 'code') {
- return --pending || done();
- }
- return highlight(token.text, token.lang, function(err, code) {
- if (err) return done(err);
- if (code == null || code === token.text) {
- return --pending || done();
- }
- token.text = code;
- token.escaped = true;
- --pending || done();
- });
- })(tokens[i]);
- }
-
- return;
- }
- try {
- if (opt) opt = merge({}, marked.defaults, opt);
- return Parser.parse(Lexer.lex(src, opt), opt);
- } catch (e) {
- e.message += '\nPlease report this to https://github.com/chjj/marked.';
- if ((opt || marked.defaults).silent) {
- return '<p>An error occured:</p><pre>'
- + escape(e.message + '', true)
- + '</pre>';
- }
- throw e;
- }
-}
-
-/**
- * Options
- */
-
-marked.options =
-marked.setOptions = function(opt) {
- merge(marked.defaults, opt);
- return marked;
-};
-
-marked.defaults = {
- gfm: true,
- tables: true,
- breaks: false,
- pedantic: false,
- sanitize: false,
- smartLists: false,
- silent: false,
- highlight: null,
- langPrefix: 'lang-',
- smartypants: false,
- headerPrefix: '',
- renderer: new Renderer,
- xhtml: false
-};
-
-/**
- * Expose
- */
-
-marked.Parser = Parser;
-marked.parser = Parser.parse;
-
-marked.Renderer = Renderer;
-
-marked.Lexer = Lexer;
-marked.lexer = Lexer.lex;
-
-marked.InlineLexer = InlineLexer;
-marked.inlineLexer = InlineLexer.output;
-
-marked.parse = marked;
-
-if (typeof module !== 'undefined' && typeof exports === 'object') {
- module.exports = marked;
-} else if (typeof define === 'function' && define.amd) {
- define(function() { return marked; });
-} else {
- this.marked = marked;
-}
-
-}).call(function() {
- return this || (typeof window !== 'undefined' ? window : global);
-}());
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/shred.bundle.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/shred.bundle.js deleted file mode 100644 index 4bbad0f5..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/shred.bundle.js +++ /dev/null @@ -1,2780 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var require = function (file, cwd) {
- var resolved = require.resolve(file, cwd || '/');
- var mod = require.modules[resolved];
- if (!mod) throw new Error(
- 'Failed to resolve module ' + file + ', tried ' + resolved
- );
- var res = mod._cached ? mod._cached : mod();
- return res;
-}
-
-require.paths = [];
-require.modules = {};
-require.extensions = [".js",".coffee"];
-
-require._core = {
- 'assert': true,
- 'events': true,
- 'fs': true,
- 'path': true,
- 'vm': true
-};
-
-require.resolve = (function () {
- return function (x, cwd) {
- if (!cwd) cwd = '/';
-
- if (require._core[x]) return x;
- var path = require.modules.path();
- var y = cwd || '.';
-
- if (x.match(/^(?:\.\.?\/|\/)/)) {
- var m = loadAsFileSync(path.resolve(y, x))
- || loadAsDirectorySync(path.resolve(y, x));
- if (m) return m;
- }
-
- var n = loadNodeModulesSync(x, y);
- if (n) return n;
-
- throw new Error("Cannot find module '" + x + "'");
-
- function loadAsFileSync (x) {
- if (require.modules[x]) {
- return x;
- }
-
- for (var i = 0; i < require.extensions.length; i++) {
- var ext = require.extensions[i];
- if (require.modules[x + ext]) return x + ext;
- }
- }
-
- function loadAsDirectorySync (x) {
- x = x.replace(/\/+$/, '');
- var pkgfile = x + '/package.json';
- if (require.modules[pkgfile]) {
- var pkg = require.modules[pkgfile]();
- var b = pkg.browserify;
- if (typeof b === 'object' && b.main) {
- var m = loadAsFileSync(path.resolve(x, b.main));
- if (m) return m;
- }
- else if (typeof b === 'string') {
- var m = loadAsFileSync(path.resolve(x, b));
- if (m) return m;
- }
- else if (pkg.main) {
- var m = loadAsFileSync(path.resolve(x, pkg.main));
- if (m) return m;
- }
- }
-
- return loadAsFileSync(x + '/index');
- }
-
- function loadNodeModulesSync (x, start) {
- var dirs = nodeModulesPathsSync(start);
- for (var i = 0; i < dirs.length; i++) {
- var dir = dirs[i];
- var m = loadAsFileSync(dir + '/' + x);
- if (m) return m;
- var n = loadAsDirectorySync(dir + '/' + x);
- if (n) return n;
- }
-
- var m = loadAsFileSync(x);
- if (m) return m;
- }
-
- function nodeModulesPathsSync (start) {
- var parts;
- if (start === '/') parts = [ '' ];
- else parts = path.normalize(start).split('/');
-
- var dirs = [];
- for (var i = parts.length - 1; i >= 0; i--) {
- if (parts[i] === 'node_modules') continue;
- var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
- dirs.push(dir);
- }
-
- return dirs;
- }
- };
-})();
-
-require.alias = function (from, to) {
- var path = require.modules.path();
- var res = null;
- try {
- res = require.resolve(from + '/package.json', '/');
- }
- catch (err) {
- res = require.resolve(from, '/');
- }
- var basedir = path.dirname(res);
-
- var keys = (Object.keys || function (obj) {
- var res = [];
- for (var key in obj) res.push(key)
- return res;
- })(require.modules);
-
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (key.slice(0, basedir.length + 1) === basedir + '/') {
- var f = key.slice(basedir.length);
- require.modules[to + f] = require.modules[basedir + f];
- }
- else if (key === basedir) {
- require.modules[to] = require.modules[basedir];
- }
- }
-};
-
-require.define = function (filename, fn) {
- var dirname = require._core[filename]
- ? ''
- : require.modules.path().dirname(filename)
- ;
-
- var require_ = function (file) {
- return require(file, dirname)
- };
- require_.resolve = function (name) {
- return require.resolve(name, dirname);
- };
- require_.modules = require.modules;
- require_.define = require.define;
- var module_ = { exports : {} };
-
- require.modules[filename] = function () {
- require.modules[filename]._cached = module_.exports;
- fn.call(
- module_.exports,
- require_,
- module_,
- module_.exports,
- dirname,
- filename
- );
- require.modules[filename]._cached = module_.exports;
- return module_.exports;
- };
-};
-
-if (typeof process === 'undefined') process = {};
-
-if (!process.nextTick) process.nextTick = (function () {
- var queue = [];
- var canPost = typeof window !== 'undefined'
- && window.postMessage && window.addEventListener
- ;
-
- if (canPost) {
- window.addEventListener('message', function (ev) {
- if (ev.source === window && ev.data === 'browserify-tick') {
- ev.stopPropagation();
- if (queue.length > 0) {
- var fn = queue.shift();
- fn();
- }
- }
- }, true);
- }
-
- return function (fn) {
- if (canPost) {
- queue.push(fn);
- window.postMessage('browserify-tick', '*');
- }
- else setTimeout(fn, 0);
- };
-})();
-
-if (!process.title) process.title = 'browser';
-
-if (!process.binding) process.binding = function (name) {
- if (name === 'evals') return require('vm')
- else throw new Error('No such module')
-};
-
-if (!process.cwd) process.cwd = function () { return '.' };
-
-require.define("path", function (require, module, exports, __dirname, __filename) {
- function filter (xs, fn) {
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- if (fn(xs[i], i, xs)) res.push(xs[i]);
- }
- return res;
-}
-
-// resolves . and .. elements in a path array with directory names there
-// must be no slashes, empty elements, or device names (c:\) in the array
-// (so also no leading and trailing slashes - it does not distinguish
-// relative and absolute paths)
-function normalizeArray(parts, allowAboveRoot) {
- // if the path tries to go above the root, `up` ends up > 0
- var up = 0;
- for (var i = parts.length; i >= 0; i--) {
- var last = parts[i];
- if (last == '.') {
- parts.splice(i, 1);
- } else if (last === '..') {
- parts.splice(i, 1);
- up++;
- } else if (up) {
- parts.splice(i, 1);
- up--;
- }
- }
-
- // if the path is allowed to go above the root, restore leading ..s
- if (allowAboveRoot) {
- for (; up--; up) {
- parts.unshift('..');
- }
- }
-
- return parts;
-}
-
-// Regex to split a filename into [*, dir, basename, ext]
-// posix version
-var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;
-
-// path.resolve([from ...], to)
-// posix version
-exports.resolve = function() {
-var resolvedPath = '',
- resolvedAbsolute = false;
-
-for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {
- var path = (i >= 0)
- ? arguments[i]
- : process.cwd();
-
- // Skip empty and invalid entries
- if (typeof path !== 'string' || !path) {
- continue;
- }
-
- resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charAt(0) === '/';
-}
-
-// At this point the path should be resolved to a full absolute path, but
-// handle relative paths to be safe (might happen when process.cwd() fails)
-
-// Normalize the path
-resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
- return !!p;
- }), !resolvedAbsolute).join('/');
-
- return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
-};
-
-// path.normalize(path)
-// posix version
-exports.normalize = function(path) {
-var isAbsolute = path.charAt(0) === '/',
- trailingSlash = path.slice(-1) === '/';
-
-// Normalize the path
-path = normalizeArray(filter(path.split('/'), function(p) {
- return !!p;
- }), !isAbsolute).join('/');
-
- if (!path && !isAbsolute) {
- path = '.';
- }
- if (path && trailingSlash) {
- path += '/';
- }
-
- return (isAbsolute ? '/' : '') + path;
-};
-
-
-// posix version
-exports.join = function() {
- var paths = Array.prototype.slice.call(arguments, 0);
- return exports.normalize(filter(paths, function(p, index) {
- return p && typeof p === 'string';
- }).join('/'));
-};
-
-
-exports.dirname = function(path) {
- var dir = splitPathRe.exec(path)[1] || '';
- var isWindows = false;
- if (!dir) {
- // No dirname
- return '.';
- } else if (dir.length === 1 ||
- (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {
- // It is just a slash or a drive letter with a slash
- return dir;
- } else {
- // It is a full dirname, strip trailing slash
- return dir.substring(0, dir.length - 1);
- }
-};
-
-
-exports.basename = function(path, ext) {
- var f = splitPathRe.exec(path)[2] || '';
- // TODO: make this comparison case-insensitive on windows?
- if (ext && f.substr(-1 * ext.length) === ext) {
- f = f.substr(0, f.length - ext.length);
- }
- return f;
-};
-
-
-exports.extname = function(path) {
- return splitPathRe.exec(path)[3] || '';
-};
-
-});
-
-require.define("/shred.js", function (require, module, exports, __dirname, __filename) {
- // Shred is an HTTP client library intended to simplify the use of Node's
-// built-in HTTP library. In particular, we wanted to make it easier to interact
-// with HTTP-based APIs.
-//
-// See the [examples](./examples.html) for more details.
-
-// Ax is a nice logging library we wrote. You can use any logger, providing it
-// has `info`, `warn`, `debug`, and `error` methods that take a string.
-var Ax = require("ax")
- , CookieJarLib = require( "cookiejar" )
- , CookieJar = CookieJarLib.CookieJar
-;
-
-// Shred takes some options, including a logger and request defaults.
-
-var Shred = function(options) {
- options = (options||{});
- this.agent = options.agent;
- this.defaults = options.defaults||{};
- this.log = options.logger||(new Ax({ level: "info" }));
- this._sharedCookieJar = new CookieJar();
- this.logCurl = options.logCurl || false;
-};
-
-// Most of the real work is done in the request and reponse classes.
-
-Shred.Request = require("./shred/request");
-Shred.Response = require("./shred/response");
-
-// The `request` method kicks off a new request, instantiating a new `Request`
-// object and passing along whatever default options we were given.
-
-Shred.prototype = {
- request: function(options) {
- options.logger = this.log;
- options.logCurl = options.logCurl || this.logCurl;
- options.cookieJar = ( 'cookieJar' in options ) ? options.cookieJar : this._sharedCookieJar; // let them set cookieJar = null
- options.agent = options.agent || this.agent;
- // fill in default options
- for (var key in this.defaults) {
- if (this.defaults.hasOwnProperty(key) && !options[key]) {
- options[key] = this.defaults[key]
- }
- }
- return new Shred.Request(options);
- }
-};
-
-// Define a bunch of convenience methods so that you don't have to include
-// a `method` property in your request options.
-
-"get put post delete".split(" ").forEach(function(method) {
- Shred.prototype[method] = function(options) {
- options.method = method;
- return this.request(options);
- };
-});
-
-
-module.exports = Shred;
-
-});
-
-require.define("/node_modules/ax/package.json", function (require, module, exports, __dirname, __filename) {
- module.exports = {"main":"./lib/ax.js"}
-});
-
-require.define("/node_modules/ax/lib/ax.js", function (require, module, exports, __dirname, __filename) {
- var inspect = require("util").inspect
- , fs = require("fs")
-;
-
-
-// this is a quick-and-dirty logger. there are other nicer loggers out there
-// but the ones i found were also somewhat involved. this one has a Ruby
-// logger type interface
-//
-// we can easily replace this, provide the info, debug, etc. methods are the
-// same. or, we can change Haiku to use a more standard node.js interface
-
-var format = function(level,message) {
- var debug = (level=="debug"||level=="error");
- if (!message) { return message.toString(); }
- if (typeof(message) == "object") {
- if (message instanceof Error && debug) {
- return message.stack;
- } else {
- return inspect(message);
- }
- } else {
- return message.toString();
- }
-};
-
-var noOp = function(message) { return this; }
-var makeLogger = function(level,fn) {
- return function(message) {
- this.stream.write(this.format(level, message)+"\n");
- return this;
- }
-};
-
-var Logger = function(options) {
- var logger = this;
- var options = options||{};
-
- // Default options
- options.level = options.level || "info";
- options.timestamp = options.timestamp || true;
- options.prefix = options.prefix || "";
- logger.options = options;
-
- // Allows a prefix to be added to the message.
- //
- // var logger = new Ax({ module: 'Haiku' })
- // logger.warn('this is going to be awesome!');
- // //=> Haiku: this is going to be awesome!
- //
- if (logger.options.module){
- logger.options.prefix = logger.options.module;
- }
-
- // Write to stderr or a file
- if (logger.options.file){
- logger.stream = fs.createWriteStream(logger.options.file, {"flags": "a"});
- } else {
- if(process.title === "node")
- logger.stream = process.stderr;
- else if(process.title === "browser")
- logger.stream = function () {
- // Work around weird console context issue: http://code.google.com/p/chromium/issues/detail?id=48662
- return console[logger.options.level].apply(console, arguments);
- };
- }
-
- switch(logger.options.level){
- case 'debug':
- ['debug', 'info', 'warn'].forEach(function (level) {
- logger[level] = Logger.writer(level);
- });
- case 'info':
- ['info', 'warn'].forEach(function (level) {
- logger[level] = Logger.writer(level);
- });
- case 'warn':
- logger.warn = Logger.writer('warn');
- }
-}
-
-// Used to define logger methods
-Logger.writer = function(level){
- return function(message){
- var logger = this;
-
- if(process.title === "node")
- logger.stream.write(logger.format(level, message) + '\n');
- else if(process.title === "browser")
- logger.stream(logger.format(level, message) + '\n');
-
- };
-}
-
-
-Logger.prototype = {
- info: function(){},
- debug: function(){},
- warn: function(){},
- error: Logger.writer('error'),
- format: function(level, message){
- if (! message) return '';
-
- var logger = this
- , prefix = logger.options.prefix
- , timestamp = logger.options.timestamp ? " " + (new Date().toISOString()) : ""
- ;
-
- return (prefix + timestamp + ": " + message);
- }
-};
-
-module.exports = Logger;
-
-});
-
-require.define("util", function (require, module, exports, __dirname, __filename) {
- // todo
-
-});
-
-require.define("fs", function (require, module, exports, __dirname, __filename) {
- // nothing to see here... no file methods for the browser
-
-});
-
-require.define("/node_modules/cookiejar/package.json", function (require, module, exports, __dirname, __filename) {
- module.exports = {"main":"cookiejar.js"}
-});
-
-require.define("/node_modules/cookiejar/cookiejar.js", function (require, module, exports, __dirname, __filename) {
- exports.CookieAccessInfo=CookieAccessInfo=function CookieAccessInfo(domain,path,secure,script) {
- if(this instanceof CookieAccessInfo) {
- this.domain=domain||undefined;
- this.path=path||"/";
- this.secure=!!secure;
- this.script=!!script;
- return this;
- }
- else {
- return new CookieAccessInfo(domain,path,secure,script)
- }
-}
-
-exports.Cookie=Cookie=function Cookie(cookiestr) {
- if(cookiestr instanceof Cookie) {
- return cookiestr;
- }
- else {
- if(this instanceof Cookie) {
- this.name = null;
- this.value = null;
- this.expiration_date = Infinity;
- this.path = "/";
- this.domain = null;
- this.secure = false; //how to define?
- this.noscript = false; //httponly
- if(cookiestr) {
- this.parse(cookiestr)
- }
- return this;
- }
- return new Cookie(cookiestr)
- }
-}
-
-Cookie.prototype.toString = function toString() {
- var str=[this.name+"="+this.value];
- if(this.expiration_date !== Infinity) {
- str.push("expires="+(new Date(this.expiration_date)).toGMTString());
- }
- if(this.domain) {
- str.push("domain="+this.domain);
- }
- if(this.path) {
- str.push("path="+this.path);
- }
- if(this.secure) {
- str.push("secure");
- }
- if(this.noscript) {
- str.push("httponly");
- }
- return str.join("; ");
-}
-
-Cookie.prototype.toValueString = function toValueString() {
- return this.name+"="+this.value;
-}
-
-var cookie_str_splitter=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g
-Cookie.prototype.parse = function parse(str) {
- if(this instanceof Cookie) {
- var parts=str.split(";")
- , pair=parts[0].match(/([^=]+)=((?:.|\n)*)/)
- , key=pair[1]
- , value=pair[2];
- this.name = key;
- this.value = value;
-
- for(var i=1;i<parts.length;i++) {
- pair=parts[i].match(/([^=]+)(?:=((?:.|\n)*))?/)
- , key=pair[1].trim().toLowerCase()
- , value=pair[2];
- switch(key) {
- case "httponly":
- this.noscript = true;
- break;
- case "expires":
- this.expiration_date = value
- ? Number(Date.parse(value))
- : Infinity;
- break;
- case "path":
- this.path = value
- ? value.trim()
- : "";
- break;
- case "domain":
- this.domain = value
- ? value.trim()
- : "";
- break;
- case "secure":
- this.secure = true;
- break
- }
- }
-
- return this;
- }
- return new Cookie().parse(str)
-}
-
-Cookie.prototype.matches = function matches(access_info) {
- if(this.noscript && access_info.script
- || this.secure && !access_info.secure
- || !this.collidesWith(access_info)) {
- return false
- }
- return true;
-}
-
-Cookie.prototype.collidesWith = function collidesWith(access_info) {
- if((this.path && !access_info.path) || (this.domain && !access_info.domain)) {
- return false
- }
- if(this.path && access_info.path.indexOf(this.path) !== 0) {
- return false;
- }
- if (this.domain===access_info.domain) {
- return true;
- }
- else if(this.domain && this.domain.charAt(0)===".")
- {
- var wildcard=access_info.domain.indexOf(this.domain.slice(1))
- if(wildcard===-1 || wildcard!==access_info.domain.length-this.domain.length+1) {
- return false;
- }
- }
- else if(this.domain){
- return false
- }
- return true;
-}
-
-exports.CookieJar=CookieJar=function CookieJar() {
- if(this instanceof CookieJar) {
- var cookies = {} //name: [Cookie]
-
- this.setCookie = function setCookie(cookie) {
- cookie = Cookie(cookie);
- //Delete the cookie if the set is past the current time
- var remove = cookie.expiration_date <= Date.now();
- if(cookie.name in cookies) {
- var cookies_list = cookies[cookie.name];
- for(var i=0;i<cookies_list.length;i++) {
- var collidable_cookie = cookies_list[i];
- if(collidable_cookie.collidesWith(cookie)) {
- if(remove) {
- cookies_list.splice(i,1);
- if(cookies_list.length===0) {
- delete cookies[cookie.name]
- }
- return false;
- }
- else {
- return cookies_list[i]=cookie;
- }
- }
- }
- if(remove) {
- return false;
- }
- cookies_list.push(cookie);
- return cookie;
- }
- else if(remove){
- return false;
- }
- else {
- return cookies[cookie.name]=[cookie];
- }
- }
- //returns a cookie
- this.getCookie = function getCookie(cookie_name,access_info) {
- var cookies_list = cookies[cookie_name];
- for(var i=0;i<cookies_list.length;i++) {
- var cookie = cookies_list[i];
- if(cookie.expiration_date <= Date.now()) {
- if(cookies_list.length===0) {
- delete cookies[cookie.name]
- }
- continue;
- }
- if(cookie.matches(access_info)) {
- return cookie;
- }
- }
- }
- //returns a list of cookies
- this.getCookies = function getCookies(access_info) {
- var matches=[];
- for(var cookie_name in cookies) {
- var cookie=this.getCookie(cookie_name,access_info);
- if (cookie) {
- matches.push(cookie);
- }
- }
- matches.toString=function toString(){return matches.join(":");}
- matches.toValueString=function() {return matches.map(function(c){return c.toValueString();}).join(';');}
- return matches;
- }
-
- return this;
- }
- return new CookieJar()
-}
-
-
-//returns list of cookies that were set correctly
-CookieJar.prototype.setCookies = function setCookies(cookies) {
- cookies=Array.isArray(cookies)
- ?cookies
- :cookies.split(cookie_str_splitter);
- var successful=[]
- for(var i=0;i<cookies.length;i++) {
- var cookie = Cookie(cookies[i]);
- if(this.setCookie(cookie)) {
- successful.push(cookie);
- }
- }
- return successful;
-}
-
-});
-
-require.define("/shred/request.js", function (require, module, exports, __dirname, __filename) {
- // The request object encapsulates a request, creating a Node.js HTTP request and
-// then handling the response.
-
-var HTTP = require("http")
- , HTTPS = require("https")
- , parseUri = require("./parseUri")
- , Emitter = require('events').EventEmitter
- , sprintf = require("sprintf").sprintf
- , Response = require("./response")
- , HeaderMixins = require("./mixins/headers")
- , Content = require("./content")
-;
-
-var STATUS_CODES = HTTP.STATUS_CODES || {
- 100 : 'Continue',
- 101 : 'Switching Protocols',
- 102 : 'Processing', // RFC 2518, obsoleted by RFC 4918
- 200 : 'OK',
- 201 : 'Created',
- 202 : 'Accepted',
- 203 : 'Non-Authoritative Information',
- 204 : 'No Content',
- 205 : 'Reset Content',
- 206 : 'Partial Content',
- 207 : 'Multi-Status', // RFC 4918
- 300 : 'Multiple Choices',
- 301 : 'Moved Permanently',
- 302 : 'Moved Temporarily',
- 303 : 'See Other',
- 304 : 'Not Modified',
- 305 : 'Use Proxy',
- 307 : 'Temporary Redirect',
- 400 : 'Bad Request',
- 401 : 'Unauthorized',
- 402 : 'Payment Required',
- 403 : 'Forbidden',
- 404 : 'Not Found',
- 405 : 'Method Not Allowed',
- 406 : 'Not Acceptable',
- 407 : 'Proxy Authentication Required',
- 408 : 'Request Time-out',
- 409 : 'Conflict',
- 410 : 'Gone',
- 411 : 'Length Required',
- 412 : 'Precondition Failed',
- 413 : 'Request Entity Too Large',
- 414 : 'Request-URI Too Large',
- 415 : 'Unsupported Media Type',
- 416 : 'Requested Range Not Satisfiable',
- 417 : 'Expectation Failed',
- 418 : 'I\'m a teapot', // RFC 2324
- 422 : 'Unprocessable Entity', // RFC 4918
- 423 : 'Locked', // RFC 4918
- 424 : 'Failed Dependency', // RFC 4918
- 425 : 'Unordered Collection', // RFC 4918
- 426 : 'Upgrade Required', // RFC 2817
- 500 : 'Internal Server Error',
- 501 : 'Not Implemented',
- 502 : 'Bad Gateway',
- 503 : 'Service Unavailable',
- 504 : 'Gateway Time-out',
- 505 : 'HTTP Version not supported',
- 506 : 'Variant Also Negotiates', // RFC 2295
- 507 : 'Insufficient Storage', // RFC 4918
- 509 : 'Bandwidth Limit Exceeded',
- 510 : 'Not Extended' // RFC 2774
-};
-
-// The Shred object itself constructs the `Request` object. You should rarely
-// need to do this directly.
-
-var Request = function(options) {
- this.log = options.logger;
- this.cookieJar = options.cookieJar;
- this.encoding = options.encoding;
- this.logCurl = options.logCurl;
- processOptions(this,options||{});
- createRequest(this);
-};
-
-// A `Request` has a number of properties, many of which help with details like
-// URL parsing or defaulting the port for the request.
-
-Object.defineProperties(Request.prototype, {
-
-// - **url**. You can set the `url` property with a valid URL string and all the
-// URL-related properties (host, port, etc.) will be automatically set on the
-// request object.
-
- url: {
- get: function() {
- if (!this.scheme) { return null; }
- return sprintf("%s://%s:%s%s",
- this.scheme, this.host, this.port,
- (this.proxy ? "/" : this.path) +
- (this.query ? ("?" + this.query) : ""));
- },
- set: function(_url) {
- _url = parseUri(_url);
- this.scheme = _url.protocol;
- this.host = _url.host;
- this.port = _url.port;
- this.path = _url.path;
- this.query = _url.query;
- return this;
- },
- enumerable: true
- },
-
-// - **headers**. Returns a hash representing the request headers. You can't set
-// this directly, only get it. You can add or modify headers by using the
-// `setHeader` or `setHeaders` method. This ensures that the headers are
-// normalized - that is, you don't accidentally send `Content-Type` and
-// `content-type` headers. Keep in mind that if you modify the returned hash,
-// it will *not* modify the request headers.
-
- headers: {
- get: function() {
- return this.getHeaders();
- },
- enumerable: true
- },
-
-// - **port**. Unless you set the `port` explicitly or include it in the URL, it
-// will default based on the scheme.
-
- port: {
- get: function() {
- if (!this._port) {
- switch(this.scheme) {
- case "https": return this._port = 443;
- case "http":
- default: return this._port = 80;
- }
- }
- return this._port;
- },
- set: function(value) { this._port = value; return this; },
- enumerable: true
- },
-
-// - **method**. The request method - `get`, `put`, `post`, etc. that will be
-// used to make the request. Defaults to `get`.
-
- method: {
- get: function() {
- return this._method = (this._method||"GET");
- },
- set: function(value) {
- this._method = value; return this;
- },
- enumerable: true
- },
-
-// - **query**. Can be set either with a query string or a hash (object). Get
-// will always return a properly escaped query string or null if there is no
-// query component for the request.
-
- query: {
- get: function() {return this._query;},
- set: function(value) {
- var stringify = function (hash) {
- var query = "";
- for (var key in hash) {
- query += encodeURIComponent(key) + '=' + encodeURIComponent(hash[key]) + '&';
- }
- // Remove the last '&'
- query = query.slice(0, -1);
- return query;
- }
-
- if (value) {
- if (typeof value === 'object') {
- value = stringify(value);
- }
- this._query = value;
- } else {
- this._query = "";
- }
- return this;
- },
- enumerable: true
- },
-
-// - **parameters**. This will return the query parameters in the form of a hash
-// (object).
-
- parameters: {
- get: function() { return QueryString.parse(this._query||""); },
- enumerable: true
- },
-
-// - **content**. (Aliased as `body`.) Set this to add a content entity to the
-// request. Attempts to use the `content-type` header to determine what to do
-// with the content value. Get this to get back a [`Content`
-// object](./content.html).
-
- body: {
- get: function() { return this._body; },
- set: function(value) {
- this._body = new Content({
- data: value,
- type: this.getHeader("Content-Type")
- });
- this.setHeader("Content-Type",this.content.type);
- this.setHeader("Content-Length",this.content.length);
- return this;
- },
- enumerable: true
- },
-
-// - **timeout**. Used to determine how long to wait for a response. Does not
-// distinguish between connect timeouts versus request timeouts. Set either in
-// milliseconds or with an object with temporal attributes (hours, minutes,
-// seconds) and convert it into milliseconds. Get will always return
-// milliseconds.
-
- timeout: {
- get: function() { return this._timeout; }, // in milliseconds
- set: function(timeout) {
- var request = this
- , milliseconds = 0;
- ;
- if (!timeout) return this;
- if (typeof timeout==="number") { milliseconds = timeout; }
- else {
- milliseconds = (timeout.milliseconds||0) +
- (1000 * ((timeout.seconds||0) +
- (60 * ((timeout.minutes||0) +
- (60 * (timeout.hours||0))))));
- }
- this._timeout = milliseconds;
- return this;
- },
- enumerable: true
- }
-});
-
-// Alias `body` property to `content`. Since the [content object](./content.html)
-// has a `body` attribute, it's preferable to use `content` since you can then
-// access the raw content data using `content.body`.
-
-Object.defineProperty(Request.prototype,"content",
- Object.getOwnPropertyDescriptor(Request.prototype, "body"));
-
-// The `Request` object can be pretty overwhelming to view using the built-in
-// Node.js inspect method. We want to make it a bit more manageable. This
-// probably goes [too far in the other
-// direction](https://github.com/spire-io/shred/issues/2).
-
-Request.prototype.inspect = function () {
- var request = this;
- var headers = this.format_headers();
- var summary = ["<Shred Request> ", request.method.toUpperCase(),
- request.url].join(" ")
- return [ summary, "- Headers:", headers].join("\n");
-};
-
-Request.prototype.format_headers = function () {
- var array = []
- var headers = this._headers
- for (var key in headers) {
- if (headers.hasOwnProperty(key)) {
- var value = headers[key]
- array.push("\t" + key + ": " + value);
- }
- }
- return array.join("\n");
-};
-
-// Allow chainable 'on's: shred.get({ ... }).on( ... ). You can pass in a
-// single function, a pair (event, function), or a hash:
-// { event: function, event: function }
-Request.prototype.on = function (eventOrHash, listener) {
- var emitter = this.emitter;
- // Pass in a single argument as a function then make it the default response handler
- if (arguments.length === 1 && typeof(eventOrHash) === 'function') {
- emitter.on('response', eventOrHash);
- } else if (arguments.length === 1 && typeof(eventOrHash) === 'object') {
- for (var key in eventOrHash) {
- if (eventOrHash.hasOwnProperty(key)) {
- emitter.on(key, eventOrHash[key]);
- }
- }
- } else {
- emitter.on(eventOrHash, listener);
- }
- return this;
-};
-
-// Add in the header methods. Again, these ensure we don't get the same header
-// multiple times with different case conventions.
-HeaderMixins.gettersAndSetters(Request);
-
-// `processOptions` is called from the constructor to handle all the work
-// associated with making sure we do our best to ensure we have a valid request.
-
-var processOptions = function(request,options) {
-
- request.log.debug("Processing request options ..");
-
- // We'll use `request.emitter` to manage the `on` event handlers.
- request.emitter = (new Emitter);
-
- request.agent = options.agent;
-
- // Set up the handlers ...
- if (options.on) {
- for (var key in options.on) {
- if (options.on.hasOwnProperty(key)) {
- request.emitter.on(key, options.on[key]);
- }
- }
- }
-
- // Make sure we were give a URL or a host
- if (!options.url && !options.host) {
- request.emitter.emit("request_error",
- new Error("No url or url options (host, port, etc.)"));
- return;
- }
-
- // Allow for the [use of a proxy](http://www.jmarshall.com/easy/http/#proxies).
-
- if (options.url) {
- if (options.proxy) {
- request.url = options.proxy;
- request.path = options.url;
- } else {
- request.url = options.url;
- }
- }
-
- // Set the remaining options.
- request.query = options.query||options.parameters||request.query ;
- request.method = options.method;
- request.setHeader("user-agent",options.agent||"Shred");
- request.setHeaders(options.headers);
-
- if (request.cookieJar) {
- var cookies = request.cookieJar.getCookies( CookieAccessInfo( request.host, request.path ) );
- if (cookies.length) {
- var cookieString = request.getHeader('cookie')||'';
- for (var cookieIndex = 0; cookieIndex < cookies.length; ++cookieIndex) {
- if ( cookieString.length && cookieString[ cookieString.length - 1 ] != ';' )
- {
- cookieString += ';';
- }
- cookieString += cookies[ cookieIndex ].name + '=' + cookies[ cookieIndex ].value + ';';
- }
- request.setHeader("cookie", cookieString);
- }
- }
-
- // The content entity can be set either using the `body` or `content` attributes.
- if (options.body||options.content) {
- request.content = options.body||options.content;
- }
- request.timeout = options.timeout;
-
-};
-
-// `createRequest` is also called by the constructor, after `processOptions`.
-// This actually makes the request and processes the response, so `createRequest`
-// is a bit of a misnomer.
-
-var createRequest = function(request) {
- var timeout ;
-
- request.log.debug("Creating request ..");
- request.log.debug(request);
-
- var reqParams = {
- host: request.host,
- port: request.port,
- method: request.method,
- path: request.path + (request.query ? '?'+request.query : ""),
- headers: request.getHeaders(),
- // Node's HTTP/S modules will ignore this, but we are using the
- // browserify-http module in the browser for both HTTP and HTTPS, and this
- // is how you differentiate the two.
- scheme: request.scheme,
- // Use a provided agent. 'Undefined' is the default, which uses a global
- // agent.
- agent: request.agent
- };
-
- if (request.logCurl) {
- logCurl(request);
- }
-
- var http = request.scheme == "http" ? HTTP : HTTPS;
-
- // Set up the real request using the selected library. The request won't be
- // sent until we call `.end()`.
- request._raw = http.request(reqParams, function(response) {
- request.log.debug("Received response ..");
-
- // We haven't timed out and we have a response, so make sure we clear the
- // timeout so it doesn't fire while we're processing the response.
- clearTimeout(timeout);
-
- // Construct a Shred `Response` object from the response. This will stream
- // the response, thus the need for the callback. We can access the response
- // entity safely once we're in the callback.
- response = new Response(response, request, function(response) {
-
- // Set up some event magic. The precedence is given first to
- // status-specific handlers, then to responses for a given event, and then
- // finally to the more general `response` handler. In the last case, we
- // need to first make sure we're not dealing with a a redirect.
- var emit = function(event) {
- var emitter = request.emitter;
- var textStatus = STATUS_CODES[response.status] ? STATUS_CODES[response.status].toLowerCase() : null;
- if (emitter.listeners(response.status).length > 0 || emitter.listeners(textStatus).length > 0) {
- emitter.emit(response.status, response);
- emitter.emit(textStatus, response);
- } else {
- if (emitter.listeners(event).length>0) {
- emitter.emit(event, response);
- } else if (!response.isRedirect) {
- emitter.emit("response", response);
- //console.warn("Request has no event listener for status code " + response.status);
- }
- }
- };
-
- // Next, check for a redirect. We simply repeat the request with the URL
- // given in the `Location` header. We fire a `redirect` event.
- if (response.isRedirect) {
- request.log.debug("Redirecting to "
- + response.getHeader("Location"));
- request.url = response.getHeader("Location");
- emit("redirect");
- createRequest(request);
-
- // Okay, it's not a redirect. Is it an error of some kind?
- } else if (response.isError) {
- emit("error");
- } else {
- // It looks like we're good shape. Trigger the `success` event.
- emit("success");
- }
- });
- });
-
- // We're still setting up the request. Next, we're going to handle error cases
- // where we have no response. We don't emit an error event because that event
- // takes a response. We don't response handlers to have to check for a null
- // value. However, we [should introduce a different event
- // type](https://github.com/spire-io/shred/issues/3) for this type of error.
- request._raw.on("error", function(error) {
- request.emitter.emit("request_error", error);
- });
-
- request._raw.on("socket", function(socket) {
- request.emitter.emit("socket", socket);
- });
-
- // TCP timeouts should also trigger the "response_error" event.
- request._raw.on('socket', function () {
- request._raw.socket.on('timeout', function () {
- // This should trigger the "error" event on the raw request, which will
- // trigger the "response_error" on the shred request.
- request._raw.abort();
- });
- });
-
-
- // We're almost there. Next, we need to write the request entity to the
- // underlying request object.
- if (request.content) {
- request.log.debug("Streaming body: '" +
- request.content.data.slice(0,59) + "' ... ");
- request._raw.write(request.content.data);
- }
-
- // Finally, we need to set up the timeout. We do this last so that we don't
- // start the clock ticking until the last possible moment.
- if (request.timeout) {
- timeout = setTimeout(function() {
- request.log.debug("Timeout fired, aborting request ...");
- request._raw.abort();
- request.emitter.emit("timeout", request);
- },request.timeout);
- }
-
- // The `.end()` method will cause the request to fire. Technically, it might
- // have already sent the headers and body.
- request.log.debug("Sending request ...");
- request._raw.end();
-};
-
-// Logs the curl command for the request.
-var logCurl = function (req) {
- var headers = req.getHeaders();
- var headerString = "";
-
- for (var key in headers) {
- headerString += '-H "' + key + ": " + headers[key] + '" ';
- }
-
- var bodyString = ""
-
- if (req.content) {
- bodyString += "-d '" + req.content.body + "' ";
- }
-
- var query = req.query ? '?' + req.query : "";
-
- console.log("curl " +
- "-X " + req.method.toUpperCase() + " " +
- req.scheme + "://" + req.host + ":" + req.port + req.path + query + " " +
- headerString +
- bodyString
- );
-};
-
-
-module.exports = Request;
-
-});
-
-require.define("http", function (require, module, exports, __dirname, __filename) {
- // todo
-
-});
-
-require.define("https", function (require, module, exports, __dirname, __filename) {
- // todo
-
-});
-
-require.define("/shred/parseUri.js", function (require, module, exports, __dirname, __filename) {
- // parseUri 1.2.2
-// (c) Steven Levithan <stevenlevithan.com>
-// MIT License
-
-function parseUri (str) {
- var o = parseUri.options,
- m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
- uri = {},
- i = 14;
-
- while (i--) uri[o.key[i]] = m[i] || "";
-
- uri[o.q.name] = {};
- uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
- if ($1) uri[o.q.name][$1] = $2;
- });
-
- return uri;
-};
-
-parseUri.options = {
- strictMode: false,
- key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
- q: {
- name: "queryKey",
- parser: /(?:^|&)([^&=]*)=?([^&]*)/g
- },
- parser: {
- strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
- loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
- }
-};
-
-module.exports = parseUri;
-
-});
-
-require.define("events", function (require, module, exports, __dirname, __filename) {
- if (!process.EventEmitter) process.EventEmitter = function () {};
-
-var EventEmitter = exports.EventEmitter = process.EventEmitter;
-var isArray = typeof Array.isArray === 'function'
- ? Array.isArray
- : function (xs) {
- return Object.toString.call(xs) === '[object Array]'
- }
-;
-
-// By default EventEmitters will print a warning if more than
-// 10 listeners are added to it. This is a useful default which
-// helps finding memory leaks.
-//
-// Obviously not all Emitters should be limited to 10. This function allows
-// that to be increased. Set to zero for unlimited.
-var defaultMaxListeners = 10;
-EventEmitter.prototype.setMaxListeners = function(n) {
- if (!this._events) this._events = {};
- this._events.maxListeners = n;
-};
-
-
-EventEmitter.prototype.emit = function(type) {
- // If there is no 'error' event listener then throw.
- if (type === 'error') {
- if (!this._events || !this._events.error ||
- (isArray(this._events.error) && !this._events.error.length))
- {
- if (arguments[1] instanceof Error) {
- throw arguments[1]; // Unhandled 'error' event
- } else {
- throw new Error("Uncaught, unspecified 'error' event.");
- }
- return false;
- }
- }
-
- if (!this._events) return false;
- var handler = this._events[type];
- if (!handler) return false;
-
- if (typeof handler == 'function') {
- switch (arguments.length) {
- // fast cases
- case 1:
- handler.call(this);
- break;
- case 2:
- handler.call(this, arguments[1]);
- break;
- case 3:
- handler.call(this, arguments[1], arguments[2]);
- break;
- // slower
- default:
- var args = Array.prototype.slice.call(arguments, 1);
- handler.apply(this, args);
- }
- return true;
-
- } else if (isArray(handler)) {
- var args = Array.prototype.slice.call(arguments, 1);
-
- var listeners = handler.slice();
- for (var i = 0, l = listeners.length; i < l; i++) {
- listeners[i].apply(this, args);
- }
- return true;
-
- } else {
- return false;
- }
-};
-
-// EventEmitter is defined in src/node_events.cc
-// EventEmitter.prototype.emit() is also defined there.
-EventEmitter.prototype.addListener = function(type, listener) {
- if ('function' !== typeof listener) {
- throw new Error('addListener only takes instances of Function');
- }
-
- if (!this._events) this._events = {};
-
- // To avoid recursion in the case that type == "newListeners"! Before
- // adding it to the listeners, first emit "newListeners".
- this.emit('newListener', type, listener);
-
- if (!this._events[type]) {
- // Optimize the case of one listener. Don't need the extra array object.
- this._events[type] = listener;
- } else if (isArray(this._events[type])) {
-
- // Check for listener leak
- if (!this._events[type].warned) {
- var m;
- if (this._events.maxListeners !== undefined) {
- m = this._events.maxListeners;
- } else {
- m = defaultMaxListeners;
- }
-
- if (m && m > 0 && this._events[type].length > m) {
- this._events[type].warned = true;
- console.error('(node) warning: possible EventEmitter memory ' +
- 'leak detected. %d listeners added. ' +
- 'Use emitter.setMaxListeners() to increase limit.',
- this._events[type].length);
- console.trace();
- }
- }
-
- // If we've already got an array, just append.
- this._events[type].push(listener);
- } else {
- // Adding the second element, need to change to array.
- this._events[type] = [this._events[type], listener];
- }
-
- return this;
-};
-
-EventEmitter.prototype.on = EventEmitter.prototype.addListener;
-
-EventEmitter.prototype.once = function(type, listener) {
- var self = this;
- self.on(type, function g() {
- self.removeListener(type, g);
- listener.apply(this, arguments);
- });
-
- return this;
-};
-
-EventEmitter.prototype.removeListener = function(type, listener) {
- if ('function' !== typeof listener) {
- throw new Error('removeListener only takes instances of Function');
- }
-
- // does not use listeners(), so no side effect of creating _events[type]
- if (!this._events || !this._events[type]) return this;
-
- var list = this._events[type];
-
- if (isArray(list)) {
- var i = list.indexOf(listener);
- if (i < 0) return this;
- list.splice(i, 1);
- if (list.length == 0)
- delete this._events[type];
- } else if (this._events[type] === listener) {
- delete this._events[type];
- }
-
- return this;
-};
-
-EventEmitter.prototype.removeAllListeners = function(type) {
- // does not use listeners(), so no side effect of creating _events[type]
- if (type && this._events && this._events[type]) this._events[type] = null;
- return this;
-};
-
-EventEmitter.prototype.listeners = function(type) {
- if (!this._events) this._events = {};
- if (!this._events[type]) this._events[type] = [];
- if (!isArray(this._events[type])) {
- this._events[type] = [this._events[type]];
- }
- return this._events[type];
-};
-
-});
-
-require.define("/node_modules/sprintf/package.json", function (require, module, exports, __dirname, __filename) {
- module.exports = {"main":"./lib/sprintf"}
-});
-
-require.define("/node_modules/sprintf/lib/sprintf.js", function (require, module, exports, __dirname, __filename) {
- /**
-sprintf() for JavaScript 0.7-beta1
-http://www.diveintojavascript.com/projects/javascript-sprintf
-
-Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of sprintf() for JavaScript nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-Changelog:
-2010.11.07 - 0.7-beta1-node
- - converted it to a node.js compatible module
-
-2010.09.06 - 0.7-beta1
- - features: vsprintf, support for named placeholders
- - enhancements: format cache, reduced global namespace pollution
-
-2010.05.22 - 0.6:
- - reverted to 0.4 and fixed the bug regarding the sign of the number 0
- Note:
- Thanks to Raphael Pigulla <raph (at] n3rd [dot) org> (http://www.n3rd.org/)
- who warned me about a bug in 0.5, I discovered that the last update was
- a regress. I appologize for that.
-
-2010.05.09 - 0.5:
- - bug fix: 0 is now preceeded with a + sign
- - bug fix: the sign was not at the right position on padded results (Kamal Abdali)
- - switched from GPL to BSD license
-
-2007.10.21 - 0.4:
- - unit test and patch (David Baird)
-
-2007.09.17 - 0.3:
- - bug fix: no longer throws exception on empty paramenters (Hans Pufal)
-
-2007.09.11 - 0.2:
- - feature: added argument swapping
-
-2007.04.03 - 0.1:
- - initial release
-**/
-
-var sprintf = (function() {
- function get_type(variable) {
- return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
- }
- function str_repeat(input, multiplier) {
- for (var output = []; multiplier > 0; output[--multiplier] = input) {/* do nothing */}
- return output.join('');
- }
-
- var str_format = function() {
- if (!str_format.cache.hasOwnProperty(arguments[0])) {
- str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
- }
- return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
- };
-
- str_format.format = function(parse_tree, argv) {
- var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
- for (i = 0; i < tree_length; i++) {
- node_type = get_type(parse_tree[i]);
- if (node_type === 'string') {
- output.push(parse_tree[i]);
- }
- else if (node_type === 'array') {
- match = parse_tree[i]; // convenience purposes only
- if (match[2]) { // keyword argument
- arg = argv[cursor];
- for (k = 0; k < match[2].length; k++) {
- if (!arg.hasOwnProperty(match[2][k])) {
- throw(sprintf('[sprintf] property "%s" does not exist', match[2][k]));
- }
- arg = arg[match[2][k]];
- }
- }
- else if (match[1]) { // positional argument (explicit)
- arg = argv[match[1]];
- }
- else { // positional argument (implicit)
- arg = argv[cursor++];
- }
-
- if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
- throw(sprintf('[sprintf] expecting number but found %s', get_type(arg)));
- }
- switch (match[8]) {
- case 'b': arg = arg.toString(2); break;
- case 'c': arg = String.fromCharCode(arg); break;
- case 'd': arg = parseInt(arg, 10); break;
- case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break;
- case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break;
- case 'o': arg = arg.toString(8); break;
- case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break;
- case 'u': arg = Math.abs(arg); break;
- case 'x': arg = arg.toString(16); break;
- case 'X': arg = arg.toString(16).toUpperCase(); break;
- }
- arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg);
- pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';
- pad_length = match[6] - String(arg).length;
- pad = match[6] ? str_repeat(pad_character, pad_length) : '';
- output.push(match[5] ? arg + pad : pad + arg);
- }
- }
- return output.join('');
- };
-
- str_format.cache = {};
-
- str_format.parse = function(fmt) {
- var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
- while (_fmt) {
- if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
- parse_tree.push(match[0]);
- }
- else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
- parse_tree.push('%');
- }
- else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
- if (match[2]) {
- arg_names |= 1;
- var field_list = [], replacement_field = match[2], field_match = [];
- if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
- field_list.push(field_match[1]);
- while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
- if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
- field_list.push(field_match[1]);
- }
- else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
- field_list.push(field_match[1]);
- }
- else {
- throw('[sprintf] huh?');
- }
- }
- }
- else {
- throw('[sprintf] huh?');
- }
- match[2] = field_list;
- }
- else {
- arg_names |= 2;
- }
- if (arg_names === 3) {
- throw('[sprintf] mixing positional and named placeholders is not (yet) supported');
- }
- parse_tree.push(match);
- }
- else {
- throw('[sprintf] huh?');
- }
- _fmt = _fmt.substring(match[0].length);
- }
- return parse_tree;
- };
-
- return str_format;
-})();
-
-var vsprintf = function(fmt, argv) {
- argv.unshift(fmt);
- return sprintf.apply(null, argv);
-};
-
-exports.sprintf = sprintf;
-exports.vsprintf = vsprintf;
-});
-
-require.define("/shred/response.js", function (require, module, exports, __dirname, __filename) {
- // The `Response object` encapsulates a Node.js HTTP response.
-
-var Content = require("./content")
- , HeaderMixins = require("./mixins/headers")
- , CookieJarLib = require( "cookiejar" )
- , Cookie = CookieJarLib.Cookie
-;
-
-// Browser doesn't have zlib.
-var zlib = null;
-try {
- zlib = require('zlib');
-} catch (e) {
- // console.warn("no zlib library");
-}
-
-// Iconv doesn't work in browser
-var Iconv = null;
-try {
- Iconv = require('iconv-lite');
-} catch (e) {
- // console.warn("no iconv library");
-}
-
-// Construct a `Response` object. You should never have to do this directly. The
-// `Request` object handles this, getting the raw response object and passing it
-// in here, along with the request. The callback allows us to stream the response
-// and then use the callback to let the request know when it's ready.
-var Response = function(raw, request, callback) {
- var response = this;
- this._raw = raw;
-
- // The `._setHeaders` method is "private"; you can't otherwise set headers on
- // the response.
- this._setHeaders.call(this,raw.headers);
-
- // store any cookies
- if (request.cookieJar && this.getHeader('set-cookie')) {
- var cookieStrings = this.getHeader('set-cookie');
- var cookieObjs = []
- , cookie;
-
- for (var i = 0; i < cookieStrings.length; i++) {
- var cookieString = cookieStrings[i];
- if (!cookieString) {
- continue;
- }
-
- if (!cookieString.match(/domain\=/i)) {
- cookieString += '; domain=' + request.host;
- }
-
- if (!cookieString.match(/path\=/i)) {
- cookieString += '; path=' + request.path;
- }
-
- try {
- cookie = new Cookie(cookieString);
- if (cookie) {
- cookieObjs.push(cookie);
- }
- } catch (e) {
- console.warn("Tried to set bad cookie: " + cookieString);
- }
- }
-
- request.cookieJar.setCookies(cookieObjs);
- }
-
- this.request = request;
- this.client = request.client;
- this.log = this.request.log;
-
- // Stream the response content entity and fire the callback when we're done.
- // Store the incoming data in a array of Buffers which we concatinate into one
- // buffer at the end. We need to use buffers instead of strings here in order
- // to preserve binary data.
- var chunkBuffers = [];
- var dataLength = 0;
- raw.on("data", function(chunk) {
- chunkBuffers.push(chunk);
- dataLength += chunk.length;
- });
- raw.on("end", function() {
- var body;
- if (typeof Buffer === 'undefined') {
- // Just concatinate into a string
- body = chunkBuffers.join('');
- } else {
- // Initialize new buffer and add the chunks one-at-a-time.
- body = new Buffer(dataLength);
- for (var i = 0, pos = 0; i < chunkBuffers.length; i++) {
- chunkBuffers[i].copy(body, pos);
- pos += chunkBuffers[i].length;
- }
- }
-
- var setBodyAndFinish = function (body) {
- response._body = new Content({
- body: body,
- type: response.getHeader("Content-Type")
- });
- callback(response);
- }
-
- if (zlib && response.getHeader("Content-Encoding") === 'gzip'){
- zlib.gunzip(body, function (err, gunzippedBody) {
- if (Iconv && response.request.encoding){
- body = Iconv.fromEncoding(gunzippedBody,response.request.encoding);
- } else {
- body = gunzippedBody.toString();
- }
- setBodyAndFinish(body);
- })
- }
- else{
- if (response.request.encoding){
- body = Iconv.fromEncoding(body,response.request.encoding);
- }
- setBodyAndFinish(body);
- }
- });
-};
-
-// The `Response` object can be pretty overwhelming to view using the built-in
-// Node.js inspect method. We want to make it a bit more manageable. This
-// probably goes [too far in the other
-// direction](https://github.com/spire-io/shred/issues/2).
-
-Response.prototype = {
- inspect: function() {
- var response = this;
- var headers = this.format_headers();
- var summary = ["<Shred Response> ", response.status].join(" ")
- return [ summary, "- Headers:", headers].join("\n");
- },
- format_headers: function () {
- var array = []
- var headers = this._headers
- for (var key in headers) {
- if (headers.hasOwnProperty(key)) {
- var value = headers[key]
- array.push("\t" + key + ": " + value);
- }
- }
- return array.join("\n");
- }
-};
-
-// `Response` object properties, all of which are read-only:
-Object.defineProperties(Response.prototype, {
-
-// - **status**. The HTTP status code for the response.
- status: {
- get: function() { return this._raw.statusCode; },
- enumerable: true
- },
-
-// - **content**. The HTTP content entity, if any. Provided as a [content
-// object](./content.html), which will attempt to convert the entity based upon
-// the `content-type` header. The converted value is available as
-// `content.data`. The original raw content entity is available as
-// `content.body`.
- body: {
- get: function() { return this._body; }
- },
- content: {
- get: function() { return this.body; },
- enumerable: true
- },
-
-// - **isRedirect**. Is the response a redirect? These are responses with 3xx
-// status and a `Location` header.
- isRedirect: {
- get: function() {
- return (this.status>299
- &&this.status<400
- &&this.getHeader("Location"));
- },
- enumerable: true
- },
-
-// - **isError**. Is the response an error? These are responses with status of
-// 400 or greater.
- isError: {
- get: function() {
- return (this.status === 0 || this.status > 399)
- },
- enumerable: true
- }
-});
-
-// Add in the [getters for accessing the normalized headers](./headers.js).
-HeaderMixins.getters(Response);
-HeaderMixins.privateSetters(Response);
-
-// Work around Mozilla bug #608735 [https://bugzil.la/608735], which causes
-// getAllResponseHeaders() to return {} if the response is a CORS request.
-// xhr.getHeader still works correctly.
-var getHeader = Response.prototype.getHeader;
-Response.prototype.getHeader = function (name) {
- return (getHeader.call(this,name) ||
- (typeof this._raw.getHeader === 'function' && this._raw.getHeader(name)));
-};
-
-module.exports = Response;
-
-});
-
-require.define("/shred/content.js", function (require, module, exports, __dirname, __filename) {
-
-// The purpose of the `Content` object is to abstract away the data conversions
-// to and from raw content entities as strings. For example, you want to be able
-// to pass in a Javascript object and have it be automatically converted into a
-// JSON string if the `content-type` is set to a JSON-based media type.
-// Conversely, you want to be able to transparently get back a Javascript object
-// in the response if the `content-type` is a JSON-based media-type.
-
-// One limitation of the current implementation is that it [assumes the `charset` is UTF-8](https://github.com/spire-io/shred/issues/5).
-
-// The `Content` constructor takes an options object, which *must* have either a
-// `body` or `data` property and *may* have a `type` property indicating the
-// media type. If there is no `type` attribute, a default will be inferred.
-var Content = function(options) {
- this.body = options.body;
- this.data = options.data;
- this.type = options.type;
-};
-
-Content.prototype = {
- // Treat `toString()` as asking for the `content.body`. That is, the raw content entity.
- //
- // toString: function() { return this.body; }
- //
- // Commented out, but I've forgotten why. :/
-};
-
-
-// `Content` objects have the following attributes:
-Object.defineProperties(Content.prototype,{
-
-// - **type**. Typically accessed as `content.type`, reflects the `content-type`
-// header associated with the request or response. If not passed as an options
-// to the constructor or set explicitly, it will infer the type the `data`
-// attribute, if possible, and, failing that, will default to `text/plain`.
- type: {
- get: function() {
- if (this._type) {
- return this._type;
- } else {
- if (this._data) {
- switch(typeof this._data) {
- case "string": return "text/plain";
- case "object": return "application/json";
- }
- }
- }
- return "text/plain";
- },
- set: function(value) {
- this._type = value;
- return this;
- },
- enumerable: true
- },
-
-// - **data**. Typically accessed as `content.data`, reflects the content entity
-// converted into Javascript data. This can be a string, if the `type` is, say,
-// `text/plain`, but can also be a Javascript object. The conversion applied is
-// based on the `processor` attribute. The `data` attribute can also be set
-// directly, in which case the conversion will be done the other way, to infer
-// the `body` attribute.
- data: {
- get: function() {
- if (this._body) {
- return this.processor.parser(this._body);
- } else {
- return this._data;
- }
- },
- set: function(data) {
- if (this._body&&data) Errors.setDataWithBody(this);
- this._data = data;
- return this;
- },
- enumerable: true
- },
-
-// - **body**. Typically accessed as `content.body`, reflects the content entity
-// as a UTF-8 string. It is the mirror of the `data` attribute. If you set the
-// `data` attribute, the `body` attribute will be inferred and vice-versa. If
-// you attempt to set both, an exception is raised.
- body: {
- get: function() {
- if (this._data) {
- return this.processor.stringify(this._data);
- } else {
- return this.processor.stringify(this._body);
- }
- },
- set: function(body) {
- if (this._data&&body) Errors.setBodyWithData(this);
- this._body = body;
- return this;
- },
- enumerable: true
- },
-
-// - **processor**. The functions that will be used to convert to/from `data` and
-// `body` attributes. You can add processors. The two that are built-in are for
-// `text/plain`, which is basically an identity transformation and
-// `application/json` and other JSON-based media types (including custom media
-// types with `+json`). You can add your own processors. See below.
- processor: {
- get: function() {
- var processor = Content.processors[this.type];
- if (processor) {
- return processor;
- } else {
- // Return the first processor that matches any part of the
- // content type. ex: application/vnd.foobar.baz+json will match json.
- var main = this.type.split(";")[0];
- var parts = main.split(/\+|\//);
- for (var i=0, l=parts.length; i < l; i++) {
- processor = Content.processors[parts[i]]
- }
- return processor || {parser:identity,stringify:toString};
- }
- },
- enumerable: true
- },
-
-// - **length**. Typically accessed as `content.length`, returns the length in
-// bytes of the raw content entity.
- length: {
- get: function() {
- if (typeof Buffer !== 'undefined') {
- return Buffer.byteLength(this.body);
- }
- return this.body.length;
- }
- }
-});
-
-Content.processors = {};
-
-// The `registerProcessor` function allows you to add your own processors to
-// convert content entities. Each processor consists of a Javascript object with
-// two properties:
-// - **parser**. The function used to parse a raw content entity and convert it
-// into a Javascript data type.
-// - **stringify**. The function used to convert a Javascript data type into a
-// raw content entity.
-Content.registerProcessor = function(types,processor) {
-
-// You can pass an array of types that will trigger this processor, or just one.
-// We determine the array via duck-typing here.
- if (types.forEach) {
- types.forEach(function(type) {
- Content.processors[type] = processor;
- });
- } else {
- // If you didn't pass an array, we just use what you pass in.
- Content.processors[types] = processor;
- }
-};
-
-// Register the identity processor, which is used for text-based media types.
-var identity = function(x) { return x; }
- , toString = function(x) { return x.toString(); }
-Content.registerProcessor(
- ["text/html","text/plain","text"],
- { parser: identity, stringify: toString });
-
-// Register the JSON processor, which is used for JSON-based media types.
-Content.registerProcessor(
- ["application/json; charset=utf-8","application/json","json"],
- {
- parser: function(string) {
- return JSON.parse(string);
- },
- stringify: function(data) {
- return JSON.stringify(data); }});
-
-// Error functions are defined separately here in an attempt to make the code
-// easier to read.
-var Errors = {
- setDataWithBody: function(object) {
- throw new Error("Attempt to set data attribute of a content object " +
- "when the body attributes was already set.");
- },
- setBodyWithData: function(object) {
- throw new Error("Attempt to set body attribute of a content object " +
- "when the data attributes was already set.");
- }
-}
-module.exports = Content;
-
-});
-
-require.define("/shred/mixins/headers.js", function (require, module, exports, __dirname, __filename) {
- // The header mixins allow you to add HTTP header support to any object. This
-// might seem pointless: why not simply use a hash? The main reason is that, per
-// the [HTTP spec](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2),
-// headers are case-insensitive. So, for example, `content-type` is the same as
-// `CONTENT-TYPE` which is the same as `Content-Type`. Since there is no way to
-// overload the index operator in Javascript, using a hash to represent the
-// headers means it's possible to have two conflicting values for a single
-// header.
-//
-// The solution to this is to provide explicit methods to set or get headers.
-// This also has the benefit of allowing us to introduce additional variations,
-// including snake case, which we automatically convert to what Matthew King has
-// dubbed "corset case" - the hyphen-separated names with initial caps:
-// `Content-Type`. We use corset-case just in case we're dealing with servers
-// that haven't properly implemented the spec.
-
-// Convert headers to corset-case. **Example:** `CONTENT-TYPE` will be converted
-// to `Content-Type`.
-
-var corsetCase = function(string) {
- return string;//.toLowerCase()
- //.replace("_","-")
- // .replace(/(^|-)(\w)/g,
- // function(s) { return s.toUpperCase(); });
-};
-
-// We suspect that `initializeHeaders` was once more complicated ...
-var initializeHeaders = function(object) {
- return {};
-};
-
-// Access the `_headers` property using lazy initialization. **Warning:** If you
-// mix this into an object that is using the `_headers` property already, you're
-// going to have trouble.
-var $H = function(object) {
- return object._headers||(object._headers=initializeHeaders(object));
-};
-
-// Hide the implementations as private functions, separate from how we expose them.
-
-// The "real" `getHeader` function: get the header after normalizing the name.
-var getHeader = function(object,name) {
- return $H(object)[corsetCase(name)];
-};
-
-// The "real" `getHeader` function: get one or more headers, or all of them
-// if you don't ask for any specifics.
-var getHeaders = function(object,names) {
- var keys = (names && names.length>0) ? names : Object.keys($H(object));
- var hash = keys.reduce(function(hash,key) {
- hash[key] = getHeader(object,key);
- return hash;
- },{});
- // Freeze the resulting hash so you don't mistakenly think you're modifying
- // the real headers.
- Object.freeze(hash);
- return hash;
-};
-
-// The "real" `setHeader` function: set a header, after normalizing the name.
-var setHeader = function(object,name,value) {
- $H(object)[corsetCase(name)] = value;
- return object;
-};
-
-// The "real" `setHeaders` function: set multiple headers based on a hash.
-var setHeaders = function(object,hash) {
- for( var key in hash ) { setHeader(object,key,hash[key]); };
- return this;
-};
-
-// Here's where we actually bind the functionality to an object. These mixins work by
-// exposing mixin functions. Each function mixes in a specific batch of features.
-module.exports = {
-
- // Add getters.
- getters: function(constructor) {
- constructor.prototype.getHeader = function(name) { return getHeader(this,name); };
- constructor.prototype.getHeaders = function() { return getHeaders(this,arguments); };
- },
- // Add setters but as "private" methods.
- privateSetters: function(constructor) {
- constructor.prototype._setHeader = function(key,value) { return setHeader(this,key,value); };
- constructor.prototype._setHeaders = function(hash) { return setHeaders(this,hash); };
- },
- // Add setters.
- setters: function(constructor) {
- constructor.prototype.setHeader = function(key,value) { return setHeader(this,key,value); };
- constructor.prototype.setHeaders = function(hash) { return setHeaders(this,hash); };
- },
- // Add both getters and setters.
- gettersAndSetters: function(constructor) {
- constructor.prototype.getHeader = function(name) { return getHeader(this,name); };
- constructor.prototype.getHeaders = function() { return getHeaders(this,arguments); };
- constructor.prototype.setHeader = function(key,value) { return setHeader(this,key,value); };
- constructor.prototype.setHeaders = function(hash) { return setHeaders(this,hash); };
- }
-};
-
-});
-
-require.define("/node_modules/iconv-lite/package.json", function (require, module, exports, __dirname, __filename) {
- module.exports = {}
-});
-
-require.define("/node_modules/iconv-lite/index.js", function (require, module, exports, __dirname, __filename) {
- // Module exports
-var iconv = module.exports = {
- toEncoding: function(str, encoding) {
- return iconv.getCodec(encoding).toEncoding(str);
- },
- fromEncoding: function(buf, encoding) {
- return iconv.getCodec(encoding).fromEncoding(buf);
- },
-
- defaultCharUnicode: '�',
- defaultCharSingleByte: '?',
-
- // Get correct codec for given encoding.
- getCodec: function(encoding) {
- var enc = encoding || "utf8";
- var codecOptions = undefined;
- while (1) {
- if (getType(enc) === "String")
- enc = enc.replace(/[- ]/g, "").toLowerCase();
- var codec = iconv.encodings[enc];
- var type = getType(codec);
- if (type === "String") {
- // Link to other encoding.
- codecOptions = {originalEncoding: enc};
- enc = codec;
- }
- else if (type === "Object" && codec.type != undefined) {
- // Options for other encoding.
- codecOptions = codec;
- enc = codec.type;
- }
- else if (type === "Function")
- // Codec itself.
- return codec(codecOptions);
- else
- throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
- }
- },
-
- // Define basic encodings
- encodings: {
- internal: function(options) {
- return {
- toEncoding: function(str) {
- return new Buffer(ensureString(str), options.originalEncoding);
- },
- fromEncoding: function(buf) {
- return ensureBuffer(buf).toString(options.originalEncoding);
- }
- };
- },
- utf8: "internal",
- ucs2: "internal",
- binary: "internal",
- ascii: "internal",
- base64: "internal",
-
- // Codepage single-byte encodings.
- singlebyte: function(options) {
- // Prepare chars if needed
- if (!options.chars || (options.chars.length !== 128 && options.chars.length !== 256))
- throw new Error("Encoding '"+options.type+"' has incorrect 'chars' (must be of len 128 or 256)");
-
- if (options.chars.length === 128)
- options.chars = asciiString + options.chars;
-
- if (!options.charsBuf) {
- options.charsBuf = new Buffer(options.chars, 'ucs2');
- }
-
- if (!options.revCharsBuf) {
- options.revCharsBuf = new Buffer(65536);
- var defChar = iconv.defaultCharSingleByte.charCodeAt(0);
- for (var i = 0; i < options.revCharsBuf.length; i++)
- options.revCharsBuf[i] = defChar;
- for (var i = 0; i < options.chars.length; i++)
- options.revCharsBuf[options.chars.charCodeAt(i)] = i;
- }
-
- return {
- toEncoding: function(str) {
- str = ensureString(str);
-
- var buf = new Buffer(str.length);
- var revCharsBuf = options.revCharsBuf;
- for (var i = 0; i < str.length; i++)
- buf[i] = revCharsBuf[str.charCodeAt(i)];
-
- return buf;
- },
- fromEncoding: function(buf) {
- buf = ensureBuffer(buf);
-
- // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
- var charsBuf = options.charsBuf;
- var newBuf = new Buffer(buf.length*2);
- var idx1 = 0, idx2 = 0;
- for (var i = 0, _len = buf.length; i < _len; i++) {
- idx1 = buf[i]*2; idx2 = i*2;
- newBuf[idx2] = charsBuf[idx1];
- newBuf[idx2+1] = charsBuf[idx1+1];
- }
- return newBuf.toString('ucs2');
- }
- };
- },
-
- // Codepage double-byte encodings.
- table: function(options) {
- var table = options.table, key, revCharsTable = options.revCharsTable;
- if (!table) {
- throw new Error("Encoding '" + options.type +"' has incorect 'table' option");
- }
- if(!revCharsTable) {
- revCharsTable = options.revCharsTable = {};
- for (key in table) {
- revCharsTable[table[key]] = parseInt(key);
- }
- }
-
- return {
- toEncoding: function(str) {
- str = ensureString(str);
- var strLen = str.length;
- var bufLen = strLen;
- for (var i = 0; i < strLen; i++)
- if (str.charCodeAt(i) >> 7)
- bufLen++;
-
- var newBuf = new Buffer(bufLen), gbkcode, unicode,
- defaultChar = revCharsTable[iconv.defaultCharUnicode.charCodeAt(0)];
-
- for (var i = 0, j = 0; i < strLen; i++) {
- unicode = str.charCodeAt(i);
- if (unicode >> 7) {
- gbkcode = revCharsTable[unicode] || defaultChar;
- newBuf[j++] = gbkcode >> 8; //high byte;
- newBuf[j++] = gbkcode & 0xFF; //low byte
- } else {//ascii
- newBuf[j++] = unicode;
- }
- }
- return newBuf;
- },
- fromEncoding: function(buf) {
- buf = ensureBuffer(buf);
- var bufLen = buf.length, strLen = 0;
- for (var i = 0; i < bufLen; i++) {
- strLen++;
- if (buf[i] & 0x80) //the high bit is 1, so this byte is gbkcode's high byte.skip next byte
- i++;
- }
- var newBuf = new Buffer(strLen*2), unicode, gbkcode,
- defaultChar = iconv.defaultCharUnicode.charCodeAt(0);
-
- for (var i = 0, j = 0; i < bufLen; i++, j+=2) {
- gbkcode = buf[i];
- if (gbkcode & 0x80) {
- gbkcode = (gbkcode << 8) + buf[++i];
- unicode = table[gbkcode] || defaultChar;
- } else {
- unicode = gbkcode;
- }
- newBuf[j] = unicode & 0xFF; //low byte
- newBuf[j+1] = unicode >> 8; //high byte
- }
- return newBuf.toString('ucs2');
- }
- }
- }
- }
-};
-
-// Add aliases to convert functions
-iconv.encode = iconv.toEncoding;
-iconv.decode = iconv.fromEncoding;
-
-// Load other encodings from files in /encodings dir.
-var encodingsDir = __dirname+"/encodings/",
- fs = require('fs');
-fs.readdirSync(encodingsDir).forEach(function(file) {
- if(fs.statSync(encodingsDir + file).isDirectory()) return;
- var encodings = require(encodingsDir + file)
- for (var key in encodings)
- iconv.encodings[key] = encodings[key]
-});
-
-// Utilities
-var asciiString = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+
- ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f';
-
-var ensureBuffer = function(buf) {
- buf = buf || new Buffer(0);
- return (buf instanceof Buffer) ? buf : new Buffer(buf.toString(), "utf8");
-}
-
-var ensureString = function(str) {
- str = str || "";
- return (str instanceof String) ? str : str.toString((str instanceof Buffer) ? 'utf8' : undefined);
-}
-
-var getType = function(obj) {
- return Object.prototype.toString.call(obj).slice(8, -1);
-}
-
-
-});
-
-require.define("/node_modules/http-browserify/package.json", function (require, module, exports, __dirname, __filename) {
- module.exports = {"main":"index.js","browserify":"browser.js"}
-});
-
-require.define("/node_modules/http-browserify/browser.js", function (require, module, exports, __dirname, __filename) {
- var http = module.exports;
-var EventEmitter = require('events').EventEmitter;
-var Request = require('./lib/request');
-
-http.request = function (params, cb) {
- if (!params) params = {};
- if (!params.host) params.host = window.location.host.split(':')[0];
- if (!params.port) params.port = window.location.port;
-
- var req = new Request(new xhrHttp, params);
- if (cb) req.on('response', cb);
- return req;
-};
-
-http.get = function (params, cb) {
- params.method = 'GET';
- var req = http.request(params, cb);
- req.end();
- return req;
-};
-
-var xhrHttp = (function () {
- if (typeof window === 'undefined') {
- throw new Error('no window object present');
- }
- else if (window.XMLHttpRequest) {
- return window.XMLHttpRequest;
- }
- else if (window.ActiveXObject) {
- var axs = [
- 'Msxml2.XMLHTTP.6.0',
- 'Msxml2.XMLHTTP.3.0',
- 'Microsoft.XMLHTTP'
- ];
- for (var i = 0; i < axs.length; i++) {
- try {
- var ax = new(window.ActiveXObject)(axs[i]);
- return function () {
- if (ax) {
- var ax_ = ax;
- ax = null;
- return ax_;
- }
- else {
- return new(window.ActiveXObject)(axs[i]);
- }
- };
- }
- catch (e) {}
- }
- throw new Error('ajax not supported in this browser')
- }
- else {
- throw new Error('ajax not supported in this browser');
- }
-})();
-
-http.STATUS_CODES = {
- 100 : 'Continue',
- 101 : 'Switching Protocols',
- 102 : 'Processing', // RFC 2518, obsoleted by RFC 4918
- 200 : 'OK',
- 201 : 'Created',
- 202 : 'Accepted',
- 203 : 'Non-Authoritative Information',
- 204 : 'No Content',
- 205 : 'Reset Content',
- 206 : 'Partial Content',
- 207 : 'Multi-Status', // RFC 4918
- 300 : 'Multiple Choices',
- 301 : 'Moved Permanently',
- 302 : 'Moved Temporarily',
- 303 : 'See Other',
- 304 : 'Not Modified',
- 305 : 'Use Proxy',
- 307 : 'Temporary Redirect',
- 400 : 'Bad Request',
- 401 : 'Unauthorized',
- 402 : 'Payment Required',
- 403 : 'Forbidden',
- 404 : 'Not Found',
- 405 : 'Method Not Allowed',
- 406 : 'Not Acceptable',
- 407 : 'Proxy Authentication Required',
- 408 : 'Request Time-out',
- 409 : 'Conflict',
- 410 : 'Gone',
- 411 : 'Length Required',
- 412 : 'Precondition Failed',
- 413 : 'Request Entity Too Large',
- 414 : 'Request-URI Too Large',
- 415 : 'Unsupported Media Type',
- 416 : 'Requested Range Not Satisfiable',
- 417 : 'Expectation Failed',
- 418 : 'I\'m a teapot', // RFC 2324
- 422 : 'Unprocessable Entity', // RFC 4918
- 423 : 'Locked', // RFC 4918
- 424 : 'Failed Dependency', // RFC 4918
- 425 : 'Unordered Collection', // RFC 4918
- 426 : 'Upgrade Required', // RFC 2817
- 500 : 'Internal Server Error',
- 501 : 'Not Implemented',
- 502 : 'Bad Gateway',
- 503 : 'Service Unavailable',
- 504 : 'Gateway Time-out',
- 505 : 'HTTP Version not supported',
- 506 : 'Variant Also Negotiates', // RFC 2295
- 507 : 'Insufficient Storage', // RFC 4918
- 509 : 'Bandwidth Limit Exceeded',
- 510 : 'Not Extended' // RFC 2774
-};
-
-});
-
-require.define("/node_modules/http-browserify/lib/request.js", function (require, module, exports, __dirname, __filename) {
- var EventEmitter = require('events').EventEmitter;
-var Response = require('./response');
-var isSafeHeader = require('./isSafeHeader');
-
-var Request = module.exports = function (xhr, params) {
- var self = this;
- self.xhr = xhr;
- self.body = '';
-
- var uri = params.host + ':' + params.port + (params.path || '/');
-
- xhr.open(
- params.method || 'GET',
- (params.scheme || 'http') + '://' + uri,
- true
- );
-
- if (params.headers) {
- Object.keys(params.headers).forEach(function (key) {
- if (!isSafeHeader(key)) return;
- var value = params.headers[key];
- if (Array.isArray(value)) {
- value.forEach(function (v) {
- xhr.setRequestHeader(key, v);
- });
- }
- else xhr.setRequestHeader(key, value)
- });
- }
-
- var res = new Response(xhr);
- res.on('ready', function () {
- self.emit('response', res);
- });
-
- xhr.onreadystatechange = function () {
- res.handle(xhr);
- };
-};
-
-Request.prototype = new EventEmitter;
-
-Request.prototype.setHeader = function (key, value) {
- if ((Array.isArray && Array.isArray(value))
- || value instanceof Array) {
- for (var i = 0; i < value.length; i++) {
- this.xhr.setRequestHeader(key, value[i]);
- }
- }
- else {
- this.xhr.setRequestHeader(key, value);
- }
-};
-
-Request.prototype.write = function (s) {
- this.body += s;
-};
-
-Request.prototype.end = function (s) {
- if (s !== undefined) this.write(s);
- this.xhr.send(this.body);
-};
-
-});
-
-require.define("/node_modules/http-browserify/lib/response.js", function (require, module, exports, __dirname, __filename) {
- var EventEmitter = require('events').EventEmitter;
-var isSafeHeader = require('./isSafeHeader');
-
-var Response = module.exports = function (xhr) {
- this.xhr = xhr;
- this.offset = 0;
-};
-
-Response.prototype = new EventEmitter;
-
-var capable = {
- streaming : true,
- status2 : true
-};
-
-function parseHeaders (xhr) {
- var lines = xhr.getAllResponseHeaders().split(/\r?\n/);
- var headers = {};
- for (var i = 0; i < lines.length; i++) {
- var line = lines[i];
- if (line === '') continue;
-
- var m = line.match(/^([^:]+):\s*(.*)/);
- if (m) {
- var key = m[1].toLowerCase(), value = m[2];
-
- if (headers[key] !== undefined) {
- if ((Array.isArray && Array.isArray(headers[key]))
- || headers[key] instanceof Array) {
- headers[key].push(value);
- }
- else {
- headers[key] = [ headers[key], value ];
- }
- }
- else {
- headers[key] = value;
- }
- }
- else {
- headers[line] = true;
- }
- }
- return headers;
-}
-
-Response.prototype.getHeader = function (key) {
- var header = this.headers ? this.headers[key.toLowerCase()] : null;
- if (header) return header;
-
- // Work around Mozilla bug #608735 [https://bugzil.la/608735], which causes
- // getAllResponseHeaders() to return {} if the response is a CORS request.
- // xhr.getHeader still works correctly.
- if (isSafeHeader(key)) {
- return this.xhr.getResponseHeader(key);
- }
- return null;
-};
-
-Response.prototype.handle = function () {
- var xhr = this.xhr;
- if (xhr.readyState === 2 && capable.status2) {
- try {
- this.statusCode = xhr.status;
- this.headers = parseHeaders(xhr);
- }
- catch (err) {
- capable.status2 = false;
- }
-
- if (capable.status2) {
- this.emit('ready');
- }
- }
- else if (capable.streaming && xhr.readyState === 3) {
- try {
- if (!this.statusCode) {
- this.statusCode = xhr.status;
- this.headers = parseHeaders(xhr);
- this.emit('ready');
- }
- }
- catch (err) {}
-
- try {
- this.write();
- }
- catch (err) {
- capable.streaming = false;
- }
- }
- else if (xhr.readyState === 4) {
- if (!this.statusCode) {
- this.statusCode = xhr.status;
- this.emit('ready');
- }
- this.write();
-
- if (xhr.error) {
- this.emit('error', xhr.responseText);
- }
- else this.emit('end');
- }
-};
-
-Response.prototype.write = function () {
- var xhr = this.xhr;
- if (xhr.responseText.length > this.offset) {
- this.emit('data', xhr.responseText.slice(this.offset));
- this.offset = xhr.responseText.length;
- }
-};
-
-});
-
-require.define("/node_modules/http-browserify/lib/isSafeHeader.js", function (require, module, exports, __dirname, __filename) {
- // Taken from http://dxr.mozilla.org/mozilla/mozilla-central/content/base/src/nsXMLHttpRequest.cpp.html
-var unsafeHeaders = [
- "accept-charset",
- "accept-encoding",
- "access-control-request-headers",
- "access-control-request-method",
- "connection",
- "content-length",
- "cookie",
- "cookie2",
- "content-transfer-encoding",
- "date",
- "expect",
- "host",
- "keep-alive",
- "origin",
- "referer",
- "set-cookie",
- "te",
- "trailer",
- "transfer-encoding",
- "upgrade",
- "user-agent",
- "via"
-];
-
-module.exports = function (headerName) {
- if (!headerName) return false;
- return (unsafeHeaders.indexOf(headerName.toLowerCase()) === -1)
-};
-
-});
-
-require.alias("http-browserify", "/node_modules/http");
-
-require.alias("http-browserify", "/node_modules/https");
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/shred/content.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/shred/content.js deleted file mode 100644 index 465b3ceb..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/shred/content.js +++ /dev/null @@ -1,207 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// The purpose of the `Content` object is to abstract away the data conversions
-// to and from raw content entities as strings. For example, you want to be able
-// to pass in a Javascript object and have it be automatically converted into a
-// JSON string if the `content-type` is set to a JSON-based media type.
-// Conversely, you want to be able to transparently get back a Javascript object
-// in the response if the `content-type` is a JSON-based media-type.
-
-// One limitation of the current implementation is that it [assumes the `charset` is UTF-8](https://github.com/spire-io/shred/issues/5).
-
-// The `Content` constructor takes an options object, which *must* have either a
-// `body` or `data` property and *may* have a `type` property indicating the
-// media type. If there is no `type` attribute, a default will be inferred.
-var Content = function(options) {
- this.body = options.body;
- this.data = options.data;
- this.type = options.type;
-};
-
-Content.prototype = {
- // Treat `toString()` as asking for the `content.body`. That is, the raw content entity.
- //
- // toString: function() { return this.body; }
- //
- // Commented out, but I've forgotten why. :/
-};
-
-
-// `Content` objects have the following attributes:
-Object.defineProperties(Content.prototype,{
-
-// - **type**. Typically accessed as `content.type`, reflects the `content-type`
-// header associated with the request or response. If not passed as an options
-// to the constructor or set explicitly, it will infer the type the `data`
-// attribute, if possible, and, failing that, will default to `text/plain`.
- type: {
- get: function() {
- if (this._type) {
- return this._type;
- } else {
- if (this._data) {
- switch(typeof this._data) {
- case "string": return "text/plain";
- case "object": return "application/json";
- }
- }
- }
- return "text/plain";
- },
- set: function(value) {
- this._type = value;
- return this;
- },
- enumerable: true
- },
-
-// - **data**. Typically accessed as `content.data`, reflects the content entity
-// converted into Javascript data. This can be a string, if the `type` is, say,
-// `text/plain`, but can also be a Javascript object. The conversion applied is
-// based on the `processor` attribute. The `data` attribute can also be set
-// directly, in which case the conversion will be done the other way, to infer
-// the `body` attribute.
- data: {
- get: function() {
- if (this._body) {
- return this.processor.parser(this._body);
- } else {
- return this._data;
- }
- },
- set: function(data) {
- if (this._body&&data) Errors.setDataWithBody(this);
- this._data = data;
- return this;
- },
- enumerable: true
- },
-
-// - **body**. Typically accessed as `content.body`, reflects the content entity
-// as a UTF-8 string. It is the mirror of the `data` attribute. If you set the
-// `data` attribute, the `body` attribute will be inferred and vice-versa. If
-// you attempt to set both, an exception is raised.
- body: {
- get: function() {
- if (this._data) {
- return this.processor.stringify(this._data);
- } else {
- return this._body.toString();
- }
- },
- set: function(body) {
- if (this._data&&body) Errors.setBodyWithData(this);
- this._body = body;
- return this;
- },
- enumerable: true
- },
-
-// - **processor**. The functions that will be used to convert to/from `data` and
-// `body` attributes. You can add processors. The two that are built-in are for
-// `text/plain`, which is basically an identity transformation and
-// `application/json` and other JSON-based media types (including custom media
-// types with `+json`). You can add your own processors. See below.
- processor: {
- get: function() {
- var processor = Content.processors[this.type];
- if (processor) {
- return processor;
- } else {
- // Return the first processor that matches any part of the
- // content type. ex: application/vnd.foobar.baz+json will match json.
- var main = this.type.split(";")[0];
- var parts = main.split(/\+|\//);
- for (var i=0, l=parts.length; i < l; i++) {
- processor = Content.processors[parts[i]]
- }
- return processor || {parser:identity,stringify:toString};
- }
- },
- enumerable: true
- },
-
-// - **length**. Typically accessed as `content.length`, returns the length in
-// bytes of the raw content entity.
- length: {
- get: function() {
- if (typeof Buffer !== 'undefined') {
- return Buffer.byteLength(this.body);
- }
- return this.body.length;
- }
- }
-});
-
-Content.processors = {};
-
-// The `registerProcessor` function allows you to add your own processors to
-// convert content entities. Each processor consists of a Javascript object with
-// two properties:
-// - **parser**. The function used to parse a raw content entity and convert it
-// into a Javascript data type.
-// - **stringify**. The function used to convert a Javascript data type into a
-// raw content entity.
-Content.registerProcessor = function(types,processor) {
-
-// You can pass an array of types that will trigger this processor, or just one.
-// We determine the array via duck-typing here.
- if (types.forEach) {
- types.forEach(function(type) {
- Content.processors[type] = processor;
- });
- } else {
- // If you didn't pass an array, we just use what you pass in.
- Content.processors[types] = processor;
- }
-};
-
-// Register the identity processor, which is used for text-based media types.
-var identity = function(x) { return x; }
- , toString = function(x) { return x.toString(); }
-Content.registerProcessor(
- ["text/html","text/plain","text"],
- { parser: identity, stringify: toString });
-
-// Register the JSON processor, which is used for JSON-based media types.
-Content.registerProcessor(
- ["application/json; charset=utf-8","application/json","json"],
- {
- parser: function(string) {
- return JSON.parse(string);
- },
- stringify: function(data) {
- return JSON.stringify(data); }});
-
-var qs = require('querystring');
-// Register the post processor, which is used for JSON-based media types.
-Content.registerProcessor(
- ["application/x-www-form-urlencoded"],
- { parser : qs.parse, stringify : qs.stringify });
-
-// Error functions are defined separately here in an attempt to make the code
-// easier to read.
-var Errors = {
- setDataWithBody: function(object) {
- throw new Error("Attempt to set data attribute of a content object " +
- "when the body attributes was already set.");
- },
- setBodyWithData: function(object) {
- throw new Error("Attempt to set body attribute of a content object " +
- "when the data attributes was already set.");
- }
-}
-module.exports = Content;
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/swagger-client.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/swagger-client.js deleted file mode 100644 index 510464ce..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/swagger-client.js +++ /dev/null @@ -1,3309 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * swagger-client - swagger.js is a javascript client for use with swaggering APIs.
- * @version v2.1.9-M1
- * @link http://swagger.io
- * @license apache 2.0
- */
-(function(){
-var ArrayModel = function(definition) {
- this.name = "arrayModel";
- this.definition = definition || {};
- this.properties = [];
-
- var requiredFields = definition.enum || [];
- var innerType = definition.items;
- if(innerType) {
- if(innerType.type) {
- this.type = typeFromJsonSchema(innerType.type, innerType.format);
- }
- else {
- this.ref = innerType.$ref;
- }
- }
- return this;
-};
-
-ArrayModel.prototype.createJSONSample = function(modelsToIgnore) {
- var result;
- modelsToIgnore = (modelsToIgnore||{});
- if(this.type) {
- result = this.type;
- }
- else if (this.ref) {
- var name = simpleRef(this.ref);
- if(typeof modelsToIgnore[name] === 'undefined') {
- modelsToIgnore[name] = this;
- result = models[name].createJSONSample(modelsToIgnore);
- }
- else {
- return name;
- }
- }
- return [ result ];
-};
-
-ArrayModel.prototype.getSampleValue = function(modelsToIgnore) {
- var result;
- modelsToIgnore = (modelsToIgnore || {});
- if(this.type) {
- result = type;
- }
- else if (this.ref) {
- var name = simpleRef(this.ref);
- result = models[name].getSampleValue(modelsToIgnore);
- }
- return [ result ];
-};
-
-ArrayModel.prototype.getMockSignature = function(modelsToIgnore) {
- var propertiesStr = [];
- var i, prop;
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- propertiesStr.push(prop.toString());
- }
-
- var strong = '<span class="strong">';
- var stronger = '<span class="stronger">';
- var strongClose = '</span>';
- var classOpen = strong + 'array' + ' {' + strongClose;
- var classClose = strong + '}' + strongClose;
- var returnVal = classOpen + '<div>' + propertiesStr.join(',</div><div>') + '</div>' + classClose;
-
- if (!modelsToIgnore)
- modelsToIgnore = {};
- modelsToIgnore[this.name] = this;
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- var ref = prop.$ref;
- var model = models[ref];
- if (model && typeof modelsToIgnore[ref] === 'undefined') {
- returnVal = returnVal + ('<br>' + model.getMockSignature(modelsToIgnore));
- }
- }
- return returnVal;
-};
-
-
-/**
- * SwaggerAuthorizations applys the correct authorization to an operation being executed
- */
-var SwaggerAuthorizations = function() {
- this.authz = {};
-};
-
-SwaggerAuthorizations.prototype.add = function(name, auth) {
- this.authz[name] = auth;
- return auth;
-};
-
-SwaggerAuthorizations.prototype.remove = function(name) {
- return delete this.authz[name];
-};
-
-SwaggerAuthorizations.prototype.apply = function (obj, authorizations) {
- var status = null;
- var key, name, value, result;
-
- // if the "authorizations" key is undefined, or has an empty array, add all keys
- if (typeof authorizations === 'undefined' || Object.keys(authorizations).length === 0) {
- for (key in this.authz) {
- value = this.authz[key];
- result = value.apply(obj, authorizations);
- if (result === true)
- status = true;
- }
- }
- else {
- // 2.0 support
- if (Array.isArray(authorizations)) {
-
- for (var i = 0; i < authorizations.length; i++) {
- var auth = authorizations[i];
- for (name in auth) {
- for (key in this.authz) {
- if (key == name) {
- value = this.authz[key];
- result = value.apply(obj, authorizations);
- if (result === true)
- status = true;
- }
- }
- }
- }
- }
- else {
- // 1.2 support
- for (name in authorizations) {
- for (key in this.authz) {
- if (key == name) {
- value = this.authz[key];
- result = value.apply(obj, authorizations);
- if (result === true)
- status = true;
- }
- }
- }
- }
- }
-
- return status;
-};
-
-/**
- * ApiKeyAuthorization allows a query param or header to be injected
- */
-var ApiKeyAuthorization = function(name, value, type) {
- this.name = name;
- this.value = value;
- this.type = type;
-};
-
-ApiKeyAuthorization.prototype.apply = function(obj, authorizations) {
- if (this.type === "query") {
- if (obj.url.indexOf('?') > 0)
- obj.url = obj.url + "&" + this.name + "=" + this.value;
- else
- obj.url = obj.url + "?" + this.name + "=" + this.value;
- return true;
- } else if (this.type === "header") {
- obj.headers[this.name] = this.value;
- return true;
- }
-};
-
-var CookieAuthorization = function(cookie) {
- this.cookie = cookie;
-};
-
-CookieAuthorization.prototype.apply = function(obj, authorizations) {
- obj.cookieJar = obj.cookieJar || CookieJar();
- obj.cookieJar.setCookie(this.cookie);
- return true;
-};
-
-/**
- * Password Authorization is a basic auth implementation
- */
-var PasswordAuthorization = function(name, username, password) {
- this.name = name;
- this.username = username;
- this.password = password;
- this._btoa = null;
- if (typeof window !== 'undefined')
- this._btoa = btoa;
- else
- this._btoa = require("btoa");
-};
-
-PasswordAuthorization.prototype.apply = function(obj, authorizations) {
- var base64encoder = this._btoa;
- obj.headers.Authorization = "Basic " + base64encoder(this.username + ":" + this.password);
- return true;
-};
-var __bind = function(fn, me){
- return function(){
- return fn.apply(me, arguments);
- };
-};
-
-fail = function(message) {
- log(message);
-};
-
-log = function(){
- log.history = log.history || [];
- log.history.push(arguments);
- if(this.console){
- console.log( Array.prototype.slice.call(arguments)[0] );
- }
-};
-
-if (!Array.prototype.indexOf) {
- Array.prototype.indexOf = function(obj, start) {
- for (var i = (start || 0), j = this.length; i < j; i++) {
- if (this[i] === obj) { return i; }
- }
- return -1;
- };
-}
-
-/**
- * allows override of the default value based on the parameter being
- * supplied
- **/
-var applyParameterMacro = function (operation, parameter) {
- var e = (typeof window !== 'undefined' ? window : exports);
- if(e.parameterMacro)
- return e.parameterMacro(operation, parameter);
- else
- return parameter.defaultValue;
-};
-
-/**
- * allows overriding the default value of an model property
- **/
-var applyModelPropertyMacro = function (model, property) {
- var e = (typeof window !== 'undefined' ? window : exports);
- if(e.modelPropertyMacro)
- return e.modelPropertyMacro(model, property);
- else
- return property.defaultValue;
-};
-
-/**
- * PrimitiveModel
- **/
-var PrimitiveModel = function(definition) {
- this.name = "name";
- this.definition = definition || {};
- this.properties = [];
-
- var requiredFields = definition.enum || [];
- this.type = typeFromJsonSchema(definition.type, definition.format);
-};
-
-PrimitiveModel.prototype.createJSONSample = function(modelsToIgnore) {
- var result = this.type;
- return result;
-};
-
-PrimitiveModel.prototype.getSampleValue = function() {
- var result = this.type;
- return null;
-};
-
-PrimitiveModel.prototype.getMockSignature = function(modelsToIgnore) {
- var propertiesStr = [];
- var i, prop;
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- propertiesStr.push(prop.toString());
- }
-
- var strong = '<span class="strong">';
- var stronger = '<span class="stronger">';
- var strongClose = '</span>';
- var classOpen = strong + this.name + ' {' + strongClose;
- var classClose = strong + '}' + strongClose;
- var returnVal = classOpen + '<div>' + propertiesStr.join(',</div><div>') + '</div>' + classClose;
-
- if (!modelsToIgnore)
- modelsToIgnore = {};
- modelsToIgnore[this.name] = this;
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- var ref = prop.$ref;
- var model = models[ref];
- if (model && typeof modelsToIgnore[ref] === 'undefined') {
- returnVal = returnVal + ('<br>' + model.getMockSignature(modelsToIgnore));
- }
- }
- return returnVal;
-};
-/**
- * Resolves a spec's remote references
- */
-var Resolver = function (){};
-
-Resolver.prototype.resolve = function(spec, callback, scope) {
- this.scope = (scope || this);
- var host, name, path, property, propertyName, type;
- var processedCalls = 0, resolvedRefs = {}, unresolvedRefs = {};
-
- // store objects for dereferencing
- var resolutionTable = {};
-
- // models
- for(name in spec.definitions) {
- var model = spec.definitions[name];
- for(propertyName in model.properties) {
- property = model.properties[propertyName];
- this.resolveTo(property, resolutionTable);
- }
- }
- // operations
- for(name in spec.paths) {
- var method, operation, responseCode;
- path = spec.paths[name];
- for(method in path) {
- operation = path[method];
- var i, parameters = operation.parameters;
- for(i in parameters) {
- var parameter = parameters[i];
- if(parameter.in === 'body' && parameter.schema) {
- this.resolveTo(parameter.schema, resolutionTable);
- }
- if(parameter.$ref) {
- this.resolveInline(spec, parameter, resolutionTable, unresolvedRefs);
- }
- }
- for(responseCode in operation.responses) {
- var response = operation.responses[responseCode];
- if(response.schema) {
- this.resolveTo(response.schema, resolutionTable);
- }
- }
- }
- }
- // get hosts
- var opts = {}, expectedCalls = 0;
- for(name in resolutionTable) {
- var parts = name.split('#');
- if(parts.length == 2) {
- host = parts[0]; path = parts[1];
- if(!Array.isArray(opts[host])) {
- opts[host] = [];
- expectedCalls += 1;
- }
- opts[host].push(path);
- }
- }
-
- for(name in opts) {
- var self = this, opt = opts[name];
- host = name;
-
- var obj = {
- useJQuery: false, // TODO
- url: host,
- method: "get",
- headers: {
- accept: this.scope.swaggerRequestHeaders || 'application/json'
- },
- on: {
- error: function(response) {
- processedCalls += 1;
- var i;
- for(i = 0; i < opt.length; i++) {
- // fail all of these
- var resolved = host + '#' + opt[i];
- unresolvedRefs[resolved] = null;
- }
- if(processedCalls === expectedCalls)
- self.finish(spec, resolutionTable, resolvedRefs, unresolvedRefs, callback);
- },
- response: function(response) {
- var i, j, swagger = response.obj;
- processedCalls += 1;
- for(i = 0; i < opt.length; i++) {
- var location = swagger, path = opt[i], parts = path.split('/');
- for(j = 0; j < parts.length; j++) {
- var segment = parts[j];
- if(typeof location === 'undefined')
- break;
- if(segment.length > 0)
- location = location[segment];
- }
- var resolved = host + '#' + path, resolvedName = parts[j-1];
- if(typeof location !== 'undefined') {
- resolvedRefs[resolved] = {
- name: resolvedName,
- obj: location
- };
- }
- else unresolvedRefs[resolved] = null;
- }
- if(processedCalls === expectedCalls)
- self.finish(spec, resolutionTable, resolvedRefs, unresolvedRefs, callback);
- }
- }
- };
- authorizations.apply(obj);
- new SwaggerHttp().execute(obj);
- }
- if(Object.keys(opts).length === 0)
- callback.call(this.scope, spec, unresolvedRefs);
-};
-
-Resolver.prototype.finish = function(spec, resolutionTable, resolvedRefs, unresolvedRefs, callback) {
- // walk resolution table and replace with resolved refs
- var ref;
- for(ref in resolutionTable) {
- var i, locations = resolutionTable[ref];
- for(i = 0; i < locations.length; i++) {
- var resolvedTo = resolvedRefs[locations[i].obj.$ref];
- if(resolvedTo) {
- if(!spec.definitions)
- spec.definitions = {};
- if(locations[i].resolveAs === '$ref') {
- spec.definitions[resolvedTo.name] = resolvedTo.obj;
- locations[i].obj.$ref = '#/definitions/' + resolvedTo.name;
- }
- else if (locations[i].resolveAs === 'inline') {
- var key;
- var targetObj = locations[i].obj;
- delete targetObj.$ref;
- for(key in resolvedTo.obj) {
- targetObj[key] = resolvedTo.obj[key];
- }
- }
- }
- }
- }
- callback.call(this.scope, spec, unresolvedRefs);
-};
-
-/**
- * immediately in-lines local refs, queues remote refs
- * for inline resolution
- */
-Resolver.prototype.resolveInline = function (spec, property, objs, unresolvedRefs) {
- var ref = property.$ref;
- if(ref) {
- if(ref.indexOf('http') === 0) {
- if(Array.isArray(objs[ref])) {
- objs[ref].push({obj: property, resolveAs: 'inline'});
- }
- else {
- objs[ref] = [{obj: property, resolveAs: 'inline'}];
- }
- }
- else if (ref.indexOf('#') === 0) {
- // local resolve
- var shortenedRef = ref.substring(1);
- var i, parts = shortenedRef.split('/'), location = spec;
- for(i = 0; i < parts.length; i++) {
- var part = parts[i];
- if(part.length > 0) {
- location = location[part];
- }
- }
- if(location) {
- delete property.$ref;
- var key;
- for(key in location) {
- property[key] = location[key];
- }
- }
- else unresolvedRefs[ref] = null;
- }
- }
- else if(property.type === 'array') {
- this.resolveTo(property.items, objs);
- }
-};
-
-Resolver.prototype.resolveTo = function (property, objs) {
- var ref = property.$ref;
- if(ref) {
- if(ref.indexOf('http') === 0) {
- if(Array.isArray(objs[ref])) {
- objs[ref].push({obj: property, resolveAs: '$ref'});
- }
- else {
- objs[ref] = [{obj: property, resolveAs: '$ref'}];
- }
- }
- }
- else if(property.type === 'array') {
- var items = property.items;
- this.resolveTo(items, objs);
- }
-};
-var addModel = function(name, model) {
- models[name] = model;
-};
-
-var SwaggerClient = function(url, options) {
- this.isBuilt = false;
- this.url = null;
- this.debug = false;
- this.basePath = null;
- this.modelsArray = [];
- this.authorizations = null;
- this.authorizationScheme = null;
- this.isValid = false;
- this.info = null;
- this.useJQuery = false;
- this.resourceCount = 0;
-
- if(typeof url !== 'undefined')
- return this.initialize(url, options);
-};
-
-SwaggerClient.prototype.initialize = function (url, options) {
- this.models = models = {};
-
- options = (options||{});
-
- if(typeof url === 'string')
- this.url = url;
- else if(typeof url === 'object') {
- options = url;
- this.url = options.url;
- }
- this.swaggerRequstHeaders = options.swaggerRequstHeaders || 'application/json;charset=utf-8,*/*';
- this.defaultSuccessCallback = options.defaultSuccessCallback || null;
- this.defaultErrorCallback = options.defaultErrorCallback || null;
-
- if (typeof options.success === 'function')
- this.success = options.success;
-
- if (options.useJQuery)
- this.useJQuery = options.useJQuery;
-
- if (options.authorizations) {
- this.clientAuthorizations = options.authorizations;
- } else {
- this.clientAuthorizations = authorizations;
- }
-
- this.supportedSubmitMethods = options.supportedSubmitMethods || [];
- this.failure = options.failure || function() {};
- this.progress = options.progress || function() {};
- this.spec = options.spec;
- this.options = options;
-
- if (typeof options.success === 'function') {
- this.ready = true;
- this.build();
- }
-};
-
-SwaggerClient.prototype.build = function(mock) {
- if (this.isBuilt) return this;
- var self = this;
- this.progress('fetching resource list: ' + this.url);
- var obj = {
- useJQuery: this.useJQuery,
- url: this.url,
- method: "get",
- headers: {
- accept: this.swaggerRequstHeaders
- },
- on: {
- error: function(response) {
- if (self.url.substring(0, 4) !== 'http')
- return self.fail('Please specify the protocol for ' + self.url);
- else if (response.status === 0)
- return self.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.');
- else if (response.status === 404)
- return self.fail('Can\'t read swagger JSON from ' + self.url);
- else
- return self.fail(response.status + ' : ' + response.statusText + ' ' + self.url);
- },
- response: function(resp) {
- var responseObj = resp.obj || JSON.parse(resp.data);
- self.swaggerVersion = responseObj.swaggerVersion;
-
- if(responseObj.swagger && parseInt(responseObj.swagger) === 2) {
- self.swaggerVersion = responseObj.swagger;
- new Resolver().resolve(responseObj, self.buildFromSpec, self);
- self.isValid = true;
- }
- else {
- if (self.swaggerVersion === '1.2') {
- return self.buildFrom1_2Spec(responseObj);
- } else {
- return self.buildFrom1_1Spec(responseObj);
- }
- }
- }
- }
- };
- if(this.spec) {
- setTimeout(function() {
- new Resolver().resolve(self.spec, self.buildFromSpec, self);
- }, 10);
- }
- else {
- authorizations.apply(obj);
- if(mock)
- return obj;
- new SwaggerHttp().execute(obj);
- }
- return this;
-};
-
-SwaggerClient.prototype.buildFromSpec = function(response) {
- if(this.isBuilt) return this;
-
- this.info = response.info || {};
- this.title = response.title || '';
- this.host = response.host || '';
- this.schemes = response.schemes || [];
- this.basePath = response.basePath || '';
- this.apis = {};
- this.apisArray = [];
- this.consumes = response.consumes;
- this.produces = response.produces;
- this.securityDefinitions = response.securityDefinitions;
-
- // legacy support
- this.authSchemes = response.securityDefinitions;
-
- var definedTags = {};
- if(Array.isArray(response.tags)) {
- definedTags = {};
- for(k = 0; k < response.tags.length; k++) {
- var t = response.tags[k];
- definedTags[t.name] = t;
- }
- }
-
- var location;
- if(typeof this.url === 'string') {
- location = this.parseUri(this.url);
- }
-
- if(typeof this.schemes === 'undefined' || this.schemes.length === 0) {
- this.scheme = location.scheme || 'http';
- }
- else {
- this.scheme = this.schemes[0];
- }
-
- if(typeof this.host === 'undefined' || this.host === '') {
- this.host = location.host;
- if (location.port) {
- this.host = this.host + ':' + location.port;
- }
- }
-
- this.definitions = response.definitions;
- var key;
- for(key in this.definitions) {
- var model = new Model(key, this.definitions[key]);
- if(model) {
- models[key] = model;
- }
- }
-
- // get paths, create functions for each operationId
- var path;
- var operations = [];
- for(path in response.paths) {
- if(typeof response.paths[path] === 'object') {
- var httpMethod;
- for(httpMethod in response.paths[path]) {
- if(['delete', 'get', 'head', 'options', 'patch', 'post', 'put'].indexOf(httpMethod) === -1) {
- continue;
- }
- var operation = response.paths[path][httpMethod];
- var tags = operation.tags;
- if(typeof tags === 'undefined') {
- operation.tags = [ 'default' ];
- tags = operation.tags;
- }
- var operationId = this.idFromOp(path, httpMethod, operation);
- var operationObject = new Operation (
- this,
- operation.scheme,
- operationId,
- httpMethod,
- path,
- operation,
- this.definitions
- );
- // bind this operation's execute command to the api
- if(tags.length > 0) {
- var i;
- for(i = 0; i < tags.length; i++) {
- var tag = this.tagFromLabel(tags[i]);
- var operationGroup = this[tag];
- if(typeof this.apis[tag] === 'undefined')
- this.apis[tag] = {};
- if(typeof operationGroup === 'undefined') {
- this[tag] = [];
- operationGroup = this[tag];
- operationGroup.operations = {};
- operationGroup.label = tag;
- operationGroup.apis = [];
- var tagObject = definedTags[tag];
- if(typeof tagObject === 'object') {
- operationGroup.description = tagObject.description;
- operationGroup.externalDocs = tagObject.externalDocs;
- }
- this[tag].help = this.help.bind(operationGroup);
- this.apisArray.push(new OperationGroup(tag, operationGroup.description, operationGroup.externalDocs, operationObject));
- }
- if(typeof this.apis[tag].help !== 'function')
- this.apis[tag].help = this.help.bind(operationGroup);
- // bind to the apis object
- this.apis[tag][operationId] = operationObject.execute.bind(operationObject);
- this.apis[tag][operationId].help = operationObject.help.bind(operationObject);
- this.apis[tag][operationId].asCurl = operationObject.asCurl.bind(operationObject);
- operationGroup[operationId] = operationObject.execute.bind(operationObject);
- operationGroup[operationId].help = operationObject.help.bind(operationObject);
- operationGroup[operationId].asCurl = operationObject.asCurl.bind(operationObject);
-
- operationGroup.apis.push(operationObject);
- operationGroup.operations[operationId] = operationObject;
-
- // legacy UI feature
- var j;
- var api;
- for(j = 0; j < this.apisArray.length; j++) {
- if(this.apisArray[j].tag === tag) {
- api = this.apisArray[j];
- }
- }
- if(api) {
- api.operationsArray.push(operationObject);
- }
- }
- }
- else {
- log('no group to bind to');
- }
- }
- }
- }
- this.isBuilt = true;
- if (this.success) {
- this.isValid = true;
- this.isBuilt = true;
- this.success();
- }
- return this;
-};
-
-SwaggerClient.prototype.parseUri = function(uri) {
- var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/;
- var parts = urlParseRE.exec(uri);
- return {
- scheme: parts[4].replace(':',''),
- host: parts[11],
- port: parts[12],
- path: parts[15]
- };
-};
-
-SwaggerClient.prototype.help = function(dontPrint) {
- var i;
- var output = 'operations for the "' + this.label + '" tag';
- for(i = 0; i < this.apis.length; i++) {
- var api = this.apis[i];
- output += '\n * ' + api.nickname + ': ' + api.operation.summary;
- }
- if(dontPrint)
- return output;
- else {
- log(output);
- return output;
- }
-};
-
-SwaggerClient.prototype.tagFromLabel = function(label) {
- return label;
-};
-
-SwaggerClient.prototype.idFromOp = function(path, httpMethod, op) {
- var opId = op.operationId || (path.substring(1) + '_' + httpMethod);
- return opId.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()\+\s]/g,'_');
-};
-
-SwaggerClient.prototype.fail = function(message) {
- this.failure(message);
- throw message;
-};
-
-var OperationGroup = function(tag, description, externalDocs, operation) {
- this.tag = tag;
- this.path = tag;
- this.description = description;
- this.externalDocs = externalDocs;
- this.name = tag;
- this.operation = operation;
- this.operationsArray = [];
-};
-
-var Operation = function(parent, scheme, operationId, httpMethod, path, args, definitions) {
- var errors = [];
- parent = parent||{};
- args = args||{};
-
- this.operations = {};
- this.operation = args;
- this.deprecated = args.deprecated;
- this.consumes = args.consumes;
- this.produces = args.produces;
- this.parent = parent;
- this.host = parent.host || 'localhost';
- this.schemes = parent.schemes;
- this.scheme = scheme || parent.scheme || 'http';
- this.basePath = parent.basePath || '/';
- this.nickname = (operationId||errors.push('Operations must have a nickname.'));
- this.method = (httpMethod||errors.push('Operation ' + operationId + ' is missing method.'));
- this.path = (path||errors.push('Operation ' + this.nickname + ' is missing path.'));
- this.parameters = args !== null ? (args.parameters||[]) : {};
- this.summary = args.summary || '';
- this.responses = (args.responses||{});
- this.type = null;
- this.security = args.security;
- this.authorizations = args.security;
- this.description = args.description;
- this.useJQuery = parent.useJQuery;
-
- if(typeof this.deprecated === 'string') {
- switch(this.deprecated.toLowerCase()) {
- case 'true': case 'yes': case '1': {
- this.deprecated = true;
- break;
- }
- case 'false': case 'no': case '0': case null: {
- this.deprecated = false;
- break;
- }
- default: this.deprecated = Boolean(this.deprecated);
- }
- }
-
- var i, model;
-
- if(definitions) {
- // add to global models
- var key;
- for(key in this.definitions) {
- model = new Model(key, definitions[key]);
- if(model) {
- models[key] = model;
- }
- }
- }
- for(i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- if(param.type === 'array') {
- param.isList = true;
- param.allowMultiple = true;
- }
- var innerType = this.getType(param);
- if(innerType && innerType.toString().toLowerCase() === 'boolean') {
- param.allowableValues = {};
- param.isList = true;
- param['enum'] = ["true", "false"];
- }
- if(typeof param['enum'] !== 'undefined') {
- var id;
- param.allowableValues = {};
- param.allowableValues.values = [];
- param.allowableValues.descriptiveValues = [];
- for(id = 0; id < param['enum'].length; id++) {
- var value = param['enum'][id];
- var isDefault = (value === param.default) ? true : false;
- param.allowableValues.values.push(value);
- param.allowableValues.descriptiveValues.push({value : value, isDefault: isDefault});
- }
- }
- if(param.type === 'array') {
- innerType = [innerType];
- if(typeof param.allowableValues === 'undefined') {
- // can't show as a list if no values to select from
- delete param.isList;
- delete param.allowMultiple;
- }
- }
- param.signature = this.getModelSignature(innerType, models).toString();
- param.sampleJSON = this.getModelSampleJSON(innerType, models);
- param.responseClassSignature = param.signature;
- }
-
- var defaultResponseCode, response, responses = this.responses;
-
- if(responses['200']) {
- response = responses['200'];
- defaultResponseCode = '200';
- }
- else if(responses['201']) {
- response = responses['201'];
- defaultResponseCode = '201';
- }
- else if(responses['202']) {
- response = responses['202'];
- defaultResponseCode = '202';
- }
- else if(responses['203']) {
- response = responses['203'];
- defaultResponseCode = '203';
- }
- else if(responses['204']) {
- response = responses['204'];
- defaultResponseCode = '204';
- }
- else if(responses['205']) {
- response = responses['205'];
- defaultResponseCode = '205';
- }
- else if(responses['206']) {
- response = responses['206'];
- defaultResponseCode = '206';
- }
- else if(responses['default']) {
- response = responses['default'];
- defaultResponseCode = 'default';
- }
-
- if(response && response.schema) {
- var resolvedModel = this.resolveModel(response.schema, definitions);
- delete responses[defaultResponseCode];
- if(resolvedModel) {
- this.successResponse = {};
- this.successResponse[defaultResponseCode] = resolvedModel;
- }
- else {
- this.successResponse = {};
- this.successResponse[defaultResponseCode] = response.schema.type;
- }
- this.type = response;
- }
-
- if (errors.length > 0) {
- if(this.resource && this.resource.api && this.resource.api.fail)
- this.resource.api.fail(errors);
- }
-
- return this;
-};
-
-OperationGroup.prototype.sort = function(sorter) {
-
-};
-
-Operation.prototype.getType = function (param) {
- var type = param.type;
- var format = param.format;
- var isArray = false;
- var str;
- if(type === 'integer' && format === 'int32')
- str = 'integer';
- else if(type === 'integer' && format === 'int64')
- str = 'long';
- else if(type === 'integer')
- str = 'integer';
- else if(type === 'string') {
- if(format === 'date-time')
- str = 'date-time';
- else if(format === 'date')
- str = 'date';
- else
- str = 'string';
- }
- else if(type === 'number' && format === 'float')
- str = 'float';
- else if(type === 'number' && format === 'double')
- str = 'double';
- else if(type === 'number')
- str = 'double';
- else if(type === 'boolean')
- str = 'boolean';
- else if(type === 'array') {
- isArray = true;
- if(param.items)
- str = this.getType(param.items);
- }
- if(param.$ref)
- str = param.$ref;
-
- var schema = param.schema;
- if(schema) {
- var ref = schema.$ref;
- if(ref) {
- ref = simpleRef(ref);
- if(isArray)
- return [ ref ];
- else
- return ref;
- }
- else
- return this.getType(schema);
- }
- if(isArray)
- return [ str ];
- else
- return str;
-};
-
-Operation.prototype.resolveModel = function (schema, definitions) {
- if(typeof schema.$ref !== 'undefined') {
- var ref = schema.$ref;
- if(ref.indexOf('#/definitions/') === 0)
- ref = ref.substring('#/definitions/'.length);
- if(definitions[ref]) {
- return new Model(ref, definitions[ref]);
- }
- }
- if(schema.type === 'array')
- return new ArrayModel(schema);
- else
- return null;
-};
-
-Operation.prototype.help = function(dontPrint) {
- var out = this.nickname + ': ' + this.summary + '\n';
- for(var i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- var typeInfo = param.signature;
- out += '\n * ' + param.name + ' (' + typeInfo + '): ' + param.description;
- }
- if(typeof dontPrint === 'undefined')
- log(out);
- return out;
-};
-
-Operation.prototype.getModelSignature = function(type, definitions) {
- var isPrimitive, listType;
-
- if(type instanceof Array) {
- listType = true;
- type = type[0];
- }
- else if(typeof type === 'undefined')
- type = 'undefined';
-
- if(type === 'string')
- isPrimitive = true;
- else
- isPrimitive = (listType && definitions[listType]) || (definitions[type]) ? false : true;
- if (isPrimitive) {
- if(listType)
- return 'Array[' + type + ']';
- else
- return type.toString();
- } else {
- if (listType)
- return 'Array[' + definitions[type].getMockSignature() + ']';
- else
- return definitions[type].getMockSignature();
- }
-};
-
-Operation.prototype.supportHeaderParams = function () {
- return true;
-};
-
-Operation.prototype.supportedSubmitMethods = function () {
- return this.parent.supportedSubmitMethods;
-};
-
-Operation.prototype.getHeaderParams = function (args) {
- var headers = this.setContentTypes(args, {});
- for(var i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- if(typeof args[param.name] !== 'undefined') {
- if (param.in === 'header') {
- var value = args[param.name];
- if(Array.isArray(value))
- value = value.toString();
- headers[param.name] = value;
- }
- }
- }
- return headers;
-};
-
-Operation.prototype.urlify = function (args) {
- var formParams = {};
- var requestUrl = this.path;
-
- // grab params from the args, build the querystring along the way
- var querystring = '';
- for(var i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- if(typeof args[param.name] !== 'undefined') {
- if(param.in === 'path') {
- var reg = new RegExp('\{' + param.name + '\}', 'gi');
- var value = args[param.name];
- if(Array.isArray(value))
- value = this.encodePathCollection(param.collectionFormat, param.name, value);
- else
- value = this.encodePathParam(value);
- requestUrl = requestUrl.replace(reg, value);
- }
- else if (param.in === 'query' && typeof args[param.name] !== 'undefined') {
- if(querystring === '')
- querystring += '?';
- else
- querystring += '&';
- if(typeof param.collectionFormat !== 'undefined') {
- var qp = args[param.name];
- if(Array.isArray(qp))
- querystring += this.encodeQueryCollection(param.collectionFormat, param.name, qp);
- else
- querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]);
- }
- else
- querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]);
- }
- else if (param.in === 'formData')
- formParams[param.name] = args[param.name];
- }
- }
- var url = this.scheme + '://' + this.host;
-
- if(this.basePath !== '/')
- url += this.basePath;
-
- return url + requestUrl + querystring;
-};
-
-Operation.prototype.getMissingParams = function(args) {
- var missingParams = [];
- // check required params, track the ones that are missing
- var i;
- for(i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- if(param.required === true) {
- if(typeof args[param.name] === 'undefined')
- missingParams = param.name;
- }
- }
- return missingParams;
-};
-
-Operation.prototype.getBody = function(headers, args, opts) {
- var formParams = {}, body, key;
-
- for(var i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- if(typeof args[param.name] !== 'undefined') {
- if (param.in === 'body') {
- body = args[param.name];
- } else if(param.in === 'formData') {
- formParams[param.name] = args[param.name];
- }
- }
- }
-
- // handle form params
- if(headers['Content-Type'] === 'application/x-www-form-urlencoded') {
- var encoded = "";
- for(key in formParams) {
- value = formParams[key];
- if(typeof value !== 'undefined'){
- if(encoded !== "")
- encoded += "&";
- encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
- }
- }
- body = encoded;
- }
- else if (headers['Content-Type'] && headers['Content-Type'].indexOf('multipart/form-data') >= 0) {
- if(opts.useJQuery) {
- var bodyParam = new FormData();
- bodyParam.type = 'formData';
- for (key in formParams) {
- value = args[key];
- if (typeof value !== 'undefined') {
- // required for jquery file upload
- if(value.type === 'file' && value.value) {
- delete headers['Content-Type'];
- bodyParam.append(key, value.value);
- }
- else
- bodyParam.append(key, value);
- }
- }
- body = bodyParam;
- }
- }
-
- return body;
-};
-
-/**
- * gets sample response for a single operation
- **/
-Operation.prototype.getModelSampleJSON = function(type, models) {
- var isPrimitive, listType, sampleJson;
-
- listType = (type instanceof Array);
- isPrimitive = models[type] ? false : true;
- sampleJson = isPrimitive ? void 0 : models[type].createJSONSample();
- if (sampleJson) {
- sampleJson = listType ? [sampleJson] : sampleJson;
- if(typeof sampleJson == 'string')
- return sampleJson;
- else if(typeof sampleJson === 'object') {
- var t = sampleJson;
- if(sampleJson instanceof Array && sampleJson.length > 0) {
- t = sampleJson[0];
- }
- if(t.nodeName) {
- var xmlString = new XMLSerializer().serializeToString(t);
- return this.formatXml(xmlString);
- }
- else
- return JSON.stringify(sampleJson, null, 2);
- }
- else
- return sampleJson;
- }
-};
-
-/**
- * legacy binding
- **/
-Operation.prototype["do"] = function(args, opts, callback, error, parent) {
- return this.execute(args, opts, callback, error, parent);
-};
-
-
-/**
- * executes an operation
- **/
-Operation.prototype.execute = function(arg1, arg2, arg3, arg4, parent) {
- var args = arg1 || {};
- var opts = {}, success, error;
- if(typeof arg2 === 'object') {
- opts = arg2;
- success = arg3;
- error = arg4;
- }
-
- if(typeof arg2 === 'function') {
- success = arg2;
- error = arg3;
- }
-
- success = (success||log);
- error = (error||log);
-
- if(opts.useJQuery)
- this.useJQuery = opts.useJQuery;
-
- var missingParams = this.getMissingParams(args);
- if(missingParams.length > 0) {
- var message = 'missing required params: ' + missingParams;
- fail(message);
- return;
- }
- var allHeaders = this.getHeaderParams(args);
- var contentTypeHeaders = this.setContentTypes(args, opts);
-
- var headers = {}, attrname;
- for (attrname in allHeaders) { headers[attrname] = allHeaders[attrname]; }
- for (attrname in contentTypeHeaders) { headers[attrname] = contentTypeHeaders[attrname]; }
-
- var body = this.getBody(headers, args, opts);
- var url = this.urlify(args);
-
- var obj = {
- url: url,
- method: this.method.toUpperCase(),
- body: body,
- useJQuery: this.useJQuery,
- headers: headers,
- on: {
- response: function(response) {
- return success(response, parent);
- },
- error: function(response) {
- return error(response, parent);
- }
- }
- };
- var status = authorizations.apply(obj, this.operation.security);
- if(opts.mock === true)
- return obj;
- else
- new SwaggerHttp().execute(obj, opts);
-};
-
-Operation.prototype.setContentTypes = function(args, opts) {
- // default type
- var accepts = 'application/json';
- var consumes = args.parameterContentType || 'application/json';
- var allDefinedParams = this.parameters;
- var definedFormParams = [];
- var definedFileParams = [];
- var body;
- var headers = {};
-
- // get params from the operation and set them in definedFileParams, definedFormParams, headers
- var i;
- for(i = 0; i < allDefinedParams.length; i++) {
- var param = allDefinedParams[i];
- if(param.in === 'formData') {
- if(param.type === 'file')
- definedFileParams.push(param);
- else
- definedFormParams.push(param);
- }
- else if(param.in === 'header' && opts) {
- var key = param.name;
- var headerValue = opts[param.name];
- if(typeof opts[param.name] !== 'undefined')
- headers[key] = headerValue;
- }
- else if(param.in === 'body' && typeof args[param.name] !== 'undefined') {
- body = args[param.name];
- }
- }
-
- // if there's a body, need to set the consumes header via requestContentType
- if (body && (this.method === 'post' || this.method === 'put' || this.method === 'patch' || this.method === 'delete')) {
- if (opts.requestContentType)
- consumes = opts.requestContentType;
- } else {
- // if any form params, content type must be set
- if(definedFormParams.length > 0) {
- if(opts.requestContentType) // override if set
- consumes = opts.requestContentType;
- else if(definedFileParams.length > 0) // if a file, must be multipart/form-data
- consumes = 'multipart/form-data';
- else // default to x-www-from-urlencoded
- consumes = 'application/x-www-form-urlencoded';
- }
- else if (this.type == 'DELETE')
- body = '{}';
- else if (this.type != 'DELETE')
- consumes = null;
- }
-
- if (consumes && this.consumes) {
- if (this.consumes.indexOf(consumes) === -1) {
- log('server doesn\'t consume ' + consumes + ', try ' + JSON.stringify(this.consumes));
- }
- }
-
- if (opts.responseContentType) {
- accepts = opts.responseContentType;
- } else {
- accepts = 'application/json';
- }
- if (accepts && this.produces) {
- if (this.produces.indexOf(accepts) === -1) {
- log('server can\'t produce ' + accepts);
- }
- }
-
- if ((consumes && body !== '') || (consumes === 'application/x-www-form-urlencoded'))
- headers['Content-Type'] = consumes;
- if (accepts)
- headers.Accept = accepts;
- return headers;
-};
-
-Operation.prototype.asCurl = function (args) {
- var obj = this.execute(args, {mock: true});
- authorizations.apply(obj);
- var results = [];
- results.push('-X ' + this.method.toUpperCase());
- if (obj.headers) {
- var key;
- for (key in obj.headers)
- results.push('--header "' + key + ': ' + obj.headers[key] + '"');
- }
- if(obj.body) {
- var body;
- if(typeof obj.body === 'object')
- body = JSON.stringify(obj.body);
- else
- body = obj.body;
- results.push('-d "' + body.replace(/"/g, '\\"') + '"');
- }
- return 'curl ' + (results.join(' ')) + ' "' + obj.url + '"';
-};
-
-Operation.prototype.encodePathCollection = function(type, name, value) {
- var encoded = '';
- var i;
- var separator = '';
- if(type === 'ssv')
- separator = '%20';
- else if(type === 'tsv')
- separator = '\\t';
- else if(type === 'pipes')
- separator = '|';
- else
- separator = ',';
-
- for(i = 0; i < value.length; i++) {
- if(i === 0)
- encoded = this.encodeQueryParam(value[i]);
- else
- encoded += separator + this.encodeQueryParam(value[i]);
- }
- return encoded;
-};
-
-Operation.prototype.encodeQueryCollection = function(type, name, value) {
- var encoded = '';
- var i;
- if(type === 'default' || type === 'multi') {
- for(i = 0; i < value.length; i++) {
- if(i > 0) encoded += '&';
- encoded += this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]);
- }
- }
- else {
- var separator = '';
- if(type === 'csv')
- separator = ',';
- else if(type === 'ssv')
- separator = '%20';
- else if(type === 'tsv')
- separator = '\\t';
- else if(type === 'pipes')
- separator = '|';
- else if(type === 'brackets') {
- for(i = 0; i < value.length; i++) {
- if(i !== 0)
- encoded += '&';
- encoded += this.encodeQueryParam(name) + '[]=' + this.encodeQueryParam(value[i]);
- }
- }
- if(separator !== '') {
- for(i = 0; i < value.length; i++) {
- if(i === 0)
- encoded = this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]);
- else
- encoded += separator + this.encodeQueryParam(value[i]);
- }
- }
- }
- return encoded;
-};
-
-Operation.prototype.encodeQueryParam = function(arg) {
- return encodeURIComponent(arg);
-};
-
-/**
- * TODO revisit, might not want to leave '/'
- **/
-Operation.prototype.encodePathParam = function(pathParam) {
- var encParts, part, parts, i, len;
- pathParam = pathParam.toString();
- if (pathParam.indexOf('/') === -1) {
- return encodeURIComponent(pathParam);
- } else {
- parts = pathParam.split('/');
- encParts = [];
- for (i = 0, len = parts.length; i < len; i++) {
- encParts.push(encodeURIComponent(parts[i]));
- }
- return encParts.join('/');
- }
-};
-
-var Model = function(name, definition) {
- this.name = name;
- this.definition = definition || {};
- this.properties = [];
- var requiredFields = definition.required || [];
- if(definition.type === 'array') {
- var out = new ArrayModel(definition);
- return out;
- }
- var key;
- var props = definition.properties;
- if(props) {
- for(key in props) {
- var required = false;
- var property = props[key];
- if(requiredFields.indexOf(key) >= 0)
- required = true;
- this.properties.push(new Property(key, property, required));
- }
- }
-};
-
-Model.prototype.createJSONSample = function(modelsToIgnore) {
- var i, result = {}, representations = {};
- modelsToIgnore = (modelsToIgnore||{});
- modelsToIgnore[this.name] = this;
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- var sample = prop.getSampleValue(modelsToIgnore, representations);
- result[prop.name] = sample;
- }
- delete modelsToIgnore[this.name];
- return result;
-};
-
-Model.prototype.getSampleValue = function(modelsToIgnore) {
- var i, obj = {}, representations = {};
- for(i = 0; i < this.properties.length; i++ ) {
- var property = this.properties[i];
- obj[property.name] = property.sampleValue(false, modelsToIgnore, representations);
- }
- return obj;
-};
-
-Model.prototype.getMockSignature = function(modelsToIgnore) {
- var i, prop, propertiesStr = [];
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- propertiesStr.push(prop.toString());
- }
- var strong = '<span class="strong">';
- var stronger = '<span class="stronger">';
- var strongClose = '</span>';
- var classOpen = strong + this.name + ' {' + strongClose;
- var classClose = strong + '}' + strongClose;
- var returnVal = classOpen + '<div>' + propertiesStr.join(',</div><div>') + '</div>' + classClose;
- if (!modelsToIgnore)
- modelsToIgnore = {};
-
- modelsToIgnore[this.name] = this;
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- var ref = prop.$ref;
- var model = models[ref];
- if (model && typeof modelsToIgnore[model.name] === 'undefined') {
- returnVal = returnVal + ('<br>' + model.getMockSignature(modelsToIgnore));
- }
- }
- return returnVal;
-};
-
-var Property = function(name, obj, required) {
- this.schema = obj;
- this.required = required;
- if(obj.$ref)
- this.$ref = simpleRef(obj.$ref);
- else if (obj.type === 'array' && obj.items) {
- if(obj.items.$ref)
- this.$ref = simpleRef(obj.items.$ref);
- else
- obj = obj.items;
- }
- this.name = name;
- this.description = obj.description;
- this.obj = obj;
- this.optional = true;
- this.optional = !required;
- this.default = obj.default || null;
- this.example = obj.example !== undefined ? obj.example : null;
- this.collectionFormat = obj.collectionFormat || null;
- this.maximum = obj.maximum || null;
- this.exclusiveMaximum = obj.exclusiveMaximum || null;
- this.minimum = obj.minimum || null;
- this.exclusiveMinimum = obj.exclusiveMinimum || null;
- this.maxLength = obj.maxLength || null;
- this.minLength = obj.minLength || null;
- this.pattern = obj.pattern || null;
- this.maxItems = obj.maxItems || null;
- this.minItems = obj.minItems || null;
- this.uniqueItems = obj.uniqueItems || null;
- this['enum'] = obj['enum'] || null;
- this.multipleOf = obj.multipleOf || null;
-};
-
-Property.prototype.getSampleValue = function (modelsToIgnore, representations) {
- return this.sampleValue(false, modelsToIgnore, representations);
-};
-
-Property.prototype.isArray = function () {
- var schema = this.schema;
- if(schema.type === 'array')
- return true;
- else
- return false;
-};
-
-Property.prototype.sampleValue = function(isArray, ignoredModels, representations) {
- isArray = (isArray || this.isArray());
- ignoredModels = (ignoredModels || {});
- // representations = (representations || {});
-
- var type = getStringSignature(this.obj, true);
- var output;
-
- if(this.$ref) {
- var refModelName = simpleRef(this.$ref);
- var refModel = models[refModelName];
- if(typeof representations[type] !== 'undefined') {
- return representations[type];
- }
- else
-
- if(refModel && typeof ignoredModels[type] === 'undefined') {
- ignoredModels[type] = this;
- output = refModel.getSampleValue(ignoredModels, representations);
- representations[type] = output;
- }
- else {
- output = (representations[type] || refModelName);
- }
- }
- else if(this.example)
- output = this.example;
- else if(this.default)
- output = this.default;
- else if(type === 'date-time')
- output = new Date().toISOString();
- else if(type === 'date')
- output = new Date().toISOString().split("T")[0];
- else if(type === 'string')
- output = 'string';
- else if(type === 'integer')
- output = 0;
- else if(type === 'long')
- output = 0;
- else if(type === 'float')
- output = 0.0;
- else if(type === 'double')
- output = 0.0;
- else if(type === 'boolean')
- output = true;
- else
- output = {};
- ignoredModels[type] = output;
- if(isArray)
- return [output];
- else
- return output;
-};
-
-getStringSignature = function(obj, baseComponent) {
- var str = '';
- if(typeof obj.$ref !== 'undefined')
- str += simpleRef(obj.$ref);
- else if(typeof obj.type === 'undefined')
- str += 'object';
- else if(obj.type === 'array') {
- if(baseComponent)
- str += getStringSignature((obj.items || obj.$ref || {}));
- else {
- str += 'Array[';
- str += getStringSignature((obj.items || obj.$ref || {}));
- str += ']';
- }
- }
- else if(obj.type === 'integer' && obj.format === 'int32')
- str += 'integer';
- else if(obj.type === 'integer' && obj.format === 'int64')
- str += 'long';
- else if(obj.type === 'integer' && typeof obj.format === 'undefined')
- str += 'long';
- else if(obj.type === 'string' && obj.format === 'date-time')
- str += 'date-time';
- else if(obj.type === 'string' && obj.format === 'date')
- str += 'date';
- else if(obj.type === 'string' && typeof obj.format === 'undefined')
- str += 'string';
- else if(obj.type === 'number' && obj.format === 'float')
- str += 'float';
- else if(obj.type === 'number' && obj.format === 'double')
- str += 'double';
- else if(obj.type === 'number' && typeof obj.format === 'undefined')
- str += 'double';
- else if(obj.type === 'boolean')
- str += 'boolean';
- else if(obj.$ref)
- str += simpleRef(obj.$ref);
- else
- str += obj.type;
- return str;
-};
-
-simpleRef = function(name) {
- if(typeof name === 'undefined')
- return null;
- if(name.indexOf("#/definitions/") === 0)
- return name.substring('#/definitions/'.length);
- else
- return name;
-};
-
-Property.prototype.toString = function() {
- var str = getStringSignature(this.obj);
- if(str !== '') {
- str = '<span class="propName ' + this.required + '">' + this.name + '</span> (<span class="propType">' + str + '</span>';
- if(!this.required)
- str += ', <span class="propOptKey">optional</span>';
- str += ')';
- }
- else
- str = this.name + ' (' + JSON.stringify(this.obj) + ')';
-
- if(typeof this.description !== 'undefined')
- str += ': ' + this.description;
-
- if (this['enum']) {
- str += ' = <span class="propVals">[\'' + this['enum'].join('\' or \'') + '\']</span>';
- }
- if (this.descr) {
- str += ': <span class="propDesc">' + this.descr + '</span>';
- }
-
-
- var options = '';
- var isArray = this.schema.type === 'array';
- var type;
-
- if(isArray) {
- if(this.schema.items)
- type = this.schema.items.type;
- else
- type = '';
- }
- else {
- type = this.schema.type;
- }
-
- if (this.default)
- options += optionHtml('Default', this.default);
-
- switch (type) {
- case 'string':
- if (this.minLength)
- options += optionHtml('Min. Length', this.minLength);
- if (this.maxLength)
- options += optionHtml('Max. Length', this.maxLength);
- if (this.pattern)
- options += optionHtml('Reg. Exp.', this.pattern);
- break;
- case 'integer':
- case 'number':
- if (this.minimum)
- options += optionHtml('Min. Value', this.minimum);
- if (this.exclusiveMinimum)
- options += optionHtml('Exclusive Min.', "true");
- if (this.maximum)
- options += optionHtml('Max. Value', this.maximum);
- if (this.exclusiveMaximum)
- options += optionHtml('Exclusive Max.', "true");
- if (this.multipleOf)
- options += optionHtml('Multiple Of', this.multipleOf);
- break;
- }
-
- if (isArray) {
- if (this.minItems)
- options += optionHtml('Min. Items', this.minItems);
- if (this.maxItems)
- options += optionHtml('Max. Items', this.maxItems);
- if (this.uniqueItems)
- options += optionHtml('Unique Items', "true");
- if (this.collectionFormat)
- options += optionHtml('Coll. Format', this.collectionFormat);
- }
-
- if (this['enum']) {
- var enumString;
-
- if (type === 'number' || type === 'integer')
- enumString = this['enum'].join(', ');
- else {
- enumString = '"' + this['enum'].join('", "') + '"';
- }
-
- options += optionHtml('Enum', enumString);
- }
-
- if (options.length > 0)
- str = '<span class="propWrap">' + str + '<table class="optionsWrapper"><tr><th colspan="2">' + this.name + '</th></tr>' + options + '</table></span>';
-
- return str;
-};
-
-optionHtml = function(label, value) {
- return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
-};
-
-typeFromJsonSchema = function(type, format) {
- var str;
- if(type === 'integer' && format === 'int32')
- str = 'integer';
- else if(type === 'integer' && format === 'int64')
- str = 'long';
- else if(type === 'integer' && typeof format === 'undefined')
- str = 'long';
- else if(type === 'string' && format === 'date-time')
- str = 'date-time';
- else if(type === 'string' && format === 'date')
- str = 'date';
- else if(type === 'number' && format === 'float')
- str = 'float';
- else if(type === 'number' && format === 'double')
- str = 'double';
- else if(type === 'number' && typeof format === 'undefined')
- str = 'double';
- else if(type === 'boolean')
- str = 'boolean';
- else if(type === 'string')
- str = 'string';
-
- return str;
-};
-
-var sampleModels = {};
-var cookies = {};
-var models = {};
-
-SwaggerClient.prototype.buildFrom1_2Spec = function (response) {
- if (response.apiVersion !== null) {
- this.apiVersion = response.apiVersion;
- }
- this.apis = {};
- this.apisArray = [];
- this.consumes = response.consumes;
- this.produces = response.produces;
- this.authSchemes = response.authorizations;
- this.info = this.convertInfo(response.info);
-
- var isApi = false, i, res;
- for (i = 0; i < response.apis.length; i++) {
- var api = response.apis[i];
- if (api.operations) {
- var j;
- for (j = 0; j < api.operations.length; j++) {
- operation = api.operations[j];
- isApi = true;
- }
- }
- }
- if (response.basePath)
- this.basePath = response.basePath;
- else if (this.url.indexOf('?') > 0)
- this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
- else
- this.basePath = this.url;
-
- if (isApi) {
- var newName = response.resourcePath.replace(/\//g, '');
- this.resourcePath = response.resourcePath;
- res = new SwaggerResource(response, this);
- this.apis[newName] = res;
- this.apisArray.push(res);
- this.finish();
- } else {
- var k;
- this.expectedResourceCount = response.apis.length;
- for (k = 0; k < response.apis.length; k++) {
- var resource = response.apis[k];
- res = new SwaggerResource(resource, this);
- this.apis[res.name] = res;
- this.apisArray.push(res);
- }
- }
- this.isValid = true;
- return this;
-};
-
-SwaggerClient.prototype.finish = function() {
- if (typeof this.success === 'function') {
- this.isValid = true;
- this.ready = true;
- this.isBuilt = true;
- this.selfReflect();
- this.success();
- }
-};
-
-SwaggerClient.prototype.buildFrom1_1Spec = function (response) {
- log('This API is using a deprecated version of Swagger! Please see http://github.com/wordnik/swagger-core/wiki for more info');
- if (response.apiVersion !== null)
- this.apiVersion = response.apiVersion;
- this.apis = {};
- this.apisArray = [];
- this.produces = response.produces;
- this.info = this.convertInfo(response.info);
- var isApi = false, res;
- for (var i = 0; i < response.apis.length; i++) {
- var api = response.apis[i];
- if (api.operations) {
- for (var j = 0; j < api.operations.length; j++) {
- operation = api.operations[j];
- isApi = true;
- }
- }
- }
- if (response.basePath) {
- this.basePath = response.basePath;
- } else if (this.url.indexOf('?') > 0) {
- this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
- } else {
- this.basePath = this.url;
- }
- if (isApi) {
- var newName = response.resourcePath.replace(/\//g, '');
- this.resourcePath = response.resourcePath;
- res = new SwaggerResource(response, this);
- this.apis[newName] = res;
- this.apisArray.push(res);
- this.finish();
- } else {
- this.expectedResourceCount = response.apis.length;
- for (k = 0; k < response.apis.length; k++) {
- resource = response.apis[k];
- res = new SwaggerResource(resource, this);
- this.apis[res.name] = res;
- this.apisArray.push(res);
- }
- }
- this.isValid = true;
- return this;
-};
-
-SwaggerClient.prototype.convertInfo = function (resp) {
- if(typeof resp == 'object') {
- var info = {};
-
- info.title = resp.title;
- info.description = resp.description;
- info.termsOfService = resp.termsOfServiceUrl;
- info.contact = {};
- info.contact.name = resp.contact;
- info.license = {};
- info.license.name = resp.license;
- info.license.url = resp.licenseUrl;
-
- return info;
- }
-};
-
-SwaggerClient.prototype.selfReflect = function () {
- var resource, tag, ref;
- if (this.apis === null) {
- return false;
- }
- ref = this.apis;
- for (tag in ref) {
- api = ref[tag];
- if (api.ready === null) {
- return false;
- }
- this[tag] = api;
- this[tag].help = __bind(api.help, api);
- }
- this.setConsolidatedModels();
- this.ready = true;
-};
-
-SwaggerClient.prototype.setConsolidatedModels = function () {
- var model, modelName, resource, resource_name, i, apis, models, results;
- this.models = {};
- apis = this.apis;
- for (resource_name in apis) {
- resource = apis[resource_name];
- for (modelName in resource.models) {
- if (typeof this.models[modelName] === 'undefined') {
- this.models[modelName] = resource.models[modelName];
- this.modelsArray.push(resource.models[modelName]);
- }
- }
- }
- models = this.modelsArray;
- results = [];
- for (i = 0; i < models.length; i++) {
- model = models[i];
- results.push(model.setReferencedModels(this.models));
- }
- return results;
-};
-
-var SwaggerResource = function (resourceObj, api) {
- var _this = this;
- this.api = api;
- this.swaggerRequstHeaders = api.swaggerRequstHeaders;
- this.path = (typeof this.api.resourcePath === 'string') ? this.api.resourcePath : resourceObj.path;
- this.description = resourceObj.description;
- this.authorizations = (resourceObj.authorizations || {});
-
- var parts = this.path.split('/');
- this.name = parts[parts.length - 1].replace('.{format}', '');
- this.basePath = this.api.basePath;
- this.operations = {};
- this.operationsArray = [];
- this.modelsArray = [];
- this.models = api.models || {};
- this.rawModels = {};
- this.useJQuery = (typeof api.useJQuery !== 'undefined') ? api.useJQuery : null;
-
- if ((resourceObj.apis) && this.api.resourcePath) {
- this.addApiDeclaration(resourceObj);
- } else {
- if (typeof this.path === 'undefined') {
- this.api.fail('SwaggerResources must have a path.');
- }
- if (this.path.substring(0, 4) === 'http') {
- this.url = this.path.replace('{format}', 'json');
- } else {
- this.url = this.api.basePath + this.path.replace('{format}', 'json');
- }
- this.api.progress('fetching resource ' + this.name + ': ' + this.url);
- var obj = {
- url: this.url,
- method: 'GET',
- useJQuery: this.useJQuery,
- headers: {
- accept: this.swaggerRequstHeaders
- },
- on: {
- response: function (resp) {
- var responseObj = resp.obj || JSON.parse(resp.data);
- _this.api.resourceCount += 1;
- return _this.addApiDeclaration(responseObj);
- },
- error: function (response) {
- _this.api.resourceCount += 1;
- return _this.api.fail('Unable to read api \'' +
- _this.name + '\' from path ' + _this.url + ' (server returned ' + response.statusText + ')');
- }
- }
- };
- var e = typeof window !== 'undefined' ? window : exports;
- e.authorizations.apply(obj);
- new SwaggerHttp().execute(obj);
- }
-};
-
-SwaggerResource.prototype.help = function (dontPrint) {
- var i;
- var output = 'operations for the "' + this.name + '" tag';
- for(i = 0; i < this.operationsArray.length; i++) {
- var api = this.operationsArray[i];
- output += '\n * ' + api.nickname + ': ' + api.description;
- }
- if(dontPrint)
- return output;
- else {
- log(output);
- return output;
- }
-};
-
-SwaggerResource.prototype.getAbsoluteBasePath = function (relativeBasePath) {
- var pos, url;
- url = this.api.basePath;
- pos = url.lastIndexOf(relativeBasePath);
- var parts = url.split('/');
- var rootUrl = parts[0] + '//' + parts[2];
-
- if (relativeBasePath.indexOf('http') === 0)
- return relativeBasePath;
- if (relativeBasePath === '/')
- return rootUrl;
- if (relativeBasePath.substring(0, 1) == '/') {
- // use root + relative
- return rootUrl + relativeBasePath;
- }
- else {
- pos = this.basePath.lastIndexOf('/');
- var base = this.basePath.substring(0, pos);
- if (base.substring(base.length - 1) == '/')
- return base + relativeBasePath;
- else
- return base + '/' + relativeBasePath;
- }
-};
-
-SwaggerResource.prototype.addApiDeclaration = function (response) {
- if (typeof response.produces === 'string')
- this.produces = response.produces;
- if (typeof response.consumes === 'string')
- this.consumes = response.consumes;
- if ((typeof response.basePath === 'string') && response.basePath.replace(/\s/g, '').length > 0)
- this.basePath = response.basePath.indexOf('http') === -1 ? this.getAbsoluteBasePath(response.basePath) : response.basePath;
- this.resourcePath = response.resourcePath;
- this.addModels(response.models);
- if (response.apis) {
- for (var i = 0 ; i < response.apis.length; i++) {
- var endpoint = response.apis[i];
- this.addOperations(endpoint.path, endpoint.operations, response.consumes, response.produces);
- }
- }
- this.api[this.name] = this;
- this.ready = true;
- if(this.api.resourceCount === this.api.expectedResourceCount)
- this.api.finish();
- return this;
-};
-
-SwaggerResource.prototype.addModels = function (models) {
- if (typeof models === 'object') {
- var modelName;
- for (modelName in models) {
- if (typeof this.models[modelName] === 'undefined') {
- var swaggerModel = new SwaggerModel(modelName, models[modelName]);
- this.modelsArray.push(swaggerModel);
- this.models[modelName] = swaggerModel;
- this.rawModels[modelName] = models[modelName];
- }
- }
- var output = [];
- for (var i = 0; i < this.modelsArray.length; i++) {
- var model = this.modelsArray[i];
- output.push(model.setReferencedModels(this.models));
- }
- return output;
- }
-};
-
-SwaggerResource.prototype.addOperations = function (resource_path, ops, consumes, produces) {
- if (ops) {
- var output = [];
- for (var i = 0; i < ops.length; i++) {
- var o = ops[i];
- consumes = this.consumes;
- produces = this.produces;
- if (typeof o.consumes !== 'undefined')
- consumes = o.consumes;
- else
- consumes = this.consumes;
-
- if (typeof o.produces !== 'undefined')
- produces = o.produces;
- else
- produces = this.produces;
- var type = (o.type || o.responseClass);
-
- if (type === 'array') {
- ref = null;
- if (o.items)
- ref = o.items.type || o.items.$ref;
- type = 'array[' + ref + ']';
- }
- var responseMessages = o.responseMessages;
- var method = o.method;
- if (o.httpMethod) {
- method = o.httpMethod;
- }
- if (o.supportedContentTypes) {
- consumes = o.supportedContentTypes;
- }
- if (o.errorResponses) {
- responseMessages = o.errorResponses;
- for (var j = 0; j < responseMessages.length; j++) {
- r = responseMessages[j];
- r.message = r.reason;
- r.reason = null;
- }
- }
- o.nickname = this.sanitize(o.nickname);
- var op = new SwaggerOperation(o.nickname,
- resource_path,
- method,
- o.parameters,
- o.summary,
- o.notes,
- type,
- responseMessages,
- this,
- consumes,
- produces,
- o.authorizations,
- o.deprecated);
-
- this.operations[op.nickname] = op;
- output.push(this.operationsArray.push(op));
- }
- return output;
- }
-};
-
-SwaggerResource.prototype.sanitize = function (nickname) {
- var op;
- op = nickname.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_');
- op = op.replace(/((_){2,})/g, '_');
- op = op.replace(/^(_)*/g, '');
- op = op.replace(/([_])*$/g, '');
- return op;
-};
-
-var SwaggerModel = function (modelName, obj) {
- this.name = typeof obj.id !== 'undefined' ? obj.id : modelName;
- this.properties = [];
- var propertyName;
- for (propertyName in obj.properties) {
- if (obj.required) {
- var value;
- for (value in obj.required) {
- if (propertyName === obj.required[value]) {
- obj.properties[propertyName].required = true;
- }
- }
- }
- var prop = new SwaggerModelProperty(propertyName, obj.properties[propertyName], this);
- this.properties.push(prop);
- }
-};
-
-SwaggerModel.prototype.setReferencedModels = function (allModels) {
- var results = [];
- for (var i = 0; i < this.properties.length; i++) {
- var property = this.properties[i];
- var type = property.type || property.dataType;
- if (allModels[type])
- results.push(property.refModel = allModels[type]);
- else if ((property.refDataType) && (allModels[property.refDataType]))
- results.push(property.refModel = allModels[property.refDataType]);
- else
- results.push(void 0);
- }
- return results;
-};
-
-SwaggerModel.prototype.getMockSignature = function (modelsToIgnore) {
- var i, prop, propertiesStr = [];
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- propertiesStr.push(prop.toString());
- }
-
- var strong = '<span class="strong">';
- var strongClose = '</span>';
- var classOpen = strong + this.name + ' {' + strongClose;
- var classClose = strong + '}' + strongClose;
- var returnVal = classOpen + '<div>' + propertiesStr.join(',</div><div>') + '</div>' + classClose;
- if (!modelsToIgnore)
- modelsToIgnore = [];
- modelsToIgnore.push(this.name);
-
- for (i = 0; i < this.properties.length; i++) {
- prop = this.properties[i];
- if ((prop.refModel) && modelsToIgnore.indexOf(prop.refModel.name) === -1) {
- returnVal = returnVal + ('<br>' + prop.refModel.getMockSignature(modelsToIgnore));
- }
- }
- return returnVal;
-};
-
-SwaggerModel.prototype.createJSONSample = function (modelsToIgnore) {
- if (sampleModels[this.name]) {
- return sampleModels[this.name];
- }
- else {
- var result = {};
- modelsToIgnore = (modelsToIgnore || []);
- modelsToIgnore.push(this.name);
- for (var i = 0; i < this.properties.length; i++) {
- var prop = this.properties[i];
- result[prop.name] = prop.getSampleValue(modelsToIgnore);
- }
- modelsToIgnore.pop(this.name);
- return result;
- }
-};
-
-var SwaggerModelProperty = function (name, obj, model) {
- this.name = name;
- this.dataType = obj.type || obj.dataType || obj.$ref;
- this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
- this.descr = obj.description;
- this.required = obj.required;
- this.defaultValue = applyModelPropertyMacro(obj, model);
- if (obj.items) {
- if (obj.items.type) {
- this.refDataType = obj.items.type;
- }
- if (obj.items.$ref) {
- this.refDataType = obj.items.$ref;
- }
- }
- this.dataTypeWithRef = this.refDataType ? (this.dataType + '[' + this.refDataType + ']') : this.dataType;
- if (obj.allowableValues) {
- this.valueType = obj.allowableValues.valueType;
- this.values = obj.allowableValues.values;
- if (this.values) {
- this.valuesString = '\'' + this.values.join('\' or \'') + '\'';
- }
- }
- if (obj['enum']) {
- this.valueType = 'string';
- this.values = obj['enum'];
- if (this.values) {
- this.valueString = '\'' + this.values.join('\' or \'') + '\'';
- }
- }
-};
-
-SwaggerModelProperty.prototype.getSampleValue = function (modelsToIgnore) {
- var result;
- if ((this.refModel) && (modelsToIgnore.indexOf(this.refModel.name) === -1)) {
- result = this.refModel.createJSONSample(modelsToIgnore);
- } else {
- if (this.isCollection) {
- result = this.toSampleValue(this.refDataType);
- } else {
- result = this.toSampleValue(this.dataType);
- }
- }
- if (this.isCollection) {
- return [result];
- } else {
- return result;
- }
-};
-
-SwaggerModelProperty.prototype.toSampleValue = function (value) {
- var result;
- if ((typeof this.defaultValue !== 'undefined') && this.defaultValue) {
- result = this.defaultValue;
- } else if (value === 'integer') {
- result = 0;
- } else if (value === 'boolean') {
- result = false;
- } else if (value === 'double' || value === 'number') {
- result = 0.0;
- } else if (value === 'string') {
- result = '';
- } else {
- result = value;
- }
- return result;
-};
-
-SwaggerModelProperty.prototype.toString = function () {
- var req = this.required ? 'propReq' : 'propOpt';
- var str = '<span class="propName ' + req + '">' + this.name + '</span> (<span class="propType">' + this.dataTypeWithRef + '</span>';
- if (!this.required) {
- str += ', <span class="propOptKey">optional</span>';
- }
- str += ')';
- if (this.values) {
- str += ' = <span class="propVals">[\'' + this.values.join('\' or \'') + '\']</span>';
- }
- if (this.descr) {
- str += ': <span class="propDesc">' + this.descr + '</span>';
- }
- return str;
-};
-
-var SwaggerOperation = function (nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations, deprecated) {
- var _this = this;
-
- var errors = [];
- this.nickname = (nickname || errors.push('SwaggerOperations must have a nickname.'));
- this.path = (path || errors.push('SwaggerOperation ' + nickname + ' is missing path.'));
- this.method = (method || errors.push('SwaggerOperation ' + nickname + ' is missing method.'));
- this.parameters = parameters ? parameters : [];
- this.summary = summary;
- this.notes = notes;
- this.type = type;
- this.responseMessages = (responseMessages || []);
- this.resource = (resource || errors.push('Resource is required'));
- this.consumes = consumes;
- this.produces = produces;
- this.authorizations = typeof authorizations !== 'undefined' ? authorizations : resource.authorizations;
- this.deprecated = deprecated;
- this['do'] = __bind(this['do'], this);
-
-
- if(typeof this.deprecated === 'string') {
- switch(this.deprecated.toLowerCase()) {
- case 'true': case 'yes': case '1': {
- this.deprecated = true;
- break;
- }
- case 'false': case 'no': case '0': case null: {
- this.deprecated = false;
- break;
- }
- default: this.deprecated = Boolean(this.deprecated);
- }
- }
-
- if (errors.length > 0) {
- console.error('SwaggerOperation errors', errors, arguments);
- this.resource.api.fail(errors);
- }
-
- this.path = this.path.replace('{format}', 'json');
- this.method = this.method.toLowerCase();
- this.isGetMethod = this.method === 'get';
-
- var i, j, v;
- this.resourceName = this.resource.name;
- if (typeof this.type !== 'undefined' && this.type === 'void')
- this.type = null;
- else {
- this.responseClassSignature = this.getSignature(this.type, this.resource.models);
- this.responseSampleJSON = this.getSampleJSON(this.type, this.resource.models);
- }
-
- for (i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- // might take this away
- param.name = param.name || param.type || param.dataType;
- // for 1.1 compatibility
- type = param.type || param.dataType;
- if (type === 'array') {
- type = 'array[' + (param.items.$ref ? param.items.$ref : param.items.type) + ']';
- }
- param.type = type;
-
- if (type && type.toLowerCase() === 'boolean') {
- param.allowableValues = {};
- param.allowableValues.values = ['true', 'false'];
- }
- param.signature = this.getSignature(type, this.resource.models);
- param.sampleJSON = this.getSampleJSON(type, this.resource.models);
-
- var enumValue = param['enum'];
- if (typeof enumValue !== 'undefined') {
- param.isList = true;
- param.allowableValues = {};
- param.allowableValues.descriptiveValues = [];
-
- for (j = 0; j < enumValue.length; j++) {
- v = enumValue[j];
- if (param.defaultValue) {
- param.allowableValues.descriptiveValues.push({
- value: String(v),
- isDefault: (v === param.defaultValue)
- });
- }
- else {
- param.allowableValues.descriptiveValues.push({
- value: String(v),
- isDefault: false
- });
- }
- }
- }
- else if (param.allowableValues) {
- if (param.allowableValues.valueType === 'RANGE')
- param.isRange = true;
- else
- param.isList = true;
- if (param.allowableValues) {
- param.allowableValues.descriptiveValues = [];
- if (param.allowableValues.values) {
- for (j = 0; j < param.allowableValues.values.length; j++) {
- v = param.allowableValues.values[j];
- if (param.defaultValue !== null) {
- param.allowableValues.descriptiveValues.push({
- value: String(v),
- isDefault: (v === param.defaultValue)
- });
- }
- else {
- param.allowableValues.descriptiveValues.push({
- value: String(v),
- isDefault: false
- });
- }
- }
- }
- }
- }
- param.defaultValue = applyParameterMacro(this, param);
- }
- var defaultSuccessCallback = this.resource.api.defaultSuccessCallback || null;
- var defaultErrorCallback = this.resource.api.defaultErrorCallback || null;
-
- this.resource[this.nickname] = function (args, opts, callback, error) {
- var arg1, arg2, arg3, arg4;
- if(typeof args === 'function') { // right shift 3
- arg1 = {}; arg2 = {}; arg3 = args; arg4 = opts;
- }
- else if(typeof args === 'object' && typeof opts === 'function') { // right shift 2
- arg1 = args; arg2 = {}; arg3 = opts; arg4 = callback;
- }
- else {
- arg1 = args; arg2 = opts; arg3 = callback; arg4 = error;
- }
- return _this['do'](arg1 || {}, arg2 || {}, arg3 || defaultSuccessCallback, arg4 || defaultErrorCallback);
- };
-
- this.resource[this.nickname].help = function (dontPrint) {
- return _this.help(dontPrint);
- };
- this.resource[this.nickname].asCurl = function (args) {
- return _this.asCurl(args);
- };
-};
-
-SwaggerOperation.prototype.isListType = function (type) {
- if (type && type.indexOf('[') >= 0) {
- return type.substring(type.indexOf('[') + 1, type.indexOf(']'));
- } else {
- return void 0;
- }
-};
-
-SwaggerOperation.prototype.getSignature = function (type, models) {
- var isPrimitive, listType;
- listType = this.isListType(type);
- isPrimitive = ((typeof listType !== 'undefined') && models[listType]) || (typeof models[type] !== 'undefined') ? false : true;
- if (isPrimitive) {
- return type;
- } else {
- if (typeof listType !== 'undefined') {
- return models[listType].getMockSignature();
- } else {
- return models[type].getMockSignature();
- }
- }
-};
-
-SwaggerOperation.prototype.getSampleJSON = function (type, models) {
- var isPrimitive, listType, val;
- listType = this.isListType(type);
- isPrimitive = ((typeof listType !== 'undefined') && models[listType]) || (typeof models[type] !== 'undefined') ? false : true;
- val = isPrimitive ? void 0 : (listType ? models[listType].createJSONSample() : models[type].createJSONSample());
- if (val) {
- val = listType ? [val] : val;
- if (typeof val == 'string')
- return val;
- else if (typeof val === 'object') {
- var t = val;
- if (val instanceof Array && val.length > 0) {
- t = val[0];
- }
- if (t.nodeName) {
- var xmlString = new XMLSerializer().serializeToString(t);
- return this.formatXml(xmlString);
- }
- else
- return JSON.stringify(val, null, 2);
- }
- else
- return val;
- }
-};
-
-SwaggerOperation.prototype['do'] = function (args, opts, callback, error) {
- var key, param, params, possibleParams = [], req, value;
-
- if (typeof error !== 'function') {
- error = function (xhr, textStatus, error) {
- return log(xhr, textStatus, error);
- };
- }
-
- if (typeof callback !== 'function') {
- callback = function (response) {
- var content;
- content = null;
- if (response !== null) {
- content = response.data;
- } else {
- content = 'no data';
- }
- return log('default callback: ' + content);
- };
- }
-
- params = {};
- params.headers = [];
- if (args.headers) {
- params.headers = args.headers;
- delete args.headers;
- }
- // allow override from the opts
- if(opts && opts.responseContentType) {
- params.headers['Content-Type'] = opts.responseContentType;
- }
- if(opts && opts.requestContentType) {
- params.headers.Accept = opts.requestContentType;
- }
-
- for (var i = 0; i < this.parameters.length; i++) {
- param = this.parameters[i];
- if (param.paramType === 'header') {
- if (typeof args[param.name] !== 'undefined')
- params.headers[param.name] = args[param.name];
- }
- else if (param.paramType === 'form' || param.paramType.toLowerCase() === 'file')
- possibleParams.push(param);
- else if (param.paramType === 'body' && param.name !== 'body' && typeof args[param.name] !== 'undefined') {
- if (args.body) {
- throw new Error('Saw two body params in an API listing; expecting a max of one.');
- }
- args.body = args[param.name];
- }
- }
-
- if (typeof args.body !== 'undefined') {
- params.body = args.body;
- delete args.body;
- }
-
- if (possibleParams) {
- for (key in possibleParams) {
- value = possibleParams[key];
- if (args[value.name]) {
- params[value.name] = args[value.name];
- }
- }
- }
-
- req = new SwaggerRequest(this.method, this.urlify(args), params, opts, callback, error, this);
- if (opts.mock) {
- return req;
- } else {
- return true;
- }
-};
-
-SwaggerOperation.prototype.pathJson = function () {
- return this.path.replace('{format}', 'json');
-};
-
-SwaggerOperation.prototype.pathXml = function () {
- return this.path.replace('{format}', 'xml');
-};
-
-SwaggerOperation.prototype.encodePathParam = function (pathParam) {
- var encParts, part, parts, _i, _len;
- pathParam = pathParam.toString();
- if (pathParam.indexOf('/') === -1) {
- return encodeURIComponent(pathParam);
- } else {
- parts = pathParam.split('/');
- encParts = [];
- for (_i = 0, _len = parts.length; _i < _len; _i++) {
- part = parts[_i];
- encParts.push(encodeURIComponent(part));
- }
- return encParts.join('/');
- }
-};
-
-SwaggerOperation.prototype.urlify = function (args) {
- var i, j, param, url;
- // ensure no double slashing...
- if(this.resource.basePath.length > 1 && this.resource.basePath.slice(-1) === '/' && this.pathJson().charAt(0) === '/')
- url = this.resource.basePath + this.pathJson().substring(1);
- else
- url = this.resource.basePath + this.pathJson();
- var params = this.parameters;
- for (i = 0; i < params.length; i++) {
- param = params[i];
- if (param.paramType === 'path') {
- if (typeof args[param.name] !== 'undefined') {
- // apply path params and remove from args
- var reg = new RegExp('\\{\\s*?' + param.name + '[^\\{\\}\\/]*(?:\\{.*?\\}[^\\{\\}\\/]*)*\\}(?=(\\/?|$))', 'gi');
- url = url.replace(reg, this.encodePathParam(args[param.name]));
- delete args[param.name];
- }
- else
- throw '' + param.name + ' is a required path param.';
- }
- }
-
- var queryParams = '';
- for (i = 0; i < params.length; i++) {
- param = params[i];
- if(param.paramType === 'query') {
- if (queryParams !== '')
- queryParams += '&';
- if (Array.isArray(param)) {
- var output = '';
- for(j = 0; j < param.length; j++) {
- if(j > 0)
- output += ',';
- output += encodeURIComponent(param[j]);
- }
- queryParams += encodeURIComponent(param.name) + '=' + output;
- }
- else {
- if (typeof args[param.name] !== 'undefined') {
- queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
- } else {
- if (param.required)
- throw '' + param.name + ' is a required query param.';
- }
- }
- }
- }
- if ((queryParams) && queryParams.length > 0)
- url += '?' + queryParams;
- return url;
-};
-
-SwaggerOperation.prototype.supportHeaderParams = function () {
- return this.resource.api.supportHeaderParams;
-};
-
-SwaggerOperation.prototype.supportedSubmitMethods = function () {
- return this.resource.api.supportedSubmitMethods;
-};
-
-SwaggerOperation.prototype.getQueryParams = function (args) {
- return this.getMatchingParams(['query'], args);
-};
-
-SwaggerOperation.prototype.getHeaderParams = function (args) {
- return this.getMatchingParams(['header'], args);
-};
-
-SwaggerOperation.prototype.getMatchingParams = function (paramTypes, args) {
- var matchingParams = {};
- var params = this.parameters;
- for (var i = 0; i < params.length; i++) {
- param = params[i];
- if (args && args[param.name])
- matchingParams[param.name] = args[param.name];
- }
- var headers = this.resource.api.headers;
- var name;
- for (name in headers) {
- var value = headers[name];
- matchingParams[name] = value;
- }
- return matchingParams;
-};
-
-SwaggerOperation.prototype.help = function (dontPrint) {
- var msg = this.nickname + ': ' + this.summary;
- var params = this.parameters;
- for (var i = 0; i < params.length; i++) {
- var param = params[i];
- msg += '\n* ' + param.name + (param.required ? ' (required)' : '') + " - " + param.description;
- }
- if(dontPrint)
- return msg;
- else {
- console.log(msg);
- return msg;
- }
-};
-
-SwaggerOperation.prototype.asCurl = function (args) {
- var results = [];
- var i;
-
- var headers = SwaggerRequest.prototype.setHeaders(args, {}, this);
- for(i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- if(param.paramType && param.paramType === 'header' && args[param.name]) {
- headers[param.name] = args[param.name];
- }
- }
-
- var key;
- for (key in headers) {
- results.push('--header "' + key + ': ' + headers[key] + '"');
- }
- return 'curl ' + (results.join(' ')) + ' ' + this.urlify(args);
-};
-
-SwaggerOperation.prototype.formatXml = function (xml) {
- var contexp, formatted, indent, lastType, lines, ln, pad, reg, transitions, wsexp, _fn, _i, _len;
- reg = /(>)(<)(\/*)/g;
- wsexp = /[ ]*(.*)[ ]+\n/g;
- contexp = /(<.+>)(.+\n)/g;
- xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
- pad = 0;
- formatted = '';
- lines = xml.split('\n');
- indent = 0;
- lastType = 'other';
- transitions = {
- 'single->single': 0,
- 'single->closing': -1,
- 'single->opening': 0,
- 'single->other': 0,
- 'closing->single': 0,
- 'closing->closing': -1,
- 'closing->opening': 0,
- 'closing->other': 0,
- 'opening->single': 1,
- 'opening->closing': 0,
- 'opening->opening': 1,
- 'opening->other': 1,
- 'other->single': 0,
- 'other->closing': -1,
- 'other->opening': 0,
- 'other->other': 0
- };
- _fn = function (ln) {
- var fromTo, j, key, padding, type, types, value;
- types = {
- single: Boolean(ln.match(/<.+\/>/)),
- closing: Boolean(ln.match(/<\/.+>/)),
- opening: Boolean(ln.match(/<[^!?].*>/))
- };
- type = ((function () {
- var _results;
- _results = [];
- for (key in types) {
- value = types[key];
- if (value) {
- _results.push(key);
- }
- }
- return _results;
- })())[0];
- type = type === void 0 ? 'other' : type;
- fromTo = lastType + '->' + type;
- lastType = type;
- padding = '';
- indent += transitions[fromTo];
- padding = ((function () {
- var _j, _ref5, _results;
- _results = [];
- for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
- _results.push(' ');
- }
- return _results;
- })()).join('');
- if (fromTo === 'opening->closing') {
- formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
- } else {
- formatted += padding + ln + '\n';
- }
- };
- for (_i = 0, _len = lines.length; _i < _len; _i++) {
- ln = lines[_i];
- _fn(ln);
- }
- return formatted;
-};
-
-var SwaggerRequest = function (type, url, params, opts, successCallback, errorCallback, operation, execution) {
- var _this = this;
- var errors = [];
-
- this.useJQuery = (typeof operation.resource.useJQuery !== 'undefined' ? operation.resource.useJQuery : null);
- this.type = (type || errors.push('SwaggerRequest type is required (get/post/put/delete/patch/options).'));
- this.url = (url || errors.push('SwaggerRequest url is required.'));
- this.params = params;
- this.opts = opts;
- this.successCallback = (successCallback || errors.push('SwaggerRequest successCallback is required.'));
- this.errorCallback = (errorCallback || errors.push('SwaggerRequest error callback is required.'));
- this.operation = (operation || errors.push('SwaggerRequest operation is required.'));
- this.execution = execution;
- this.headers = (params.headers || {});
-
- if (errors.length > 0) {
- throw errors;
- }
-
- this.type = this.type.toUpperCase();
-
- // set request, response content type headers
- var headers = this.setHeaders(params, opts, this.operation);
- var body = params.body;
-
- // encode the body for form submits
- if (headers['Content-Type']) {
- var key, value, values = {}, i;
- var operationParams = this.operation.parameters;
- for (i = 0; i < operationParams.length; i++) {
- var param = operationParams[i];
- if (param.paramType === 'form')
- values[param.name] = param;
- }
-
- if (headers['Content-Type'].indexOf('application/x-www-form-urlencoded') === 0) {
- var encoded = '';
- for (key in values) {
- value = this.params[key];
- if (typeof value !== 'undefined') {
- if (encoded !== '')
- encoded += '&';
- encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
- }
- }
- body = encoded;
- }
- else if (headers['Content-Type'].indexOf('multipart/form-data') === 0) {
- // encode the body for form submits
- var data = '';
- var boundary = '----SwaggerFormBoundary' + Date.now();
- for (key in values) {
- value = this.params[key];
- if (typeof value !== 'undefined') {
- data += '--' + boundary + '\n';
- data += 'Content-Disposition: form-data; name="' + key + '"';
- data += '\n\n';
- data += value + '\n';
- }
- }
- data += '--' + boundary + '--\n';
- headers['Content-Type'] = 'multipart/form-data; boundary=' + boundary;
- body = data;
- }
- }
-
- var obj;
- if (!((this.headers) && (this.headers.mock))) {
- obj = {
- url: this.url,
- method: this.type,
- headers: headers,
- body: body,
- useJQuery: this.useJQuery,
- on: {
- error: function (response) {
- return _this.errorCallback(response, _this.opts.parent);
- },
- redirect: function (response) {
- return _this.successCallback(response, _this.opts.parent);
- },
- 307: function (response) {
- return _this.successCallback(response, _this.opts.parent);
- },
- response: function (response) {
- return _this.successCallback(response, _this.opts.parent);
- }
- }
- };
-
- var status = false;
- if (this.operation.resource && this.operation.resource.api && this.operation.resource.api.clientAuthorizations) {
- // Get the client authorizations from the resource declaration
- status = this.operation.resource.api.clientAuthorizations.apply(obj, this.operation.authorizations);
- } else {
- // Get the client authorization from the default authorization declaration
- var e;
- if (typeof window !== 'undefined') {
- e = window;
- } else {
- e = exports;
- }
- status = e.authorizations.apply(obj, this.operation.authorizations);
- }
-
- if (!opts.mock) {
- if (status !== false) {
- new SwaggerHttp().execute(obj);
- } else {
- obj.canceled = true;
- }
- } else {
- return obj;
- }
- }
- return obj;
-};
-
-SwaggerRequest.prototype.setHeaders = function (params, opts, operation) {
- // default type
- var accepts = opts.responseContentType || 'application/json';
- var consumes = opts.requestContentType || 'application/json';
-
- var allDefinedParams = operation.parameters;
- var definedFormParams = [];
- var definedFileParams = [];
- var body = params.body;
- var headers = {};
-
- // get params from the operation and set them in definedFileParams, definedFormParams, headers
- var i;
- for (i = 0; i < allDefinedParams.length; i++) {
- var param = allDefinedParams[i];
- if (param.paramType === 'form')
- definedFormParams.push(param);
- else if (param.paramType === 'file')
- definedFileParams.push(param);
- else if (param.paramType === 'header' && this.params.headers) {
- var key = param.name;
- var headerValue = this.params.headers[param.name];
- if (typeof this.params.headers[param.name] !== 'undefined')
- headers[key] = headerValue;
- }
- }
-
- // if there's a body, need to set the accepts header via requestContentType
- if (body && (this.type === 'POST' || this.type === 'PUT' || this.type === 'PATCH' || this.type === 'DELETE')) {
- if (this.opts.requestContentType)
- consumes = this.opts.requestContentType;
- } else {
- // if any form params, content type must be set
- if (definedFormParams.length > 0) {
- if (definedFileParams.length > 0)
- consumes = 'multipart/form-data';
- else
- consumes = 'application/x-www-form-urlencoded';
- }
- else if (this.type === 'DELETE')
- body = '{}';
- else if (this.type != 'DELETE')
- consumes = null;
- }
-
- if (consumes && this.operation.consumes) {
- if (this.operation.consumes.indexOf(consumes) === -1) {
- log('server doesn\'t consume ' + consumes + ', try ' + JSON.stringify(this.operation.consumes));
- }
- }
-
- if (this.opts && this.opts.responseContentType) {
- accepts = this.opts.responseContentType;
- } else {
- accepts = 'application/json';
- }
- if (accepts && operation.produces) {
- if (operation.produces.indexOf(accepts) === -1) {
- log('server can\'t produce ' + accepts);
- }
- }
-
- if ((consumes && body !== '') || (consumes === 'application/x-www-form-urlencoded'))
- headers['Content-Type'] = consumes;
- if (accepts)
- headers.Accept = accepts;
- return headers;
-};
-
-/**
- * SwaggerHttp is a wrapper for executing requests
- */
-var SwaggerHttp = function() {};
-
-SwaggerHttp.prototype.execute = function(obj, opts) {
- if(obj && (typeof obj.useJQuery === 'boolean'))
- this.useJQuery = obj.useJQuery;
- else
- this.useJQuery = this.isIE8();
-
- if(obj && typeof obj.body === 'object') {
- if(obj.body.type && obj.body.type !== 'formData')
- obj.body = JSON.stringify(obj.body);
- else {
- obj.contentType = false;
- obj.processData = false;
- // delete obj.cache;
- delete obj.headers['Content-Type'];
- }
- }
-
- if(this.useJQuery)
- return new JQueryHttpClient(opts).execute(obj);
- else
- return new ShredHttpClient(opts).execute(obj);
-};
-
-SwaggerHttp.prototype.isIE8 = function() {
- var detectedIE = false;
- if (typeof navigator !== 'undefined' && navigator.userAgent) {
- nav = navigator.userAgent.toLowerCase();
- if (nav.indexOf('msie') !== -1) {
- var version = parseInt(nav.split('msie')[1]);
- if (version <= 8) {
- detectedIE = true;
- }
- }
- }
- return detectedIE;
-};
-
-/*
- * JQueryHttpClient lets a browser take advantage of JQuery's cross-browser magic.
- * NOTE: when jQuery is available it will export both '$' and 'jQuery' to the global space.
- * Since we are using closures here we need to alias it for internal use.
- */
-var JQueryHttpClient = function(options) {
- "use strict";
- if(!jQuery){
- var jQuery = window.jQuery;
- }
-};
-
-JQueryHttpClient.prototype.execute = function(obj) {
- var cb = obj.on;
- var request = obj;
-
- obj.type = obj.method;
- obj.cache = false;
- delete obj.useJQuery;
-
- /*
- obj.beforeSend = function(xhr) {
- var key, results;
- if (obj.headers) {
- results = [];
- for (key in obj.headers) {
- if (key.toLowerCase() === "content-type") {
- results.push(obj.contentType = obj.headers[key]);
- } else if (key.toLowerCase() === "accept") {
- results.push(obj.accepts = obj.headers[key]);
- } else {
- results.push(xhr.setRequestHeader(key, obj.headers[key]));
- }
- }
- return results;
- }
- };*/
-
- obj.data = obj.body;
- delete obj.body;
- obj.complete = function(response, textStatus, opts) {
- var headers = {},
- headerArray = response.getAllResponseHeaders().split("\n");
-
- for(var i = 0; i < headerArray.length; i++) {
- var toSplit = headerArray[i].trim();
- if(toSplit.length === 0)
- continue;
- var separator = toSplit.indexOf(":");
- if(separator === -1) {
- // Name but no value in the header
- headers[toSplit] = null;
- continue;
- }
- var name = toSplit.substring(0, separator).trim(),
- value = toSplit.substring(separator + 1).trim();
- headers[name] = value;
- }
-
- var out = {
- url: request.url,
- method: request.method,
- status: response.status,
- statusText: response.statusText,
- data: response.responseText,
- headers: headers
- };
-
- var contentType = (headers["content-type"]||headers["Content-Type"]||null);
- if(contentType) {
- if(contentType.indexOf("application/json") === 0 || contentType.indexOf("+json") > 0) {
- try {
- out.obj = response.responseJSON || JSON.parse(out.data) || {};
- } catch (ex) {
- // do not set out.obj
- log("unable to parse JSON content");
- }
- }
- }
-
- if(response.status >= 200 && response.status < 300)
- cb.response(out);
- else if(response.status === 0 || (response.status >= 400 && response.status < 599))
- cb.error(out);
- else
- return cb.response(out);
- };
-
- jQuery.support.cors = true;
- return jQuery.ajax(obj);
-};
-
-/*
- * ShredHttpClient is a light-weight, node or browser HTTP client
- */
-var ShredHttpClient = function(opts) {
- this.opts = (opts||{});
- this.isInitialized = false;
-
- var identity, toString;
-
- if (typeof window !== 'undefined') {
- this.Shred = require("./shred");
- this.content = require("./shred/content");
- }
- else
- this.Shred = require("shred");
- this.shred = new this.Shred(opts);
-};
-
-ShredHttpClient.prototype.initShred = function () {
- this.isInitialized = true;
- this.registerProcessors(this.shred);
-};
-
-ShredHttpClient.prototype.registerProcessors = function(shred) {
- var identity = function(x) {
- return x;
- };
- var toString = function(x) {
- return x.toString();
- };
-
- if (typeof window !== 'undefined') {
- this.content.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
- parser: identity,
- stringify: toString
- });
- } else {
- this.Shred.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
- parser: identity,
- stringify: toString
- });
- }
-};
-
-ShredHttpClient.prototype.execute = function(obj) {
- if(!this.isInitialized)
- this.initShred();
-
- var cb = obj.on, res;
- var transform = function(response) {
- var out = {
- headers: response._headers,
- url: response.request.url,
- method: response.request.method,
- status: response.status,
- data: response.content.data
- };
-
- var headers = response._headers.normalized || response._headers;
- var contentType = (headers["content-type"]||headers["Content-Type"]||null);
-
- if(contentType) {
- if(contentType.indexOf("application/json") === 0 || contentType.indexOf("+json") > 0) {
- if(response.content.data && response.content.data !== "")
- try{
- out.obj = JSON.parse(response.content.data);
- }
- catch (e) {
- // unable to parse
- }
- else
- out.obj = {};
- }
- }
- return out;
- };
-
- // Transform an error into a usable response-like object
- var transformError = function (error) {
- var out = {
- // Default to a status of 0 - The client will treat this as a generic permissions sort of error
- status: 0,
- data: error.message || error
- };
-
- if (error.code) {
- out.obj = error;
-
- if (error.code === 'ENOTFOUND' || error.code === 'ECONNREFUSED') {
- // We can tell the client that this should be treated as a missing resource and not as a permissions thing
- out.status = 404;
- }
- }
- return out;
- };
-
- res = {
- error: function (response) {
- if (obj)
- return cb.error(transform(response));
- },
- // Catch the Shred error raised when the request errors as it is made (i.e. No Response is coming)
- request_error: function (err) {
- if (obj)
- return cb.error(transformError(err));
- },
- response: function (response) {
- if (obj) {
- return cb.response(transform(response));
- }
- }
- };
- if (obj) {
- obj.on = res;
- }
- return this.shred.request(obj);
-};
-
-
-var e = (typeof window !== 'undefined' ? window : exports);
-
-e.authorizations = authorizations = new SwaggerAuthorizations();
-e.ApiKeyAuthorization = ApiKeyAuthorization;
-e.PasswordAuthorization = PasswordAuthorization;
-e.CookieAuthorization = CookieAuthorization;
-e.SwaggerClient = SwaggerClient;
-e.SwaggerApi = SwaggerClient;
-e.Operation = Operation;
-e.Model = Model;
-e.addModel = addModel;
-e.Resolver = Resolver;
-})();
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/swagger-oauth.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/swagger-oauth.js deleted file mode 100644 index 26d99d5e..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/swagger-oauth.js +++ /dev/null @@ -1,294 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var appName;
-var popupMask;
-var popupDialog;
-var clientId;
-var realm;
-var oauth2KeyName;
-var redirect_uri;
-
-function handleLogin() {
- var scopes = [];
-
- var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
- if(auths) {
- var key;
- var defs = auths;
- for(key in defs) {
- var auth = defs[key];
- if(auth.type === 'oauth2' && auth.scopes) {
- oauth2KeyName = key;
- var scope;
- if(Array.isArray(auth.scopes)) {
- // 1.2 support
- var i;
- for(i = 0; i < auth.scopes.length; i++) {
- scopes.push(auth.scopes[i]);
- }
- }
- else {
- // 2.0 support
- for(scope in auth.scopes) {
- scopes.push({scope: scope, description: auth.scopes[scope]});
- }
- }
- }
- }
- }
-
- if(window.swaggerUi.api
- && window.swaggerUi.api.info) {
- appName = window.swaggerUi.api.info.title;
- }
-
- popupDialog = $(
- [
- '<div class="api-popup-dialog">',
- '<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
- '<div class="api-popup-content">',
- '<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
- '<a href="#">Learn how to use</a>',
- '</p>',
- '<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
- '<ul class="api-popup-scopes">',
- '</ul>',
- '<p class="error-msg"></p>',
- '<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
- '</div>',
- '</div>'].join(''));
- $(document.body).append(popupDialog);
-
- popup = popupDialog.find('ul.api-popup-scopes').empty();
- for (i = 0; i < scopes.length; i ++) {
- scope = scopes[i];
- str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"/>' + '<label for="scope_' + i + '">' + scope.scope;
- if (scope.description) {
- str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
- }
- str += '</label></li>';
- popup.append(str);
- }
-
- var $win = $(window),
- dw = $win.width(),
- dh = $win.height(),
- st = $win.scrollTop(),
- dlgWd = popupDialog.outerWidth(),
- dlgHt = popupDialog.outerHeight(),
- top = (dh -dlgHt)/2 + st,
- left = (dw - dlgWd)/2;
-
- popupDialog.css({
- top: (top < 0? 0 : top) + 'px',
- left: (left < 0? 0 : left) + 'px'
- });
-
- popupDialog.find('button.api-popup-cancel').click(function() {
- popupMask.hide();
- popupDialog.hide();
- popupDialog.empty();
- popupDialog = [];
- });
-
- $('button.api-popup-authbtn').unbind();
- popupDialog.find('button.api-popup-authbtn').click(function() {
- popupMask.hide();
- popupDialog.hide();
-
- var authSchemes = window.swaggerUi.api.authSchemes;
- var host = window.location;
- var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
- var redirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
- var url = null;
-
- for (var key in authSchemes) {
- if (authSchemes.hasOwnProperty(key)) {
- var flow = authSchemes[key].flow;
-
- if(authSchemes[key].type === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
- var dets = authSchemes[key];
- url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
- window.swaggerUi.tokenName = dets.tokenName || 'access_token';
- window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
- }
- else if(authSchemes[key].grantTypes) {
- // 1.2 support
- var o = authSchemes[key].grantTypes;
- for(var t in o) {
- if(o.hasOwnProperty(t) && t === 'implicit') {
- var dets = o[t];
- var ep = dets.loginEndpoint.url;
- url = dets.loginEndpoint.url + '?response_type=token';
- window.swaggerUi.tokenName = dets.tokenName;
- }
- else if (o.hasOwnProperty(t) && t === 'accessCode') {
- var dets = o[t];
- var ep = dets.tokenRequestEndpoint.url;
- url = dets.tokenRequestEndpoint.url + '?response_type=code';
- window.swaggerUi.tokenName = dets.tokenName;
- }
- }
- }
- }
- }
- var scopes = []
- var o = $('.api-popup-scopes').find('input:checked');
-
- for(k =0; k < o.length; k++) {
- var scope = $(o[k]).attr('scope');
-
- if (scopes.indexOf(scope) === -1)
- scopes.push(scope);
- }
-
- window.enabledScopes=scopes;
-
- redirect_uri = redirectUrl;
-
- url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
- url += '&realm=' + encodeURIComponent(realm);
- url += '&client_id=' + encodeURIComponent(clientId);
- url += '&scope=' + encodeURIComponent(scopes);
-
- window.open(url);
- });
-
- popupMask.show();
- popupDialog.show();
- return;
-}
-
-
-function handleLogout() {
- for(key in window.authorizations.authz){
- window.authorizations.remove(key)
- }
- window.enabledScopes = null;
- $('.api-ic.ic-on').addClass('ic-off');
- $('.api-ic.ic-on').removeClass('ic-on');
-
- // set the info box
- $('.api-ic.ic-warning').addClass('ic-error');
- $('.api-ic.ic-warning').removeClass('ic-warning');
-}
-
-function initOAuth(opts) {
- var o = (opts||{});
- var errors = [];
-
- appName = (o.appName||errors.push('missing appName'));
- popupMask = (o.popupMask||$('#api-common-mask'));
- popupDialog = (o.popupDialog||$('.api-popup-dialog'));
- clientId = (o.clientId||errors.push('missing client id'));
- realm = (o.realm||errors.push('missing realm'));
-
- if(errors.length > 0){
- log('auth unable initialize oauth: ' + errors);
- return;
- }
-
- $('pre code').each(function(i, e) {hljs.highlightBlock(e)});
- $('.api-ic').unbind();
- $('.api-ic').click(function(s) {
- if($(s.target).hasClass('ic-off'))
- handleLogin();
- else {
- handleLogout();
- }
- false;
- });
-}
-
-function processOAuthCode(data) {
- var params = {
- 'client_id': clientId,
- 'code': data.code,
- 'grant_type': 'authorization_code',
- 'redirect_uri': redirect_uri
- }
- $.ajax(
- {
- url : window.swaggerUi.tokenUrl,
- type: "POST",
- data: params,
- success:function(data, textStatus, jqXHR)
- {
- onOAuthComplete(data);
- },
- error: function(jqXHR, textStatus, errorThrown)
- {
- onOAuthComplete("");
- }
- });
-}
-
-function onOAuthComplete(token) {
- if(token) {
- if(token.error) {
- var checkbox = $('input[type=checkbox],.secured')
- checkbox.each(function(pos){
- checkbox[pos].checked = false;
- });
- alert(token.error);
- }
- else {
- var b = token[window.swaggerUi.tokenName];
- if(b){
- // if all roles are satisfied
- var o = null;
- $.each($('.auth #api_information_panel'), function(k, v) {
- var children = v;
- if(children && children.childNodes) {
- var requiredScopes = [];
- $.each((children.childNodes), function (k1, v1){
- var inner = v1.innerHTML;
- if(inner)
- requiredScopes.push(inner);
- });
- var diff = [];
- for(var i=0; i < requiredScopes.length; i++) {
- var s = requiredScopes[i];
- if(window.enabledScopes && window.enabledScopes.indexOf(s) == -1) {
- diff.push(s);
- }
- }
- if(diff.length > 0){
- o = v.parentNode;
- $(o.parentNode).find('.api-ic.ic-on').addClass('ic-off');
- $(o.parentNode).find('.api-ic.ic-on').removeClass('ic-on');
-
- // sorry, not all scopes are satisfied
- $(o).find('.api-ic').addClass('ic-warning');
- $(o).find('.api-ic').removeClass('ic-error');
- }
- else {
- o = v.parentNode;
- $(o.parentNode).find('.api-ic.ic-off').addClass('ic-on');
- $(o.parentNode).find('.api-ic.ic-off').removeClass('ic-off');
-
- // all scopes are satisfied
- $(o).find('.api-ic').addClass('ic-info');
- $(o).find('.api-ic').removeClass('ic-warning');
- $(o).find('.api-ic').removeClass('ic-error');
- }
- }
- });
- window.authorizations.add(oauth2KeyName, new ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
- }
- }
- }
-}
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/underscore-min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/underscore-min.js deleted file mode 100644 index d39231c5..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/underscore-min.js +++ /dev/null @@ -1,21 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// Underscore.js 1.7.0
-// http://underscorejs.org
-// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=function(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])<u?i=o+1:a=o}return i},h.toArray=function(n){return n?h.isArray(n)?a.call(n):n.length===+n.length?h.map(n,h.identity):h.values(n):[]},h.size=function(n){return null==n?0:n.length===+n.length?n.length:h.keys(n).length},h.partition=function(n,t,r){t=h.iteratee(t,r);var e=[],u=[];return h.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},h.first=h.head=h.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.length-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.push(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.call(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},h.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.defer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(arguments,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this);
-//# sourceMappingURL=underscore-min.map
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/o2c.html b/catalog-core/catalog-mgr/src/main/resources/api-doc/o2c.html deleted file mode 100644 index a2336bdf..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/o2c.html +++ /dev/null @@ -1,37 +0,0 @@ -<!--
-
- Copyright 2016 ZTE Corporation.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<script>
-var qp = null;
-if(window.location.hash) {
- qp = location.hash.substring(1);
-}
-else {
- qp = location.search.substring(1);
-}
-qp = qp ? JSON.parse('{"' + qp.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
- function(key, value) {
- return key===""?value:decodeURIComponent(value) }
- ):{}
-
-if (window.opener.swaggerUi.tokenUrl)
- window.opener.processOAuthCode(qp);
-else
- window.opener.onOAuthComplete(qp);
-
-window.close();
-</script>
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.js deleted file mode 100644 index d650a030..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.js +++ /dev/null @@ -1,2255 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/** - * swagger-ui - Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API - * @version v2.1.8-M1 - * @link http://swagger.io - * @license Apache 2.0 - */ -$(function() {
-
- // Helper function for vertically aligning DOM elements
- // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
- $.fn.vAlign = function() {
- return this.each(function(i){
- var ah = $(this).height();
- var ph = $(this).parent().height();
- var mh = (ph - ah) / 2;
- $(this).css('margin-top', mh);
- });
- };
-
- $.fn.stretchFormtasticInputWidthToParent = function() {
- return this.each(function(i){
- var p_width = $(this).closest("form").innerWidth();
- var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest("form").css('padding-right'), 10);
- var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
- $(this).css('width', p_width - p_padding - this_padding);
- });
- };
-
- $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
-
- // Vertically center these paragraphs
- // Parent may need a min-height for this to work..
- $('ul.downplayed li div.content p').vAlign();
-
- // When a sandbox form is submitted..
- $("form.sandbox").submit(function(){
-
- var error_free = true;
-
- // Cycle through the forms required inputs
- $(this).find("input.required").each(function() {
-
- // Remove any existing error styles from the input
- $(this).removeClass('error');
-
- // Tack the error style on if the input is empty..
- if ($(this).val() == '') {
- $(this).addClass('error');
- $(this).wiggle();
- error_free = false;
- }
-
- });
-
- return error_free;
- });
-
-});
-
-function clippyCopiedCallback(a) {
- $('#api_key_copied').fadeIn().delay(1000).fadeOut();
-
- // var b = $("#clippy_tooltip_" + a);
- // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
- // b.attr("title", "copy to clipboard")
- // },
- // 500))
-}
-
-// Logging function that accounts for browsers that don't have window.console
-log = function(){
- log.history = log.history || [];
- log.history.push(arguments);
- if(this.console){
- console.log( Array.prototype.slice.call(arguments)[0] );
- }
-};
-
-// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
-if (Function.prototype.bind && console && typeof console.log == "object") {
- [
- "log","info","warn","error","assert","dir","clear","profile","profileEnd"
- ].forEach(function (method) {
- console[method] = this.bind(console[method], console);
- }, Function.prototype.call);
-}
-
-var Docs = {
-
- shebang: function() {
-
- // If shebang has an operation nickname in it..
- // e.g. /docs/#!/words/get_search
- var fragments = $.param.fragment().split('/');
- fragments.shift(); // get rid of the bang
-
- switch (fragments.length) {
- case 1:
- // Expand all operations for the resource and scroll to it
- var dom_id = 'resource_' + fragments[0];
-
- Docs.expandEndpointListForResource(fragments[0]);
- $("#"+dom_id).slideto({highlight: false});
- break;
- case 2:
- // Refer to the endpoint DOM element, e.g. #words_get_search
-
- // Expand Resource
- Docs.expandEndpointListForResource(fragments[0]);
- $("#"+dom_id).slideto({highlight: false});
-
- // Expand operation
- var li_dom_id = fragments.join('_');
- var li_content_dom_id = li_dom_id + "_content";
-
-
- Docs.expandOperation($('#'+li_content_dom_id));
- $('#'+li_dom_id).slideto({highlight: false});
- break;
- }
-
- },
-
- toggleEndpointListForResource: function(resource) {
- var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
- if (elem.is(':visible')) {
- Docs.collapseEndpointListForResource(resource);
- } else {
- Docs.expandEndpointListForResource(resource);
- }
- },
-
- // Expand resource
- expandEndpointListForResource: function(resource) {
- var resource = Docs.escapeResourceName(resource);
- if (resource == '') {
- $('.resource ul.endpoints').slideDown();
- return;
- }
-
- $('li#resource_' + resource).addClass('active');
-
- var elem = $('li#resource_' + resource + ' ul.endpoints');
- elem.slideDown();
- },
-
- // Collapse resource and mark as explicitly closed
- collapseEndpointListForResource: function(resource) {
- var resource = Docs.escapeResourceName(resource);
- if (resource == '') {
- $('.resource ul.endpoints').slideUp();
- return;
- }
-
- $('li#resource_' + resource).removeClass('active');
-
- var elem = $('li#resource_' + resource + ' ul.endpoints');
- elem.slideUp();
- },
-
- expandOperationsForResource: function(resource) {
- // Make sure the resource container is open..
- Docs.expandEndpointListForResource(resource);
-
- if (resource == '') {
- $('.resource ul.endpoints li.operation div.content').slideDown();
- return;
- }
-
- $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
- Docs.expandOperation($(this));
- });
- },
-
- collapseOperationsForResource: function(resource) {
- // Make sure the resource container is open..
- Docs.expandEndpointListForResource(resource);
-
- if (resource == '') {
- $('.resource ul.endpoints li.operation div.content').slideUp();
- return;
- }
-
- $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
- Docs.collapseOperation($(this));
- });
- },
-
- escapeResourceName: function(resource) {
- return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
- },
-
- expandOperation: function(elem) {
- elem.slideDown();
- },
-
- collapseOperation: function(elem) {
- elem.slideUp();
- }
-};
- -this["Handlebars"] = this["Handlebars"] || {}; -this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {}; -this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'>" - + escapeExpression(((helper = (helper = helpers.keyName || (depth0 != null ? depth0.keyName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"keyName","hash":{},"data":data}) : helper))) - + "</div>\n <input placeholder=\"api_key\" class=\"auth_input\" id=\"input_apiKey_entry\" name=\"apiKey\" type=\"text\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_api_key\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n"; -},"useData":true}); -var SwaggerUi, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -SwaggerUi = (function(_super) { - __extends(SwaggerUi, _super); - - function SwaggerUi() { - return SwaggerUi.__super__.constructor.apply(this, arguments); - } - - SwaggerUi.prototype.dom_id = "swagger_ui"; - - SwaggerUi.prototype.options = null; - - SwaggerUi.prototype.api = null; - - SwaggerUi.prototype.headerView = null; - - SwaggerUi.prototype.mainView = null; - - SwaggerUi.prototype.initialize = function(options) { - if (options == null) { - options = {}; - } - if (options.dom_id != null) { - this.dom_id = options.dom_id; - delete options.dom_id; - } - if (options.supportedSubmitMethods == null) { - options.supportedSubmitMethods = ['get', 'put', 'post', 'delete', 'head', 'options', 'patch']; - } - if ($('#' + this.dom_id) == null) { - $('body').append('<div id="' + this.dom_id + '"></div>'); - } - this.options = options; - this.options.success = (function(_this) { - return function() { - return _this.render(); - }; - })(this); - this.options.progress = (function(_this) { - return function(d) { - return _this.showMessage(d); - }; - })(this); - this.options.failure = (function(_this) { - return function(d) { - return _this.onLoadFailure(d); - }; - })(this); - this.headerView = new HeaderView({ - el: $('#header') - }); - return this.headerView.on('update-swagger-ui', (function(_this) { - return function(data) { - return _this.updateSwaggerUi(data); - }; - })(this)); - }; - - SwaggerUi.prototype.setOption = function(option, value) { - return this.options[option] = value; - }; - - SwaggerUi.prototype.getOption = function(option) { - return this.options[option]; - }; - - SwaggerUi.prototype.updateSwaggerUi = function(data) { - this.options.url = data.url; - return this.load(); - }; - - SwaggerUi.prototype.load = function() { - var url, _ref; - if ((_ref = this.mainView) != null) { - _ref.clear(); - } - url = this.options.url; - if (url && url.indexOf("http") !== 0) { - url = this.buildUrl(window.location.href.toString(), url); - } - this.options.url = url; - this.headerView.update(url); - return this.api = new SwaggerClient(this.options); - }; - - SwaggerUi.prototype.collapseAll = function() { - return Docs.collapseEndpointListForResource(''); - }; - - SwaggerUi.prototype.listAll = function() { - return Docs.collapseOperationsForResource(''); - }; - - SwaggerUi.prototype.expandAll = function() { - return Docs.expandOperationsForResource(''); - }; - - SwaggerUi.prototype.render = function() { - this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...'); - this.mainView = new MainView({ - model: this.api, - el: $('#' + this.dom_id), - swaggerOptions: this.options - }).render(); - this.showMessage(); - switch (this.options.docExpansion) { - case "full": - this.expandAll(); - break; - case "list": - this.listAll(); - } - this.renderGFM(); - if (this.options.onComplete) { - this.options.onComplete(this.api, this); - } - return setTimeout((function(_this) { - return function() { - return Docs.shebang(); - }; - })(this), 100); - }; - - SwaggerUi.prototype.buildUrl = function(base, url) { - var endOfPath, parts; - if (url.indexOf("/") === 0) { - parts = base.split("/"); - base = parts[0] + "//" + parts[2]; - return base + url; - } else { - endOfPath = base.length; - if (base.indexOf("?") > -1) { - endOfPath = Math.min(endOfPath, base.indexOf("?")); - } - if (base.indexOf("#") > -1) { - endOfPath = Math.min(endOfPath, base.indexOf("#")); - } - base = base.substring(0, endOfPath); - if (base.indexOf("/", base.length - 1) !== -1) { - return base + url; - } - return base + "/" + url; - } - }; - - SwaggerUi.prototype.showMessage = function(data) { - if (data == null) { - data = ''; - } - $('#message-bar').removeClass('message-fail'); - $('#message-bar').addClass('message-success'); - return $('#message-bar').html(data); - }; - - SwaggerUi.prototype.onLoadFailure = function(data) { - var val; - if (data == null) { - data = ''; - } - $('#message-bar').removeClass('message-success'); - $('#message-bar').addClass('message-fail'); - val = $('#message-bar').html(data); - if (this.options.onFailure != null) { - this.options.onFailure(data); - } - return val; - }; - - SwaggerUi.prototype.renderGFM = function(data) { - if (data == null) { - data = ''; - } - return $('.markdown').each(function(index) { - return $(this).html(marked($(this).html())); - }); - }; - - return SwaggerUi; - -})(Backbone.Router); - -window.SwaggerUi = SwaggerUi; - -this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\">Username</div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\">Password</div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n"; - },"useData":true}); -Handlebars.registerHelper('sanitize', function(html) { - html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ''); - return new Handlebars.SafeString(html); -}); - -this["Handlebars"]["templates"]["content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"2":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, buffer = " <option value=\""; - stack1 = lambda(depth0, depth0); - if (stack1 != null) { buffer += stack1; } - buffer += "\">"; - stack1 = lambda(depth0, depth0); - if (stack1 != null) { buffer += stack1; } - return buffer + "</option>\n"; -},"4":function(depth0,helpers,partials,data) { - return " <option value=\"application/json\">application/json</option>\n"; - },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, buffer = "<label for=\"contentType\"></label>\n<select name=\"contentType\">\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "</select>\n"; -},"useData":true}); -var ApiKeyButton, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -ApiKeyButton = (function(_super) { - __extends(ApiKeyButton, _super); - - function ApiKeyButton() { - return ApiKeyButton.__super__.constructor.apply(this, arguments); - } - - ApiKeyButton.prototype.initialize = function() {}; - - ApiKeyButton.prototype.render = function() { - var template; - template = this.template(); - $(this.el).html(template(this.model)); - return this; - }; - - ApiKeyButton.prototype.events = { - "click #apikey_button": "toggleApiKeyContainer", - "click #apply_api_key": "applyApiKey" - }; - - ApiKeyButton.prototype.applyApiKey = function() { - var elem; - window.authorizations.add(this.model.name, new ApiKeyAuthorization(this.model.name, $("#input_apiKey_entry").val(), this.model["in"])); - window.swaggerUi.load(); - return elem = $('#apikey_container').show(); - }; - - ApiKeyButton.prototype.toggleApiKeyContainer = function() { - var elem; - if ($('#apikey_container').length > 0) { - elem = $('#apikey_container').first(); - if (elem.is(':visible')) { - return elem.hide(); - } else { - $('.auth_container').hide(); - return elem.show(); - } - } - }; - - ApiKeyButton.prototype.template = function() { - return Handlebars.templates.apikey_button_view; - }; - - return ApiKeyButton; - -})(Backbone.View); - -this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">" - + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0)) - + "</div>\n <div class=\"info_description markdown\">"; - stack1 = lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1), depth0); - if (stack1 != null) { buffer += stack1; } - buffer += "</div>\n "; - stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "\n "; - stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "\n "; - stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), {"name":"if","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "\n "; - stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "\n "; - stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "\n"; -},"2":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; - return "<div class=\"info_tos\"><a href=\"" - + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), depth0)) - + "\">Terms of service</a></div>"; -},"4":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; - return "<div class='info_name'>Created by " - + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), depth0)) - + "</div>"; -},"6":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; - return "<div class='info_url'>See more at <a href=\"" - + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0)) - + "\">" - + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0)) - + "</a></div>"; -},"8":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; - return "<div class='info_email'><a href=\"mailto:" - + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), depth0)) - + "?subject=" - + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0)) - + "\">Contact the developer</a></div>"; -},"10":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; - return "<div class='info_license'><a href='" - + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.url : stack1), depth0)) - + "'>" - + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.name : stack1), depth0)) - + "</a></div>"; -},"12":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; - return " , <span style=\"font-variant: small-caps\">api version</span>: " - + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), depth0)) - + "\n "; -},"14":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <span style=\"float:right\"><a href=\"" - + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper))) - + "/debug?url=" - + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper))) - + "\"><img id=\"validator\" src=\"" - + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper))) - + "?url=" - + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper))) - + "\"></a>\n </span>\n"; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class='info' id='api_info'>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.info : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: " - + escapeExpression(((helper = (helper = helpers.basePath || (depth0 != null ? depth0.basePath : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"basePath","hash":{},"data":data}) : helper))) - + "\n"; - stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "]\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.validatorUrl : depth0), {"name":"if","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + " </h4>\n </div>\n</div>\n"; -},"useData":true}); -var BasicAuthButton, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -BasicAuthButton = (function(_super) { - __extends(BasicAuthButton, _super); - - function BasicAuthButton() { - return BasicAuthButton.__super__.constructor.apply(this, arguments); - } - - BasicAuthButton.prototype.initialize = function() {}; - - BasicAuthButton.prototype.render = function() { - var template; - template = this.template(); - $(this.el).html(template(this.model)); - return this; - }; - - BasicAuthButton.prototype.events = { - "click #basic_auth_button": "togglePasswordContainer", - "click #apply_basic_auth": "applyPassword" - }; - - BasicAuthButton.prototype.applyPassword = function() { - var elem, password, username; - username = $(".input_username").val(); - password = $(".input_password").val(); - window.authorizations.add(this.model.type, new PasswordAuthorization("basic", username, password)); - window.swaggerUi.load(); - return elem = $('#basic_auth_container').hide(); - }; - - BasicAuthButton.prototype.togglePasswordContainer = function() { - var elem; - if ($('#basic_auth_container').length > 0) { - elem = $('#basic_auth_container').show(); - if (elem.is(':visible')) { - return elem.slideUp(); - } else { - $('.auth_container').hide(); - return elem.show(); - } - } - }; - - BasicAuthButton.prototype.template = function() { - return Handlebars.templates.basic_auth_button_view; - }; - - return BasicAuthButton; - -})(Backbone.View); - -this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - return "deprecated"; - },"3":function(depth0,helpers,partials,data) { - return " <h4>Warning: Deprecated</h4>\n"; - },"5":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4>Implementation Notes</h4>\n <p class=\"markdown\">"; - stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</p>\n"; -},"7":function(depth0,helpers,partials,data) { - return " <div class=\"auth\">\n <span class=\"api-ic ic-error\"></span>"; - },"9":function(depth0,helpers,partials,data) { - var stack1, buffer = " <div id=\"api_information_panel\" style=\"top: 526px; left: 776px; display: none;\">\n"; - stack1 = helpers.each.call(depth0, depth0, {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + " </div>\n"; -},"10":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div title='"; - stack1 = lambda((depth0 != null ? depth0.description : depth0), depth0); - if (stack1 != null) { buffer += stack1; } - return buffer + "'>" - + escapeExpression(lambda((depth0 != null ? depth0.scope : depth0), depth0)) - + "</div>\n"; -},"12":function(depth0,helpers,partials,data) { - return "</div>"; - },"14":function(depth0,helpers,partials,data) { - return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n"; - },"16":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <h4>Response Class (Status " - + escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper))) - + ")</h4>\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n"; -},"18":function(depth0,helpers,partials,data) { - return " <h4>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\">Parameter</th>\n <th style=\"width: 310px; max-width: 310px\">Value</th>\n <th style=\"width: 200px; max-width: 200px\">Description</th>\n <th style=\"width: 100px; max-width: 100px\">Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\">Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n"; - },"20":function(depth0,helpers,partials,data) { - return " <div style='margin:0;padding:0;display:inline'></div>\n <h4>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n <th>Response Model</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n"; - },"22":function(depth0,helpers,partials,data) { - return ""; -},"24":function(depth0,helpers,partials,data) { - return " <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n"; - },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='" - + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper))) - + " operation' id='" - + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper))) - + "_" - + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) - + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/" - + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper))) - + "/" - + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) - + "' class=\"toggleOperation\">" - + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper))) - + "</a>\n </span>\n <span class='path'>\n <a href='#!/" - + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper))) - + "/" - + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) - + "' class=\"toggleOperation "; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "\">" - + escapeExpression(((helper = (helper = helpers.path || (depth0 != null ? depth0.path : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"path","hash":{},"data":data}) : helper))) - + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/" - + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper))) - + "/" - + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) - + "' class=\"toggleOperation\">"; - stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - buffer += "</a>\n </li>\n </ul>\n </div>\n <div class='content' id='" - + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper))) - + "_" - + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) - + "_content' style='display:none'>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.description : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - buffer += "\n"; - stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.oauth : depth0), {"name":"each","hash":{},"fn":this.program(9, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += " "; - stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - buffer += "\n"; - stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += " <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(18, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(20, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.program(24, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + " </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n"; -},"useData":true}); -var ContentTypeView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -ContentTypeView = (function(_super) { - __extends(ContentTypeView, _super); - - function ContentTypeView() { - return ContentTypeView.__super__.constructor.apply(this, arguments); - } - - ContentTypeView.prototype.initialize = function() {}; - - ContentTypeView.prototype.render = function() { - var template; - template = this.template(); - $(this.el).html(template(this.model)); - $('label[for=contentType]', $(this.el)).text('Response Content Type'); - return this; - }; - - ContentTypeView.prototype.template = function() { - return Handlebars.templates.content_type; - }; - - return ContentTypeView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["param"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"2":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <input type=\"file\" name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'/>\n <div class=\"parameter-content-type\" />\n"; -},"4":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"5":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <textarea class='body-textarea' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'>" - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n"; -},"7":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <textarea class='body-textarea' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n"; -},"9":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(10, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"10":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(13, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"11":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <input class='parameter' minlength='0' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "' placeholder='' type='text' value='" - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "'/>\n"; -},"13":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <input class='parameter' minlength='0' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "' placeholder='' type='text' value=''/>\n"; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'>" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "</td>\n<td>\n\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "\n</td>\n<td class=\"markdown\">"; - stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - buffer += "</td>\n<td>"; - stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n"; -},"useData":true}); -var HeaderView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -HeaderView = (function(_super) { - __extends(HeaderView, _super); - - function HeaderView() { - return HeaderView.__super__.constructor.apply(this, arguments); - } - - HeaderView.prototype.events = { - 'click #show-pet-store-icon': 'showPetStore', - 'click #show-wordnik-dev-icon': 'showWordnikDev', - 'click #explore': 'showCustom', - 'keyup #input_baseUrl': 'showCustomOnKeyup', - 'keyup #input_apiKey': 'showCustomOnKeyup' - }; - - HeaderView.prototype.initialize = function() {}; - - HeaderView.prototype.showPetStore = function(e) { - return this.trigger('update-swagger-ui', { - url: "http://petstore.swagger.wordnik.com/api/api-docs" - }); - }; - - HeaderView.prototype.showWordnikDev = function(e) { - return this.trigger('update-swagger-ui', { - url: "http://api.wordnik.com/v4/resources.json" - }); - }; - - HeaderView.prototype.showCustomOnKeyup = function(e) { - if (e.keyCode === 13) { - return this.showCustom(); - } - }; - - HeaderView.prototype.showCustom = function(e) { - if (e != null) { - e.preventDefault(); - } - return this.trigger('update-swagger-ui', { - url: $('#input_baseUrl').val(), - apiKey: $('#input_apiKey').val() - }); - }; - - HeaderView.prototype.update = function(url, apiKey, trigger) { - if (trigger == null) { - trigger = false; - } - $('#input_baseUrl').val(url); - if (trigger) { - return this.trigger('update-swagger-ui', { - url: url - }); - } - }; - - return HeaderView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["param_list"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - return " multiple='multiple'"; - },"3":function(depth0,helpers,partials,data) { - return ""; -},"5":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.program(6, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"6":function(depth0,helpers,partials,data) { - var stack1, helperMissing=helpers.helperMissing, buffer = ""; - stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(3, data),"inverse":this.program(7, data),"data":data})); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"7":function(depth0,helpers,partials,data) { - return " <option selected=\"\" value=''></option>\n"; - },"9":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.program(12, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"10":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <option selected=\"\" value='" - + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper))) - + "'>" - + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper))) - + " (default)</option>\n"; -},"12":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <option value='" - + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper))) - + "'>" - + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper))) - + "</option>\n"; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'>" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "</td>\n<td>\n <select "; - stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data})); - if (stack1 != null) { buffer += stack1; } - buffer += " class='parameter' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.program(5, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - stack1 = helpers.each.call(depth0, ((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1), {"name":"each","hash":{},"fn":this.program(9, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += " </select>\n</td>\n<td class=\"markdown\">"; - stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - buffer += "</td>\n<td>"; - stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>"; -},"useData":true}); -var MainView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -MainView = (function(_super) { - var sorters; - - __extends(MainView, _super); - - function MainView() { - return MainView.__super__.constructor.apply(this, arguments); - } - - sorters = { - 'alpha': function(a, b) { - return a.path.localeCompare(b.path); - }, - 'method': function(a, b) { - return a.method.localeCompare(b.method); - } - }; - - MainView.prototype.initialize = function(opts) { - var auth, key, value, _ref; - if (opts == null) { - opts = {}; - } - this.model.auths = []; - _ref = this.model.securityDefinitions; - for (key in _ref) { - value = _ref[key]; - auth = { - name: key, - type: value.type, - value: value - }; - this.model.auths.push(auth); - } - if (this.model.swaggerVersion === "2.0") { - if ("validatorUrl" in opts.swaggerOptions) { - return this.model.validatorUrl = opts.swaggerOptions.validatorUrl; - } else if (this.model.url.indexOf("localhost") > 0) { - return this.model.validatorUrl = null; - } else { - return this.model.validatorUrl = "http://online.swagger.io/validator"; - } - } - }; - - MainView.prototype.render = function() { - var auth, button, counter, id, name, resource, resources, _i, _len, _ref; - if (this.model.securityDefinitions) { - for (name in this.model.securityDefinitions) { - auth = this.model.securityDefinitions[name]; - if (auth.type === "apiKey" && $("#apikey_button").length === 0) { - button = new ApiKeyButton({ - model: auth - }).render().el; - $('.auth_main_container').append(button); - } - if (auth.type === "basicAuth" && $("#basic_auth_button").length === 0) { - button = new BasicAuthButton({ - model: auth - }).render().el; - $('.auth_main_container').append(button); - } - } - } - $(this.el).html(Handlebars.templates.main(this.model)); - resources = {}; - counter = 0; - _ref = this.model.apisArray; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - resource = _ref[_i]; - id = resource.name; - while (typeof resources[id] !== 'undefined') { - id = id + "_" + counter; - counter += 1; - } - resource.id = id; - resources[id] = resource; - this.addResource(resource, this.model.auths); - } - $('.propWrap').hover(function() { - return $('.optionsWrapper', $(this)).show(); - }, function() { - return $('.optionsWrapper', $(this)).hide(); - }); - return this; - }; - - MainView.prototype.addResource = function(resource, auths) { - var resourceView; - resource.id = resource.id.replace(/\s/g, '_'); - resourceView = new ResourceView({ - model: resource, - tagName: 'li', - id: 'resource_' + resource.id, - className: 'resource', - auths: auths, - swaggerOptions: this.options.swaggerOptions - }); - return $('#resources').append(resourceView.render().el); - }; - - MainView.prototype.clear = function() { - return $(this.el).html(''); - }; - - return MainView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["param_readonly"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <textarea class='body-textarea' readonly='readonly' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'>" - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "</textarea>\n"; -},"3":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"4":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " " - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "\n"; -},"6":function(depth0,helpers,partials,data) { - return " (empty)\n"; - },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'>" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "</td>\n<td>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "</td>\n<td class=\"markdown\">"; - stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - buffer += "</td>\n<td>"; - stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n"; -},"useData":true}); -this["Handlebars"]["templates"]["param_readonly_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'>" - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "</textarea>\n"; -},"3":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"4":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " " - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "\n"; -},"6":function(depth0,helpers,partials,data) { - return " (empty)\n"; - },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'>" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "</td>\n<td>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "</td>\n<td class=\"markdown\">"; - stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - buffer += "</td>\n<td>"; - stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n"; -},"useData":true}); -var OperationView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -OperationView = (function(_super) { - __extends(OperationView, _super); - - function OperationView() { - return OperationView.__super__.constructor.apply(this, arguments); - } - - OperationView.prototype.invocationUrl = null; - - OperationView.prototype.events = { - 'submit .sandbox': 'submitOperation', - 'click .submit': 'submitOperation', - 'click .response_hider': 'hideResponse', - 'click .toggleOperation': 'toggleOperationContent', - 'mouseenter .api-ic': 'mouseEnter', - 'mouseout .api-ic': 'mouseExit' - }; - - OperationView.prototype.initialize = function(opts) { - if (opts == null) { - opts = {}; - } - this.auths = opts.auths; - this.parentId = this.model.parentId; - this.nickname = this.model.nickname; - return this; - }; - - OperationView.prototype.mouseEnter = function(e) { - var elem, hgh, pos, scMaxX, scMaxY, scX, scY, wd, x, y; - elem = $(this.el).find('.content'); - x = e.pageX; - y = e.pageY; - scX = $(window).scrollLeft(); - scY = $(window).scrollTop(); - scMaxX = scX + $(window).width(); - scMaxY = scY + $(window).height(); - wd = elem.width(); - hgh = elem.height(); - if (x + wd > scMaxX) { - x = scMaxX - wd; - } - if (x < scX) { - x = scX; - } - if (y + hgh > scMaxY) { - y = scMaxY - hgh; - } - if (y < scY) { - y = scY; - } - pos = {}; - pos.top = y; - pos.left = x; - elem.css(pos); - return $(e.currentTarget.parentNode).find('#api_information_panel').show(); - }; - - OperationView.prototype.mouseExit = function(e) { - return $(e.currentTarget.parentNode).find('#api_information_panel').hide(); - }; - - OperationView.prototype.render = function() { - var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, modelAuths, o, param, ref, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, type, v, value, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4; - isMethodSubmissionSupported = jQuery.inArray(this.model.method, this.model.supportedSubmitMethods()) >= 0; - if (!isMethodSubmissionSupported) { - this.model.isReadOnly = true; - } - this.model.description = this.model.description || this.model.notes; - if (this.model.description) { - this.model.description = this.model.description.replace(/(?:\r\n|\r|\n)/g, '<br />'); - } - this.model.oauth = null; - modelAuths = this.model.authorizations || this.model.security; - if (modelAuths) { - if (Array.isArray(modelAuths)) { - for (_i = 0, _len = modelAuths.length; _i < _len; _i++) { - auths = modelAuths[_i]; - for (key in auths) { - auth = auths[key]; - for (a in this.auths) { - auth = this.auths[a]; - if (auth.type === 'oauth2') { - this.model.oauth = {}; - this.model.oauth.scopes = []; - _ref = auth.value.scopes; - for (k in _ref) { - v = _ref[k]; - scopeIndex = auths[key].indexOf(k); - if (scopeIndex >= 0) { - o = { - scope: k, - description: v - }; - this.model.oauth.scopes.push(o); - } - } - } - } - } - } - } else { - for (k in modelAuths) { - v = modelAuths[k]; - if (k === "oauth2") { - if (this.model.oauth === null) { - this.model.oauth = {}; - } - if (this.model.oauth.scopes === void 0) { - this.model.oauth.scopes = []; - } - for (_j = 0, _len1 = v.length; _j < _len1; _j++) { - o = v[_j]; - this.model.oauth.scopes.push(o); - } - } - } - } - } - if (typeof this.model.responses !== 'undefined') { - this.model.responseMessages = []; - _ref1 = this.model.responses; - for (code in _ref1) { - value = _ref1[code]; - schema = null; - schemaObj = this.model.responses[code].schema; - if (schemaObj && schemaObj['$ref']) { - schema = schemaObj['$ref']; - if (schema.indexOf('#/definitions/') === 0) { - schema = schema.substring('#/definitions/'.length); - } - } - this.model.responseMessages.push({ - code: code, - message: value.description, - responseModel: schema - }); - } - } - if (typeof this.model.responseMessages === 'undefined') { - this.model.responseMessages = []; - } - signatureModel = null; - if (this.model.successResponse) { - successResponse = this.model.successResponse; - for (key in successResponse) { - value = successResponse[key]; - this.model.successCode = key; - if (typeof value === 'object' && typeof value.createJSONSample === 'function') { - signatureModel = { - sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2), - isParam: false, - signature: value.getMockSignature() - }; - } - } - } else if (this.model.responseClassSignature && this.model.responseClassSignature !== 'string') { - signatureModel = { - sampleJSON: this.model.responseSampleJSON, - isParam: false, - signature: this.model.responseClassSignature - }; - } - $(this.el).html(Handlebars.templates.operation(this.model)); - if (signatureModel) { - responseSignatureView = new SignatureView({ - model: signatureModel, - tagName: 'div' - }); - $('.model-signature', $(this.el)).append(responseSignatureView.render().el); - } else { - this.model.responseClassSignature = 'string'; - $('.model-signature', $(this.el)).html(this.model.type); - } - contentTypeModel = { - isParam: false - }; - contentTypeModel.consumes = this.model.consumes; - contentTypeModel.produces = this.model.produces; - _ref2 = this.model.parameters; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - param = _ref2[_k]; - type = param.type || param.dataType || ''; - if (typeof type === 'undefined') { - schema = param.schema; - if (schema && schema['$ref']) { - ref = schema['$ref']; - if (ref.indexOf('#/definitions/') === 0) { - type = ref.substring('#/definitions/'.length); - } else { - type = ref; - } - } - } - if (type && type.toLowerCase() === 'file') { - if (!contentTypeModel.consumes) { - contentTypeModel.consumes = 'multipart/form-data'; - } - } - param.type = type; - } - responseContentTypeView = new ResponseContentTypeView({ - model: contentTypeModel - }); - $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el); - _ref3 = this.model.parameters; - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - param = _ref3[_l]; - this.addParameter(param, contentTypeModel.consumes); - } - _ref4 = this.model.responseMessages; - for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) { - statusCode = _ref4[_m]; - this.addStatusCode(statusCode); - } - return this; - }; - - OperationView.prototype.addParameter = function(param, consumes) { - var paramView; - param.consumes = consumes; - paramView = new ParameterView({ - model: param, - tagName: 'tr', - readOnly: this.model.isReadOnly - }); - return $('.operation-params', $(this.el)).append(paramView.render().el); - }; - - OperationView.prototype.addStatusCode = function(statusCode) { - var statusCodeView; - statusCodeView = new StatusCodeView({ - model: statusCode, - tagName: 'tr' - }); - return $('.operation-status', $(this.el)).append(statusCodeView.render().el); - }; - - OperationView.prototype.submitOperation = function(e) { - var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2; - if (e != null) { - e.preventDefault(); - } - form = $('.sandbox', $(this.el)); - error_free = true; - form.find("input.required").each(function() { - $(this).removeClass("error"); - if (jQuery.trim($(this).val()) === "") { - $(this).addClass("error"); - $(this).wiggle({ - callback: (function(_this) { - return function() { - return $(_this).focus(); - }; - })(this) - }); - return error_free = false; - } - }); - form.find("textarea.required").each(function() { - $(this).removeClass("error"); - if (jQuery.trim($(this).val()) === "") { - $(this).addClass("error"); - $(this).wiggle({ - callback: (function(_this) { - return function() { - return $(_this).focus(); - }; - })(this) - }); - return error_free = false; - } - }); - if (error_free) { - map = {}; - opts = { - parent: this - }; - isFileUpload = false; - _ref = form.find("input"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - o = _ref[_i]; - if ((o.value != null) && jQuery.trim(o.value).length > 0) { - map[o.name] = o.value; - } - if (o.type === "file") { - map[o.name] = o.files[0]; - isFileUpload = true; - } - } - _ref1 = form.find("textarea"); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - o = _ref1[_j]; - if ((o.value != null) && jQuery.trim(o.value).length > 0) { - map[o.name] = o.value; - } - } - _ref2 = form.find("select"); - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - o = _ref2[_k]; - val = this.getSelectedValue(o); - if ((val != null) && jQuery.trim(val).length > 0) { - map[o.name] = val; - } - } - opts.responseContentType = $("div select[name=responseContentType]", $(this.el)).val(); - opts.requestContentType = $("div select[name=parameterContentType]", $(this.el)).val(); - $(".response_throbber", $(this.el)).show(); - if (isFileUpload) { - return this.handleFileUpload(map, form); - } else { - return this.model["do"](map, opts, this.showCompleteStatus, this.showErrorStatus, this); - } - } - }; - - OperationView.prototype.success = function(response, parent) { - return parent.showCompleteStatus(response); - }; - - OperationView.prototype.handleFileUpload = function(map, form) { - var bodyParam, el, headerParams, o, obj, param, params, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3; - _ref = form.serializeArray(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - o = _ref[_i]; - if ((o.value != null) && jQuery.trim(o.value).length > 0) { - map[o.name] = o.value; - } - } - bodyParam = new FormData(); - params = 0; - _ref1 = this.model.parameters; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - param = _ref1[_j]; - if (param.paramType === 'form' || param["in"] === 'formData') { - if (param.type.toLowerCase() !== 'file' && map[param.name] !== void 0) { - bodyParam.append(param.name, map[param.name]); - } - } - } - headerParams = {}; - _ref2 = this.model.parameters; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - param = _ref2[_k]; - if (param.paramType === 'header') { - headerParams[param.name] = map[param.name]; - } - } - _ref3 = form.find('input[type~="file"]'); - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - el = _ref3[_l]; - if (typeof el.files[0] !== 'undefined') { - bodyParam.append($(el).attr('name'), el.files[0]); - params += 1; - } - } - this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), delete headerParams['Content-Type'], this.model.urlify(map, false)) : this.model.urlify(map, true); - $(".request_url", $(this.el)).html("<pre></pre>"); - $(".request_url pre", $(this.el)).text(this.invocationUrl); - obj = { - type: this.model.method, - url: this.invocationUrl, - headers: headerParams, - data: bodyParam, - dataType: 'json', - contentType: false, - processData: false, - error: (function(_this) { - return function(data, textStatus, error) { - return _this.showErrorStatus(_this.wrap(data), _this); - }; - })(this), - success: (function(_this) { - return function(data) { - return _this.showResponse(data, _this); - }; - })(this), - complete: (function(_this) { - return function(data) { - return _this.showCompleteStatus(_this.wrap(data), _this); - }; - })(this) - }; - if (window.authorizations) { - window.authorizations.apply(obj); - } - if (params === 0) { - obj.data.append("fake", "true"); - } - jQuery.ajax(obj); - return false; - }; - - OperationView.prototype.wrap = function(data) { - var h, headerArray, headers, i, o, _i, _len; - headers = {}; - headerArray = data.getAllResponseHeaders().split("\r"); - for (_i = 0, _len = headerArray.length; _i < _len; _i++) { - i = headerArray[_i]; - h = i.match(/^([^:]*?):(.*)$/); - if (!h) { - h = []; - } - h.shift(); - if (h[0] !== void 0 && h[1] !== void 0) { - headers[h[0].trim()] = h[1].trim(); - } - } - o = {}; - o.content = {}; - o.content.data = data.responseText; - o.headers = headers; - o.request = {}; - o.request.url = this.invocationUrl; - o.status = data.status; - return o; - }; - - OperationView.prototype.getSelectedValue = function(select) { - var opt, options, _i, _len, _ref; - if (!select.multiple) { - return select.value; - } else { - options = []; - _ref = select.options; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - opt = _ref[_i]; - if (opt.selected) { - options.push(opt.value); - } - } - if (options.length > 0) { - return options; - } else { - return null; - } - } - }; - - OperationView.prototype.hideResponse = function(e) { - if (e != null) { - e.preventDefault(); - } - $(".response", $(this.el)).slideUp(); - return $(".response_hider", $(this.el)).fadeOut(); - }; - - OperationView.prototype.showResponse = function(response) { - var prettyJson; - prettyJson = JSON.stringify(response, null, "\t").replace(/\n/g, "<br>"); - return $(".response_body", $(this.el)).html(escape(prettyJson)); - }; - - OperationView.prototype.showErrorStatus = function(data, parent) { - return parent.showStatus(data); - }; - - OperationView.prototype.showCompleteStatus = function(data, parent) { - return parent.showStatus(data); - }; - - OperationView.prototype.formatXml = function(xml) { - var contexp, formatted, indent, lastType, lines, ln, pad, reg, transitions, wsexp, _fn, _i, _len; - reg = /(>)(<)(\/*)/g; - wsexp = /[ ]*(.*)[ ]+\n/g; - contexp = /(<.+>)(.+\n)/g; - xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2'); - pad = 0; - formatted = ''; - lines = xml.split('\n'); - indent = 0; - lastType = 'other'; - transitions = { - 'single->single': 0, - 'single->closing': -1, - 'single->opening': 0, - 'single->other': 0, - 'closing->single': 0, - 'closing->closing': -1, - 'closing->opening': 0, - 'closing->other': 0, - 'opening->single': 1, - 'opening->closing': 0, - 'opening->opening': 1, - 'opening->other': 1, - 'other->single': 0, - 'other->closing': -1, - 'other->opening': 0, - 'other->other': 0 - }; - _fn = function(ln) { - var fromTo, j, key, padding, type, types, value; - types = { - single: Boolean(ln.match(/<.+\/>/)), - closing: Boolean(ln.match(/<\/.+>/)), - opening: Boolean(ln.match(/<[^!?].*>/)) - }; - type = ((function() { - var _results; - _results = []; - for (key in types) { - value = types[key]; - if (value) { - _results.push(key); - } - } - return _results; - })())[0]; - type = type === void 0 ? 'other' : type; - fromTo = lastType + '->' + type; - lastType = type; - padding = ''; - indent += transitions[fromTo]; - padding = ((function() { - var _j, _ref, _results; - _results = []; - for (j = _j = 0, _ref = indent; 0 <= _ref ? _j < _ref : _j > _ref; j = 0 <= _ref ? ++_j : --_j) { - _results.push(' '); - } - return _results; - })()).join(''); - if (fromTo === 'opening->closing') { - return formatted = formatted.substr(0, formatted.length - 1) + ln + '\n'; - } else { - return formatted += padding + ln + '\n'; - } - }; - for (_i = 0, _len = lines.length; _i < _len; _i++) { - ln = lines[_i]; - _fn(ln); - } - return formatted; - }; - - OperationView.prototype.showStatus = function(response) { - var code, content, contentType, e, headers, json, opts, pre, response_body, response_body_el, url; - if (response.content === void 0) { - content = response.data; - url = response.url; - } else { - content = response.content.data; - url = response.request.url; - } - headers = response.headers; - contentType = null; - if (headers) { - contentType = headers["Content-Type"] || headers["content-type"]; - if (contentType) { - contentType = contentType.split(";")[0].trim(); - } - } - $(".response_body", $(this.el)).removeClass('json'); - $(".response_body", $(this.el)).removeClass('xml'); - if (!content) { - code = $('<code />').text("no content"); - pre = $('<pre class="json" />').append(code); - } else if (contentType === "application/json" || /\+json$/.test(contentType)) { - json = null; - try { - json = JSON.stringify(JSON.parse(content), null, " "); - } catch (_error) { - e = _error; - json = "can't parse JSON. Raw result:\n\n" + content; - } - code = $('<code />').text(json); - pre = $('<pre class="json" />').append(code); - } else if (contentType === "application/xml" || /\+xml$/.test(contentType)) { - code = $('<code />').text(this.formatXml(content)); - pre = $('<pre class="xml" />').append(code); - } else if (contentType === "text/html") { - code = $('<code />').html(_.escape(content)); - pre = $('<pre class="xml" />').append(code); - } else if (/^image\//.test(contentType)) { - pre = $('<img>').attr('src', url); - } else { - code = $('<code />').text(content); - pre = $('<pre class="json" />').append(code); - } - response_body = pre; - $(".request_url", $(this.el)).html("<pre></pre>"); - $(".request_url pre", $(this.el)).text(url); - $(".response_code", $(this.el)).html("<pre>" + response.status + "</pre>"); - $(".response_body", $(this.el)).html(response_body); - $(".response_headers", $(this.el)).html("<pre>" + _.escape(JSON.stringify(response.headers, null, " ")).replace(/\n/g, "<br>") + "</pre>"); - $(".response", $(this.el)).slideDown(); - $(".response_hider", $(this.el)).show(); - $(".response_throbber", $(this.el)).hide(); - response_body_el = $('.response_body', $(this.el))[0]; - opts = this.options.swaggerOptions; - if (opts.highlightSizeThreshold && response.data.length > opts.highlightSizeThreshold) { - return response_body_el; - } else { - return hljs.highlightBlock(response_body_el); - } - }; - - OperationView.prototype.toggleOperationContent = function() { - var elem; - elem = $('#' + Docs.escapeResourceName(this.parentId + "_" + this.nickname + "_content")); - if (elem.is(':visible')) { - return Docs.collapseOperation(elem); - } else { - return Docs.expandOperation(elem); - } - }; - - return OperationView; - -})(Backbone.View); - -var ParameterContentTypeView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -ParameterContentTypeView = (function(_super) { - __extends(ParameterContentTypeView, _super); - - function ParameterContentTypeView() { - return ParameterContentTypeView.__super__.constructor.apply(this, arguments); - } - - ParameterContentTypeView.prototype.initialize = function() {}; - - ParameterContentTypeView.prototype.render = function() { - var template; - template = this.template(); - $(this.el).html(template(this.model)); - $('label[for=parameterContentType]', $(this.el)).text('Parameter content type:'); - return this; - }; - - ParameterContentTypeView.prototype.template = function() { - return Handlebars.templates.parameter_content_type; - }; - - return ParameterContentTypeView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["param_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"2":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <input type=\"file\" name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'/>\n"; -},"4":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"5":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <textarea class='body-textarea required' placeholder='(required)' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'>" - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n"; -},"7":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <textarea class='body-textarea required' placeholder='(required)' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n"; -},"9":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.program(12, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"10":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <input class='parameter' class='required' type='file' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "'/>\n"; -},"12":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(13, data),"inverse":this.program(15, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"13":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <input class='parameter required' minlength='1' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "' placeholder='(required)' type='text' value='" - + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) - + "'/>\n"; -},"15":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <input class='parameter required' minlength='1' name='" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "' placeholder='(required)' type='text' value=''/>\n"; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'>" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "</td>\n<td>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "</td>\n<td>\n <strong><span class=\"markdown\">"; - stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - buffer += "</span></strong>\n</td>\n<td>"; - stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n"; -},"useData":true}); -this["Handlebars"]["templates"]["parameter_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"2":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, buffer = " <option value=\""; - stack1 = lambda(depth0, depth0); - if (stack1 != null) { buffer += stack1; } - buffer += "\">"; - stack1 = lambda(depth0, depth0); - if (stack1 != null) { buffer += stack1; } - return buffer + "</option>\n"; -},"4":function(depth0,helpers,partials,data) { - return " <option value=\"application/json\">application/json</option>\n"; - },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, buffer = "<label for=\"parameterContentType\"></label>\n<select name=\"parameterContentType\">\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "</select>\n"; -},"useData":true}); -var ParameterView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -ParameterView = (function(_super) { - __extends(ParameterView, _super); - - function ParameterView() { - return ParameterView.__super__.constructor.apply(this, arguments); - } - - ParameterView.prototype.initialize = function() { - return Handlebars.registerHelper('isArray', function(param, opts) { - if (param.type.toLowerCase() === 'array' || param.allowMultiple) { - return opts.fn(this); - } else { - return opts.inverse(this); - } - }); - }; - - ParameterView.prototype.render = function() { - var contentTypeModel, isParam, parameterContentTypeView, ref, responseContentTypeView, schema, signatureModel, signatureView, template, type; - type = this.model.type || this.model.dataType; - if (typeof type === 'undefined') { - schema = this.model.schema; - if (schema && schema['$ref']) { - ref = schema['$ref']; - if (ref.indexOf('#/definitions/') === 0) { - type = ref.substring('#/definitions/'.length); - } else { - type = ref; - } - } - } - this.model.type = type; - this.model.paramType = this.model["in"] || this.model.paramType; - if (this.model.paramType === 'body' || this.model["in"] === 'body') { - this.model.isBody = true; - } - if (type && type.toLowerCase() === 'file') { - this.model.isFile = true; - } - this.model["default"] = this.model["default"] || this.model.defaultValue; - if (this.model.allowableValues) { - this.model.isList = true; - } - template = this.template(); - $(this.el).html(template(this.model)); - signatureModel = { - sampleJSON: this.model.sampleJSON, - isParam: true, - signature: this.model.signature - }; - if (this.model.sampleJSON) { - signatureView = new SignatureView({ - model: signatureModel, - tagName: 'div' - }); - $('.model-signature', $(this.el)).append(signatureView.render().el); - } else { - $('.model-signature', $(this.el)).html(this.model.signature); - } - isParam = false; - if (this.model.isBody) { - isParam = true; - } - contentTypeModel = { - isParam: isParam - }; - contentTypeModel.consumes = this.model.consumes; - if (isParam) { - parameterContentTypeView = new ParameterContentTypeView({ - model: contentTypeModel - }); - $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el); - } else { - responseContentTypeView = new ResponseContentTypeView({ - model: contentTypeModel - }); - $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el); - } - return this; - }; - - ParameterView.prototype.template = function() { - if (this.model.isList) { - return Handlebars.templates.param_list; - } else { - if (this.options.readOnly) { - if (this.model.required) { - return Handlebars.templates.param_readonly_required; - } else { - return Handlebars.templates.param_readonly; - } - } else { - if (this.model.required) { - return Handlebars.templates.param_required; - } else { - return Handlebars.templates.param; - } - } - } - }; - - return ParameterView; - -})(Backbone.View); - -var ResourceView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -ResourceView = (function(_super) { - __extends(ResourceView, _super); - - function ResourceView() { - return ResourceView.__super__.constructor.apply(this, arguments); - } - - ResourceView.prototype.initialize = function(opts) { - if (opts == null) { - opts = {}; - } - this.auths = opts.auths; - if ("" === this.model.description) { - this.model.description = null; - } - if (this.model.description != null) { - return this.model.summary = this.model.description; - } - }; - - ResourceView.prototype.render = function() { - var counter, id, methods, operation, _i, _len, _ref; - methods = {}; - $(this.el).html(Handlebars.templates.resource(this.model)); - _ref = this.model.operationsArray; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - operation = _ref[_i]; - counter = 0; - id = operation.nickname; - while (typeof methods[id] !== 'undefined') { - id = id + "_" + counter; - counter += 1; - } - methods[id] = operation; - operation.nickname = id; - operation.parentId = this.model.id; - this.addOperation(operation); - } - $('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource')); - $('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource')); - $('.expandResource', this.el).click(this.callDocs.bind(this, 'expandOperationsForResource')); - return this; - }; - - ResourceView.prototype.addOperation = function(operation) { - var operationView; - operation.number = this.number; - operationView = new OperationView({ - model: operation, - tagName: 'li', - className: 'endpoint', - swaggerOptions: this.options.swaggerOptions, - auths: this.auths - }); - $('.endpoints', $(this.el)).append(operationView.render().el); - return this.number++; - }; - - ResourceView.prototype.callDocs = function(fnName, e) { - e.preventDefault(); - return Docs[fnName](e.currentTarget.getAttribute('data-id')); - }; - - return ResourceView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["resource"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - return " : "; - },"3":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "<li>\n <a href='" - + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper))) - + "'>Raw</a>\n </li>"; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div class='heading'>\n <h2>\n <a href='#!/" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "' class=\"toggleEndpointList\" data-id=\"" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "\">" - + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) - + "</a> "; - stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(options={"name":"summary","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.summary) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "' id='endpointListTogger_" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "' class=\"toggleEndpointList\" data-id=\"" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "\">Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\"" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\"" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "\">\n Expand Operations\n </a>\n </li>\n "; - stack1 = ((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(options={"name":"url","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.url) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - return buffer + "\n </ul>\n</div>\n<ul class='endpoints' id='" - + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) - + "_endpoint_list' style='display:none'>\n\n</ul>\n"; -},"useData":true}); -var ResponseContentTypeView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -ResponseContentTypeView = (function(_super) { - __extends(ResponseContentTypeView, _super); - - function ResponseContentTypeView() { - return ResponseContentTypeView.__super__.constructor.apply(this, arguments); - } - - ResponseContentTypeView.prototype.initialize = function() {}; - - ResponseContentTypeView.prototype.render = function() { - var template; - template = this.template(); - $(this.el).html(template(this.model)); - $('label[for=responseContentType]', $(this.el)).text('Response Content Type'); - return this; - }; - - ResponseContentTypeView.prototype.template = function() { - return Handlebars.templates.response_content_type; - }; - - return ResponseContentTypeView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["response_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"2":function(depth0,helpers,partials,data) { - var stack1, lambda=this.lambda, buffer = " <option value=\""; - stack1 = lambda(depth0, depth0); - if (stack1 != null) { buffer += stack1; } - buffer += "\">"; - stack1 = lambda(depth0, depth0); - if (stack1 != null) { buffer += stack1; } - return buffer + "</option>\n"; -},"4":function(depth0,helpers,partials,data) { - return " <option value=\"application/json\">application/json</option>\n"; - },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, buffer = "<label for=\"responseContentType\"></label>\n<select name=\"responseContentType\">\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "</select>\n"; -},"useData":true}); -var SignatureView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -SignatureView = (function(_super) { - __extends(SignatureView, _super); - - function SignatureView() { - return SignatureView.__super__.constructor.apply(this, arguments); - } - - SignatureView.prototype.events = { - 'click a.description-link': 'switchToDescription', - 'click a.snippet-link': 'switchToSnippet', - 'mousedown .snippet': 'snippetToTextArea' - }; - - SignatureView.prototype.initialize = function() {}; - - SignatureView.prototype.render = function() { - var template; - template = this.template(); - $(this.el).html(template(this.model)); - this.switchToSnippet(); - this.isParam = this.model.isParam; - if (this.isParam) { - $('.notice', $(this.el)).text('Click to set as parameter value'); - } - return this; - }; - - SignatureView.prototype.template = function() { - return Handlebars.templates.signature; - }; - - SignatureView.prototype.switchToDescription = function(e) { - if (e != null) { - e.preventDefault(); - } - $(".snippet", $(this.el)).hide(); - $(".description", $(this.el)).show(); - $('.description-link', $(this.el)).addClass('selected'); - return $('.snippet-link', $(this.el)).removeClass('selected'); - }; - - SignatureView.prototype.switchToSnippet = function(e) { - if (e != null) { - e.preventDefault(); - } - $(".description", $(this.el)).hide(); - $(".snippet", $(this.el)).show(); - $('.snippet-link', $(this.el)).addClass('selected'); - return $('.description-link', $(this.el)).removeClass('selected'); - }; - - SignatureView.prototype.snippetToTextArea = function(e) { - var textArea; - if (this.isParam) { - if (e != null) { - e.preventDefault(); - } - textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode)); - if ($.trim(textArea.val()) === '') { - return textArea.val(this.model.sampleJSON); - } - } - }; - - return SignatureView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["signature"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\">Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\">Model Schema</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n "; - stack1 = ((helper = (helper = helpers.signature || (depth0 != null ? depth0.signature : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signature","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "\n </div>\n\n <div class=\"snippet\">\n <pre><code>" - + escapeExpression(((helper = (helper = helpers.sampleJSON || (depth0 != null ? depth0.sampleJSON : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"sampleJSON","hash":{},"data":data}) : helper))) - + "</code></pre>\n <small class=\"notice\"></small>\n </div>\n</div>\n\n"; -},"useData":true}); -var StatusCodeView, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __hasProp = {}.hasOwnProperty; - -StatusCodeView = (function(_super) { - __extends(StatusCodeView, _super); - - function StatusCodeView() { - return StatusCodeView.__super__.constructor.apply(this, arguments); - } - - StatusCodeView.prototype.initialize = function() {}; - - StatusCodeView.prototype.render = function() { - var responseModel, responseModelView, template; - template = this.template(); - $(this.el).html(template(this.model)); - if (swaggerUi.api.models.hasOwnProperty(this.model.responseModel)) { - responseModel = { - sampleJSON: JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(), null, 2), - isParam: false, - signature: swaggerUi.api.models[this.model.responseModel].getMockSignature() - }; - responseModelView = new SignatureView({ - model: responseModel, - tagName: 'div' - }); - $('.model-signature', this.$el).append(responseModelView.render().el); - } else { - $('.model-signature', this.$el).html(''); - } - return this; - }; - - StatusCodeView.prototype.template = function() { - return Handlebars.templates.status_code; - }; - - return StatusCodeView; - -})(Backbone.View); - -this["Handlebars"]["templates"]["status_code"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td width='15%' class='code'>" - + escapeExpression(((helper = (helper = helpers.code || (depth0 != null ? depth0.code : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"code","hash":{},"data":data}) : helper))) - + "</td>\n<td>"; - stack1 = ((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"message","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</td>\n<td width='50%'><span class=\"model-signature\" /></td>"; -},"useData":true});
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.min.js deleted file mode 100644 index 3eabe583..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/*
- * Copyright 2016 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function clippyCopiedCallback(){$("#api_key_copied").fadeIn().delay(1e3).fadeOut()}$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),t=$(this).parent().height(),n=(t-e)/2;$(this).css("margin-top",n)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),t=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),n=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-t-n)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""==$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),log=function(){log.history=log.history||[],log.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments)[0])},Function.prototype.bind&&console&&"object"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call);var Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e.length){case 1:var t="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});break;case 2:Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});var n=e.join("_"),a=n+"_content";Docs.expandOperation($("#"+a)),$("#"+n).slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var t=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");t.is(":visible")?Docs.collapseEndpointListForResource(e):Docs.expandEndpointListForResource(e)},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+e).removeClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}};this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return"<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'>"+l((s=null!=(s=t.keyName||(null!=e?e.keyName:e))?s:r,typeof s===i?s.call(e,{name:"keyName",hash:{},data:a}):s))+'</div>\n <input placeholder="api_key" class="auth_input" id="input_apiKey_entry" name="apiKey" type="text"/>\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_api_key" href="#">apply</a></div>\n </div>\n</div>\n\n'},useData:!0});var SwaggerUi,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;SwaggerUi=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.dom_id="swagger_ui",t.prototype.options=null,t.prototype.api=null,t.prototype.headerView=null,t.prototype.mainView=null,t.prototype.initialize=function(e){return null==e&&(e={}),null!=e.dom_id&&(this.dom_id=e.dom_id,delete e.dom_id),null==e.supportedSubmitMethods&&(e.supportedSubmitMethods=["get","put","post","delete","head","options","patch"]),null==$("#"+this.dom_id)&&$("body").append('<div id="'+this.dom_id+'"></div>'),this.options=e,this.options.success=function(e){return function(){return e.render()}}(this),this.options.progress=function(e){return function(t){return e.showMessage(t)}}(this),this.options.failure=function(e){return function(t){return e.onLoadFailure(t)}}(this),this.headerView=new HeaderView({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return function(t){return e.updateSwaggerUi(t)}}(this))},t.prototype.setOption=function(e,t){return this.options[e]=t},t.prototype.getOption=function(e){return this.options[e]},t.prototype.updateSwaggerUi=function(e){return this.options.url=e.url,this.load()},t.prototype.load=function(){var e,t;return null!=(t=this.mainView)&&t.clear(),e=this.options.url,e&&0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.options.url=e,this.headerView.update(e),this.api=new SwaggerClient(this.options)},t.prototype.collapseAll=function(){return Docs.collapseEndpointListForResource("")},t.prototype.listAll=function(){return Docs.collapseOperationsForResource("")},t.prototype.expandAll=function(){return Docs.expandOperationsForResource("")},t.prototype.render=function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new MainView({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options}).render(),this.showMessage(),this.options.docExpansion){case"full":this.expandAll();break;case"list":this.listAll()}return this.renderGFM(),this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(function(){return function(){return Docs.shebang()}}(this),100)},t.prototype.buildUrl=function(e,t){var n,a;return 0===t.indexOf("/")?(a=e.split("/"),e=a[0]+"//"+a[2],e+t):(n=e.length,e.indexOf("?")>-1&&(n=Math.min(n,e.indexOf("?"))),e.indexOf("#")>-1&&(n=Math.min(n,e.indexOf("#"))),e=e.substring(0,n),-1!==e.indexOf("/",e.length-1)?e+t:e+"/"+t)},t.prototype.showMessage=function(e){return null==e&&(e=""),$("#message-bar").removeClass("message-fail"),$("#message-bar").addClass("message-success"),$("#message-bar").html(e)},t.prototype.onLoadFailure=function(e){var t;return null==e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail"),t=$("#message-bar").html(e),null!=this.options.onFailure&&this.options.onFailure(e),t},t.prototype.renderGFM=function(e){return null==e&&(e=""),$(".markdown").each(function(){return $(this).html(marked($(this).html()))})},t}(Backbone.Router),window.SwaggerUi=SwaggerUi,this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(){return'<div class=\'auth_button\' id=\'basic_auth_button\'><img class=\'auth_icon\' src=\'images/password.jpeg\'></div>\n<div class=\'auth_container\' id=\'basic_auth_container\'>\n <div class=\'key_input_container\'>\n <div class="auth_label">Username</div>\n <input placeholder="username" class="auth_input" id="input_username" name="username" type="text"/>\n <div class="auth_label">Password</div>\n <input placeholder="password" class="auth_input" id="input_password" name="password" type="password"/>\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_basic_auth" href="#">apply</a></div>\n </div>\n</div>\n\n'},useData:!0}),Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),new Handlebars.SafeString(e)}),this.Handlebars.templates.content_type=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(i+=s),i},2:function(e){var t,n=this.lambda,a=' <option value="';return t=n(e,e),null!=t&&(a+=t),a+='">',t=n(e,e),null!=t&&(a+=t),a+"</option>\n"},4:function(){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i='<label for="contentType"></label>\n<select name="contentType">\n';return s=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(4,a),data:a}),null!=s&&(i+=s),i+"</select>\n"},useData:!0});var ApiKeyButton,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ApiKeyButton=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),this},t.prototype.events={"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"},t.prototype.applyApiKey=function(){var e;return window.authorizations.add(this.model.name,new ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"])),window.swaggerUi.load(),e=$("#apikey_container").show()},t.prototype.toggleApiKeyContainer=function(){var e;return $("#apikey_container").length>0?(e=$("#apikey_container").first(),e.is(":visible")?e.hide():($(".auth_container").hide(),e.show())):void 0},t.prototype.template=function(){return Handlebars.templates.apikey_button_view},t}(Backbone.View),this.Handlebars.templates.main=Handlebars.template({1:function(e,t,n,a){var s,i=this.lambda,r=this.escapeExpression,l=' <div class="info_title">'+r(i(null!=(s=null!=e?e.info:e)?s.title:s,e))+'</div>\n <div class="info_description markdown">';return s=i(null!=(s=null!=e?e.info:e)?s.description:s,e),null!=s&&(l+=s),l+="</div>\n ",s=t["if"].call(e,null!=(s=null!=e?e.info:e)?s.termsOfServiceUrl:s,{name:"if",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=(s=null!=e?e.info:e)?s.contact:s)?s.name:s,{name:"if",hash:{},fn:this.program(4,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=(s=null!=e?e.info:e)?s.contact:s)?s.url:s,{name:"if",hash:{},fn:this.program(6,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=(s=null!=e?e.info:e)?s.contact:s)?s.email:s,{name:"if",hash:{},fn:this.program(8,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=e?e.info:e)?s.license:s,{name:"if",hash:{},fn:this.program(10,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+"\n"},2:function(e){var t,n=this.lambda,a=this.escapeExpression;return'<div class="info_tos"><a href="'+a(n(null!=(t=null!=e?e.info:e)?t.termsOfServiceUrl:t,e))+'">Terms of service</a></div>'},4:function(e){var t,n=this.lambda,a=this.escapeExpression;return"<div class='info_name'>Created by "+a(n(null!=(t=null!=(t=null!=e?e.info:e)?t.contact:t)?t.name:t,e))+"</div>"},6:function(e){var t,n=this.lambda,a=this.escapeExpression;return"<div class='info_url'>See more at <a href=\""+a(n(null!=(t=null!=(t=null!=e?e.info:e)?t.contact:t)?t.url:t,e))+'">'+a(n(null!=(t=null!=(t=null!=e?e.info:e)?t.contact:t)?t.url:t,e))+"</a></div>"},8:function(e){var t,n=this.lambda,a=this.escapeExpression;return"<div class='info_email'><a href=\"mailto:"+a(n(null!=(t=null!=(t=null!=e?e.info:e)?t.contact:t)?t.email:t,e))+"?subject="+a(n(null!=(t=null!=e?e.info:e)?t.title:t,e))+'">Contact the developer</a></div>'},10:function(e){var t,n=this.lambda,a=this.escapeExpression;return"<div class='info_license'><a href='"+a(n(null!=(t=null!=(t=null!=e?e.info:e)?t.license:t)?t.url:t,e))+"'>"+a(n(null!=(t=null!=(t=null!=e?e.info:e)?t.license:t)?t.name:t,e))+"</a></div>"},12:function(e){var t,n=this.lambda,a=this.escapeExpression;return' , <span style="font-variant: small-caps">api version</span>: '+a(n(null!=(t=null!=e?e.info:e)?t.version:t,e))+"\n "},14:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' <span style="float:right"><a href="'+l((s=null!=(s=t.validatorUrl||(null!=e?e.validatorUrl:e))?s:r,typeof s===i?s.call(e,{name:"validatorUrl",hash:{},data:a}):s))+"/debug?url="+l((s=null!=(s=t.url||(null!=e?e.url:e))?s:r,typeof s===i?s.call(e,{name:"url",hash:{},data:a}):s))+'"><img id="validator" src="'+l((s=null!=(s=t.validatorUrl||(null!=e?e.validatorUrl:e))?s:r,typeof s===i?s.call(e,{name:"validatorUrl",hash:{},data:a}):s))+"?url="+l((s=null!=(s=t.url||(null!=e?e.url:e))?s:r,typeof s===i?s.call(e,{name:"url",hash:{},data:a}):s))+'"></a>\n </span>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="<div class='info' id='api_info'>\n";return s=t["if"].call(e,null!=e?e.info:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+="</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "+o((i=null!=(i=t.basePath||(null!=e?e.basePath:e))?i:l,typeof i===r?i.call(e,{name:"basePath",hash:{},data:a}):i))+"\n",s=t["if"].call(e,null!=(s=null!=e?e.info:e)?s.version:s,{name:"if",hash:{},fn:this.program(12,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+="]\n",s=t["if"].call(e,null!=e?e.validatorUrl:e,{name:"if",hash:{},fn:this.program(14,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+" </h4>\n </div>\n</div>\n"},useData:!0});var BasicAuthButton,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;BasicAuthButton=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),this},t.prototype.events={"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"},t.prototype.applyPassword=function(){var e,t,n;return n=$(".input_username").val(),t=$(".input_password").val(),window.authorizations.add(this.model.type,new PasswordAuthorization("basic",n,t)),window.swaggerUi.load(),e=$("#basic_auth_container").hide()},t.prototype.togglePasswordContainer=function(){var e;return $("#basic_auth_container").length>0?(e=$("#basic_auth_container").show(),e.is(":visible")?e.slideUp():($(".auth_container").hide(),e.show())):void 0},t.prototype.template=function(){return Handlebars.templates.basic_auth_button_view},t}(Backbone.View),this.Handlebars.templates.operation=Handlebars.template({1:function(){return"deprecated"},3:function(){return" <h4>Warning: Deprecated</h4>\n"},5:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=' <h4>Implementation Notes</h4>\n <p class="markdown">';return i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(o+=s),o+"</p>\n"},7:function(){return' <div class="auth">\n <span class="api-ic ic-error"></span>'},9:function(e,t,n,a){var s,i=' <div id="api_information_panel" style="top: 526px; left: 776px; display: none;">\n';return s=t.each.call(e,e,{name:"each",hash:{},fn:this.program(10,a),inverse:this.noop,data:a}),null!=s&&(i+=s),i+" </div>\n"},10:function(e){var t,n=this.lambda,a=this.escapeExpression,s=" <div title='";return t=n(null!=e?e.description:e,e),null!=t&&(s+=t),s+"'>"+a(n(null!=e?e.scope:e,e))+"</div>\n"},12:function(){return"</div>"},14:function(){return' <div class=\'access\'>\n <span class="api-ic ic-off" title="click to authenticate"></span>\n </div>\n'},16:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <h4>Response Class (Status "+l((s=null!=(s=t.successCode||(null!=e?e.successCode:e))?s:r,typeof s===i?s.call(e,{name:"successCode",hash:{},data:a}):s))+')</h4>\n <p><span class="model-signature" /></p>\n <br/>\n <div class="response-content-type" />\n'},18:function(){return' <h4>Parameters</h4>\n <table class=\'fullwidth\'>\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px">Parameter</th>\n <th style="width: 310px; max-width: 310px">Value</th>\n <th style="width: 200px; max-width: 200px">Description</th>\n <th style="width: 100px; max-width: 100px">Parameter Type</th>\n <th style="width: 220px; max-width: 230px">Data Type</th>\n </tr>\n </thead>\n <tbody class="operation-params">\n\n </tbody>\n </table>\n'},20:function(){return" <div style='margin:0;padding:0;display:inline'></div>\n <h4>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n <th>Response Model</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n"},22:function(){return""},24:function(){return" <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r,l="function",o=t.helperMissing,p=this.escapeExpression,u=t.blockHelperMissing,h="\n <ul class='operations' >\n <li class='"+p((i=null!=(i=t.method||(null!=e?e.method:e))?i:o,typeof i===l?i.call(e,{name:"method",hash:{},data:a}):i))+" operation' id='"+p((i=null!=(i=t.parentId||(null!=e?e.parentId:e))?i:o,typeof i===l?i.call(e,{name:"parentId",hash:{},data:a}):i))+"_"+p((i=null!=(i=t.nickname||(null!=e?e.nickname:e))?i:o,typeof i===l?i.call(e,{name:"nickname",hash:{},data:a}):i))+"'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/"+p((i=null!=(i=t.parentId||(null!=e?e.parentId:e))?i:o,typeof i===l?i.call(e,{name:"parentId",hash:{},data:a}):i))+"/"+p((i=null!=(i=t.nickname||(null!=e?e.nickname:e))?i:o,typeof i===l?i.call(e,{name:"nickname",hash:{},data:a}):i))+'\' class="toggleOperation">'+p((i=null!=(i=t.method||(null!=e?e.method:e))?i:o,typeof i===l?i.call(e,{name:"method",hash:{},data:a}):i))+"</a>\n </span>\n <span class='path'>\n <a href='#!/"+p((i=null!=(i=t.parentId||(null!=e?e.parentId:e))?i:o,typeof i===l?i.call(e,{name:"parentId",hash:{},data:a}):i))+"/"+p((i=null!=(i=t.nickname||(null!=e?e.nickname:e))?i:o,typeof i===l?i.call(e,{name:"nickname",hash:{},data:a}):i))+"' class=\"toggleOperation ";return s=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=s&&(h+=s),h+='">'+p((i=null!=(i=t.path||(null!=e?e.path:e))?i:o,typeof i===l?i.call(e,{name:"path",hash:{},data:a}):i))+"</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/"+p((i=null!=(i=t.parentId||(null!=e?e.parentId:e))?i:o,typeof i===l?i.call(e,{name:"parentId",hash:{},data:a}):i))+"/"+p((i=null!=(i=t.nickname||(null!=e?e.nickname:e))?i:o,typeof i===l?i.call(e,{name:"nickname",hash:{},data:a}):i))+'\' class="toggleOperation">',i=null!=(i=t.summary||(null!=e?e.summary:e))?i:o,s=typeof i===l?i.call(e,{name:"summary",hash:{},data:a}):i,null!=s&&(h+=s),h+="</a>\n </li>\n </ul>\n </div>\n <div class='content' id='"+p((i=null!=(i=t.parentId||(null!=e?e.parentId:e))?i:o,typeof i===l?i.call(e,{name:"parentId",hash:{},data:a}):i))+"_"+p((i=null!=(i=t.nickname||(null!=e?e.nickname:e))?i:o,typeof i===l?i.call(e,{name:"nickname",hash:{},data:a}):i))+"_content' style='display:none'>\n",s=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(3,a),inverse:this.noop,data:a}),null!=s&&(h+=s),s=t["if"].call(e,null!=e?e.description:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.noop,data:a}),null!=s&&(h+=s),i=null!=(i=t.oauth||(null!=e?e.oauth:e))?i:o,r={name:"oauth",hash:{},fn:this.program(7,a),inverse:this.noop,data:a},s=typeof i===l?i.call(e,r):i,t.oauth||(s=u.call(e,s,r)),null!=s&&(h+=s),h+="\n",s=t.each.call(e,null!=e?e.oauth:e,{name:"each",hash:{},fn:this.program(9,a),inverse:this.noop,data:a}),null!=s&&(h+=s),h+=" ",i=null!=(i=t.oauth||(null!=e?e.oauth:e))?i:o,r={name:"oauth",hash:{},fn:this.program(12,a),inverse:this.noop,data:a},s=typeof i===l?i.call(e,r):i,t.oauth||(s=u.call(e,s,r)),null!=s&&(h+=s),h+="\n",i=null!=(i=t.oauth||(null!=e?e.oauth:e))?i:o,r={name:"oauth",hash:{},fn:this.program(14,a),inverse:this.noop,data:a},s=typeof i===l?i.call(e,r):i,t.oauth||(s=u.call(e,s,r)),null!=s&&(h+=s),s=t["if"].call(e,null!=e?e.type:e,{name:"if",hash:{},fn:this.program(16,a),inverse:this.noop,data:a}),null!=s&&(h+=s),h+=" <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n",s=t["if"].call(e,null!=e?e.parameters:e,{name:"if",hash:{},fn:this.program(18,a),inverse:this.noop,data:a}),null!=s&&(h+=s),s=t["if"].call(e,null!=e?e.responseMessages:e,{name:"if",hash:{},fn:this.program(20,a),inverse:this.noop,data:a}),null!=s&&(h+=s),s=t["if"].call(e,null!=e?e.isReadOnly:e,{name:"if",hash:{},fn:this.program(22,a),inverse:this.program(24,a),data:a}),null!=s&&(h+=s),h+" </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n"},useData:!0});var ContentTypeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ContentTypeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=contentType]",$(this.el)).text("Response Content Type"),this},t.prototype.template=function(){return Handlebars.templates.content_type},t}(Backbone.View),this.Handlebars.templates.param=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=s&&(i+=s),i},2:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' <input type="file" name=\''+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+'\'/>\n <div class="parameter-content-type" />\n'},4:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=s&&(i+=s),i},5:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <textarea class='body-textarea' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"'>"+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+'</textarea>\n <br />\n <div class="parameter-content-type" />\n'},7:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <textarea class='body-textarea' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n'},9:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(10,a),data:a}),null!=s&&(i+=s),i},10:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(11,a),inverse:this.program(13,a),data:a}),null!=s&&(i+=s),i},11:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <input class='parameter' minlength='0' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"' placeholder='' type='text' value='"+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"'/>\n"},13:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <input class='parameter' minlength='0' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"' placeholder='' type='text' value=''/>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="<td class='code'>"+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"</td>\n<td>\n\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=s&&(p+=s),p+='\n</td>\n<td class="markdown">',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="</td>\n<td>",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'</td>\n<td>\n <span class="model-signature"></span>\n</td>\n'},useData:!0});var HeaderView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;HeaderView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},t.prototype.initialize=function(){},t.prototype.showPetStore=function(){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})},t.prototype.showWordnikDev=function(){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})},t.prototype.showCustomOnKeyup=function(e){return 13===e.keyCode?this.showCustom():void 0},t.prototype.showCustom=function(e){return null!=e&&e.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},t.prototype.update=function(e,t,n){return null==n&&(n=!1),$("#input_baseUrl").val(e),n?this.trigger("update-swagger-ui",{url:e}):void 0},t}(Backbone.View),this.Handlebars.templates.param_list=Handlebars.template({1:function(){return" multiple='multiple'"},3:function(){return""},5:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(3,a),inverse:this.program(6,a),data:a}),null!=s&&(i+=s),i},6:function(e,t,n,a){var s,i=t.helperMissing,r="";return s=(t.isArray||e&&e.isArray||i).call(e,e,{name:"isArray",hash:{},fn:this.program(3,a),inverse:this.program(7,a),data:a}),null!=s&&(r+=s),r},7:function(){return" <option selected=\"\" value=''></option>\n"},9:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(10,a),inverse:this.program(12,a),data:a}),null!=s&&(i+=s),i},10:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' <option selected="" value=\''+l((s=null!=(s=t.value||(null!=e?e.value:e))?s:r,typeof s===i?s.call(e,{name:"value",hash:{},data:a}):s))+"'>"+l((s=null!=(s=t.value||(null!=e?e.value:e))?s:r,typeof s===i?s.call(e,{name:"value",hash:{},data:a}):s))+" (default)</option>\n"},12:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <option value='"+l((s=null!=(s=t.value||(null!=e?e.value:e))?s:r,typeof s===i?s.call(e,{name:"value",hash:{},data:a}):s))+"'>"+l((s=null!=(s=t.value||(null!=e?e.value:e))?s:r,typeof s===i?s.call(e,{name:"value",hash:{},data:a}):s))+"</option>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="<td class='code'>"+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"</td>\n<td>\n <select ";return s=(t.isArray||e&&e.isArray||l).call(e,e,{name:"isArray",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+=" class='parameter' name='"+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"'>\n",s=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(3,a),inverse:this.program(5,a),data:a}),null!=s&&(p+=s),s=t.each.call(e,null!=(s=null!=e?e.allowableValues:e)?s.descriptiveValues:s,{name:"each",hash:{},fn:this.program(9,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+=' </select>\n</td>\n<td class="markdown">',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="</td>\n<td>",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'</td>\n<td><span class="model-signature"></span></td>'},useData:!0});var MainView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;MainView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}var n;return __extends(t,e),n={alpha:function(e,t){return e.path.localeCompare(t.path)},method:function(e,t){return e.method.localeCompare(t.method)}},t.prototype.initialize=function(e){var t,n,a,s;null==e&&(e={}),this.model.auths=[],s=this.model.securityDefinitions;for(n in s)a=s[n],t={name:n,type:a.type,value:a},this.model.auths.push(t);return"2.0"===this.model.swaggerVersion?this.model.validatorUrl="validatorUrl"in e.swaggerOptions?e.swaggerOptions.validatorUrl:this.model.url.indexOf("localhost")>0?null:"http://online.swagger.io/validator":void 0},t.prototype.render=function(){var e,t,n,a,s,i,r,l,o,p;if(this.model.securityDefinitions)for(s in this.model.securityDefinitions)e=this.model.securityDefinitions[s],"apiKey"===e.type&&0===$("#apikey_button").length&&(t=new ApiKeyButton({model:e}).render().el,$(".auth_main_container").append(t)),"basicAuth"===e.type&&0===$("#basic_auth_button").length&&(t=new BasicAuthButton({model:e}).render().el,$(".auth_main_container").append(t));for($(this.el).html(Handlebars.templates.main(this.model)),r={},n=0,p=this.model.apisArray,l=0,o=p.length;o>l;l++){for(i=p[l],a=i.name;"undefined"!=typeof r[a];)a=a+"_"+n,n+=1;
-i.id=a,r[a]=i,this.addResource(i,this.model.auths)}return $(".propWrap").hover(function(){return $(".optionsWrapper",$(this)).show()},function(){return $(".optionsWrapper",$(this)).hide()}),this},t.prototype.addResource=function(e,t){var n;return e.id=e.id.replace(/\s/g,"_"),n=new ResourceView({model:e,tagName:"li",id:"resource_"+e.id,className:"resource",auths:t,swaggerOptions:this.options.swaggerOptions}),$("#resources").append(n.render().el)},t.prototype.clear=function(){return $(this.el).html("")},t}(Backbone.View),this.Handlebars.templates.param_readonly=Handlebars.template({1:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <textarea class='body-textarea' readonly='readonly' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"'>"+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"</textarea>\n"},3:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=s&&(i+=s),i},4:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" "+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="<td class='code'>"+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"</td>\n<td>\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=s&&(p+=s),p+='</td>\n<td class="markdown">',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="</td>\n<td>",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_readonly_required=Handlebars.template({1:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"'>"+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"</textarea>\n"},3:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=s&&(i+=s),i},4:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" "+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="<td class='code required'>"+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"</td>\n<td>\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=s&&(p+=s),p+='</td>\n<td class="markdown">',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="</td>\n<td>",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0});var OperationView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;OperationView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.invocationUrl=null,t.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"},t.prototype.initialize=function(e){return null==e&&(e={}),this.auths=e.auths,this.parentId=this.model.parentId,this.nickname=this.model.nickname,this},t.prototype.mouseEnter=function(e){var t,n,a,s,i,r,l,o,p,u;return t=$(this.el).find(".content"),p=e.pageX,u=e.pageY,r=$(window).scrollLeft(),l=$(window).scrollTop(),s=r+$(window).width(),i=l+$(window).height(),o=t.width(),n=t.height(),p+o>s&&(p=s-o),r>p&&(p=r),u+n>i&&(u=i-n),l>u&&(u=l),a={},a.top=u,a.left=p,t.css(a),$(e.currentTarget.parentNode).find("#api_information_panel").show()},t.prototype.mouseExit=function(e){return $(e.currentTarget.parentNode).find("#api_information_panel").hide()},t.prototype.render=function(){var e,t,n,a,s,i,r,l,o,p,u,h,c,d,m,f,y,g,v,_,w,b,x,k,O,C,S,P,T,D,H,M,E,R,V,N,U,A;if(i=jQuery.inArray(this.model.method,this.model.supportedSubmitMethods())>=0,i||(this.model.isReadOnly=!0),this.model.description=this.model.description||this.model.notes,this.model.description&&(this.model.description=this.model.description.replace(/(?:\r\n|\r|\n)/g,"<br />")),this.model.oauth=null,o=this.model.authorizations||this.model.security)if(Array.isArray(o))for(k=0,P=o.length;P>k;k++){n=o[k];for(l in n){t=n[l];for(e in this.auths)if(t=this.auths[e],"oauth2"===t.type){this.model.oauth={},this.model.oauth.scopes=[],R=t.value.scopes;for(r in R)b=R[r],y=n[l].indexOf(r),y>=0&&(p={scope:r,description:b},this.model.oauth.scopes.push(p))}}}else for(r in o)if(b=o[r],"oauth2"===r)for(null===this.model.oauth&&(this.model.oauth={}),void 0===this.model.oauth.scopes&&(this.model.oauth.scopes=[]),O=0,T=b.length;T>O;O++)p=b[O],this.model.oauth.scopes.push(p);if("undefined"!=typeof this.model.responses){this.model.responseMessages=[],V=this.model.responses;for(a in V)x=V[a],m=null,f=this.model.responses[a].schema,f&&f.$ref&&(m=f.$ref,0===m.indexOf("#/definitions/")&&(m=m.substring("#/definitions/".length))),this.model.responseMessages.push({code:a,message:x.description,responseModel:m})}if("undefined"==typeof this.model.responseMessages&&(this.model.responseMessages=[]),g=null,this.model.successResponse){_=this.model.successResponse;for(l in _)x=_[l],this.model.successCode=l,"object"==typeof x&&"function"==typeof x.createJSONSample&&(g={sampleJSON:JSON.stringify(x.createJSONSample(),void 0,2),isParam:!1,signature:x.getMockSignature()})}else this.model.responseClassSignature&&"string"!==this.model.responseClassSignature&&(g={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature});for($(this.el).html(Handlebars.templates.operation(this.model)),g?(d=new SignatureView({model:g,tagName:"div"}),$(".model-signature",$(this.el)).append(d.render().el)):(this.model.responseClassSignature="string",$(".model-signature",$(this.el)).html(this.model.type)),s={isParam:!1},s.consumes=this.model.consumes,s.produces=this.model.produces,N=this.model.parameters,C=0,D=N.length;D>C;C++)u=N[C],w=u.type||u.dataType||"","undefined"==typeof w&&(m=u.schema,m&&m.$ref&&(h=m.$ref,w=0===h.indexOf("#/definitions/")?h.substring("#/definitions/".length):h)),w&&"file"===w.toLowerCase()&&(s.consumes||(s.consumes="multipart/form-data")),u.type=w;for(c=new ResponseContentTypeView({model:s}),$(".response-content-type",$(this.el)).append(c.render().el),U=this.model.parameters,S=0,H=U.length;H>S;S++)u=U[S],this.addParameter(u,s.consumes);for(A=this.model.responseMessages,E=0,M=A.length;M>E;E++)v=A[E],this.addStatusCode(v);return this},t.prototype.addParameter=function(e,t){var n;return e.consumes=t,n=new ParameterView({model:e,tagName:"tr",readOnly:this.model.isReadOnly}),$(".operation-params",$(this.el)).append(n.render().el)},t.prototype.addStatusCode=function(e){var t;return t=new StatusCodeView({model:e,tagName:"tr"}),$(".operation-status",$(this.el)).append(t.render().el)},t.prototype.submitOperation=function(e){var t,n,a,s,i,r,l,o,p,u,h,c,d,m,f,y;if(null!=e&&e.preventDefault(),n=$(".sandbox",$(this.el)),t=!0,n.find("input.required").each(function(){return $(this).removeClass("error"),""===jQuery.trim($(this).val())?($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),t=!1):void 0}),n.find("textarea.required").each(function(){return $(this).removeClass("error"),""===jQuery.trim($(this).val())?($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),t=!1):void 0}),t){for(s={},r={parent:this},a=!1,m=n.find("input"),o=0,h=m.length;h>o;o++)i=m[o],null!=i.value&&jQuery.trim(i.value).length>0&&(s[i.name]=i.value),"file"===i.type&&(s[i.name]=i.files[0],a=!0);for(f=n.find("textarea"),p=0,c=f.length;c>p;p++)i=f[p],null!=i.value&&jQuery.trim(i.value).length>0&&(s[i.name]=i.value);for(y=n.find("select"),u=0,d=y.length;d>u;u++)i=y[u],l=this.getSelectedValue(i),null!=l&&jQuery.trim(l).length>0&&(s[i.name]=l);return r.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),r.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),a?this.handleFileUpload(s,n):this.model["do"](s,r,this.showCompleteStatus,this.showErrorStatus,this)}},t.prototype.success=function(e,t){return t.showCompleteStatus(e)},t.prototype.handleFileUpload=function(e,t){var n,a,s,i,r,l,o,p,u,h,c,d,m,f,y,g,v,_,w;for(g=t.serializeArray(),p=0,d=g.length;d>p;p++)i=g[p],null!=i.value&&jQuery.trim(i.value).length>0&&(e[i.name]=i.value);for(n=new FormData,o=0,v=this.model.parameters,u=0,m=v.length;m>u;u++)l=v[u],("form"===l.paramType||"formData"===l["in"])&&"file"!==l.type.toLowerCase()&&void 0!==e[l.name]&&n.append(l.name,e[l.name]);for(s={},_=this.model.parameters,h=0,f=_.length;f>h;h++)l=_[h],"header"===l.paramType&&(s[l.name]=e[l.name]);for(w=t.find('input[type~="file"]'),c=0,y=w.length;y>c;c++)a=w[c],"undefined"!=typeof a.files[0]&&(n.append($(a).attr("name"),a.files[0]),o+=1);return this.invocationUrl=this.model.supportHeaderParams()?(s=this.model.getHeaderParams(e),delete s["Content-Type"],this.model.urlify(e,!1)):this.model.urlify(e,!0),$(".request_url",$(this.el)).html("<pre></pre>"),$(".request_url pre",$(this.el)).text(this.invocationUrl),r={type:this.model.method,url:this.invocationUrl,headers:s,data:n,dataType:"json",contentType:!1,processData:!1,error:function(e){return function(t){return e.showErrorStatus(e.wrap(t),e)}}(this),success:function(e){return function(t){return e.showResponse(t,e)}}(this),complete:function(e){return function(t){return e.showCompleteStatus(e.wrap(t),e)}}(this)},window.authorizations&&window.authorizations.apply(r),0===o&&r.data.append("fake","true"),jQuery.ajax(r),!1},t.prototype.wrap=function(e){var t,n,a,s,i,r,l;for(a={},n=e.getAllResponseHeaders().split("\r"),r=0,l=n.length;l>r;r++)s=n[r],t=s.match(/^([^:]*?):(.*)$/),t||(t=[]),t.shift(),void 0!==t[0]&&void 0!==t[1]&&(a[t[0].trim()]=t[1].trim());return i={},i.content={},i.content.data=e.responseText,i.headers=a,i.request={},i.request.url=this.invocationUrl,i.status=e.status,i},t.prototype.getSelectedValue=function(e){var t,n,a,s,i;if(e.multiple){for(n=[],i=e.options,a=0,s=i.length;s>a;a++)t=i[a],t.selected&&n.push(t.value);return n.length>0?n:null}return e.value},t.prototype.hideResponse=function(e){return null!=e&&e.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},t.prototype.showResponse=function(e){var t;return t=JSON.stringify(e,null," ").replace(/\n/g,"<br>"),$(".response_body",$(this.el)).html(escape(t))},t.prototype.showErrorStatus=function(e,t){return t.showStatus(e)},t.prototype.showCompleteStatus=function(e,t){return t.showStatus(e)},t.prototype.formatXml=function(e){var t,n,a,s,i,r,l,o,p,u,h,c,d;for(o=/(>)(<)(\/*)/g,u=/[ ]*(.*)[ ]+\n/g,t=/(<.+>)(.+\n)/g,e=e.replace(o,"$1\n$2$3").replace(u,"$1\n").replace(t,"$1\n$2"),l=0,n="",i=e.split("\n"),a=0,s="other",p={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},h=function(e){var t,i,r,l,o,u,h;return u={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},o=function(){var e;e=[];for(r in u)h=u[r],h&&e.push(r);return e}()[0],o=void 0===o?"other":o,t=s+"->"+o,s=o,l="",a+=p[t],l=function(){var e,t,n;for(n=[],i=e=0,t=a;t>=0?t>e:e>t;i=t>=0?++e:--e)n.push(" ");return n}().join(""),"opening->closing"===t?n=n.substr(0,n.length-1)+e+"\n":n+=l+e+"\n"},c=0,d=i.length;d>c;c++)r=i[c],h(r);return n},t.prototype.showStatus=function(e){var t,n,a,s,i,r,l,o,p,u,h;if(void 0===e.content?(n=e.data,h=e.url):(n=e.content.data,h=e.request.url),i=e.headers,a=null,i&&(a=i["Content-Type"]||i["content-type"],a&&(a=a.split(";")[0].trim())),$(".response_body",$(this.el)).removeClass("json"),$(".response_body",$(this.el)).removeClass("xml"),n)if("application/json"===a||/\+json$/.test(a)){r=null;try{r=JSON.stringify(JSON.parse(n),null," ")}catch(c){s=c,r="can't parse JSON. Raw result:\n\n"+n}t=$("<code />").text(r),o=$('<pre class="json" />').append(t)}else"application/xml"===a||/\+xml$/.test(a)?(t=$("<code />").text(this.formatXml(n)),o=$('<pre class="xml" />').append(t)):"text/html"===a?(t=$("<code />").html(_.escape(n)),o=$('<pre class="xml" />').append(t)):/^image\//.test(a)?o=$("<img>").attr("src",h):(t=$("<code />").text(n),o=$('<pre class="json" />').append(t));else t=$("<code />").text("no content"),o=$('<pre class="json" />').append(t);return p=o,$(".request_url",$(this.el)).html("<pre></pre>"),$(".request_url pre",$(this.el)).text(h),$(".response_code",$(this.el)).html("<pre>"+e.status+"</pre>"),$(".response_body",$(this.el)).html(p),$(".response_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(e.headers,null," ")).replace(/\n/g,"<br>")+"</pre>"),$(".response",$(this.el)).slideDown(),$(".response_hider",$(this.el)).show(),$(".response_throbber",$(this.el)).hide(),u=$(".response_body",$(this.el))[0],l=this.options.swaggerOptions,l.highlightSizeThreshold&&e.data.length>l.highlightSizeThreshold?u:hljs.highlightBlock(u)},t.prototype.toggleOperationContent=function(){var e;return e=$("#"+Docs.escapeResourceName(this.parentId+"_"+this.nickname+"_content")),e.is(":visible")?Docs.collapseOperation(e):Docs.expandOperation(e)},t}(Backbone.View);var ParameterContentTypeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ParameterContentTypeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:"),this},t.prototype.template=function(){return Handlebars.templates.parameter_content_type},t}(Backbone.View),this.Handlebars.templates.param_required=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=s&&(i+=s),i},2:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' <input type="file" name=\''+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"'/>\n"},4:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=s&&(i+=s),i},5:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <textarea class='body-textarea required' placeholder='(required)' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"'>"+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+'</textarea>\n <br />\n <div class="parameter-content-type" />\n'},7:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <textarea class='body-textarea required' placeholder='(required)' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n'},9:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(10,a),inverse:this.program(12,a),data:a}),null!=s&&(i+=s),i},10:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <input class='parameter' class='required' type='file' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"'/>\n"},12:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(13,a),inverse:this.program(15,a),data:a}),null!=s&&(i+=s),i},13:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <input class='parameter required' minlength='1' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"' placeholder='(required)' type='text' value='"+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"'/>\n"},15:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" <input class='parameter required' minlength='1' name='"+l((s=null!=(s=t.name||(null!=e?e.name:e))?s:r,typeof s===i?s.call(e,{name:"name",hash:{},data:a}):s))+"' placeholder='(required)' type='text' value=''/>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="<td class='code required'>"+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"</td>\n<td>\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=s&&(p+=s),p+='</td>\n<td>\n <strong><span class="markdown">',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="</span></strong>\n</td>\n<td>",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.parameter_content_type=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t.each.call(e,null!=e?e.consumes:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(i+=s),i},2:function(e){var t,n=this.lambda,a=' <option value="';return t=n(e,e),null!=t&&(a+=t),a+='">',t=n(e,e),null!=t&&(a+=t),a+"</option>\n"},4:function(){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i='<label for="parameterContentType"></label>\n<select name="parameterContentType">\n';return s=t["if"].call(e,null!=e?e.consumes:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(4,a),data:a}),null!=s&&(i+=s),i+"</select>\n"},useData:!0});var ParameterView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ParameterView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(e,t){return"array"===e.type.toLowerCase()||e.allowMultiple?t.fn(this):t.inverse(this)})},t.prototype.render=function(){var e,t,n,a,s,i,r,l,o,p;return p=this.model.type||this.model.dataType,"undefined"==typeof p&&(i=this.model.schema,i&&i.$ref&&(a=i.$ref,p=0===a.indexOf("#/definitions/")?a.substring("#/definitions/".length):a)),this.model.type=p,this.model.paramType=this.model["in"]||this.model.paramType,("body"===this.model.paramType||"body"===this.model["in"])&&(this.model.isBody=!0),p&&"file"===p.toLowerCase()&&(this.model.isFile=!0),this.model["default"]=this.model["default"]||this.model.defaultValue,this.model.allowableValues&&(this.model.isList=!0),o=this.template(),$(this.el).html(o(this.model)),r={sampleJSON:this.model.sampleJSON,isParam:!0,signature:this.model.signature},this.model.sampleJSON?(l=new SignatureView({model:r,tagName:"div"}),$(".model-signature",$(this.el)).append(l.render().el)):$(".model-signature",$(this.el)).html(this.model.signature),t=!1,this.model.isBody&&(t=!0),e={isParam:t},e.consumes=this.model.consumes,t?(n=new ParameterContentTypeView({model:e}),$(".parameter-content-type",$(this.el)).append(n.render().el)):(s=new ResponseContentTypeView({model:e}),$(".response-content-type",$(this.el)).append(s.render().el)),this},t.prototype.template=function(){return this.model.isList?Handlebars.templates.param_list:this.options.readOnly?this.model.required?Handlebars.templates.param_readonly_required:Handlebars.templates.param_readonly:this.model.required?Handlebars.templates.param_required:Handlebars.templates.param},t}(Backbone.View);var ResourceView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ResourceView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(e){return null==e&&(e={}),this.auths=e.auths,""===this.model.description&&(this.model.description=null),null!=this.model.description?this.model.summary=this.model.description:void 0},t.prototype.render=function(){var e,t,n,a,s,i,r;for(n={},$(this.el).html(Handlebars.templates.resource(this.model)),r=this.model.operationsArray,s=0,i=r.length;i>s;s++){for(a=r[s],e=0,t=a.nickname;"undefined"!=typeof n[t];)t=t+"_"+e,e+=1;n[t]=a,a.nickname=t,a.parentId=this.model.id,this.addOperation(a)}return $(".toggleEndpointList",this.el).click(this.callDocs.bind(this,"toggleEndpointListForResource")),$(".collapseResource",this.el).click(this.callDocs.bind(this,"collapseOperationsForResource")),$(".expandResource",this.el).click(this.callDocs.bind(this,"expandOperationsForResource")),this},t.prototype.addOperation=function(e){var t;return e.number=this.number,t=new OperationView({model:e,tagName:"li",className:"endpoint",swaggerOptions:this.options.swaggerOptions,auths:this.auths}),$(".endpoints",$(this.el)).append(t.render().el),this.number++},t.prototype.callDocs=function(e,t){return t.preventDefault(),Docs[e](t.currentTarget.getAttribute("data-id"))},t}(Backbone.View),this.Handlebars.templates.resource=Handlebars.template({1:function(){return" : "},3:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return"<li>\n <a href='"+l((s=null!=(s=t.url||(null!=e?e.url:e))?s:r,typeof s===i?s.call(e,{name:"url",hash:{},data:a}):s))+"'>Raw</a>\n </li>"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r,l="function",o=t.helperMissing,p=this.escapeExpression,u=t.blockHelperMissing,h="<div class='heading'>\n <h2>\n <a href='#!/"+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+'\' class="toggleEndpointList" data-id="'+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+'">'+p((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===l?i.call(e,{name:"name",hash:{},data:a}):i))+"</a> ";return i=null!=(i=t.summary||(null!=e?e.summary:e))?i:o,r={name:"summary",hash:{},fn:this.program(1,a),inverse:this.noop,data:a},s=typeof i===l?i.call(e,r):i,t.summary||(s=u.call(e,s,r)),null!=s&&(h+=s),i=null!=(i=t.summary||(null!=e?e.summary:e))?i:o,s=typeof i===l?i.call(e,{name:"summary",hash:{},data:a}):i,null!=s&&(h+=s),h+="\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+"' id='endpointListTogger_"+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+'\' class="toggleEndpointList" data-id="'+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+'">Show/Hide</a>\n </li>\n <li>\n <a href=\'#\' class="collapseResource" data-id="'+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+'">\n List Operations\n </a>\n </li>\n <li>\n <a href=\'#\' class="expandResource" data-id="'+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+'">\n Expand Operations\n </a>\n </li>\n ',i=null!=(i=t.url||(null!=e?e.url:e))?i:o,r={name:"url",hash:{},fn:this.program(3,a),inverse:this.noop,data:a},s=typeof i===l?i.call(e,r):i,t.url||(s=u.call(e,s,r)),null!=s&&(h+=s),h+"\n </ul>\n</div>\n<ul class='endpoints' id='"+p((i=null!=(i=t.id||(null!=e?e.id:e))?i:o,typeof i===l?i.call(e,{name:"id",hash:{},data:a}):i))+"_endpoint_list' style='display:none'>\n\n</ul>\n"},useData:!0});var ResponseContentTypeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ResponseContentTypeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=responseContentType]",$(this.el)).text("Response Content Type"),this},t.prototype.template=function(){return Handlebars.templates.response_content_type},t}(Backbone.View),this.Handlebars.templates.response_content_type=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(i+=s),i},2:function(e){var t,n=this.lambda,a=' <option value="';return t=n(e,e),null!=t&&(a+=t),a+='">',t=n(e,e),null!=t&&(a+=t),a+"</option>\n"},4:function(){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i='<label for="responseContentType"></label>\n<select name="responseContentType">\n';return s=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(4,a),data:a}),null!=s&&(i+=s),i+"</select>\n"},useData:!0});var SignatureView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;SignatureView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"},t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),this.switchToSnippet(),this.isParam=this.model.isParam,this.isParam&&$(".notice",$(this.el)).text("Click to set as parameter value"),this},t.prototype.template=function(){return Handlebars.templates.signature},t.prototype.switchToDescription=function(e){return null!=e&&e.preventDefault(),$(".snippet",$(this.el)).hide(),$(".description",$(this.el)).show(),$(".description-link",$(this.el)).addClass("selected"),$(".snippet-link",$(this.el)).removeClass("selected")},t.prototype.switchToSnippet=function(e){return null!=e&&e.preventDefault(),$(".description",$(this.el)).hide(),$(".snippet",$(this.el)).show(),$(".snippet-link",$(this.el)).addClass("selected"),$(".description-link",$(this.el)).removeClass("selected")},t.prototype.snippetToTextArea=function(e){var t;return this.isParam&&(null!=e&&e.preventDefault(),t=$("textarea",$(this.el.parentNode.parentNode.parentNode)),""===$.trim(t.val()))?t.val(this.model.sampleJSON):void 0},t}(Backbone.View),this.Handlebars.templates.signature=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p='<div>\n<ul class="signature-nav">\n <li><a class="description-link" href="#">Model</a></li>\n <li><a class="snippet-link" href="#">Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n <div class="description">\n ';return i=null!=(i=t.signature||(null!=e?e.signature:e))?i:l,s=typeof i===r?i.call(e,{name:"signature",hash:{},data:a}):i,null!=s&&(p+=s),p+'\n </div>\n\n <div class="snippet">\n <pre><code>'+o((i=null!=(i=t.sampleJSON||(null!=e?e.sampleJSON:e))?i:l,typeof i===r?i.call(e,{name:"sampleJSON",hash:{},data:a}):i))+'</code></pre>\n <small class="notice"></small>\n </div>\n</div>\n\n'},useData:!0});var StatusCodeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;StatusCodeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e,t,n;return n=this.template(),$(this.el).html(n(this.model)),swaggerUi.api.models.hasOwnProperty(this.model.responseModel)?(e={sampleJSON:JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(),null,2),isParam:!1,signature:swaggerUi.api.models[this.model.responseModel].getMockSignature()},t=new SignatureView({model:e,tagName:"div"}),$(".model-signature",this.$el).append(t.render().el)):$(".model-signature",this.$el).html(""),this},t.prototype.template=function(){return Handlebars.templates.status_code},t}(Backbone.View),this.Handlebars.templates.status_code=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="<td width='15%' class='code'>"+o((i=null!=(i=t.code||(null!=e?e.code:e))?i:l,typeof i===r?i.call(e,{name:"code",hash:{},data:a}):i))+"</td>\n<td>";return i=null!=(i=t.message||(null!=e?e.message:e))?i:l,s=typeof i===r?i.call(e,{name:"message",hash:{},data:a}):i,null!=s&&(p+=s),p+"</td>\n<td width='50%'><span class=\"model-signature\" /></td>"},useData:!0});
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/main/resources/migrations.xml b/catalog-core/catalog-mgr/src/main/resources/migrations.xml deleted file mode 100644 index 84181c62..00000000 --- a/catalog-core/catalog-mgr/src/main/resources/migrations.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog - http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> - - <changeSet id="org.openo.commontosca.catalog.createObj" author="db_resource" runAlways = "true"> - <sqlFile path="./conf/catalog-resource-createObj-mysql.sql"/> - </changeSet> - - <changeSet id="org.openo.commontosca.catalog.insert" author="db_resource" runAlways = "true"> - <sqlFile path="./conf/catalog-resource-insert-mysql.sql"/> - </changeSet> - - <changeSet id="org.openo.commontosca.catalog.extend.insert" author="db_resource" runAlways = "true"> - <sqlFile path="./conf/catalog-resource-insert-extend-mysql.sql"/> - </changeSet> - -</databaseChangeLog> diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/IntegrationManager.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/IntegrationManager.java deleted file mode 100644 index d0068af1..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/IntegrationManager.java +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.resource; - - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.H2DbServer; -import org.openo.commontosca.catalog.db.util.HibernateSession; - -import java.util.ArrayList; - -public class IntegrationManager { - private static PackageManager packageManager; - private static TemplateManager templateManager; - - /** - * startup H2DB session before class. - * @throws Exception e - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - H2DbServer.startUp(); - DaoManager.getInstance().setSessionFactory(HibernateSession.init()); - packageManager = PackageManager.getInstance(); - templateManager = TemplateManager.getInstance(); - } - - /** - * destory H2DB session after class. - * @throws Exception e - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - try { - HibernateSession.destory(); - DaoManager.getInstance().setDaoNull(); - H2DbServer.shutDown(); - } catch (Exception e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - @Before - public void setUp() { - initPackageInfo(); - initTemplateInfo(); - } - - /** - * init package information. - */ - public void initPackageInfo() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - data.setName("AG"); - data.setVersion("v1.0"); - data.setProvider("ZTE"); - try { - packageManager.addPackage(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * delete package information. - */ - public void deletePackageInfo() { - try { - packageManager.deletePackage("10001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * init template information. - */ - public void initTemplateInfo() { - ServiceTemplateData serviceData = new ServiceTemplateData(); - serviceData.setCsarId("10001"); - serviceData.setServiceTemplateId("20001"); - serviceData.setVendor("ZTE"); - serviceData.setVersion("v1.0"); - NodeTemplateData nodeData = new NodeTemplateData(); - nodeData.setName("node"); - nodeData.setNodeTemplateId("30001"); - nodeData.setServiceTemplateId("20001"); - ArrayList<NodeTemplateData> nodelist = new ArrayList<NodeTemplateData>(); - nodelist.add(nodeData); - TemplateData data = new TemplateData(); - data.setServiceTemplate(serviceData); - data.setNodeTemplates(nodelist); - try { - templateManager.addServiceTemplate(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * delete template. - */ - public void deleteTemplate() { - try { - templateManager.deleteServiceTemplateById("20001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - @After - public void tearDown() { - deleteTemplate(); - deletePackageInfo(); - } - - @Test - public void testDeletePackageByServiceTemplateId() { - try { - packageManager.deletePackageByServiceTemplateId("20001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = packageManager.queryPackageByServiceTemplateId("20001"); - } catch (CatalogResourceException e2) { - Assert.fail("Exception" + e2.getMessage()); - } - Assert.assertTrue(list.size() == 0); - } - - @Test - public void testQueryPackageByServiceTemplateId() { - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = packageManager.queryPackageByServiceTemplateId("20001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - - @Test - public void testDeleteServiceTemplateByCsarPackageInfo() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - ArrayList<ServiceTemplateData> list = new ArrayList<ServiceTemplateData>(); - try { - templateManager.deleteServiceTemplateByCsarPackageInfo(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - try { - list = templateManager.queryServiceTemplateByCsarPackageInfo(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() == 0); - } - - @Test - public void testQueryServiceTemplateByCsarPackageInfo() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - ArrayList<ServiceTemplateData> list = new ArrayList<ServiceTemplateData>(); - try { - list = templateManager.queryServiceTemplateByCsarPackageInfo(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/PackageManagerTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/PackageManagerTest.java deleted file mode 100644 index 32ac3198..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/PackageManagerTest.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.resource; - -import static org.junit.Assert.assertTrue; - - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openo.commontosca.catalog.db.common.Parameters; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.H2DbServer; -import org.openo.commontosca.catalog.db.util.HibernateSession; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - - -public class PackageManagerTest { - private static PackageManager manager; - - /** - * startup db session before class. - * @throws Exception e - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - H2DbServer.startUp(); - DaoManager.getInstance().setSessionFactory(HibernateSession.init()); - manager = PackageManager.getInstance(); - } - - /** - * destory db session after class. - * @throws Exception e - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - try { - HibernateSession.destory(); - DaoManager.getInstance().setPackageDao(null); - H2DbServer.shutDown(); - } catch (Exception e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * create data before test. - */ - @Before - public void setUp() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - data.setName("AG"); - data.setVersion("v1.0"); - data.setProvider("ZTE"); - try { - manager.addPackage(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * delete data after test. - */ - @After - public void tearDown() { - try { - manager.deletePackage("10001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - @Test - public void testAddPackageRepeat() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - data.setName("AG"); - data.setVersion("v1.0"); - data.setProvider("ZTE"); - try { - manager.addPackage(data); - Assert.fail("no exception"); - } catch (CatalogResourceException e1) { - Assert.assertTrue(true); - } - - } - - @Test - public void testQueryPackageByCsarId_exist() { - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = manager.queryPackageByCsarId("10001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - - @Test - public void testQueryPackageByCsarId_not_exist() { - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = manager.queryPackageByCsarId("10002"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() == 0); - } - - @Test - public void testQueryPackage_exist() { - - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = manager.queryPackage("AG", "ZTE", "v1.0", null, null); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - - } - - @Test - public void testQueryPackage_not_exist() { - - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = manager.queryPackage("AG", "ZTE", "v2.0", null, null); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() == 0); - - } - - @Test - public void testUpdatePackage() { - PackageData data = new PackageData(); - data.setSize("20M"); - try { - manager.updatePackage(data, "10001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.csarId.name(), "10001"); - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = manager.queryPackageByCsarId("10001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - assertTrue(list.size() > 0 && list.get(0).getSize().equals("20M")); - } - -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java deleted file mode 100644 index b977832f..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.resource; - - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.H2DbServer; -import org.openo.commontosca.catalog.db.util.HibernateSession; - -import java.util.ArrayList; - -public class TemplateManagerTest { - private static TemplateManager manager; - - /** - * startup db session before class. - * @throws Exception e - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - H2DbServer.startUp(); - DaoManager.getInstance().setSessionFactory(HibernateSession.init()); - manager = TemplateManager.getInstance(); - } - - /** - * destory db session after class. - * @throws Exception e - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - try { - HibernateSession.destory(); - DaoManager.getInstance().setTemplateDao(null); - DaoManager.getInstance().setServiceTemplateDao(null); - DaoManager.getInstance().setNodeTemplateDao(null); - H2DbServer.shutDown(); - } catch (Exception e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * create data before test. - */ - @Before - public void setUp() { - ServiceTemplateData serviceData = new ServiceTemplateData(); - serviceData.setCsarId("10001"); - serviceData.setServiceTemplateId("20001"); - serviceData.setRowData("EEEEEEWERWEREWRERWEREW"); - serviceData.setOperations("SDFSDFDSERWERWE"); - serviceData.setVendor("ZTE"); - serviceData.setVersion("v1.0"); - serviceData.setMetadata("metadata"); - serviceData.setServiceTemplateOriginalId("NS_01"); - NodeTemplateData nodeData = new NodeTemplateData(); - nodeData.setName("node"); - nodeData.setNodeTemplateId("30001"); - nodeData.setServiceTemplateId("20001"); - ArrayList<NodeTemplateData> nodelist = new ArrayList<NodeTemplateData>(); - nodelist.add(nodeData); - TemplateData data = new TemplateData(); - data.setServiceTemplate(serviceData); - data.setNodeTemplates(nodelist); - try { - manager.addServiceTemplate(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * delete data after test. - */ - @After - public void tearDown() { - try { - manager.deleteServiceTemplateById("20001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - @Test - public void testAddServiceTemplateRepeat() { - ServiceTemplateData serviceData = new ServiceTemplateData(); - TemplateData data = new TemplateData(); - data.setServiceTemplate(serviceData); - serviceData.setCsarId("10001"); - serviceData.setServiceTemplateId("20001"); - serviceData.setVendor("ZTE"); - serviceData.setVersion("v1.0"); - serviceData.setMetadata("metadata"); - serviceData.setServiceTemplateOriginalId("NS_01"); - NodeTemplateData nodeData = new NodeTemplateData(); - nodeData.setName("node"); - nodeData.setServiceTemplateId("20001"); - ArrayList<NodeTemplateData> nodelist = new ArrayList<NodeTemplateData>(); - nodelist.add(nodeData); - data.setNodeTemplates(nodelist); - try { - manager.addServiceTemplate(data); - Assert.fail("no exception"); - } catch (CatalogResourceException e1) { - Assert.assertTrue(true); - } - } - - @Test - public void testQueryServiceTemplateById() { - ArrayList<ServiceTemplateData> list = new ArrayList<ServiceTemplateData>(); - try { - list = manager.queryServiceTemplateById("20001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - @Test - public void testQueryServiceTemplateByIdAndMetadataIsNotNull() { - ArrayList<ServiceTemplateData> list = new ArrayList<ServiceTemplateData>(); - try { - list = manager.queryServiceTemplateById("20001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert - .assertTrue(list.size() > 0 && "NS_01".equals(list.get(0).getServiceTemplateOriginalId())); - } - @Test - public void testQueryServiceTemplate() { - - ArrayList<ServiceTemplateData> list = new ArrayList<ServiceTemplateData>(); - try { - list = manager.queryServiceTemplate(null, "v1.0", "ZTE"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - - } - - @Test - public void testQueryNodeTemplateBySeriviceTemplateId() { - ArrayList<NodeTemplateData> list = new ArrayList<NodeTemplateData>(); - try { - list = manager.queryNodeTemplateBySeriviceTemplateId("20001"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - - @Test - public void testQueryNodeTemplateById() { - ArrayList<NodeTemplateData> list = new ArrayList<NodeTemplateData>(); - try { - list = manager.queryNodeTemplateById("20001", null); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateMappingManagerTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateMappingManagerTest.java deleted file mode 100644 index 1297a39a..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateMappingManagerTest.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.resource; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.H2DbServer; -import org.openo.commontosca.catalog.db.util.HibernateSession; - -import java.util.ArrayList; - - -public class TemplateMappingManagerTest { - private static TemplateManager manager; - - /** - * startup db session before class. - * @throws Exception e - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - H2DbServer.startUp(); - DaoManager.getInstance().setSessionFactory(HibernateSession.init()); - manager = TemplateManager.getInstance(); - } - - /** - * destory db session after class. - * @throws Exception e - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - try { - HibernateSession.destory(); - DaoManager.getInstance().setTemplateDao(null); - H2DbServer.shutDown(); - } catch (Exception e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * create data before test. - */ - @Before - public void setUp() { - ServiceTemplateMappingData serviceMappingData = new ServiceTemplateMappingData(); - serviceMappingData.setCapabilities("wsectdSDFSDFDSXCVFertregdDFGDFG"); - serviceMappingData.setRequirements("REWREWRWE#$#"); - serviceMappingData.setNodeType("NS"); - serviceMappingData.setServiceTemplateId("10020"); - serviceMappingData.setMappingId("10000"); - try { - manager.addServiceTemplateMapping(serviceMappingData); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * delete data after test. - */ - @After - public void tearDown() { - try { - manager.deleteServiceTemplateMappingById("10000"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - @Test - public void testAddServiceTemplateRepeat() { - ServiceTemplateMappingData serviceMappingData = new ServiceTemplateMappingData(); - serviceMappingData.setCapabilities("wsectdSDFSDFDSXCVFertregdDFGDFG"); - serviceMappingData.setRequirements("REWREWRWE#$#"); - serviceMappingData.setNodeType("NS"); - serviceMappingData.setServiceTemplateId("10020"); - serviceMappingData.setMappingId("10000"); - try { - manager.addServiceTemplateMapping(serviceMappingData); - Assert.fail("no exception"); - } catch (CatalogResourceException e1) { - Assert.assertTrue(true); - } - } - - @Test - public void testServiceTemplateMappingById() { - ArrayList<ServiceTemplateMappingData> list = new ArrayList<ServiceTemplateMappingData>(); - try { - list = manager.queryServiceTemplateMappingById("10000"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - - @Test - public void testQueryServiceTemplateMapping() { - - ArrayList<ServiceTemplateMappingData> list = new ArrayList<ServiceTemplateMappingData>(); - try { - list = manager.queryServiceTemplateMapping("NS", "10020"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - try { - list = manager.queryServiceTemplateMapping("NS", ""); - } catch (CatalogResourceException e2) { - Assert.fail("Exception" + e2.getMessage()); - } - Assert.assertTrue(list.size() > 0); - try { - list = manager.queryServiceTemplateMapping("", "10020"); - } catch (CatalogResourceException e3) { - Assert.fail("Exception" + e3.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - - @Test - public void testDeleteServiceTemplateMapping() { - - ArrayList<ServiceTemplateMappingData> list = new ArrayList<ServiceTemplateMappingData>(); - try { - manager.deleteServiceTemplateMapping("NS", "10020"); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - try { - list = manager.queryServiceTemplateMapping("NS", "10020"); - } catch (CatalogResourceException e2) { - Assert.fail("Exception" + e2.getMessage()); - } - Assert.assertTrue(list.size() == 0); - } - - @Test - public void testQueryAllServiceTemplateMapping() { - - ArrayList<ServiceTemplateMappingData> list = new ArrayList<ServiceTemplateMappingData>(); - try { - list = manager.queryServiceTemplateMapping("", ""); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/dao/PackageDaoTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/dao/PackageDaoTest.java deleted file mode 100644 index 2f27676e..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/dao/PackageDaoTest.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.resource.dao; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openo.commontosca.catalog.db.common.Parameters; -import org.openo.commontosca.catalog.db.dao.PackageDao; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.util.H2DbServer; -import org.openo.commontosca.catalog.db.util.HibernateSession; -import org.openo.commontosca.catalog.db.util.HqlFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -public class PackageDaoTest { - - private static PackageDao packageDao; - - /** - * setup db session before class. - * @throws Exception e - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - H2DbServer.startUp(); - packageDao = new PackageDao(HibernateSession.init()); - - } - - /** - * shutdown db session before class. - * @throws Exception e - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - try { - HibernateSession.destory(); - H2DbServer.shutDown(); - } catch (Exception e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * create data before test. - * @throws Exception e - */ - @Before - public void setUp() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - data.setName("AG"); - try { - packageDao.create(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /** - * delete data after test. - * @throws Exception e - */ - @After - public void tearDown() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - try { - packageDao.delete(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - @Test - public void testQueryPackageById() { - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.csarId.name(), "10001"); - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = (ArrayList<PackageData>) packageDao.query(queryParam); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Assert.assertTrue(list.size() > 0); - } - - @Test - public void testUpdatePackage() { - PackageData data = new PackageData(); - data.setSize("20M"); - try { - packageDao.update(data, HqlFactory.getOidFilter(Parameters.csarId.name(), "10001")); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.csarId.name(), "10001"); - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = (ArrayList<PackageData>) packageDao.query(queryParam); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - assertTrue(list.size() > 0 && list.get(0).getSize().equals("20M")); - } - - @Test - public void testDeleteByOid() { - PackageData data = new PackageData(); - data.setCsarId("10001"); - try { - packageDao.delete(data); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - Map<String, String> queryParam = new HashMap<String, String>(); - queryParam.put(Parameters.csarId.name(), "10001"); - ArrayList<PackageData> list = new ArrayList<PackageData>(); - try { - list = (ArrayList<PackageData>) packageDao.query(queryParam); - } catch (CatalogResourceException e1) { - Assert.fail("Exception" + e1.getMessage()); - } - assertEquals(list.size(), 0); - } - -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/CatalogDbUtilTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/CatalogDbUtilTest.java deleted file mode 100644 index 3a559675..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/CatalogDbUtilTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.util; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -//import static org.junit.Assert.*; - -import org.junit.Test; - -public class CatalogDbUtilTest { - - @Test - public void when_generate_id_is_not_null() { - String actualUuid = CatalogDbUtil.generateId(); - assertNotNull(actualUuid); - } - - @Test - public void when_input_empty_string_output_false() { - boolean expect = false; - boolean actual = CatalogDbUtil.isNotEmpty(""); - assertEquals(expect, actual); - } - - @Test - public void when_input_blan_string_output_true() { - boolean expect = true; - boolean actual = CatalogDbUtil.isNotEmpty(" "); - assertEquals(expect, actual); - } - - @Test - public void when_input_null_string_output_false() { - boolean expect = false; - boolean actual = CatalogDbUtil.isNotEmpty(null); - assertEquals(expect, actual); - } - - @Test - public void when_input_str_string_output_true() { - boolean expect = true; - boolean actual = CatalogDbUtil.isNotEmpty("str"); - assertEquals(expect, actual); - } - -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServer.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServer.java deleted file mode 100644 index 831b9a29..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServer.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.util; - -import org.h2.tools.Server; - -import java.sql.SQLException; - - -public class H2DbServer { - - private static Server h2DbWebServer; - private static Server h2DbTcpServer; - - /** - * start up db service. - */ - public static void startUp() { - try { - h2DbWebServer = - Server.createWebServer(new String[] {"-web", "-webAllowOthers", "-webPort", "8206"}); - h2DbWebServer.start(); - - h2DbTcpServer = - Server.createTcpServer(new String[] {"-tcp", "-tcpAllowOthers", "-tcpPort", "8205"}); - h2DbTcpServer.start(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - - /** - * shut down db service. - */ - public static void shutDown() { - if (h2DbWebServer.isRunning(true)) { - h2DbWebServer.stop(); - h2DbWebServer.shutdown(); - } - if (h2DbTcpServer.isRunning(true)) { - h2DbTcpServer.stop(); - h2DbTcpServer.shutdown(); - } - } -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java deleted file mode 100644 index 327de491..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.util; - -import org.apache.tools.ant.Project; -import org.apache.tools.ant.taskdefs.SQLExec; -import org.apache.tools.ant.types.EnumeratedAttribute; - -import java.io.File; -import java.net.URISyntaxException; - -public class H2DbServerUtil { - private static String resourcePath; - - /** - * init data table. - */ - public static void initTable() { - init(); - SQLExec sqlExec = new SQLExec(); - // set db connetc parameter - sqlExec.setDriver("org.h2.Driver"); - sqlExec.setUrl("jdbc:h2:tcp://localhost:8205/" + resourcePath + "db/catalog"); - sqlExec.setUserid("catalog"); - sqlExec.setPassword("catalog"); - // execute sql - sqlExec.setSrc(new File(resourcePath + "sql/catalog-resource-createObj-mysql.sql")); - sqlExec.setOnerror((SQLExec.OnError) (EnumeratedAttribute.getInstance(SQLExec.OnError.class, - "abort"))); - sqlExec.setPrint(true); // set print - sqlExec.setProject(new Project()); - sqlExec.execute(); - } - - private static void init() { - try { - resourcePath = HibernateSession.class.getResource("/").toURI().getPath(); - } catch (URISyntaxException e1) { - e1.printStackTrace(); - } - } - - /** - * test. - */ - public static void main(String args[]) { - H2DbServer.startUp(); - H2DbServerUtil.initTable(); - H2DbServer.shutDown(); - } -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HibernateSession.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HibernateSession.java deleted file mode 100644 index 93b02f64..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HibernateSession.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.util; - -import org.hibernate.SessionFactory; -import org.hibernate.boot.registry.StandardServiceRegistryBuilder; -import org.hibernate.cfg.Configuration; -import org.hibernate.service.ServiceRegistry; - -import java.io.File; -import java.net.URISyntaxException; - -public class HibernateSession { - private static File cfgfile = null; - - private static ServiceRegistry serviceRegistry = null; - private static Configuration configuration = null; - private static SessionFactory sessionFactory = null; - private static String resourcePath; - - /** - * Get a hibernate sessionFactory. - */ - public static SessionFactory init() { - initConfigure(); - configuration = new Configuration().configure(cfgfile); - configuration.setProperty("hibernate.connection.url", "jdbc:h2:tcp://localhost:8205/" - + resourcePath + "db/catalog"); - serviceRegistry = - new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); - sessionFactory = configuration.buildSessionFactory(serviceRegistry); - return sessionFactory; - } - - private static void initConfigure() { - try { - resourcePath = HibernateSession.class.getResource("/").toURI().getPath(); - } catch (URISyntaxException e1) { - e1.printStackTrace(); - } - final String filename = "Hibernate.cfg.xml"; - cfgfile = new File(resourcePath + filename); - } - - /** - * Destory a hibernate sessionFactory. - */ - public static void destory() { - if (sessionFactory != null && !sessionFactory.isClosed()) { - sessionFactory.close(); - } - } - - /* Maybe you don't need it. */ - private static void removeCfgFile() { - if (cfgfile.exists()) { - cfgfile.deleteOnExit(); - } - } - - /** - * test. - * @param args param - */ - public static void main(String[] args) { - // createCfgFile(); - // removeCfgFile(); - - - } -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HqlFactoryTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HqlFactoryTest.java deleted file mode 100644 index 0e0fa66f..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HqlFactoryTest.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.db.util; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; - -public class HqlFactoryTest { - - @Test - public void when_input_entity_output_udatehql() { - PackageData data = new PackageData(); - String filter = "csarId='xd03dsfsdfsfsdfsd'"; - data.setName("csarName"); - data.setType("NS"); - String expect = - "update PackageData set name='csarName',type='NS' where csarId='xd03dsfsdfsfsdfsd'"; - String actual = HqlFactory.getUpdateHql(data, null, filter); - assertEquals(expect, actual); - } - - @Test - public void when_input_null_testContain_output_false() { - boolean expect = false; - boolean actual = HqlFactory.contain(null, "name"); - assertEquals(expect, actual); - String[] src = new String[0]; - actual = HqlFactory.contain(src, "name"); - assertEquals(expect, actual); - src = new String[1]; - actual = HqlFactory.contain(src, null); - assertEquals(expect, actual); - } - - @Test - public void when_input_src_contain_target_testContain_output_true() { - boolean expect = true; - String[] src = {"name", "type"}; - String target = "name"; - boolean actual = HqlFactory.contain(src, target); - assertEquals(expect, actual); - } - - @Test - public void when_input_src_not_contain_target_testContain_output_false() { - boolean expect = false; - String[] src = {"name", "type"}; - String target = "version"; - boolean actual = HqlFactory.contain(src, target); - assertEquals(expect, actual); - } - - @Test - public void testGetOidFilter() { - // fail("Not yet implemented"); - String key = "csarId"; - String value = "xd03dsfsdfsfsdfsd"; - String expect = "csarId= 'xd03dsfsdfsfsdfsd'"; - String actual = HqlFactory.getOidFilter(key, value); - assertEquals(expect, actual); - } - - @Test - public void when_input_entity_output_queryhql() { - PackageData data = new PackageData(); - String filter = "csarId"; - data.setName("csarName"); - data.setType("NS"); - String expect = "select q.csarId from PackageData as q where q.name='csarName' and q.type='NS'"; - String actual = HqlFactory.getQueryHql(data, filter); - assertEquals(expect, actual); - } - - @Test - public void when_input_entity_output_getQueryHqlByFilter() { - PackageData data = new PackageData(); - String filter = "csarId"; - data.setName("csarName"); - data.setType("NS"); - String expect = - " from ServiceTemplateData as a where a.csarId " - + "in(select q.csarId from PackageData as q " - + "where q.name='csarName' and q.type='NS')"; - String actual = HqlFactory.getQueryHqlByFilter(ServiceTemplateData.class, data, filter); - assertEquals(expect, actual); - } - - @Test - public void when_input_entity_output_getDeleteHqlByFilter() { - PackageData data = new PackageData(); - String filter = "csarId"; - data.setName("csarName"); - data.setType("NS"); - String expect = - "delete from ServiceTemplateData as b where b.csarId " - + "in(select q.csarId from PackageData as q " - + "where q.name='csarName' and q.type='NS')"; - String actual = HqlFactory.getDeleteHqlByFilter(ServiceTemplateData.class, data, filter); - assertEquals(expect, actual); - } -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/PackageWrapperTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/PackageWrapperTest.java deleted file mode 100644 index 4181512d..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/PackageWrapperTest.java +++ /dev/null @@ -1,312 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.wrapper; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openo.commontosca.catalog.CatalogAppConfiguration; -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.common.HttpServerAddrConfig; -import org.openo.commontosca.catalog.common.HttpServerPathConfig; -import org.openo.commontosca.catalog.common.MsbAddrConfig; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.PackageManager; -import org.openo.commontosca.catalog.db.util.H2DbServer; -import org.openo.commontosca.catalog.db.util.HibernateSession; -import org.openo.commontosca.catalog.entity.EnumOnboardState; -import org.openo.commontosca.catalog.entity.EnumOperationalState; -import org.openo.commontosca.catalog.entity.EnumProcessState; -import org.openo.commontosca.catalog.entity.EnumUsageState; -import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; -import org.openo.commontosca.catalog.entity.response.PackageMeta; -import org.openo.commontosca.catalog.model.parser.EnumPackageFormat; -import org.openo.commontosca.catalog.model.parser.ModelParserFactory; -import org.openo.commontosca.catalog.model.parser.yaml.zte.ToscaYamlModelParser; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.util.ArrayList; - -import javax.ws.rs.core.Response; - -public class PackageWrapperTest { - private static String resourcePath; - - static { - MsbAddrConfig.setMsbAddress("http://10.74.44.28:80"); - HttpServerAddrConfig.setHttpServerAddress("http://127.0.0.1:8080"); - HttpServerPathConfig.setHttpServerPath("../tomcat/webapps/ROOT/"); - - CatalogAppConfiguration configuration = new CatalogAppConfiguration(); - Config.setConfigration(configuration); - Config.getConfigration().setParserType("zte"); - ModelParserFactory.getInstance().put(EnumPackageFormat.TOSCA_YAML, new TestYamlModelParser()); - } - - private static PackageManager manager; - - - /** - * startup db session before class. - * @throws Exception e - */ - @BeforeClass - public static void setUpBeforeClass() throws CatalogResourceException { - H2DbServer.startUp(); - DaoManager.getInstance().setSessionFactory(HibernateSession.init()); - manager = PackageManager.getInstance(); - CatalogAppConfiguration configuration = new CatalogAppConfiguration(); - Config.setConfigration(configuration); - System.out.println("Set up before class"); - } - - /** - * create data before test. - */ - @Before - public void setUp() throws Exception { - ArrayList<PackageData> packageList = manager.queryPackage(null, null, null, null, null); - if (packageList != null && packageList.size() > 0) { - for (int i = 0; i < packageList.size(); i++) { - String packageOid = packageList.get(i).getCsarId(); - manager.deletePackage(packageOid); - } - } - ArrayList<PackageData> packageList2 = manager.queryPackage(null, null, null, null, null); - if (packageList2 != null && packageList2.size() > 0) { - for (int j = 0; j < packageList2.size(); j++) { - if (packageList2.get(j).getCsarId().equals("123456")) { - manager.updatePackage(getPackageData(), "123456"); - } else { - PackageData packageData = new PackageData(); - packageData = getPackageData(); - manager.addPackage(packageData); - } - } - } else { - PackageData packageData = new PackageData(); - packageData = getPackageData(); - manager.addPackage(packageData); - } - } - - // @Ignore - @Test - public void testUploadPackage() throws Exception { - InputStream ins = null; - Response result = null; - Response result1 = null; - Response result2 = null; - // PackageData packageData = new PackageData(); - // packageData = getPackageData(); - - FormDataContentDisposition fileDetail = - FormDataContentDisposition.name("fileName").fileName("NanocellGW.csar").build(); - - try { - resourcePath = HibernateSession.class.getResource("/").toURI().getPath(); - } catch (URISyntaxException e1) { - e1.printStackTrace(); - } - final String filename = "NanocellGW.csar"; - File packageFile = new File(resourcePath + filename); - try { - ins = new FileInputStream(packageFile); - } catch (FileNotFoundException e2) { - e2.printStackTrace(); - } - if (ins != null) { - try { - result = PackageWrapper.getInstance().uploadPackage(ins, fileDetail, null); - } catch (Exception e3) { - e3.printStackTrace(); - } - } - assertNotNull(result); - assertEquals(200, result.getStatus()); - assertNotNull(result.getEntity()); - - try { - result1 = PackageWrapper.getInstance().uploadPackage(null, fileDetail, null); - } catch (Exception e4) { - e4.printStackTrace(); - } - assertEquals(500, result1.getStatus()); - - try { - result2 = PackageWrapper.getInstance().uploadPackage(ins, null, null); - } catch (Exception e5) { - e5.printStackTrace(); - } - assertEquals(500, result2.getStatus()); - } - - @Test - public void testQueryPackageById() throws Exception { - PackageMeta metas = new PackageMeta(); - metas = getPackageMeta(); - - Response result = PackageWrapper.getInstance().queryPackageById("123456"); - assertEquals(200, result.getStatus()); - //assertEquals(metas, result.getEntity()); - } - - @Test - public void testQueryPackageByCond() { - ArrayList<PackageMeta> metas = new ArrayList<PackageMeta>(); - metas = getPackageMetaList(); - System.out.println("Test query package by Id"); - Response result = - PackageWrapper.getInstance().queryPackageListByCond("NanocellGW", "ZTE", "V1.0", "false", - "NSAR"); - assertEquals(200, result.getStatus()); - //assertEquals(metas, result.getEntity()); - } - - @Test - public void testUpdatePackageStatus() { - System.out.println("Test update package status"); - Response result = - PackageWrapper.getInstance().updatePackageStatus("123456", "Enabled", "NotInUse", "true", - "onBoarding", "true"); - assertEquals(200, result.getStatus()); - } - - @Test - public void testGetCsarFileUri() { - System.out.println("Test get csar file uri "); - CsarFileUriResponse expectResult = new CsarFileUriResponse(); - String csarFileUri = - getDownloadUriHead() + "/NSAR/ZTE/NanocellGW/v1.0/NanocellGW/images/segw.img"; - String localUri = HttpServerPathConfig.getHttpServerPath() - + "NSAR/ZTE/NanocellGW/v1.0/NanocellGW/images/segw.img"; - File srcDir = new File(localUri); - String localPath = srcDir.getAbsolutePath().replace("\\", "/"); - - expectResult.setDownloadUri(csarFileUri); - expectResult.setLocalPath(localPath); - Response result = PackageWrapper.getInstance().getCsarFileUri("123456", "/images/segw.img"); - assertEquals(200, result.getStatus()); - //assertEquals(expectResult, result.getEntity()); - } - - // @Test - // public void testDelPackage() { - // System.out.println("Test delete package "); - // Response result = PackageWrapper.getInstance().delPackage("123456"); - // assertEquals(204, result.getStatus()); - // try { - // Thread.sleep(5000); - // } catch (InterruptedException e1) { - // e1.printStackTrace(); - // } - // } - - /** - * delete data after test. - */ - @After - public void tearDown() throws Exception { - ArrayList<PackageData> packageList = manager.queryPackageByCsarId("123456"); - if (packageList != null && packageList.size() != 0) { - manager.deletePackage("123456"); - } else { - return; - } - System.out.println("Tear down"); - } - - /** - * destory db session after class. - * @throws Exception e - */ - @AfterClass - public static void tearDownAfterClass() { - try { - HibernateSession.destory(); - DaoManager.getInstance().setDaoNull(); - H2DbServer.shutDown(); - } catch (Exception e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - private PackageData getPackageData() { - PackageData packageData = new PackageData(); - packageData.setCsarId("123456"); - packageData.setCreateTime("2016-06-29 03:33:15"); - packageData.setDeletionPending("false"); - packageData.setDownloadUri("/NSAR/ZTE/NanocellGW/v1.0/"); - packageData.setFormat("yml"); - packageData.setModifyTime("2016-06-29 03:33:15"); - packageData.setName("NanocellGW"); - packageData.setOnBoardState("non-onBoarded"); - packageData.setOperationalState("Disabled"); - packageData.setProvider("ZTE"); - packageData.setSize("0.93M"); - packageData.setType("NSAR"); - packageData.setUsageState("InUse"); - packageData.setVersion("V1.0"); - packageData.setProcessState("normal"); - return packageData; - } - - private ArrayList<PackageMeta> getPackageMetaList() { - PackageMeta meta = new PackageMeta(); - meta = getPackageMeta(); - ArrayList<PackageMeta> metas = new ArrayList<PackageMeta>(); - metas.add(meta); - return metas; - } - - private PackageMeta getPackageMeta() { - PackageMeta meta = new PackageMeta(); - meta.setCreateTime("2016-06-29 03:33:15"); - meta.setCsarId("123456"); - meta.setDeletionPending(false); - meta.setDownloadUri(getDownloadUriHead() - + "/NSAR/ZTE/NanocellGW/v1.0/NanocellGW.csar"); - meta.setFormat("yml"); - meta.setModifyTime("2016-06-29 03:33:15"); - meta.setName("NanocellGW"); - meta.setOperationalState(EnumOperationalState.valueOf("Disabled")); - meta.setProvider("ZTE"); - meta.setSize("0.93M"); - meta.setType("NSAR"); - meta.setUsageState(EnumUsageState.valueOf("InUse")); - meta.setVersion("V1.0"); - meta.setOnBoardState(EnumOnboardState.nonOnBoarded.getValue()); - meta.setProcessState(EnumProcessState.valueOf("normal")); - return meta; - } - - private String getDownloadUriHead() { - return MsbAddrConfig.getMsbAddress() + "/files/catalog-http"; - } -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/ServiceTemplateWrapperTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/ServiceTemplateWrapperTest.java deleted file mode 100644 index 76af3744..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/ServiceTemplateWrapperTest.java +++ /dev/null @@ -1,489 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.wrapper; - -import static org.junit.Assert.assertEquals; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openo.commontosca.catalog.CatalogAppConfiguration; -import org.openo.commontosca.catalog.common.Config; -import org.openo.commontosca.catalog.common.HttpServerAddrConfig; -import org.openo.commontosca.catalog.common.HttpServerPathConfig; -import org.openo.commontosca.catalog.common.MsbAddrConfig; -import org.openo.commontosca.catalog.common.ToolUtil; -import org.openo.commontosca.catalog.db.dao.DaoManager; -import org.openo.commontosca.catalog.db.entity.NodeTemplateData; -import org.openo.commontosca.catalog.db.entity.PackageData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; -import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.commontosca.catalog.db.entity.TemplateData; -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.db.resource.PackageManager; -import org.openo.commontosca.catalog.db.resource.TemplateManager; -import org.openo.commontosca.catalog.db.util.H2DbServer; -import org.openo.commontosca.catalog.db.util.HibernateSession; -import org.openo.commontosca.catalog.entity.EnumOperationalState; -import org.openo.commontosca.catalog.model.entity.InputParameter; -import org.openo.commontosca.catalog.model.entity.NodeTemplate; -import org.openo.commontosca.catalog.model.entity.OutputParameter; -import org.openo.commontosca.catalog.model.entity.Parameters; -import org.openo.commontosca.catalog.model.entity.QueryRawDataCondition; -import org.openo.commontosca.catalog.model.entity.RelationShip; -import org.openo.commontosca.catalog.model.entity.ServiceTemplate; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; -import org.openo.commontosca.catalog.model.entity.ServiceTemplateRawData; -import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; -import org.openo.commontosca.catalog.model.wrapper.ServiceTemplateWrapper; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - - -public class ServiceTemplateWrapperTest { - private static ServiceTemplateWrapper serviceTemplateWrapper; - private static TemplateManager templateManager; - private static PackageManager packageManager; - - static { - CatalogAppConfiguration configuration = new CatalogAppConfiguration(); - Config.setConfigration(configuration); - Config.getConfigration().setMsbServerAddr("http://127.0.0.1:80"); - - HttpServerAddrConfig.setHttpServerAddress("http://127.0.0.1:8201"); - HttpServerPathConfig.setHttpServerPath("../tomcat/webapps/ROOT/"); - } - - /** - * startup db session before class. - */ - @BeforeClass - public static void setUpBeforeClass() { - H2DbServer.startUp(); - DaoManager.getInstance().setDaoNull(); - DaoManager.getInstance().setSessionFactory(HibernateSession.init()); - serviceTemplateWrapper = ServiceTemplateWrapper.getInstance(); - templateManager = TemplateManager.getInstance(); - packageManager = PackageManager.getInstance(); - CatalogAppConfiguration configuration = new CatalogAppConfiguration(); - Config.setConfigration(configuration); - System.out.println("Set up before class"); - } - - /** - * clean database. - */ - @Before - public void setUp() throws Exception { - /*Response packageListResult = packageWrapper.queryPackageListByCond(null, - null, null, null, null); - @SuppressWarnings("unchecked") - ArrayList<PackageMeta> packageList = (ArrayList<PackageMeta>) packageListResult.getEntity(); - for (PackageMeta packageMeta:packageList) { - String csarId = packageMeta.getCsarId(); - packageWrapper.delPackage(csarId); - }*/ - ArrayList<ServiceTemplateData> servicetemplates = templateManager.queryServiceTemplate( - null, null, null); - if (null != servicetemplates && servicetemplates.size() > 0) { - for (int i = 0; i < servicetemplates.size(); i++) { - String serviceTemplateId = servicetemplates.get(i).getServiceTemplateId(); - templateManager.deleteServiceTemplateById(serviceTemplateId); - } - } - //uploadPackage(); - TemplateData templateData = new TemplateData(); - templateData = setTemplateData(); - templateManager.addServiceTemplate(templateData); - - ServiceTemplateMappingData templateMappingData = new ServiceTemplateMappingData(); - templateMappingData = setTemplateMappingData(); - templateManager.addServiceTemplateMapping(templateMappingData); - - ArrayList<PackageData> packageList = packageManager.queryPackage(null, null, null, null, null); - if (packageList != null && packageList.size() > 0) { - for (int i = 0; i < packageList.size(); i++) { - String packageOid = packageList.get(i).getCsarId(); - packageManager.deletePackage(packageOid); - } - } - PackageData packageData = new PackageData(); - packageData = getPackageData(); - packageManager.addPackage(packageData); - - //ArrayList<ServiceTemplateData> serviceTemplates = templateManager - //.queryServiceTemplate(null, null, null); - //ArrayList<NodeTemplateData> nodeTemplateDatas = templateManager - //.queryNodeTemplateBySeriviceTemplateId("serviceTemplateId"); - System.out.println("Set up before"); - } - - - - @Test - public void testGetServiceTemplates() throws CatalogResourceException { - ServiceTemplate[] expectResult = getExpectServiceTemplates(); - ServiceTemplate[] result1 = serviceTemplateWrapper.getServiceTemplates(null, false); - assertEquals(expectResult, result1); - - ServiceTemplate[] result2 = serviceTemplateWrapper.getServiceTemplates(EnumOperationalState.Enabled, false); - assertEquals(new ServiceTemplate[0], result2); - } - - @Test - public void testGetNestingServiceTemplate() throws CatalogResourceException { - ServiceTemplate[] expectResult = getExpectServiceTemplates(); - String[] nodeTypeIds = new String[]{"tosca.nodes.nfv.VL"}; - ServiceTemplate[] result = serviceTemplateWrapper.getNestingServiceTemplate(nodeTypeIds); - assertEquals(expectResult, result); - } - - @Test - public void testGetNodeTemplatesByType() throws CatalogResourceException { - NodeTemplate[] expectResult = getExpectNodeTemplates(); - NodeTemplate[] result1 = serviceTemplateWrapper.getNodeTemplates("serviceTemplateId", null); - assertEquals(1, result1.length); - result1[0].setId("nodeTemplateId"); - assertEquals(expectResult, result1); - - String[] types = {"tosca.nodes.nfv.VL"}; - NodeTemplate[] result2 = serviceTemplateWrapper.getNodeTemplates("serviceTemplateId", types); - assertEquals(1, result2.length); - result2[0].setId("nodeTemplateId"); - assertEquals(expectResult, result2); - } - - @Test - public void testGetNodeTemplateById() throws CatalogResourceException { - NodeTemplate[] nodeTemplates = serviceTemplateWrapper.getNodeTemplates( - "serviceTemplateId", null); - NodeTemplate result = new NodeTemplate(); - if (null != nodeTemplates && nodeTemplates.length > 0) { - String nodeTemplateId = nodeTemplates[0].getId(); - result = serviceTemplateWrapper.getNodeTemplateById( - "serviceTemplateId", nodeTemplateId); - result.setId("nodeTemplateId"); - } - NodeTemplate expectResult = getExpectNodeTemplate(); - assertEquals(expectResult, result); - } - - @Test - public void testGetServiceTemplateOperations() throws CatalogResourceException { - ServiceTemplateOperation[] expectResult = getServiceTemplateOperation(); - ServiceTemplateOperation[] result = serviceTemplateWrapper - .getTemplateOperations("serviceTemplateId"); - assertEquals(expectResult, result); - } - - @Test - public void testGetServiceTemplateById() throws CatalogResourceException { - ServiceTemplate expectResult = getExpectServiceTemplate(); - ServiceTemplate result = serviceTemplateWrapper.getServiceTemplateById("serviceTemplateId"); - assertEquals(expectResult, result); - } - - @Test - public void testGetServiceTemplateParameters() throws CatalogResourceException { - Parameters expectResult = getParameters(); - Parameters result = serviceTemplateWrapper.getServiceTemplateParameters("serviceTemplateId"); - assertEquals(expectResult, result); - } - - @Test - public void testGetParametersByOperationName() throws CatalogResourceException { - InputParameter[] expectResult = getServiceTemplateInputs(); - InputParameter[] result = serviceTemplateWrapper.getParametersByOperationName( - "serviceTemplateId", "init"); - assertEquals(expectResult, result); - } - - @Test - public void testGetServiceTemplateRawData() throws Exception { - ServiceTemplateRawData expectResult = new ServiceTemplateRawData(); - expectResult.setRawData("rawData"); - QueryRawDataCondition queryCondition = new QueryRawDataCondition(); - queryCondition.setCsarId("123456"); - ServiceTemplateRawData result = serviceTemplateWrapper - .getServiceTemplateRawData(queryCondition); - assertEquals(expectResult, result); - } - - /** - * delete data after test. - */ - @After - public void tearDown() throws Exception { - packageManager.deletePackage("123456"); - templateManager.deleteServiceTemplateById("serviceTemplateId"); - templateManager.deleteServiceTemplateMapping(null, "serviceTemplateId"); - System.out.println("Tear down"); - } - - /** - * destory db session after class. - */ - @AfterClass - public static void tearDownAfterClass() { - try { - HibernateSession.destory(); - DaoManager.getInstance().setDaoNull(); - H2DbServer.shutDown(); - } catch (Exception e1) { - Assert.fail("Exception" + e1.getMessage()); - } - } - - /*private void uploadPackage() { - InputStream ins = null; - - FormDataContentDisposition fileDetail = - FormDataContentDisposition.name("fileName").fileName("NanocellGW.csar").build(); - - try { - resourcePath = HibernateSession.class.getResource("/").toURI().getPath(); - } catch (URISyntaxException e1) { - e1.printStackTrace(); - } - final String filename = "NanocellGW.csar"; - File packageFile = new File(resourcePath + filename); - try { - ins = new FileInputStream(packageFile); - } catch (FileNotFoundException e2) { - e2.printStackTrace(); - } - if (ins != null) { - try { - PackageWrapper.getInstance().uploadPackage(ins, fileDetail, null); - } catch (Exception e3) { - e3.printStackTrace(); - } - } - }*/ - - private TemplateData setTemplateData() { - ServiceTemplateData serviceTemplate = new ServiceTemplateData(); - ArrayList<NodeTemplateData> nodeTemplates = new ArrayList<NodeTemplateData>(); - NodeTemplateData nodeTemplate = new NodeTemplateData(); - serviceTemplate = setServiceTemplate(); - nodeTemplate = setNodeTemplate(); - nodeTemplates.add(nodeTemplate); - TemplateData templateData = new TemplateData(); - templateData.setServiceTemplate(serviceTemplate); - templateData.setNodeTemplates(nodeTemplates); - return templateData; - } - - private NodeTemplateData setNodeTemplate() { - NodeTemplateData nodeTemplate = new NodeTemplateData(); - nodeTemplate.setName("nodeName"); - nodeTemplate.setNodeTemplateId("nodeTemplateId"); - String properties = "{\"cidr\":\"\",\"gateWay\":\"\",\"dhcp\":\"\"}"; - nodeTemplate.setProperties(properties); - String relationShips = "[{\"sourceNodeName\":\"endpoint.vlan2\"," - + "\"targetNodeName\":\"VLAN\"," - + "\"sourceNodeId\":\"tosca_nodes_nfv_CP_4\"," - + "\"targetNodeId\":\"tosca_nodes_nfv_VL_1\"," - + "\"type\":\"tosca.relationships.nfv.VirtualLinksTo\"}]"; - nodeTemplate.setRelationShips(relationShips); - nodeTemplate.setServiceTemplateId("serviceTemplateId"); - nodeTemplate.setType("tosca.nodes.nfv.VL"); - return nodeTemplate; - } - - private ServiceTemplateData setServiceTemplate() { - ServiceTemplateData serviceTemplate = new ServiceTemplateData(); - serviceTemplate.setCsarId("123456"); - serviceTemplate.setDownloadUri("/Definitions/segw.yml"); - String inputs = "{\"inputs\":[{\"name\": \"SubscribersPerNfc\"," - + "\"type\": \"STRING\",\"description\": \"\",\"required\": false}]," - + "\"outputs\":[]}"; - serviceTemplate.setInputs(inputs); - String operations = "[{\"name\":\"init\",\"description\":\"\"," - + "\"packageName\":\"NanocellGW\",\"processId\":\"\"," - + "\"inputs\":[{\"name\": \"SubscribersPerNfc\"," - + "\"type\": \"STRING\",\"description\": \"\"," - + "\"required\": false}]}]"; - serviceTemplate.setOperations(operations); - serviceTemplate.setRowData("rawData"); - serviceTemplate.setServiceTemplateId("serviceTemplateId"); - serviceTemplate.setTemplateName("templateName"); - serviceTemplate.setType("NS"); - serviceTemplate.setVendor("ZTE"); - serviceTemplate.setVersion("0.0.1"); - return serviceTemplate; - } - - private ServiceTemplateMappingData setTemplateMappingData() { - ServiceTemplateMappingData mappingData = new ServiceTemplateMappingData(); - mappingData.setCapabilities(""); - mappingData.setMappingId("mappingId"); - mappingData.setNodeType("tosca.nodes.nfv.VL"); - mappingData.setRequirements(""); - mappingData.setServiceTemplateId("serviceTemplateId"); - return mappingData; - } - - private ServiceTemplate[] getExpectServiceTemplates() { - ServiceTemplate serviceTemplate = new ServiceTemplate(); - serviceTemplate = getExpectServiceTemplate(); - ServiceTemplate[] serviceTemplates = new ServiceTemplate[1]; - serviceTemplates[0] = serviceTemplate; - return serviceTemplates; - } - - private ServiceTemplate getExpectServiceTemplate() { - ServiceTemplate serviceTemplate = new ServiceTemplate(); - serviceTemplate.setCsarId("123456"); - serviceTemplate.setDownloadUri(MsbAddrConfig.getMsbAddress() - + "/files/catalog-http/NSAR/ZTE/NanocellGW/v1.0/NanocellGW/Definitions/segw.yml"); - InputParameter[] inputs = getServiceTemplateInputs(); - serviceTemplate.setInputs(inputs); - ServiceTemplateOperation[] operations = getServiceTemplateOperation(); - serviceTemplate.setOperations(operations); - OutputParameter[] outputs = getOutputs(); - serviceTemplate.setOutputs(outputs); - serviceTemplate.setServiceTemplateId("serviceTemplateId"); - serviceTemplate.setTemplateName("templateName"); - serviceTemplate.setType("NS"); - serviceTemplate.setVendor("ZTE"); - serviceTemplate.setVersion("0.0.1"); - serviceTemplate.setSubstitution( - new SubstitutionMapping("serviceTemplateId", "tosca.nodes.nfv.VL")); - return serviceTemplate; - } - - private OutputParameter[] getOutputs() { - String outputsStr = "[]"; - OutputParameter[] outputs = ToolUtil.fromJson(outputsStr, OutputParameter[].class); - return outputs; - } - - private ServiceTemplateOperation[] getServiceTemplateOperation() { - String operationsStr = "[{\"name\":\"init\",\"description\":\"\"," - + "\"packageName\":\"NanocellGW\",\"processId\":\"\"," - + "\"inputs\":[{\"name\": \"SubscribersPerNfc\"," - + "\"type\": \"STRING\",\"description\": \"\"," - + "\"required\": false}]}]"; - ServiceTemplateOperation[] operations = ToolUtil.fromJson(operationsStr, - ServiceTemplateOperation[].class); - return operations; - } - - private InputParameter[] getServiceTemplateInputs() { - String inputsStr = "[{\"name\": \"SubscribersPerNfc\"," - + "\"type\": \"STRING\",\"description\": \"\",\"required\": false}]"; - InputParameter[] inputs = ToolUtil.fromJson(inputsStr, InputParameter[].class); - return inputs; - } - - private Parameters getParameters() { - String parametersStr = "{\"inputs\":[{\"name\": \"SubscribersPerNfc\"," - + "\"type\": \"STRING\",\"description\": \"\",\"required\": false}]," - + "\"outputs\":[]}"; - Parameters parameters = ToolUtil.fromJson(parametersStr, Parameters.class); - return parameters; - } - - private NodeTemplate[] getExpectNodeTemplates() { - NodeTemplate nodeTemplate = new NodeTemplate(); - nodeTemplate = getExpectNodeTemplate(); - NodeTemplate[] nodeTemplates = new NodeTemplate[1]; - nodeTemplates[0] = nodeTemplate; - return nodeTemplates; - } - - private NodeTemplate getExpectNodeTemplate() { - NodeTemplate nodeTemplate = new NodeTemplate(); - nodeTemplate.setId("nodeTemplateId"); - nodeTemplate.setName("nodeName"); - String propertiesStr = "{\"cidr\":\"\",\"gateWay\":\"\",\"dhcp\":\"\"}"; - Map<String, Object> properties = convert2Property(propertiesStr); - nodeTemplate.setProperties(properties); - String relationShipsStr = "[{\"sourceNodeName\":\"endpoint.vlan2\"," - + "\"targetNodeName\":\"VLAN\"," - + "\"sourceNodeId\":\"tosca_nodes_nfv_CP_4\"," - + "\"targetNodeId\":\"tosca_nodes_nfv_VL_1\"," - + "\"type\":\"tosca.relationships.nfv.VirtualLinksTo\"}]"; - List<RelationShip> relationShips = convert2RelationShipList(relationShipsStr); - nodeTemplate.setRelationShips(relationShips); - nodeTemplate.setType("tosca.nodes.nfv.VL"); - return nodeTemplate; - } - - private Map<String, Object> convert2Property(String properties) { - JsonObject jsonObject = new Gson().fromJson(properties, JsonObject.class); - return parseMapValue(jsonObject); - } - - private Map<String, Object> parseMapValue(JsonObject jsonObject) { - Map<String, Object> map = new HashMap<>(); - - Iterator<Entry<String, JsonElement>> iterator = jsonObject.entrySet().iterator(); - while (iterator.hasNext()) { - Entry<String, JsonElement> next = iterator.next(); - if (next.getValue() instanceof JsonPrimitive) { - map.put(next.getKey(), next.getValue().getAsString()); - continue; - } - - if (next.getValue() instanceof JsonObject) { - map.put(next.getKey(), parseMapValue((JsonObject) next.getValue())); - continue; - } - } - return map; - } - - private List<RelationShip> convert2RelationShipList(String srelationShips) { - RelationShip[] relationShips = ToolUtil.fromJson(srelationShips, RelationShip[].class); - return Arrays.asList(relationShips); - } - - private PackageData getPackageData() { - PackageData packageData = new PackageData(); - packageData.setCsarId("123456"); - packageData.setCreateTime("2016-06-29 03:33:15"); - packageData.setDeletionPending("false"); - packageData.setDownloadUri("/NSAR/ZTE/NanocellGW/v1.0/"); - packageData.setFormat("yml"); - packageData.setModifyTime("2016-06-29 03:33:15"); - packageData.setName("NanocellGW"); - packageData.setOnBoardState("non-onBoarded"); - packageData.setOperationalState("Disabled"); - packageData.setProvider("ZTE"); - packageData.setSize("0.93M"); - packageData.setType("NSAR"); - packageData.setUsageState("InUse"); - packageData.setVersion("V1.0"); - packageData.setProcessState("normal"); - return packageData; - } -} diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/TestYamlModelParser.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/TestYamlModelParser.java deleted file mode 100644 index ba9db346..00000000 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/TestYamlModelParser.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.commontosca.catalog.wrapper; - -import org.openo.commontosca.catalog.db.exception.CatalogResourceException; -import org.openo.commontosca.catalog.model.parser.AbstractModelParser; - -public class TestYamlModelParser extends AbstractModelParser { - - /* (non-Javadoc) - * @see org.openo.commontosca.catalog.model.parser.AbstractModelParser#parse(java.lang.String, java.lang.String) - */ - @Override - public String parse(String packageId, String fileLocation) throws CatalogResourceException { - // TODO Auto-generated method stub - return packageId; - } - -} diff --git a/catalog-core/catalog-mgr/src/test/resources/Hibernate.cfg.xml b/catalog-core/catalog-mgr/src/test/resources/Hibernate.cfg.xml deleted file mode 100644 index 07af8c8a..00000000 --- a/catalog-core/catalog-mgr/src/test/resources/Hibernate.cfg.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<!DOCTYPE hibernate-configuration PUBLIC -"-//Hibernate/Hibernate Configuration DTD 3.0//EN" -"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> -<hibernate-configuration> -<session-factory> - <property name="show_sql">true</property> - <property name="dialect">org.hibernate.dialect.H2Dialect</property> - <property name="hibernate.connection.driver_class">org.h2.Driver</property> - <property name="hibernate.connection.url">jdbc:h2:tcp://localhost:8205/./db/catalog</property> - <property name="hibernate.connection.username">catalog</property> - <property name="hibernate.connection.password">catalog</property> - <property name="hbm2ddl">update</property> - <property name="current_session_context_class">thread</property> - <mapping class="org.openo.commontosca.catalog.db.entity.NodeTemplateData"/> - <mapping class="org.openo.commontosca.catalog.db.entity.PackageData"/> - <mapping class="org.openo.commontosca.catalog.db.entity.ServiceTemplateData"/> - <mapping class="org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData"/> -</session-factory> -</hibernate-configuration>
\ No newline at end of file diff --git a/catalog-core/catalog-mgr/src/test/resources/NanocellGW.csar b/catalog-core/catalog-mgr/src/test/resources/NanocellGW.csar Binary files differdeleted file mode 100644 index d41b6b99..00000000 --- a/catalog-core/catalog-mgr/src/test/resources/NanocellGW.csar +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/test/resources/db/catalog.mv.db b/catalog-core/catalog-mgr/src/test/resources/db/catalog.mv.db Binary files differdeleted file mode 100644 index 02d0712e..00000000 --- a/catalog-core/catalog-mgr/src/test/resources/db/catalog.mv.db +++ /dev/null diff --git a/catalog-core/catalog-mgr/src/test/resources/sql/catalog-resource-createObj-mysql.sql b/catalog-core/catalog-mgr/src/test/resources/sql/catalog-resource-createObj-mysql.sql deleted file mode 100644 index 209c2598..00000000 --- a/catalog-core/catalog-mgr/src/test/resources/sql/catalog-resource-createObj-mysql.sql +++ /dev/null @@ -1,76 +0,0 @@ ---
--- Copyright 2016 ZTE Corporation.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-DROP TABLE IF EXISTS catalog_package_table;
-
-CREATE TABLE catalog_package_table (
- CSARID VARCHAR(200) NOT NULL,
- DOWNLOADURI VARCHAR(200) NULL,
- SIZE VARCHAR(100) NULL,
- FORMAT VARCHAR(100) NULL,
- CREATETIME VARCHAR(100) NULL,
- DELETIONPENDING VARCHAR(100) NULL,
- MODIFYTIME VARCHAR(100) NULL,
- OPERATIONALSTATE VARCHAR(100) NULL,
- USAGESTATE VARCHAR(100) NULL,
- ONBOARDSTATE VARCHAR(100) NULL,
- NAME VARCHAR(100) NULL,
- VERSION VARCHAR(20) NULL,
- PROVIDER VARCHAR(300) NULL,
- TYPE VARCHAR(300) NULL,
- PROCESSSTATE VARCHAR(100) NULL,
- CONSTRAINT CATALOG_PACKAGE_TABLE_OID PRIMARY KEY(CSARID)
-);
-
-DROP TABLE IF EXISTS catalog_service_template_table;
-CREATE TABLE catalog_service_template_table (
- SERVICETEMPLATEID VARCHAR(200) NOT NULL,
- TEMPLATENAME VARCHAR(100) NULL,
- TYPE VARCHAR(50) NULL,
- VENDOR VARCHAR(100) NULL,
- VERSION VARCHAR(20) NULL,
- CSARID VARCHAR(100) NULL,
- INPUTS LONGTEXT NULL,
- ROWDATA LONGTEXT NULL,
- OPERATIONS LONGTEXT NULL,
- DOWNLOADURI VARCHAR(200) NULL,
- SERVICETEMPLATEORIGINALID VARCHAR(100) NULL,
- METADATA LONGTEXT NULL,
-
- CONSTRAINT CATALOG_SERVICE_TEMPLATE_TABLE_OID PRIMARY KEY(SERVICETEMPLATEID)
-);
-
-DROP TABLE IF EXISTS catalog_node_template_table;
-CREATE TABLE catalog_node_template_table (
- NODETEMPLATEID VARCHAR(200) NOT NULL,
- NAME VARCHAR(100) NULL,
- SERVICETEMPLATEID VARCHAR(200) NULL,
- TYPE VARCHAR(50) NULL,
- PROPERTIES LONGTEXT NULL,
- RELATIONSHIPS LONGTEXT NULL,
-
- CONSTRAINT catalog_node_template_table PRIMARY KEY(NODETEMPLATEID)
-);
-DROP TABLE IF EXISTS catalog_model_substitution_mapping_table;
-CREATE TABLE catalog_model_substitution_mapping_table (
- MAPPINGID VARCHAR(200) NOT NULL,
- NODETYPE VARCHAR(100) NULL,
- SERVICETEMPLATEID VARCHAR(200) NULL,
- REQUIREMENTS LONGTEXT NULL,
- CAPABILITIES LONGTEXT NULL,
-
- CONSTRAINT catalog_model_substitution_mapping_table PRIMARY KEY(MAPPINGID)
-);
diff --git a/catalog-core/distribution/catalog-all/pom.xml b/catalog-core/distribution/catalog-all/pom.xml deleted file mode 100644 index 9ce872e1..00000000 --- a/catalog-core/distribution/catalog-all/pom.xml +++ /dev/null @@ -1,231 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>distribution</artifactId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>catalog-all</artifactId> - <name>common-tosca-catalog/catalog-core/distribution/catalog-all</name> - <packaging>pom</packaging> - - <build> - <plugins> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <executions> - <execution> - <id>copy-resources-${linux64id}</id> - <phase>process-resources</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${linux64outputdir}</outputDirectory> - <resources> - <resource> - <directory>src/main/assembly/</directory> - <filtering>false</filtering> - <includes> - <include>**/*</include> - </includes> - <excludes> - <exclude>**/*.bat</exclude> - </excludes> - </resource> - </resources> - <overwrite>true</overwrite> - </configuration> - </execution> - <execution> - <id>copy-resources-${win64id}</id> - <phase>process-resources</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${win64outputdir}</outputDirectory> - <resources> - <resource> - <directory>src/main/assembly/</directory> - <filtering>false</filtering> - <includes> - <include>**/*</include> - </includes> - <excludes> - <exclude>**/*.sh</exclude> - </excludes> - </resource> - </resources> - <overwrite>true</overwrite> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>unpack-catalog-${linux64id}</id> - <goals> - <goal>unpack</goal> - </goals> - <phase>prepare-package</phase> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-standalone</artifactId> - <type>tar.gz</type> - <classifier>linux64</classifier> - </artifactItem> - </artifactItems> - <excludes>**/*.bat,*.cmd</excludes> - <outputDirectory>${linux64outputdir}/catalog</outputDirectory> - <overWriteReleases>false</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename> - </configuration> - </execution> - <execution> - <id>unpack-httpserver-${linux64id}</id> - <goals> - <goal>unpack</goal> - </goals> - <phase>prepare-package</phase> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>httpserver</artifactId> - <type>zip</type> - </artifactItem> - </artifactItems> - <excludes>**/*.bat,*.cmd</excludes> - <outputDirectory>${linux64outputdir}</outputDirectory> - <overWriteReleases>false</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename> - </configuration> - </execution> - <execution> - <id>unpack-catalog-${win64id}</id> - <goals> - <goal>unpack</goal> - </goals> - <phase>prepare-package</phase> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-standalone</artifactId> - <type>zip</type> - <classifier>win64</classifier> - </artifactItem> - </artifactItems> - <excludes>*.sh,*/*.sh,*/*/*.sh</excludes> - <outputDirectory>${win64outputdir}/catalog</outputDirectory> - <overWriteReleases>false</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename> - </configuration> - </execution> - <execution> - <id>unpack-httpserver-${win64id}</id> - <goals> - <goal>unpack</goal> - </goals> - <phase>prepare-package</phase> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>httpserver</artifactId> - <type>zip</type> - </artifactItem> - </artifactItems> - <excludes>*.sh,*/*.sh,*/*/*.sh</excludes> - <outputDirectory>${win64outputdir}</outputDirectory> - <overWriteReleases>false</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>distribution</id> - <phase>package</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <target name="distribution"> - <tar destfile="${version.output}/${packagename}-${project.version}-linux64.tar.gz" longfile="posix" compression="gzip"> - <tarfileset dir="target/assembly/linux64" filemode="0644" dirmode="0755"> - <exclude name="**/*.sh"/> - </tarfileset> - <tarfileset dir="target/assembly/linux64" filemode="0755" dirmode="0755"> - <include name="**/*.sh"/> - </tarfileset> - </tar> - <attachartifact file="${version.output}/${packagename}-${project.version}-linux64.tar.gz" classifier="linux64" type="tar.gz"/> - <zip destfile="${version.output}/${packagename}-${project.version}-win64.zip" update="true"> - <zipfileset dir="target/assembly/win64" includes="**"/> - </zip> - <attachartifact file="${version.output}/${packagename}-${project.version}-win64.zip" classifier="win64" type="zip"/> - </target> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <dependencies> - <dependency> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-standalone</artifactId> - <version>${project.version}</version> - <type>zip</type> - <classifier>win64</classifier> - </dependency> - <dependency> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-standalone</artifactId> - <version>${project.version}</version> - <type>tar.gz</type> - <classifier>linux64</classifier> - </dependency> - <dependency> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>httpserver</artifactId> - <version>${project.version}</version> - <type>zip</type> - </dependency> - </dependencies> -</project> diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.bat b/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.bat deleted file mode 100644 index 06663fe2..00000000 --- a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.bat +++ /dev/null @@ -1,28 +0,0 @@ -@REM
-@REM Copyright 2016 ZTE Corporation.
-@REM
-@REM Licensed under the Apache License, Version 2.0 (the "License");
-@REM you may not use this file except in compliance with the License.
-@REM You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing, software
-@REM distributed under the License is distributed on an "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@REM See the License for the specific language governing permissions and
-@REM limitations under the License.
-@REM
-
-@echo off
-title catalog
-
-set RUNHOME=%~dp0
-echo ##RUNHOME %RUNHOME%
-
-
-echo ### Starting catalog
-start /D %RUNHOME%catalog bin\stop.bat
-
-echo ### Starting tomcat
-start /D %RUNHOME%tomcat bin\shutdown.bat
diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh b/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh deleted file mode 100644 index 291e3555..00000000 --- a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright 2016 ZTE Corporation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -DIRNAME=`dirname $0` -RUNHOME=`cd $DIRNAME/; pwd` -echo @RUNHOME@ $RUNHOME - -echo "### Starting catalog"; -cd catalog -$RUNHOME/catalog/bin/stop.sh & -cd $RUNHOME - - -echo "\n\n### Starting catalog-http server" -cd ./tomcat -export CATALINA_HOME=$RUNHOME/tomcat -export CATALINA_BASE=$RUNHOME/tomcat -$RUNHOME/tomcat/bin/shutdown.sh & -echo "### Starting catalog end..."; diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/startup.bat b/catalog-core/distribution/catalog-all/src/main/assembly/startup.bat deleted file mode 100644 index fbd74a73..00000000 --- a/catalog-core/distribution/catalog-all/src/main/assembly/startup.bat +++ /dev/null @@ -1,30 +0,0 @@ -@REM
-@REM Copyright 2016 ZTE Corporation.
-@REM
-@REM Licensed under the Apache License, Version 2.0 (the "License");
-@REM you may not use this file except in compliance with the License.
-@REM You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing, software
-@REM distributed under the License is distributed on an "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@REM See the License for the specific language governing permissions and
-@REM limitations under the License.
-@REM
-
-@echo off
-title catalog
-
-set RUNHOME=%~dp0
-echo ##RUNHOME %RUNHOME%
-
-
-echo ### Starting catalog
-start /D %RUNHOME%catalog bin\run.bat
-set CATALINA_HOME=%RUNHOME%tomcat
-set CATALINA_BASE=%RUNHOME%tomcat
-echo ### Starting tomcat
-start /D %RUNHOME%tomcat bin\startup.bat
-
diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh b/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh deleted file mode 100644 index b9e8ea68..00000000 --- a/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright 2016 ZTE Corporation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -DIRNAME=`dirname $0` -RUNHOME=`cd $DIRNAME/; pwd` -echo @RUNHOME@ $RUNHOME - -echo "### Starting catalog"; -cd catalog -$RUNHOME/catalog/bin/run.sh & -cd $RUNHOME - - -echo "\n\n### Starting catalog-http server" -cd ./tomcat -if [ ! -d "$RUNHOME/tomcat/logs" ]; then - mkdir $RUNHOME/tomcat/logs -fi -export CATALINA_HOME=$RUNHOME/tomcat -export CATALINA_BASE=$RUNHOME/tomcat -$RUNHOME/tomcat/bin/startup.sh & -echo "### Starting catalog end..."; - diff --git a/catalog-core/distribution/catalog-standalone/pom.xml b/catalog-core/distribution/catalog-standalone/pom.xml deleted file mode 100644 index 605b9d50..00000000 --- a/catalog-core/distribution/catalog-standalone/pom.xml +++ /dev/null @@ -1,168 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>distribution</artifactId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>catalog-standalone</artifactId> - <name>common-tosca-catalog/catalog-core/distribution/catalog-standalone</name> - <packaging>pom</packaging> - - <build> - <plugins> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <executions> - <execution> - <id>copy-resources-${linux64id}</id> - <phase>process-resources</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${linux64outputdir}</outputDirectory> - <resources> - <resource> - <directory>src/main/assembly/</directory> - <filtering>false</filtering> - <includes> - <include>**/*</include> - </includes> - <excludes> - <exclude>**/*.bat</exclude> - </excludes> - </resource> - </resources> - <overwrite>true</overwrite> - </configuration> - </execution> - <execution> - <id>copy-resources-${win64id}</id> - <phase>process-resources</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${win64outputdir}</outputDirectory> - <resources> - <resource> - <directory>src/main/assembly/</directory> - <filtering>false</filtering> - <includes> - <include>**/*</include> - </includes> - <excludes> - <exclude>**/*.sh</exclude> - </excludes> - </resource> - </resources> - <overwrite>true</overwrite> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-jar-${linux64id}</id> - <goals> - <goal>copy</goal> - </goals> - <phase>prepare-package</phase> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-mgr</artifactId> - <type>jar</type> - <overWrite>true</overWrite> - <outputDirectory>${linux64outputdir}</outputDirectory> - <destFileName>catalog-service.jar</destFileName> - </artifactItem> - </artifactItems> - </configuration> - </execution> - <execution> - <id>copy-jar-${win64id}</id> - <goals> - <goal>copy</goal> - </goals> - <phase>prepare-package</phase> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-mgr</artifactId> - <type>jar</type> - <overWrite>true</overWrite> - <outputDirectory>${win64outputdir}</outputDirectory> - <destFileName>catalog-service.jar</destFileName> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>distribution</id> - <phase>package</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <target name="distribution"> - <tar destfile="${version.output}/${packagename}-${project.version}-linux64.tar.gz" longfile="posix" compression="gzip"> - <tarfileset dir="target/assembly/linux64" filemode="0644" dirmode="0755"> - <exclude name="**/*.sh"/> - </tarfileset> - <tarfileset dir="target/assembly/linux64" filemode="0755" dirmode="0755"> - <include name="**/*.sh"/> - </tarfileset> - </tar> - <attachartifact file="${version.output}/${packagename}-${project.version}-linux64.tar.gz" classifier="linux64" type="tar.gz"/> - <zip destfile="${version.output}/${packagename}-${project.version}-win64.zip" update="true"> - <zipfileset dir="target/assembly/win64" includes="**"/> - </zip> - <attachartifact file="${version.output}/${packagename}-${project.version}-win64.zip" classifier="win64" type="zip"/> - </target> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-mgr</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> -</project> diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/find_kill_process.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/find_kill_process.bat deleted file mode 100644 index a4a2f069..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/find_kill_process.bat +++ /dev/null @@ -1,24 +0,0 @@ -@REM
-@REM Copyright 2016 ZTE Corporation.
-@REM
-@REM Licensed under the Apache License, Version 2.0 (the "License");
-@REM you may not use this file except in compliance with the License.
-@REM You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing, software
-@REM distributed under the License is distributed on an "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@REM See the License for the specific language governing permissions and
-@REM limitations under the License.
-@REM
-
-echo %1 | findstr %2 >NUL
-echo ERRORLEVEL=%ERRORLEVEL%
-IF ERRORLEVEL 1 goto findend
-for /f "tokens=1" %%a in (%1) do (
- echo kill %1
- taskkill /F /pid %%a
-)
-:findend
\ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/initDB.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/initDB.bat deleted file mode 100644 index 10749c3a..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/initDB.bat +++ /dev/null @@ -1,34 +0,0 @@ -@REM -@REM Copyright 2016 ZTE Corporation. -@REM -@REM Licensed under the Apache License, Version 2.0 (the "License"); -@REM you may not use this file except in compliance with the License. -@REM You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. -@REM - -@echo off -set HOME=%~dp0 -set user=%1 -set password=%2 -set port=%3 -set host=%4 -echo start init catalog db -echo HOME=%HOME% -set main_path=%HOME%..\ -cd /d %main_path% -mysql -u%user% -p%password% -P%port% -h%host% < %main_path%\dbscripts\mysql\openo-common_tosca-catalog-createobj.sql -set "err=%errorlevel%" -if "%err%"=="0" ( - echo init catalog db success - ) else ( - echo failed init catalog db - pause - )
\ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/initDB.sh b/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/initDB.sh deleted file mode 100644 index 9cde0cd7..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/initDB.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 ZTE Corporation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -DIRNAME=`dirname $0` -HOME=`cd $DIRNAME/; pwd` -user=$1 -password=$2 -port=$3 -host=$4 -echo "start init catalog db" -main_path=$HOME/../ -mysql -u$user -p$password -P$port -h$host <$main_path/dbscripts/mysql/openo-common_tosca-catalog-createobj.sql -sql_result=$? -if [ $sql_result != 0 ] ; then - echo "failed to init catalog database!" - exit 1 -fi -echo "init catalog database success!" -exit 0 - diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/run.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/run.bat deleted file mode 100644 index 74c64b1f..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/run.bat +++ /dev/null @@ -1,41 +0,0 @@ -@REM
-@REM Copyright 2016 ZTE Corporation.
-@REM
-@REM Licensed under the Apache License, Version 2.0 (the "License");
-@REM you may not use this file except in compliance with the License.
-@REM You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing, software
-@REM distributed under the License is distributed on an "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@REM See the License for the specific language governing permissions and
-@REM limitations under the License.
-@REM
-
-@echo off
-title catalog-service
-
-set RUNHOME=%~dp0
-echo ### RUNHOME: %RUNHOME%
-echo ### Starting catalog-service
-set main_path=%RUNHOME%..\
-cd /d %main_path%
-set JAVA="%JAVA_HOME%\bin\java.exe"
-set port=8312
-set jvm_opts=-Xms50m -Xmx128m
-rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n
-set class_path=%main_path%;%main_path%catalog-service.jar
-echo ### jvm_opts: %jvm_opts%
-echo ### class_path: %class_path%
-
-%JAVA% -classpath %class_path% %jvm_opts% org.openo.commontosca.catalog.CatalogApp server %main_path%conf/catalog.yml
-
-IF ERRORLEVEL 1 goto showerror
-exit
-:showerror
-echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check!
-echo After checking, press any key to close
-pause
-exit
\ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/run.sh b/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/run.sh deleted file mode 100644 index 3d251af8..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/run.sh +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright 2016 ZTE Corporation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -DIRNAME=`dirname $0` -RUNHOME=`cd $DIRNAME/; pwd` -echo @RUNHOME@ $RUNHOME - -echo @JAVA_HOME@ $JAVA_HOME -JAVA="$JAVA_HOME/bin/java" -echo @JAVA@ $JAVA -main_path=$RUNHOME/../ -cd $main_path -JAVA_OPTS="-Xms50m -Xmx128m" -port=8312 -#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n" -echo @JAVA_OPTS@ $JAVA_OPTS - -class_path="$main_path/:$main_path/catalog-service.jar" -echo @class_path@ $class_path - -"$JAVA" $JAVA_OPTS -classpath "$class_path" org.openo.commontosca.catalog.CatalogApp server "$main_path/conf/catalog.yml" - diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/stop.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/stop.bat deleted file mode 100644 index 7036ade3..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/stop.bat +++ /dev/null @@ -1,34 +0,0 @@ -@REM
-@REM Copyright 2016 ZTE Corporation.
-@REM
-@REM Licensed under the Apache License, Version 2.0 (the "License");
-@REM you may not use this file except in compliance with the License.
-@REM You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing, software
-@REM distributed under the License is distributed on an "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@REM See the License for the specific language governing permissions and
-@REM limitations under the License.
-@REM
-
-@echo off
-title stopping catalog-service
-
-set HOME=%~dp0
-set Main_Class="org.openo.commontosca.catalog.CatalogApp"
-
-echo ================== catalog-service info =============================================
-echo HOME=$HOME
-echo Main_Class=%Main_Class%
-echo ===============================================================================
-
-echo ### Stopping catalog-service
-cd /d %HOME%
-
-for /f "delims=" %%i in ('"%JAVA_HOME%\bin\jcmd"') do (
- call find_kill_process "%%i" %Main_Class%
-)
-exit
\ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/stop.sh b/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/stop.sh deleted file mode 100644 index 841a4401..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/bin/stop.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 ZTE Corporation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -DIRNAME=`dirname $0` -HOME=`cd $DIRNAME/; pwd` -Main_Class="org.openo.commontosca.catalog.CatalogApp" - -echo ================== catalog-service info ============================================= -echo HOME=$HOME -echo Main_Class=$Main_Class -echo =============================================================================== -cd $HOME; pwd - -echo @WORK_DIR@ $HOME - -function save_service_pid(){ - service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'` - echo @service_pid@ $service_pid -} - -function kill_service_process(){ - ps -p $service_pid - if [ $? == 0 ]; then - kill -9 $service_pid - fi -} - -save_service_pid; -echo @C_CMD@ kill -9 $service_pid -kill_service_process;
\ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog.yml b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog.yml deleted file mode 100644 index 7bb6a5f7..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog.yml +++ /dev/null @@ -1,85 +0,0 @@ -# -# Copyright 2016 ZTE Corporation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -template: Hello, %s! - -defaultName: ${DW_DEFAULT_NAME:-Stranger} -# the micro service ip -serviceIp: -msbServerAddr: http://127.0.0.1:80 - -httpServerAddr: http://127.0.0.1:8201 - -parserType: aria - -#catalogue path to store csar temperarily -cataloguePath: ./catalog -httpServerPath: ../tomcat/webapps/ROOT/ -#database -database: - - # the name of your JDBC driver - driverClass: com.mysql.jdbc.Driver - - # the username - user: catalog - - # the password - password: catalog - - # the JDBC URL - url: jdbc:mysql://127.0.0.1:3306/catalog - -# use the simple server factory if you only want to run on a single port -#server: -# type: simple -# connector: -# type: http -# port: 8080 -server: - type: simple - rootPath: '/openoapi/catalog/v1/*' - applicationContextPath: / - adminContextPath: /admin - connector: - type: http - port: 8200 - -# Logging settings. -logging: - - # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL. - level: ALL - - # Logger-specific levels. - loggers: - - # Sets the level for 'com.example.app' to DEBUG. - org.openo.commontosca.catalog.catalog.CatalogApp: INFO - - appenders: - - type: console - threshold: INFO - timeZone: UTC - logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n" - - type: file - threshold: INFO - logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n" - currentLogFilename: ./works/logs/catalog.log - archivedLogFilenamePattern: ./works/logs/zip/catalog-%d{yyyy-MM-dd}.log.gz - archivedFileCount: 7 - timeZone: UTC - diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/dbscripts/mysql/openo-common_tosca-catalog-createobj.sql b/catalog-core/distribution/catalog-standalone/src/main/assembly/dbscripts/mysql/openo-common_tosca-catalog-createobj.sql deleted file mode 100644 index 2efd5650..00000000 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/dbscripts/mysql/openo-common_tosca-catalog-createobj.sql +++ /dev/null @@ -1,97 +0,0 @@ ---
--- Copyright 2016 ZTE Corporation.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-/******************drop old database and user***************************/
-use mysql;
-drop database IF EXISTS catalog;
-delete from user where User='catalog';
-FLUSH PRIVILEGES;
-
-/******************create new database and user***************************/
-create database catalog CHARACTER SET utf8;
-
-GRANT ALL PRIVILEGES ON catalog.* TO 'catalog'@'%' IDENTIFIED BY 'catalog' WITH GRANT OPTION;
-GRANT ALL PRIVILEGES ON mysql.* TO 'catalog'@'%' IDENTIFIED BY 'catalog' WITH GRANT OPTION;
-
-GRANT ALL PRIVILEGES ON catalog.* TO 'catalog'@'localhost' IDENTIFIED BY 'catalog' WITH GRANT OPTION;
-GRANT ALL PRIVILEGES ON mysql.* TO 'catalog'@'localhost' IDENTIFIED BY 'catalog' WITH GRANT OPTION;
-FLUSH PRIVILEGES;
-
-use catalog;
-set Names 'utf8';
-/******************delete old table and create new***************************/
-use catalog;
-DROP TABLE IF EXISTS catalog_package_table;
-
-CREATE TABLE catalog_package_table (
- CSARID VARCHAR(200) NOT NULL,
- DOWNLOADURI VARCHAR(200) NULL,
- SIZE VARCHAR(100) NULL,
- FORMAT VARCHAR(100) NULL,
- CREATETIME VARCHAR(100) NULL,
- DELETIONPENDING VARCHAR(100) NULL,
- MODIFYTIME VARCHAR(100) NULL,
- OPERATIONALSTATE VARCHAR(100) NULL,
- USAGESTATE VARCHAR(100) NULL,
- ONBOARDSTATE VARCHAR(100) NULL,
- NAME VARCHAR(100) NULL,
- VERSION VARCHAR(20) NULL,
- PROVIDER VARCHAR(300) NULL,
- TYPE VARCHAR(300) NULL,
- PROCESSSTATE VARCHAR(100) NULL,
- CONSTRAINT CATALOG_PACKAGE_TABLE_OID PRIMARY KEY(CSARID)
-);
-
-DROP TABLE IF EXISTS catalog_service_template_table;
-CREATE TABLE catalog_service_template_table (
- SERVICETEMPLATEID VARCHAR(200) NOT NULL,
- TEMPLATENAME VARCHAR(100) NULL,
- TYPE VARCHAR(50) NULL,
- VENDOR VARCHAR(100) NULL,
- VERSION VARCHAR(20) NULL,
- CSARID VARCHAR(100) NULL,
- INPUTS LONGTEXT NULL,
- ROWDATA LONGTEXT NULL,
- OPERATIONS LONGTEXT NULL,
- DOWNLOADURI VARCHAR(200) NULL,
- SERVICETEMPLATEORIGINALID VARCHAR(100) NULL,
- METADATA LONGTEXT NULL,
-
- CONSTRAINT CATALOG_SERVICE_TEMPLATE_TABLE_OID PRIMARY KEY(SERVICETEMPLATEID)
-);
-
-DROP TABLE IF EXISTS catalog_node_template_table;
-CREATE TABLE catalog_node_template_table (
- NODETEMPLATEID VARCHAR(200) NOT NULL,
- NAME VARCHAR(100) NULL,
- SERVICETEMPLATEID VARCHAR(200) NOT NULL,
- TYPE VARCHAR(50) NULL,
- PROPERTIES LONGTEXT NULL,
- RELATIONSHIPS LONGTEXT NULL,
-
- CONSTRAINT catalog_node_template_table PRIMARY KEY(NODETEMPLATEID,SERVICETEMPLATEID)
-);
-DROP TABLE IF EXISTS catalog_model_substitution_mapping_table;
-CREATE TABLE catalog_model_substitution_mapping_table (
- MAPPINGID VARCHAR(200) NOT NULL,
- NODETYPE VARCHAR(100) NULL,
- SERVICETEMPLATEID VARCHAR(200) NULL,
- REQUIREMENTS LONGTEXT NULL,
- CAPABILITIES LONGTEXT NULL,
-
- CONSTRAINT catalog_model_substitution_mapping_table PRIMARY KEY(MAPPINGID)
-);
-
diff --git a/catalog-core/distribution/pom.xml b/catalog-core/distribution/pom.xml deleted file mode 100644 index f86f1c72..00000000 --- a/catalog-core/distribution/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-core-parent</artifactId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>distribution</artifactId> - <name>common-tosca-catalog/catalog-core/distribution</name> - <packaging>pom</packaging> - - <properties> - <packagename>openo-commontosca-catalog</packagename> - <linux64id>linux64</linux64id> - <win64id>win64</win64id> - <linux64outputdir>target/assembly/${linux64id}</linux64outputdir> - <win64outputdir>target/assembly/${win64id}</win64outputdir> - <version.output>target/version</version.output> - </properties> - - <modules> - <module>catalog-standalone</module> - <module>catalog-all</module> - </modules> -</project> diff --git a/catalog-core/httpserver/pom.xml b/catalog-core/httpserver/pom.xml deleted file mode 100644 index 86f43947..00000000 --- a/catalog-core/httpserver/pom.xml +++ /dev/null @@ -1,139 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-core-parent</artifactId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>httpserver</artifactId> - <name>common-tosca-catalog/catalog-core/httpserver</name> - <packaging>pom</packaging> - - <properties> - <packagename>http-server</packagename> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>unpack-tomcat-to-temporary-dir</id> - <phase>generate-resources</phase> - <goals> - <goal>unpack</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.apache.tomcat</groupId> - <artifactId>tomcat</artifactId> - <type>zip</type> - <outputDirectory>target/tomcat</outputDirectory> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <executions> - <execution> - <id>copy-tomcat-resources</id> - <phase>process-resources</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${project.build.directory}/assembly/tomcat</outputDirectory> - <resources> - <resource> - <directory>${basedir}/target/tomcat/apache-tomcat-${tomcat.version}</directory> - <filtering>false</filtering> - <includes> - <include>**/*</include> - </includes> - </resource> - </resources> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>zip</id> - <phase>package</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks name="${project.artifactId}"> - <delete file="target/assembly/tomcat/conf/server.xml"/> - <delete file="target/assembly/tomcat/conf/web.xml"/> - <copydir src="src/main/assembly/" dest="target/assembly"/> - <zip destfile="target/${packagename}-${project.version}.zip" update="true"> - <zipfileset dir="target/assembly" includes="**"/> - </zip> - </tasks> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>attach-artifacts</id> - <phase>package</phase> - <goals> - <goal>attach-artifact</goal> - </goals> - <configuration> - <artifacts> - <artifact> - <file>target/${packagename}-${project.version}.zip</file> - <type>zip</type> - </artifact> - </artifacts> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <dependencies> - <dependency> - <groupId>org.apache.tomcat</groupId> - <artifactId>tomcat</artifactId> - <version>${tomcat.version}</version> - <type>zip</type> - </dependency> - </dependencies> -</project> diff --git a/catalog-core/httpserver/src/main/assembly/tomcat/conf/server.xml b/catalog-core/httpserver/src/main/assembly/tomcat/conf/server.xml deleted file mode 100644 index 43ffac43..00000000 --- a/catalog-core/httpserver/src/main/assembly/tomcat/conf/server.xml +++ /dev/null @@ -1,162 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<!-- Note: A "Server" is not itself a "Container", so you may not - define subcomponents such as "Valves" at this level. - Documentation at /docs/config/server.html - --> -<Server port="48005" shutdown="SHUTDOWN"> - <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> - <!-- Security listener. Documentation at /docs/config/listeners.html - <Listener className="org.apache.catalina.security.SecurityListener" /> - --> - <!--APR library loader. Documentation at /docs/apr.html --> - <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> - <!-- Prevent memory leaks due to use of particular java/javax APIs--> - <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> - <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> - <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> - - <!-- Global JNDI resources - Documentation at /docs/jndi-resources-howto.html - --> - <GlobalNamingResources> - <!-- Editable user database that can also be used by - UserDatabaseRealm to authenticate users - --> - <Resource name="UserDatabase" auth="Container" - type="org.apache.catalina.UserDatabase" - description="User database that can be updated and saved" - factory="org.apache.catalina.users.MemoryUserDatabaseFactory" - pathname="conf/tomcat-users.xml" /> - </GlobalNamingResources> - - <!-- A "Service" is a collection of one or more "Connectors" that share - a single "Container" Note: A "Service" is not itself a "Container", - so you may not define subcomponents such as "Valves" at this level. - Documentation at /docs/config/service.html - --> - <Service name="Catalina"> - - <!--The connectors can use a shared executor, you can define one or more named thread pools--> - <!-- - <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" - maxThreads="150" minSpareThreads="4"/> - --> - - - <!-- A "Connector" represents an endpoint by which requests are received - and responses are returned. Documentation at : - Java HTTP Connector: /docs/config/http.html - Java AJP Connector: /docs/config/ajp.html - APR (HTTP/AJP) Connector: /docs/apr.html - Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 - --> - <Connector port="8201" protocol="HTTP/1.1" - connectionTimeout="20000" - redirectPort="8443" /> - <!-- A "Connector" using the shared thread pool--> - <!-- - <Connector executor="tomcatThreadPool" - port="8080" protocol="HTTP/1.1" - connectionTimeout="20000" - redirectPort="8443" /> - --> - <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 - This connector uses the NIO implementation with the JSSE engine. When - using the JSSE engine, the JSSE configuration attributes must be used. - --> - <!-- - <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" - maxThreads="150" SSLEnabled="true"> - <SSLHostConfig> - <Certificate certificateKeystoreFile="conf/localhost-rsa.jks" - type="RSA" /> - </SSLHostConfig> - </Connector> - --> - <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2 - This connector uses the APR/native implementation. When using the - APR/native implementation or the OpenSSL engine with NIO or NIO2 then - the OpenSSL configuration attributes must be used. - --> - <!-- - <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" - maxThreads="150" SSLEnabled="true" > - <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> - <SSLHostConfig> - <Certificate certificateKeyFile="conf/localhost-rsa-key.pem" - certificateFile="conf/localhost-rsa-cert.pem" - certificateChainFile="conf/localhost-rsa-chain.pem" - type="RSA" /> - </SSLHostConfig> - </Connector> - --> - - <!-- Define an AJP 1.3 Connector on port 8009 --> - <!--<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />--> - - - <!-- An Engine represents the entry point (within Catalina) that processes - every request. The Engine implementation for Tomcat stand alone - analyzes the HTTP headers included with the request, and passes them - on to the appropriate Host (virtual host). - Documentation at /docs/config/engine.html --> - - <!-- You should set jvmRoute to support load-balancing via AJP ie : - <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> - --> - <Engine name="Catalina" defaultHost="localhost"> - - <!--For clustering, please take a look at documentation at: - /docs/cluster-howto.html (simple how to) - /docs/config/cluster.html (reference documentation) --> - <!-- - <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> - --> - - <!-- Use the LockOutRealm to prevent attempts to guess user passwords - via a brute-force attack --> - <Realm className="org.apache.catalina.realm.LockOutRealm"> - <!-- This Realm uses the UserDatabase configured in the global JNDI - resources under the key "UserDatabase". Any edits - that are performed against this UserDatabase are immediately - available for use by the Realm. --> - <Realm className="org.apache.catalina.realm.UserDatabaseRealm" - resourceName="UserDatabase"/> - </Realm> - - <Host name="localhost" appBase="webapps" - unpackWARs="true" autoDeploy="true"> - - <!-- SingleSignOn valve, share authentication between web applications - Documentation at: /docs/config/valve.html --> - <!-- - <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> - --> - - <!-- Access log processes all example. - Documentation at: /docs/config/valve.html - Note: The pattern used is equivalent to using pattern="common" --> - <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" - prefix="localhost_access_log" suffix=".txt" - pattern="%h %l %u %t "%r" %s %b" /> - - </Host> - </Engine> - </Service> -</Server> diff --git a/catalog-core/httpserver/src/main/assembly/tomcat/conf/web.xml b/catalog-core/httpserver/src/main/assembly/tomcat/conf/web.xml deleted file mode 100644 index 9e4756d3..00000000 --- a/catalog-core/httpserver/src/main/assembly/tomcat/conf/web.xml +++ /dev/null @@ -1,4681 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee - http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" - version="3.1"> - - <!-- ======================== Introduction ============================== --> - <!-- This document defines default values for *all* web applications --> - <!-- loaded into this instance of Tomcat. As each application is --> - <!-- deployed, this file is processed, followed by the --> - <!-- "/WEB-INF/web.xml" deployment descriptor from your own --> - <!-- applications. --> - <!-- --> - <!-- WARNING: Do not configure application-specific resources here! --> - <!-- They should go in the "/WEB-INF/web.xml" file in your application. --> - - - <!-- ================== Built In Servlet Definitions ==================== --> - - - <!-- The default servlet for all web applications, that serves static --> - <!-- resources. It processes all requests that are not mapped to other --> - <!-- servlets with servlet mappings (defined either here or in your own --> - <!-- web.xml file). This servlet supports the following initialization --> - <!-- parameters (default values are in square brackets): --> - <!-- --> - <!-- debug Debugging detail level for messages logged --> - <!-- by this servlet. Useful values are 0, 1, and --> - <!-- 11 where higher values mean more detail. [0] --> - <!-- --> - <!-- fileEncoding Encoding to be used to read static resources --> - <!-- [platform default] --> - <!-- --> - <!-- input Input buffer size (in bytes) when reading --> - <!-- resources to be served. [2048] --> - <!-- --> - <!-- listings Should directory listings be produced if there --> - <!-- is no welcome file in this directory? [false] --> - <!-- WARNING: Listings for directories with many --> - <!-- entries can be slow and may consume --> - <!-- significant proportions of server resources. --> - <!-- --> - <!-- output Output buffer size (in bytes) when writing --> - <!-- resources to be served. [2048] --> - <!-- --> - <!-- readonly Is this context "read only", so HTTP --> - <!-- commands like PUT and DELETE are --> - <!-- rejected? [true] --> - <!-- --> - <!-- readmeFile File to display together with the directory --> - <!-- contents. [null] --> - <!-- --> - <!-- sendfileSize If the connector used supports sendfile, this --> - <!-- represents the minimal file size in KB for --> - <!-- which sendfile will be used. Use a negative --> - <!-- value to always disable sendfile. [48] --> - <!-- --> - <!-- useAcceptRanges Should the Accept-Ranges header be included --> - <!-- in responses where appropriate? [true] --> - <!-- --> - <!-- For directory listing customization. Checks localXsltFile, then --> - <!-- globalXsltFile, then defaults to original behavior. --> - <!-- --> - <!-- localXsltFile Make directory listings an XML doc and --> - <!-- pass the result to this style sheet residing --> - <!-- in that directory. This overrides --> - <!-- contextXsltFile and globalXsltFile[null] --> - <!-- --> - <!-- contextXsltFile Make directory listings an XML doc and --> - <!-- pass the result to this style sheet which is --> - <!-- relative to the context root. This overrides --> - <!-- globalXsltFile[null] --> - <!-- --> - <!-- globalXsltFile Site wide configuration version of --> - <!-- localXsltFile. This argument must either be an --> - <!-- absolute or relative (to either --> - <!-- $CATALINA_BASE/conf or $CATALINA_HOME/conf) --> - <!-- path that points to a location below either --> - <!-- $CATALINA_BASE/conf (checked first) or --> - <!-- $CATALINA_HOME/conf (checked second).[null] --> - <!-- --> - <!-- showServerInfo Should server information be presented in the --> - <!-- response sent to clients when directory --> - <!-- listings is enabled? [true] --> - - <servlet> - <servlet-name>default</servlet-name> - <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> - <init-param> - <param-name>debug</param-name> - <param-value>0</param-value> - </init-param> - <init-param> - <param-name>listings</param-name> - <param-value>true</param-value> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - - - <!-- The JSP page compiler and execution servlet, which is the mechanism --> - <!-- used by Tomcat to support JSP pages. Traditionally, this servlet --> - <!-- is mapped to the URL pattern "*.jsp". This servlet supports the --> - <!-- following initialization parameters (default values are in square --> - <!-- brackets): --> - <!-- --> - <!-- checkInterval If development is false and checkInterval is --> - <!-- greater than zero, background compilations are --> - <!-- enabled. checkInterval is the time in seconds --> - <!-- between checks to see if a JSP page (and its --> - <!-- dependent files) needs to be recompiled. [0] --> - <!-- --> - <!-- classdebuginfo Should the class file be compiled with --> - <!-- debugging information? [true] --> - <!-- --> - <!-- classpath What class path should I use while compiling --> - <!-- generated servlets? [Created dynamically --> - <!-- based on the current web application] --> - <!-- --> - <!-- compiler Which compiler Ant should use to compile JSP --> - <!-- pages. See the jasper documentation for more --> - <!-- information. --> - <!-- --> - <!-- compilerSourceVM Compiler source VM. [1.7] --> - <!-- --> - <!-- compilerTargetVM Compiler target VM. [1.7] --> - <!-- --> - <!-- development Is Jasper used in development mode? If true, --> - <!-- the frequency at which JSPs are checked for --> - <!-- modification may be specified via the --> - <!-- modificationTestInterval parameter. [true] --> - <!-- --> - <!-- displaySourceFragment --> - <!-- Should a source fragment be included in --> - <!-- exception messages? [true] --> - <!-- --> - <!-- dumpSmap Should the SMAP info for JSR45 debugging be --> - <!-- dumped to a file? [false] --> - <!-- False if suppressSmap is true --> - <!-- --> - <!-- enablePooling Determines whether tag handler pooling is --> - <!-- enabled. This is a compilation option. It will --> - <!-- not alter the behaviour of JSPs that have --> - <!-- already been compiled. [true] --> - <!-- --> - <!-- engineOptionsClass Allows specifying the Options class used to --> - <!-- configure Jasper. If not present, the default --> - <!-- EmbeddedServletOptions will be used. --> - <!-- This option is ignored when running under a --> - <!-- SecurityManager. --> - <!-- --> - <!-- errorOnUseBeanInvalidClassAttribute --> - <!-- Should Jasper issue an error when the value of --> - <!-- the class attribute in an useBean action is --> - <!-- not a valid bean class? [true] --> - <!-- --> - <!-- fork Tell Ant to fork compiles of JSP pages so that --> - <!-- a separate JVM is used for JSP page compiles --> - <!-- from the one Tomcat is running in. [true] --> - <!-- --> - <!-- genStringAsCharArray --> - <!-- Should text strings be generated as char --> - <!-- arrays, to improve performance in some cases? --> - <!-- [false] --> - <!-- --> - <!-- ieClassId The class-id value to be sent to Internet --> - <!-- Explorer when using <jsp:plugin> tags. --> - <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] --> - <!-- --> - <!-- javaEncoding Java file encoding to use for generating java --> - <!-- source files. [UTF8] --> - <!-- --> - <!-- keepgenerated Should we keep the generated Java source code --> - <!-- for each page instead of deleting it? [true] --> - <!-- --> - <!-- mappedfile Should we generate static content with one --> - <!-- print statement per input line, to ease --> - <!-- debugging? [true] --> - <!-- --> - <!-- maxLoadedJsps The maximum number of JSPs that will be loaded --> - <!-- for a web application. If more than this --> - <!-- number of JSPs are loaded, the least recently --> - <!-- used JSPs will be unloaded so that the number --> - <!-- of JSPs loaded at any one time does not exceed --> - <!-- this limit. A value of zero or less indicates --> - <!-- no limit. [-1] --> - <!-- --> - <!-- jspIdleTimeout The amount of time in seconds a JSP can be --> - <!-- idle before it is unloaded. A value of zero --> - <!-- or less indicates never unload. [-1] --> - <!-- --> - <!-- modificationTestInterval --> - <!-- Causes a JSP (and its dependent files) to not --> - <!-- be checked for modification during the --> - <!-- specified time interval (in seconds) from the --> - <!-- last time the JSP was checked for --> - <!-- modification. A value of 0 will cause the JSP --> - <!-- to be checked on every access. --> - <!-- Used in development mode only. [4] --> - <!-- --> - <!-- recompileOnFail If a JSP compilation fails should the --> - <!-- modificationTestInterval be ignored and the --> - <!-- next access trigger a re-compilation attempt? --> - <!-- Used in development mode only and is disabled --> - <!-- by default as compilation may be expensive and --> - <!-- could lead to excessive resource usage. --> - <!-- [false] --> - <!-- --> - <!-- scratchdir What scratch directory should we use when --> - <!-- compiling JSP pages? [default work directory --> - <!-- for the current web application] --> - <!-- This option is ignored when running under a --> - <!-- SecurityManager. --> - <!-- --> - <!-- suppressSmap Should the generation of SMAP info for JSR45 --> - <!-- debugging be suppressed? [false] --> - <!-- --> - <!-- trimSpaces Should white spaces in template text between --> - <!-- actions or directives be trimmed? [false] --> - <!-- --> - <!-- xpoweredBy Determines whether X-Powered-By response --> - <!-- header is added by generated servlet. [false] --> - <!-- --> - <!-- strictQuoteEscaping When scriptlet expressions are used for --> - <!-- attribute values, should the rules in JSP.1.6 --> - <!-- for the escaping of quote characters be --> - <!-- strictly applied? [true] --> - <!-- --> - <!-- quoteAttributeEL When EL is used in an attribute value on a --> - <!-- JSP page should the rules for quoting of --> - <!-- attributes described in JSP.1.6 be applied to --> - <!-- the expression? [true] --> - - <servlet> - <servlet-name>jsp</servlet-name> - <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> - <init-param> - <param-name>fork</param-name> - <param-value>false</param-value> - </init-param> - <init-param> - <param-name>xpoweredBy</param-name> - <param-value>false</param-value> - </init-param> - <load-on-startup>3</load-on-startup> - </servlet> - - - <!-- NOTE: An SSI Filter is also available as an alternative SSI --> - <!-- implementation. Use either the Servlet or the Filter but NOT both. --> - <!-- --> - <!-- Server Side Includes processing servlet, which processes SSI --> - <!-- directives in HTML pages consistent with similar support in web --> - <!-- servers like Apache. Traditionally, this servlet is mapped to the --> - <!-- URL pattern "*.shtml". This servlet supports the following --> - <!-- initialization parameters (default values are in square brackets): --> - <!-- --> - <!-- buffered Should output from this servlet be buffered? --> - <!-- (0=false, 1=true) [0] --> - <!-- --> - <!-- debug Debugging detail level for messages logged --> - <!-- by this servlet. [0] --> - <!-- --> - <!-- expires The number of seconds before a page with SSI --> - <!-- directives will expire. [No default] --> - <!-- --> - <!-- isVirtualWebappRelative --> - <!-- Should "virtual" paths be interpreted as --> - <!-- relative to the context root, instead of --> - <!-- the server root? [false] --> - <!-- --> - <!-- inputEncoding The encoding to assume for SSI resources if --> - <!-- one is not available from the resource. --> - <!-- [Platform default] --> - <!-- --> - <!-- outputEncoding The encoding to use for the page that results --> - <!-- from the SSI processing. [UTF-8] --> - <!-- --> - <!-- allowExec Is use of the exec command enabled? [false] --> - -<!-- - <servlet> - <servlet-name>ssi</servlet-name> - <servlet-class> - org.apache.catalina.ssi.SSIServlet - </servlet-class> - <init-param> - <param-name>buffered</param-name> - <param-value>1</param-value> - </init-param> - <init-param> - <param-name>debug</param-name> - <param-value>0</param-value> - </init-param> - <init-param> - <param-name>expires</param-name> - <param-value>666</param-value> - </init-param> - <init-param> - <param-name>isVirtualWebappRelative</param-name> - <param-value>false</param-value> - </init-param> - <load-on-startup>4</load-on-startup> - </servlet> ---> - - - <!-- Common Gateway Includes (CGI) processing servlet, which supports --> - <!-- execution of external applications that conform to the CGI spec --> - <!-- requirements. Typically, this servlet is mapped to the URL pattern --> - <!-- "/cgi-bin/*", which means that any CGI applications that are --> - <!-- executed must be present within the web application. This servlet --> - <!-- supports the following initialization parameters (default values --> - <!-- are in square brackets): --> - <!-- --> - <!-- cgiPathPrefix The CGI search path will start at --> - <!-- webAppRootDir + File.separator + this prefix. --> - <!-- If not set, then webAppRootDir is used. --> - <!-- Recommended value: WEB-INF/cgi --> - <!-- --> - <!-- executable Name of the executable used to run the --> - <!-- script. [perl] --> - <!-- --> - <!-- envHttpHeaders A regular expression used to select the HTTP --> - <!-- headers passed to the CGI process as --> - <!-- environment variables. Note that headers are --> - <!-- converted to upper case before matching and --> - <!-- that the entire header name must match the --> - <!-- pattern. --> - <!-- [ACCEPT[-0-9A-Z]*|CACHE-CONTROL|COOKIE|HOST| --> - <!-- IF-[-0-9A-Z]*|REFERER|USER-AGENT] --> - <!-- --> - <!-- parameterEncoding Name of parameter encoding to be used with --> - <!-- CGI servlet. --> - <!-- [System.getProperty("file.encoding","UTF-8")] --> - <!-- --> - <!-- passShellEnvironment Should the shell environment variables (if --> - <!-- any) be passed to the CGI script? [false] --> - <!-- --> - <!-- stderrTimeout The time (in milliseconds) to wait for the --> - <!-- reading of stderr to complete before --> - <!-- terminating the CGI process. [2000] --> - -<!-- - <servlet> - <servlet-name>cgi</servlet-name> - <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class> - <init-param> - <param-name>cgiPathPrefix</param-name> - <param-value>WEB-INF/cgi</param-value> - </init-param> - <load-on-startup>5</load-on-startup> - </servlet> ---> - - - <!-- ================ Built In Servlet Mappings ========================= --> - - - <!-- The servlet mappings for the built in servlets defined above. Note --> - <!-- that, by default, the CGI and SSI servlets are *not* mapped. You --> - <!-- must uncomment these mappings (or add them to your application's own --> - <!-- web.xml deployment descriptor) to enable these services --> - - <!-- The mapping for the default servlet --> - <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>/</url-pattern> - </servlet-mapping> - - <!-- The mappings for the JSP servlet --> - <servlet-mapping> - <servlet-name>jsp</servlet-name> - <url-pattern>*.jsp</url-pattern> - <url-pattern>*.jspx</url-pattern> - </servlet-mapping> - - <!-- The mapping for the SSI servlet --> -<!-- - <servlet-mapping> - <servlet-name>ssi</servlet-name> - <url-pattern>*.shtml</url-pattern> - </servlet-mapping> ---> - - <!-- The mapping for the CGI Gateway servlet --> - -<!-- - <servlet-mapping> - <servlet-name>cgi</servlet-name> - <url-pattern>/cgi-bin/*</url-pattern> - </servlet-mapping> ---> - - - <!-- ================== Built In Filter Definitions ===================== --> - - <!-- A filter that sets various security related HTTP Response headers. --> - <!-- This filter supports the following initialization parameters --> - <!-- (default values are in square brackets): --> - <!-- --> - <!-- hstsEnabled Should the HTTP Strict Transport Security --> - <!-- (HSTS) header be added to the response? See --> - <!-- RFC 6797 for more information on HSTS. [true] --> - <!-- --> - <!-- hstsMaxAgeSeconds The max age value that should be used in the --> - <!-- HSTS header. Negative values will be treated --> - <!-- as zero. [0] --> - <!-- --> - <!-- hstsIncludeSubDomains --> - <!-- Should the includeSubDomains parameter be --> - <!-- included in the HSTS header. --> - <!-- --> - <!-- antiClickJackingEnabled --> - <!-- Should the anti click-jacking header --> - <!-- X-Frame-Options be added to every response? --> - <!-- [true] --> - <!-- --> - <!-- antiClickJackingOption --> - <!-- What value should be used for the header. Must --> - <!-- be one of DENY, SAMEORIGIN, ALLOW-FROM --> - <!-- (case-insensitive). [DENY] --> - <!-- --> - <!-- antiClickJackingUri IF ALLOW-FROM is used, what URI should be --> - <!-- allowed? [] --> - <!-- --> - <!-- blockContentTypeSniffingEnabled --> - <!-- Should the header that blocks content type --> - <!-- sniffing be added to every response? [true] --> -<!-- - <filter> - <filter-name>httpHeaderSecurity</filter-name> - <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class> - <async-supported>true</async-supported> - </filter> ---> - - <!-- A filter that sets character encoding that is used to decode --> - <!-- parameters in a POST request --> -<!-- - <filter> - <filter-name>setCharacterEncodingFilter</filter-name> - <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class> - <init-param> - <param-name>encoding</param-name> - <param-value>UTF-8</param-value> - </init-param> - <async-supported>true</async-supported> - </filter> ---> - - <!-- A filter that triggers request parameters parsing and rejects the --> - <!-- request if some parameters were skipped because of parsing errors or --> - <!-- request size limitations. --> -<!-- - <filter> - <filter-name>failedRequestFilter</filter-name> - <filter-class> - org.apache.catalina.filters.FailedRequestFilter - </filter-class> - <async-supported>true</async-supported> - </filter> ---> - - - <!-- NOTE: An SSI Servlet is also available as an alternative SSI --> - <!-- implementation. Use either the Servlet or the Filter but NOT both. --> - <!-- --> - <!-- Server Side Includes processing filter, which processes SSI --> - <!-- directives in HTML pages consistent with similar support in web --> - <!-- servers like Apache. Traditionally, this filter is mapped to the --> - <!-- URL pattern "*.shtml", though it can be mapped to "*" as it will --> - <!-- selectively enable/disable SSI processing based on mime types. For --> - <!-- this to work you will need to uncomment the .shtml mime type --> - <!-- definition towards the bottom of this file. --> - <!-- The contentType init param allows you to apply SSI processing to JSP --> - <!-- pages, javascript, or any other content you wish. This filter --> - <!-- supports the following initialization parameters (default values are --> - <!-- in square brackets): --> - <!-- --> - <!-- contentType A regex pattern that must be matched before --> - <!-- SSI processing is applied. --> - <!-- [text/x-server-parsed-html(;.*)?] --> - <!-- --> - <!-- debug Debugging detail level for messages logged --> - <!-- by this servlet. [0] --> - <!-- --> - <!-- expires The number of seconds before a page with SSI --> - <!-- directives will expire. [No default] --> - <!-- --> - <!-- isVirtualWebappRelative --> - <!-- Should "virtual" paths be interpreted as --> - <!-- relative to the context root, instead of --> - <!-- the server root? [false] --> - <!-- --> - <!-- allowExec Is use of the exec command enabled? [false] --> - -<!-- - <filter> - <filter-name>ssi</filter-name> - <filter-class> - org.apache.catalina.ssi.SSIFilter - </filter-class> - <init-param> - <param-name>contentType</param-name> - <param-value>text/x-server-parsed-html(;.*)?</param-value> - </init-param> - <init-param> - <param-name>debug</param-name> - <param-value>0</param-value> - </init-param> - <init-param> - <param-name>expires</param-name> - <param-value>666</param-value> - </init-param> - <init-param> - <param-name>isVirtualWebappRelative</param-name> - <param-value>false</param-value> - </init-param> - </filter> ---> - - - <!-- ==================== Built In Filter Mappings ====================== --> - - <!-- The mapping for the HTTP header security Filter --> -<!-- - <filter-mapping> - <filter-name>httpHeaderSecurity</filter-name> - <url-pattern>/*</url-pattern> - <dispatcher>REQUEST</dispatcher> - </filter-mapping> ---> - - <!-- The mapping for the Set Character Encoding Filter --> -<!-- - <filter-mapping> - <filter-name>setCharacterEncodingFilter</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> ---> - - <!-- The mapping for the Failed Request Filter --> -<!-- - <filter-mapping> - <filter-name>failedRequestFilter</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> ---> - - <!-- The mapping for the SSI Filter --> -<!-- - <filter-mapping> - <filter-name>ssi</filter-name> - <url-pattern>*.shtml</url-pattern> - </filter-mapping> ---> - - - <!-- ==================== Default Session Configuration ================= --> - <!-- You can set the default session timeout (in minutes) for all newly --> - <!-- created sessions by modifying the value below. --> - - <session-config> - <session-timeout>30</session-timeout> - </session-config> - - - <!-- ===================== Default MIME Type Mappings =================== --> - <!-- When serving static resources, Tomcat will automatically generate --> - <!-- a "Content-Type" header based on the resource's filename extension, --> - <!-- based on these mappings. Additional mappings can be added here (to --> - <!-- apply to all web applications), or in your own application's web.xml --> - <!-- deployment descriptor. --> - <!-- Note: Extensions are always matched in a case-insensitive manner. --> - - <mime-mapping> - <extension>123</extension> - <mime-type>application/vnd.lotus-1-2-3</mime-type> - </mime-mapping> - <mime-mapping> - <extension>3dml</extension> - <mime-type>text/vnd.in3d.3dml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>3ds</extension> - <mime-type>image/x-3ds</mime-type> - </mime-mapping> - <mime-mapping> - <extension>3g2</extension> - <mime-type>video/3gpp2</mime-type> - </mime-mapping> - <mime-mapping> - <extension>3gp</extension> - <mime-type>video/3gpp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>7z</extension> - <mime-type>application/x-7z-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aab</extension> - <mime-type>application/x-authorware-bin</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aac</extension> - <mime-type>audio/x-aac</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aam</extension> - <mime-type>application/x-authorware-map</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aas</extension> - <mime-type>application/x-authorware-seg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>abs</extension> - <mime-type>audio/x-mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>abw</extension> - <mime-type>application/x-abiword</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ac</extension> - <mime-type>application/pkix-attr-cert</mime-type> - </mime-mapping> - <mime-mapping> - <extension>acc</extension> - <mime-type>application/vnd.americandynamics.acc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ace</extension> - <mime-type>application/x-ace-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>acu</extension> - <mime-type>application/vnd.acucobol</mime-type> - </mime-mapping> - <mime-mapping> - <extension>acutc</extension> - <mime-type>application/vnd.acucorp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>adp</extension> - <mime-type>audio/adpcm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aep</extension> - <mime-type>application/vnd.audiograph</mime-type> - </mime-mapping> - <mime-mapping> - <extension>afm</extension> - <mime-type>application/x-font-type1</mime-type> - </mime-mapping> - <mime-mapping> - <extension>afp</extension> - <mime-type>application/vnd.ibm.modcap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ahead</extension> - <mime-type>application/vnd.ahead.space</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ai</extension> - <mime-type>application/postscript</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aif</extension> - <mime-type>audio/x-aiff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aifc</extension> - <mime-type>audio/x-aiff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aiff</extension> - <mime-type>audio/x-aiff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aim</extension> - <mime-type>application/x-aim</mime-type> - </mime-mapping> - <mime-mapping> - <extension>air</extension> - <mime-type>application/vnd.adobe.air-application-installer-package+zip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ait</extension> - <mime-type>application/vnd.dvb.ait</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ami</extension> - <mime-type>application/vnd.amiga.ami</mime-type> - </mime-mapping> - <mime-mapping> - <extension>anx</extension> - <mime-type>application/annodex</mime-type> - </mime-mapping> - <mime-mapping> - <extension>apk</extension> - <mime-type>application/vnd.android.package-archive</mime-type> - </mime-mapping> - <mime-mapping> - <extension>appcache</extension> - <mime-type>text/cache-manifest</mime-type> - </mime-mapping> - <mime-mapping> - <extension>application</extension> - <mime-type>application/x-ms-application</mime-type> - </mime-mapping> - <mime-mapping> - <extension>apr</extension> - <mime-type>application/vnd.lotus-approach</mime-type> - </mime-mapping> - <mime-mapping> - <extension>arc</extension> - <mime-type>application/x-freearc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>art</extension> - <mime-type>image/x-jg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>asc</extension> - <mime-type>application/pgp-signature</mime-type> - </mime-mapping> - <mime-mapping> - <extension>asf</extension> - <mime-type>video/x-ms-asf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>asm</extension> - <mime-type>text/x-asm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aso</extension> - <mime-type>application/vnd.accpac.simply.aso</mime-type> - </mime-mapping> - <mime-mapping> - <extension>asx</extension> - <mime-type>video/x-ms-asf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>atc</extension> - <mime-type>application/vnd.acucorp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>atom</extension> - <mime-type>application/atom+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>atomcat</extension> - <mime-type>application/atomcat+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>atomsvc</extension> - <mime-type>application/atomsvc+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>atx</extension> - <mime-type>application/vnd.antix.game-component</mime-type> - </mime-mapping> - <mime-mapping> - <extension>au</extension> - <mime-type>audio/basic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>avi</extension> - <mime-type>video/x-msvideo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>avx</extension> - <mime-type>video/x-rad-screenplay</mime-type> - </mime-mapping> - <mime-mapping> - <extension>aw</extension> - <mime-type>application/applixware</mime-type> - </mime-mapping> - <mime-mapping> - <extension>axa</extension> - <mime-type>audio/annodex</mime-type> - </mime-mapping> - <mime-mapping> - <extension>axv</extension> - <mime-type>video/annodex</mime-type> - </mime-mapping> - <mime-mapping> - <extension>azf</extension> - <mime-type>application/vnd.airzip.filesecure.azf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>azs</extension> - <mime-type>application/vnd.airzip.filesecure.azs</mime-type> - </mime-mapping> - <mime-mapping> - <extension>azw</extension> - <mime-type>application/vnd.amazon.ebook</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bat</extension> - <mime-type>application/x-msdownload</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bcpio</extension> - <mime-type>application/x-bcpio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bdf</extension> - <mime-type>application/x-font-bdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bdm</extension> - <mime-type>application/vnd.syncml.dm+wbxml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bed</extension> - <mime-type>application/vnd.realvnc.bed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bh2</extension> - <mime-type>application/vnd.fujitsu.oasysprs</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bin</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>blb</extension> - <mime-type>application/x-blorb</mime-type> - </mime-mapping> - <mime-mapping> - <extension>blorb</extension> - <mime-type>application/x-blorb</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bmi</extension> - <mime-type>application/vnd.bmi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bmp</extension> - <mime-type>image/bmp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>body</extension> - <mime-type>text/html</mime-type> - </mime-mapping> - <mime-mapping> - <extension>book</extension> - <mime-type>application/vnd.framemaker</mime-type> - </mime-mapping> - <mime-mapping> - <extension>box</extension> - <mime-type>application/vnd.previewsystems.box</mime-type> - </mime-mapping> - <mime-mapping> - <extension>boz</extension> - <mime-type>application/x-bzip2</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bpk</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>btif</extension> - <mime-type>image/prs.btif</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bz</extension> - <mime-type>application/x-bzip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>bz2</extension> - <mime-type>application/x-bzip2</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c</extension> - <mime-type>text/x-c</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c11amc</extension> - <mime-type>application/vnd.cluetrust.cartomobile-config</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c11amz</extension> - <mime-type>application/vnd.cluetrust.cartomobile-config-pkg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c4d</extension> - <mime-type>application/vnd.clonk.c4group</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c4f</extension> - <mime-type>application/vnd.clonk.c4group</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c4g</extension> - <mime-type>application/vnd.clonk.c4group</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c4p</extension> - <mime-type>application/vnd.clonk.c4group</mime-type> - </mime-mapping> - <mime-mapping> - <extension>c4u</extension> - <mime-type>application/vnd.clonk.c4group</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cab</extension> - <mime-type>application/vnd.ms-cab-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>caf</extension> - <mime-type>audio/x-caf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cap</extension> - <mime-type>application/vnd.tcpdump.pcap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>car</extension> - <mime-type>application/vnd.curl.car</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cat</extension> - <mime-type>application/vnd.ms-pki.seccat</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cb7</extension> - <mime-type>application/x-cbr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cba</extension> - <mime-type>application/x-cbr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cbr</extension> - <mime-type>application/x-cbr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cbt</extension> - <mime-type>application/x-cbr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cbz</extension> - <mime-type>application/x-cbr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cc</extension> - <mime-type>text/x-c</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cct</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ccxml</extension> - <mime-type>application/ccxml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdbcmsg</extension> - <mime-type>application/vnd.contact.cmsg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdf</extension> - <mime-type>application/x-cdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdkey</extension> - <mime-type>application/vnd.mediastation.cdkey</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdmia</extension> - <mime-type>application/cdmi-capability</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdmic</extension> - <mime-type>application/cdmi-container</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdmid</extension> - <mime-type>application/cdmi-domain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdmio</extension> - <mime-type>application/cdmi-object</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdmiq</extension> - <mime-type>application/cdmi-queue</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdx</extension> - <mime-type>chemical/x-cdx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdxml</extension> - <mime-type>application/vnd.chemdraw+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cdy</extension> - <mime-type>application/vnd.cinderella</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cer</extension> - <mime-type>application/pkix-cert</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cfs</extension> - <mime-type>application/x-cfs-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cgm</extension> - <mime-type>image/cgm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>chat</extension> - <mime-type>application/x-chat</mime-type> - </mime-mapping> - <mime-mapping> - <extension>chm</extension> - <mime-type>application/vnd.ms-htmlhelp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>chrt</extension> - <mime-type>application/vnd.kde.kchart</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cif</extension> - <mime-type>chemical/x-cif</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cii</extension> - <mime-type>application/vnd.anser-web-certificate-issue-initiation</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cil</extension> - <mime-type>application/vnd.ms-artgalry</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cla</extension> - <mime-type>application/vnd.claymore</mime-type> - </mime-mapping> - <mime-mapping> - <extension>class</extension> - <mime-type>application/java</mime-type> - </mime-mapping> - <mime-mapping> - <extension>clkk</extension> - <mime-type>application/vnd.crick.clicker.keyboard</mime-type> - </mime-mapping> - <mime-mapping> - <extension>clkp</extension> - <mime-type>application/vnd.crick.clicker.palette</mime-type> - </mime-mapping> - <mime-mapping> - <extension>clkt</extension> - <mime-type>application/vnd.crick.clicker.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>clkw</extension> - <mime-type>application/vnd.crick.clicker.wordbank</mime-type> - </mime-mapping> - <mime-mapping> - <extension>clkx</extension> - <mime-type>application/vnd.crick.clicker</mime-type> - </mime-mapping> - <mime-mapping> - <extension>clp</extension> - <mime-type>application/x-msclip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cmc</extension> - <mime-type>application/vnd.cosmocaller</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cmdf</extension> - <mime-type>chemical/x-cmdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cml</extension> - <mime-type>chemical/x-cml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cmp</extension> - <mime-type>application/vnd.yellowriver-custom-menu</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cmx</extension> - <mime-type>image/x-cmx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cod</extension> - <mime-type>application/vnd.rim.cod</mime-type> - </mime-mapping> - <mime-mapping> - <extension>com</extension> - <mime-type>application/x-msdownload</mime-type> - </mime-mapping> - <mime-mapping> - <extension>conf</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cpio</extension> - <mime-type>application/x-cpio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cpp</extension> - <mime-type>text/x-c</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cpt</extension> - <mime-type>application/mac-compactpro</mime-type> - </mime-mapping> - <mime-mapping> - <extension>crd</extension> - <mime-type>application/x-mscardfile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>crl</extension> - <mime-type>application/pkix-crl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>crt</extension> - <mime-type>application/x-x509-ca-cert</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cryptonote</extension> - <mime-type>application/vnd.rig.cryptonote</mime-type> - </mime-mapping> - <mime-mapping> - <extension>csh</extension> - <mime-type>application/x-csh</mime-type> - </mime-mapping> - <mime-mapping> - <extension>csml</extension> - <mime-type>chemical/x-csml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>csp</extension> - <mime-type>application/vnd.commonspace</mime-type> - </mime-mapping> - <mime-mapping> - <extension>css</extension> - <mime-type>text/css</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cst</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>csv</extension> - <mime-type>text/csv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cu</extension> - <mime-type>application/cu-seeme</mime-type> - </mime-mapping> - <mime-mapping> - <extension>curl</extension> - <mime-type>text/vnd.curl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cww</extension> - <mime-type>application/prs.cww</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cxt</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>cxx</extension> - <mime-type>text/x-c</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dae</extension> - <mime-type>model/vnd.collada+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>daf</extension> - <mime-type>application/vnd.mobius.daf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dart</extension> - <mime-type>application/vnd.dart</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dataless</extension> - <mime-type>application/vnd.fdsn.seed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>davmount</extension> - <mime-type>application/davmount+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dbk</extension> - <mime-type>application/docbook+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dcr</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dcurl</extension> - <mime-type>text/vnd.curl.dcurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dd2</extension> - <mime-type>application/vnd.oma.dd2+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ddd</extension> - <mime-type>application/vnd.fujixerox.ddd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>deb</extension> - <mime-type>application/x-debian-package</mime-type> - </mime-mapping> - <mime-mapping> - <extension>def</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>deploy</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>der</extension> - <mime-type>application/x-x509-ca-cert</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dfac</extension> - <mime-type>application/vnd.dreamfactory</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dgc</extension> - <mime-type>application/x-dgc-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dib</extension> - <mime-type>image/bmp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dic</extension> - <mime-type>text/x-c</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dir</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dis</extension> - <mime-type>application/vnd.mobius.dis</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dist</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>distz</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>djv</extension> - <mime-type>image/vnd.djvu</mime-type> - </mime-mapping> - <mime-mapping> - <extension>djvu</extension> - <mime-type>image/vnd.djvu</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dll</extension> - <mime-type>application/x-msdownload</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dmg</extension> - <mime-type>application/x-apple-diskimage</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dmp</extension> - <mime-type>application/vnd.tcpdump.pcap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dms</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dna</extension> - <mime-type>application/vnd.dna</mime-type> - </mime-mapping> - <mime-mapping> - <extension>doc</extension> - <mime-type>application/msword</mime-type> - </mime-mapping> - <mime-mapping> - <extension>docm</extension> - <mime-type>application/vnd.ms-word.document.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>docx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.wordprocessingml.document</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dot</extension> - <mime-type>application/msword</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dotm</extension> - <mime-type>application/vnd.ms-word.template.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dotx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.wordprocessingml.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dp</extension> - <mime-type>application/vnd.osgi.dp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dpg</extension> - <mime-type>application/vnd.dpgraph</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dra</extension> - <mime-type>audio/vnd.dra</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dsc</extension> - <mime-type>text/prs.lines.tag</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dssc</extension> - <mime-type>application/dssc+der</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dtb</extension> - <mime-type>application/x-dtbook+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dtd</extension> - <mime-type>application/xml-dtd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dts</extension> - <mime-type>audio/vnd.dts</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dtshd</extension> - <mime-type>audio/vnd.dts.hd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dump</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dv</extension> - <mime-type>video/x-dv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dvb</extension> - <mime-type>video/vnd.dvb.file</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dvi</extension> - <mime-type>application/x-dvi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dwf</extension> - <mime-type>model/vnd.dwf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dwg</extension> - <mime-type>image/vnd.dwg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dxf</extension> - <mime-type>image/vnd.dxf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dxp</extension> - <mime-type>application/vnd.spotfire.dxp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>dxr</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ecelp4800</extension> - <mime-type>audio/vnd.nuera.ecelp4800</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ecelp7470</extension> - <mime-type>audio/vnd.nuera.ecelp7470</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ecelp9600</extension> - <mime-type>audio/vnd.nuera.ecelp9600</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ecma</extension> - <mime-type>application/ecmascript</mime-type> - </mime-mapping> - <mime-mapping> - <extension>edm</extension> - <mime-type>application/vnd.novadigm.edm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>edx</extension> - <mime-type>application/vnd.novadigm.edx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>efif</extension> - <mime-type>application/vnd.picsel</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ei6</extension> - <mime-type>application/vnd.pg.osasli</mime-type> - </mime-mapping> - <mime-mapping> - <extension>elc</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>emf</extension> - <mime-type>application/x-msmetafile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>eml</extension> - <mime-type>message/rfc822</mime-type> - </mime-mapping> - <mime-mapping> - <extension>emma</extension> - <mime-type>application/emma+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>emz</extension> - <mime-type>application/x-msmetafile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>eol</extension> - <mime-type>audio/vnd.digital-winds</mime-type> - </mime-mapping> - <mime-mapping> - <extension>eot</extension> - <mime-type>application/vnd.ms-fontobject</mime-type> - </mime-mapping> - <mime-mapping> - <extension>eps</extension> - <mime-type>application/postscript</mime-type> - </mime-mapping> - <mime-mapping> - <extension>epub</extension> - <mime-type>application/epub+zip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>es3</extension> - <mime-type>application/vnd.eszigno3+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>esa</extension> - <mime-type>application/vnd.osgi.subsystem</mime-type> - </mime-mapping> - <mime-mapping> - <extension>esf</extension> - <mime-type>application/vnd.epson.esf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>et3</extension> - <mime-type>application/vnd.eszigno3+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>etx</extension> - <mime-type>text/x-setext</mime-type> - </mime-mapping> - <mime-mapping> - <extension>eva</extension> - <mime-type>application/x-eva</mime-type> - </mime-mapping> - <mime-mapping> - <extension>evy</extension> - <mime-type>application/x-envoy</mime-type> - </mime-mapping> - <mime-mapping> - <extension>exe</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>exi</extension> - <mime-type>application/exi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ext</extension> - <mime-type>application/vnd.novadigm.ext</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ez</extension> - <mime-type>application/andrew-inset</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ez2</extension> - <mime-type>application/vnd.ezpix-album</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ez3</extension> - <mime-type>application/vnd.ezpix-package</mime-type> - </mime-mapping> - <mime-mapping> - <extension>f</extension> - <mime-type>text/x-fortran</mime-type> - </mime-mapping> - <mime-mapping> - <extension>f4v</extension> - <mime-type>video/x-f4v</mime-type> - </mime-mapping> - <mime-mapping> - <extension>f77</extension> - <mime-type>text/x-fortran</mime-type> - </mime-mapping> - <mime-mapping> - <extension>f90</extension> - <mime-type>text/x-fortran</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fbs</extension> - <mime-type>image/vnd.fastbidsheet</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fcdt</extension> - <mime-type>application/vnd.adobe.formscentral.fcdt</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fcs</extension> - <mime-type>application/vnd.isac.fcs</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fdf</extension> - <mime-type>application/vnd.fdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fe_launch</extension> - <mime-type>application/vnd.denovo.fcselayout-link</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fg5</extension> - <mime-type>application/vnd.fujitsu.oasysgp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fgd</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fh</extension> - <mime-type>image/x-freehand</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fh4</extension> - <mime-type>image/x-freehand</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fh5</extension> - <mime-type>image/x-freehand</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fh7</extension> - <mime-type>image/x-freehand</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fhc</extension> - <mime-type>image/x-freehand</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fig</extension> - <mime-type>application/x-xfig</mime-type> - </mime-mapping> - <mime-mapping> - <extension>flac</extension> - <mime-type>audio/flac</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fli</extension> - <mime-type>video/x-fli</mime-type> - </mime-mapping> - <mime-mapping> - <extension>flo</extension> - <mime-type>application/vnd.micrografx.flo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>flv</extension> - <mime-type>video/x-flv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>flw</extension> - <mime-type>application/vnd.kde.kivio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>flx</extension> - <mime-type>text/vnd.fmi.flexstor</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fly</extension> - <mime-type>text/vnd.fly</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fm</extension> - <mime-type>application/vnd.framemaker</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fnc</extension> - <mime-type>application/vnd.frogans.fnc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>for</extension> - <mime-type>text/x-fortran</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fpx</extension> - <mime-type>image/vnd.fpx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>frame</extension> - <mime-type>application/vnd.framemaker</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fsc</extension> - <mime-type>application/vnd.fsc.weblaunch</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fst</extension> - <mime-type>image/vnd.fst</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ftc</extension> - <mime-type>application/vnd.fluxtime.clip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fti</extension> - <mime-type>application/vnd.anser-web-funds-transfer-initiation</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fvt</extension> - <mime-type>video/vnd.fvt</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fxp</extension> - <mime-type>application/vnd.adobe.fxp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fxpl</extension> - <mime-type>application/vnd.adobe.fxp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>fzs</extension> - <mime-type>application/vnd.fuzzysheet</mime-type> - </mime-mapping> - <mime-mapping> - <extension>g2w</extension> - <mime-type>application/vnd.geoplan</mime-type> - </mime-mapping> - <mime-mapping> - <extension>g3</extension> - <mime-type>image/g3fax</mime-type> - </mime-mapping> - <mime-mapping> - <extension>g3w</extension> - <mime-type>application/vnd.geospace</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gac</extension> - <mime-type>application/vnd.groove-account</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gam</extension> - <mime-type>application/x-tads</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gbr</extension> - <mime-type>application/rpki-ghostbusters</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gca</extension> - <mime-type>application/x-gca-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gdl</extension> - <mime-type>model/vnd.gdl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>geo</extension> - <mime-type>application/vnd.dynageo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gex</extension> - <mime-type>application/vnd.geometry-explorer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ggb</extension> - <mime-type>application/vnd.geogebra.file</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ggt</extension> - <mime-type>application/vnd.geogebra.tool</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ghf</extension> - <mime-type>application/vnd.groove-help</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gif</extension> - <mime-type>image/gif</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gim</extension> - <mime-type>application/vnd.groove-identity-message</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gml</extension> - <mime-type>application/gml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gmx</extension> - <mime-type>application/vnd.gmx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gnumeric</extension> - <mime-type>application/x-gnumeric</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gph</extension> - <mime-type>application/vnd.flographit</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gpx</extension> - <mime-type>application/gpx+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gqf</extension> - <mime-type>application/vnd.grafeq</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gqs</extension> - <mime-type>application/vnd.grafeq</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gram</extension> - <mime-type>application/srgs</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gramps</extension> - <mime-type>application/x-gramps-xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gre</extension> - <mime-type>application/vnd.geometry-explorer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>grv</extension> - <mime-type>application/vnd.groove-injector</mime-type> - </mime-mapping> - <mime-mapping> - <extension>grxml</extension> - <mime-type>application/srgs+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gsf</extension> - <mime-type>application/x-font-ghostscript</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gtar</extension> - <mime-type>application/x-gtar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gtm</extension> - <mime-type>application/vnd.groove-tool-message</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gtw</extension> - <mime-type>model/vnd.gtw</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gv</extension> - <mime-type>text/vnd.graphviz</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gxf</extension> - <mime-type>application/gxf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gxt</extension> - <mime-type>application/vnd.geonext</mime-type> - </mime-mapping> - <mime-mapping> - <extension>gz</extension> - <mime-type>application/x-gzip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>h</extension> - <mime-type>text/x-c</mime-type> - </mime-mapping> - <mime-mapping> - <extension>h261</extension> - <mime-type>video/h261</mime-type> - </mime-mapping> - <mime-mapping> - <extension>h263</extension> - <mime-type>video/h263</mime-type> - </mime-mapping> - <mime-mapping> - <extension>h264</extension> - <mime-type>video/h264</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hal</extension> - <mime-type>application/vnd.hal+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hbci</extension> - <mime-type>application/vnd.hbci</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hdf</extension> - <mime-type>application/x-hdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hh</extension> - <mime-type>text/x-c</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hlp</extension> - <mime-type>application/winhlp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hpgl</extension> - <mime-type>application/vnd.hp-hpgl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hpid</extension> - <mime-type>application/vnd.hp-hpid</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hps</extension> - <mime-type>application/vnd.hp-hps</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hqx</extension> - <mime-type>application/mac-binhex40</mime-type> - </mime-mapping> - <mime-mapping> - <extension>htc</extension> - <mime-type>text/x-component</mime-type> - </mime-mapping> - <mime-mapping> - <extension>htke</extension> - <mime-type>application/vnd.kenameaapp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>htm</extension> - <mime-type>text/html</mime-type> - </mime-mapping> - <mime-mapping> - <extension>html</extension> - <mime-type>text/html</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hvd</extension> - <mime-type>application/vnd.yamaha.hv-dic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hvp</extension> - <mime-type>application/vnd.yamaha.hv-voice</mime-type> - </mime-mapping> - <mime-mapping> - <extension>hvs</extension> - <mime-type>application/vnd.yamaha.hv-script</mime-type> - </mime-mapping> - <mime-mapping> - <extension>i2g</extension> - <mime-type>application/vnd.intergeo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>icc</extension> - <mime-type>application/vnd.iccprofile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ice</extension> - <mime-type>x-conference/x-cooltalk</mime-type> - </mime-mapping> - <mime-mapping> - <extension>icm</extension> - <mime-type>application/vnd.iccprofile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ico</extension> - <mime-type>image/x-icon</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ics</extension> - <mime-type>text/calendar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ief</extension> - <mime-type>image/ief</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ifb</extension> - <mime-type>text/calendar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ifm</extension> - <mime-type>application/vnd.shana.informed.formdata</mime-type> - </mime-mapping> - <mime-mapping> - <extension>iges</extension> - <mime-type>model/iges</mime-type> - </mime-mapping> - <mime-mapping> - <extension>igl</extension> - <mime-type>application/vnd.igloader</mime-type> - </mime-mapping> - <mime-mapping> - <extension>igm</extension> - <mime-type>application/vnd.insors.igm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>igs</extension> - <mime-type>model/iges</mime-type> - </mime-mapping> - <mime-mapping> - <extension>igx</extension> - <mime-type>application/vnd.micrografx.igx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>iif</extension> - <mime-type>application/vnd.shana.informed.interchange</mime-type> - </mime-mapping> - <mime-mapping> - <extension>imp</extension> - <mime-type>application/vnd.accpac.simply.imp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ims</extension> - <mime-type>application/vnd.ms-ims</mime-type> - </mime-mapping> - <mime-mapping> - <extension>in</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ink</extension> - <mime-type>application/inkml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>inkml</extension> - <mime-type>application/inkml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>install</extension> - <mime-type>application/x-install-instructions</mime-type> - </mime-mapping> - <mime-mapping> - <extension>iota</extension> - <mime-type>application/vnd.astraea-software.iota</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ipfix</extension> - <mime-type>application/ipfix</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ipk</extension> - <mime-type>application/vnd.shana.informed.package</mime-type> - </mime-mapping> - <mime-mapping> - <extension>irm</extension> - <mime-type>application/vnd.ibm.rights-management</mime-type> - </mime-mapping> - <mime-mapping> - <extension>irp</extension> - <mime-type>application/vnd.irepository.package+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>iso</extension> - <mime-type>application/x-iso9660-image</mime-type> - </mime-mapping> - <mime-mapping> - <extension>itp</extension> - <mime-type>application/vnd.shana.informed.formtemplate</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ivp</extension> - <mime-type>application/vnd.immervision-ivp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ivu</extension> - <mime-type>application/vnd.immervision-ivu</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jad</extension> - <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jam</extension> - <mime-type>application/vnd.jam</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jar</extension> - <mime-type>application/java-archive</mime-type> - </mime-mapping> - <mime-mapping> - <extension>java</extension> - <mime-type>text/x-java-source</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jisp</extension> - <mime-type>application/vnd.jisp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jlt</extension> - <mime-type>application/vnd.hp-jlyt</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jnlp</extension> - <mime-type>application/x-java-jnlp-file</mime-type> - </mime-mapping> - <mime-mapping> - <extension>joda</extension> - <mime-type>application/vnd.joost.joda-archive</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jpe</extension> - <mime-type>image/jpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jpeg</extension> - <mime-type>image/jpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jpg</extension> - <mime-type>image/jpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jpgm</extension> - <mime-type>video/jpm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jpgv</extension> - <mime-type>video/jpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jpm</extension> - <mime-type>video/jpm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>js</extension> - <mime-type>application/javascript</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jsf</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>json</extension> - <mime-type>application/json</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jsonml</extension> - <mime-type>application/jsonml+json</mime-type> - </mime-mapping> - <mime-mapping> - <extension>jspf</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kar</extension> - <mime-type>audio/midi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>karbon</extension> - <mime-type>application/vnd.kde.karbon</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kfo</extension> - <mime-type>application/vnd.kde.kformula</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kia</extension> - <mime-type>application/vnd.kidspiration</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kml</extension> - <mime-type>application/vnd.google-earth.kml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kmz</extension> - <mime-type>application/vnd.google-earth.kmz</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kne</extension> - <mime-type>application/vnd.kinar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>knp</extension> - <mime-type>application/vnd.kinar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kon</extension> - <mime-type>application/vnd.kde.kontour</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kpr</extension> - <mime-type>application/vnd.kde.kpresenter</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kpt</extension> - <mime-type>application/vnd.kde.kpresenter</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kpxx</extension> - <mime-type>application/vnd.ds-keypoint</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ksp</extension> - <mime-type>application/vnd.kde.kspread</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ktr</extension> - <mime-type>application/vnd.kahootz</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ktx</extension> - <mime-type>image/ktx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ktz</extension> - <mime-type>application/vnd.kahootz</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kwd</extension> - <mime-type>application/vnd.kde.kword</mime-type> - </mime-mapping> - <mime-mapping> - <extension>kwt</extension> - <mime-type>application/vnd.kde.kword</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lasxml</extension> - <mime-type>application/vnd.las.las+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>latex</extension> - <mime-type>application/x-latex</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lbd</extension> - <mime-type>application/vnd.llamagraphics.life-balance.desktop</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lbe</extension> - <mime-type>application/vnd.llamagraphics.life-balance.exchange+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>les</extension> - <mime-type>application/vnd.hhe.lesson-player</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lha</extension> - <mime-type>application/x-lzh-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>link66</extension> - <mime-type>application/vnd.route66.link66+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>list</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>list3820</extension> - <mime-type>application/vnd.ibm.modcap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>listafp</extension> - <mime-type>application/vnd.ibm.modcap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lnk</extension> - <mime-type>application/x-ms-shortcut</mime-type> - </mime-mapping> - <mime-mapping> - <extension>log</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lostxml</extension> - <mime-type>application/lost+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lrf</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lrm</extension> - <mime-type>application/vnd.ms-lrm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ltf</extension> - <mime-type>application/vnd.frogans.ltf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lvp</extension> - <mime-type>audio/vnd.lucent.voice</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lwp</extension> - <mime-type>application/vnd.lotus-wordpro</mime-type> - </mime-mapping> - <mime-mapping> - <extension>lzh</extension> - <mime-type>application/x-lzh-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m13</extension> - <mime-type>application/x-msmediaview</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m14</extension> - <mime-type>application/x-msmediaview</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m1v</extension> - <mime-type>video/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m21</extension> - <mime-type>application/mp21</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m2a</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m2v</extension> - <mime-type>video/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m3a</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m3u</extension> - <mime-type>audio/x-mpegurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m3u8</extension> - <mime-type>application/vnd.apple.mpegurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m4a</extension> - <mime-type>audio/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m4b</extension> - <mime-type>audio/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m4r</extension> - <mime-type>audio/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m4u</extension> - <mime-type>video/vnd.mpegurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>m4v</extension> - <mime-type>video/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ma</extension> - <mime-type>application/mathematica</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mac</extension> - <mime-type>image/x-macpaint</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mads</extension> - <mime-type>application/mads+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mag</extension> - <mime-type>application/vnd.ecowin.chart</mime-type> - </mime-mapping> - <mime-mapping> - <extension>maker</extension> - <mime-type>application/vnd.framemaker</mime-type> - </mime-mapping> - <mime-mapping> - <extension>man</extension> - <mime-type>text/troff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mar</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mathml</extension> - <mime-type>application/mathml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mb</extension> - <mime-type>application/mathematica</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mbk</extension> - <mime-type>application/vnd.mobius.mbk</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mbox</extension> - <mime-type>application/mbox</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mc1</extension> - <mime-type>application/vnd.medcalcdata</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mcd</extension> - <mime-type>application/vnd.mcd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mcurl</extension> - <mime-type>text/vnd.curl.mcurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mdb</extension> - <mime-type>application/x-msaccess</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mdi</extension> - <mime-type>image/vnd.ms-modi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>me</extension> - <mime-type>text/troff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mesh</extension> - <mime-type>model/mesh</mime-type> - </mime-mapping> - <mime-mapping> - <extension>meta4</extension> - <mime-type>application/metalink4+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>metalink</extension> - <mime-type>application/metalink+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mets</extension> - <mime-type>application/mets+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mfm</extension> - <mime-type>application/vnd.mfmp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mft</extension> - <mime-type>application/rpki-manifest</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mgp</extension> - <mime-type>application/vnd.osgeo.mapguide.package</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mgz</extension> - <mime-type>application/vnd.proteus.magazine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mid</extension> - <mime-type>audio/midi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>midi</extension> - <mime-type>audio/midi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mie</extension> - <mime-type>application/x-mie</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mif</extension> - <mime-type>application/x-mif</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mime</extension> - <mime-type>message/rfc822</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mj2</extension> - <mime-type>video/mj2</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mjp2</extension> - <mime-type>video/mj2</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mk3d</extension> - <mime-type>video/x-matroska</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mka</extension> - <mime-type>audio/x-matroska</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mks</extension> - <mime-type>video/x-matroska</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mkv</extension> - <mime-type>video/x-matroska</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mlp</extension> - <mime-type>application/vnd.dolby.mlp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mmd</extension> - <mime-type>application/vnd.chipnuts.karaoke-mmd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mmf</extension> - <mime-type>application/vnd.smaf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mmr</extension> - <mime-type>image/vnd.fujixerox.edmics-mmr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mng</extension> - <mime-type>video/x-mng</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mny</extension> - <mime-type>application/x-msmoney</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mobi</extension> - <mime-type>application/x-mobipocket-ebook</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mods</extension> - <mime-type>application/mods+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mov</extension> - <mime-type>video/quicktime</mime-type> - </mime-mapping> - <mime-mapping> - <extension>movie</extension> - <mime-type>video/x-sgi-movie</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp1</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp2</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp21</extension> - <mime-type>application/mp21</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp2a</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp3</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp4</extension> - <mime-type>video/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp4a</extension> - <mime-type>audio/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp4s</extension> - <mime-type>application/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mp4v</extension> - <mime-type>video/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpa</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpc</extension> - <mime-type>application/vnd.mophun.certificate</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpe</extension> - <mime-type>video/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpeg</extension> - <mime-type>video/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpega</extension> - <mime-type>audio/x-mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpg</extension> - <mime-type>video/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpg4</extension> - <mime-type>video/mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpga</extension> - <mime-type>audio/mpeg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpkg</extension> - <mime-type>application/vnd.apple.installer+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpm</extension> - <mime-type>application/vnd.blueice.multipass</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpn</extension> - <mime-type>application/vnd.mophun.application</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpp</extension> - <mime-type>application/vnd.ms-project</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpt</extension> - <mime-type>application/vnd.ms-project</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpv2</extension> - <mime-type>video/mpeg2</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mpy</extension> - <mime-type>application/vnd.ibm.minipay</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mqy</extension> - <mime-type>application/vnd.mobius.mqy</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mrc</extension> - <mime-type>application/marc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mrcx</extension> - <mime-type>application/marcxml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ms</extension> - <mime-type>text/troff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mscml</extension> - <mime-type>application/mediaservercontrol+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mseed</extension> - <mime-type>application/vnd.fdsn.mseed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mseq</extension> - <mime-type>application/vnd.mseq</mime-type> - </mime-mapping> - <mime-mapping> - <extension>msf</extension> - <mime-type>application/vnd.epson.msf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>msh</extension> - <mime-type>model/mesh</mime-type> - </mime-mapping> - <mime-mapping> - <extension>msi</extension> - <mime-type>application/x-msdownload</mime-type> - </mime-mapping> - <mime-mapping> - <extension>msl</extension> - <mime-type>application/vnd.mobius.msl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>msty</extension> - <mime-type>application/vnd.muvee.style</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mts</extension> - <mime-type>model/vnd.mts</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mus</extension> - <mime-type>application/vnd.musician</mime-type> - </mime-mapping> - <mime-mapping> - <extension>musicxml</extension> - <mime-type>application/vnd.recordare.musicxml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mvb</extension> - <mime-type>application/x-msmediaview</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mwf</extension> - <mime-type>application/vnd.mfer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mxf</extension> - <mime-type>application/mxf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mxl</extension> - <mime-type>application/vnd.recordare.musicxml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mxml</extension> - <mime-type>application/xv+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mxs</extension> - <mime-type>application/vnd.triscape.mxs</mime-type> - </mime-mapping> - <mime-mapping> - <extension>mxu</extension> - <mime-type>video/vnd.mpegurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>n-gage</extension> - <mime-type>application/vnd.nokia.n-gage.symbian.install</mime-type> - </mime-mapping> - <mime-mapping> - <extension>n3</extension> - <mime-type>text/n3</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nb</extension> - <mime-type>application/mathematica</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nbp</extension> - <mime-type>application/vnd.wolfram.player</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nc</extension> - <mime-type>application/x-netcdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ncx</extension> - <mime-type>application/x-dtbncx+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nfo</extension> - <mime-type>text/x-nfo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ngdat</extension> - <mime-type>application/vnd.nokia.n-gage.data</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nitf</extension> - <mime-type>application/vnd.nitf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nlu</extension> - <mime-type>application/vnd.neurolanguage.nlu</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nml</extension> - <mime-type>application/vnd.enliven</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nnd</extension> - <mime-type>application/vnd.noblenet-directory</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nns</extension> - <mime-type>application/vnd.noblenet-sealer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nnw</extension> - <mime-type>application/vnd.noblenet-web</mime-type> - </mime-mapping> - <mime-mapping> - <extension>npx</extension> - <mime-type>image/vnd.net-fpx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nsc</extension> - <mime-type>application/x-conference</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nsf</extension> - <mime-type>application/vnd.lotus-notes</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ntf</extension> - <mime-type>application/vnd.nitf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>nzb</extension> - <mime-type>application/x-nzb</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oa2</extension> - <mime-type>application/vnd.fujitsu.oasys2</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oa3</extension> - <mime-type>application/vnd.fujitsu.oasys3</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oas</extension> - <mime-type>application/vnd.fujitsu.oasys</mime-type> - </mime-mapping> - <mime-mapping> - <extension>obd</extension> - <mime-type>application/x-msbinder</mime-type> - </mime-mapping> - <mime-mapping> - <extension>obj</extension> - <mime-type>application/x-tgif</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oda</extension> - <mime-type>application/oda</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Database --> - <extension>odb</extension> - <mime-type>application/vnd.oasis.opendocument.database</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Chart --> - <extension>odc</extension> - <mime-type>application/vnd.oasis.opendocument.chart</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Formula --> - <extension>odf</extension> - <mime-type>application/vnd.oasis.opendocument.formula</mime-type> - </mime-mapping> - <mime-mapping> - <extension>odft</extension> - <mime-type>application/vnd.oasis.opendocument.formula-template</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Drawing --> - <extension>odg</extension> - <mime-type>application/vnd.oasis.opendocument.graphics</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Image --> - <extension>odi</extension> - <mime-type>application/vnd.oasis.opendocument.image</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Master Document --> - <extension>odm</extension> - <mime-type>application/vnd.oasis.opendocument.text-master</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Presentation --> - <extension>odp</extension> - <mime-type>application/vnd.oasis.opendocument.presentation</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Spreadsheet --> - <extension>ods</extension> - <mime-type>application/vnd.oasis.opendocument.spreadsheet</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Text --> - <extension>odt</extension> - <mime-type>application/vnd.oasis.opendocument.text</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oga</extension> - <mime-type>audio/ogg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ogg</extension> - <mime-type>audio/ogg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ogv</extension> - <mime-type>video/ogg</mime-type> - </mime-mapping> - <mime-mapping> - <!-- xiph mime types --> - <extension>ogx</extension> - <mime-type>application/ogg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>omdoc</extension> - <mime-type>application/omdoc+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>onepkg</extension> - <mime-type>application/onenote</mime-type> - </mime-mapping> - <mime-mapping> - <extension>onetmp</extension> - <mime-type>application/onenote</mime-type> - </mime-mapping> - <mime-mapping> - <extension>onetoc</extension> - <mime-type>application/onenote</mime-type> - </mime-mapping> - <mime-mapping> - <extension>onetoc2</extension> - <mime-type>application/onenote</mime-type> - </mime-mapping> - <mime-mapping> - <extension>opf</extension> - <mime-type>application/oebps-package+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>opml</extension> - <mime-type>text/x-opml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oprc</extension> - <mime-type>application/vnd.palm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>org</extension> - <mime-type>application/vnd.lotus-organizer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>osf</extension> - <mime-type>application/vnd.yamaha.openscoreformat</mime-type> - </mime-mapping> - <mime-mapping> - <extension>osfpvg</extension> - <mime-type>application/vnd.yamaha.openscoreformat.osfpvg+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>otc</extension> - <mime-type>application/vnd.oasis.opendocument.chart-template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>otf</extension> - <mime-type>application/x-font-otf</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Drawing Template --> - <extension>otg</extension> - <mime-type>application/vnd.oasis.opendocument.graphics-template</mime-type> - </mime-mapping> - <mime-mapping> - <!-- HTML Document Template --> - <extension>oth</extension> - <mime-type>application/vnd.oasis.opendocument.text-web</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oti</extension> - <mime-type>application/vnd.oasis.opendocument.image-template</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Presentation Template --> - <extension>otp</extension> - <mime-type>application/vnd.oasis.opendocument.presentation-template</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Spreadsheet Template --> - <extension>ots</extension> - <mime-type>application/vnd.oasis.opendocument.spreadsheet-template</mime-type> - </mime-mapping> - <mime-mapping> - <!-- OpenDocument Text Template --> - <extension>ott</extension> - <mime-type>application/vnd.oasis.opendocument.text-template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oxps</extension> - <mime-type>application/oxps</mime-type> - </mime-mapping> - <mime-mapping> - <extension>oxt</extension> - <mime-type>application/vnd.openofficeorg.extension</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p</extension> - <mime-type>text/x-pascal</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p10</extension> - <mime-type>application/pkcs10</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p12</extension> - <mime-type>application/x-pkcs12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p7b</extension> - <mime-type>application/x-pkcs7-certificates</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p7c</extension> - <mime-type>application/pkcs7-mime</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p7m</extension> - <mime-type>application/pkcs7-mime</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p7r</extension> - <mime-type>application/x-pkcs7-certreqresp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p7s</extension> - <mime-type>application/pkcs7-signature</mime-type> - </mime-mapping> - <mime-mapping> - <extension>p8</extension> - <mime-type>application/pkcs8</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pas</extension> - <mime-type>text/x-pascal</mime-type> - </mime-mapping> - <mime-mapping> - <extension>paw</extension> - <mime-type>application/vnd.pawaafile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pbd</extension> - <mime-type>application/vnd.powerbuilder6</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pbm</extension> - <mime-type>image/x-portable-bitmap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pcap</extension> - <mime-type>application/vnd.tcpdump.pcap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pcf</extension> - <mime-type>application/x-font-pcf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pcl</extension> - <mime-type>application/vnd.hp-pcl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pclxl</extension> - <mime-type>application/vnd.hp-pclxl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pct</extension> - <mime-type>image/pict</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pcurl</extension> - <mime-type>application/vnd.curl.pcurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pcx</extension> - <mime-type>image/x-pcx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pdb</extension> - <mime-type>application/vnd.palm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pdf</extension> - <mime-type>application/pdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pfa</extension> - <mime-type>application/x-font-type1</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pfb</extension> - <mime-type>application/x-font-type1</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pfm</extension> - <mime-type>application/x-font-type1</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pfr</extension> - <mime-type>application/font-tdpfr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pfx</extension> - <mime-type>application/x-pkcs12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pgm</extension> - <mime-type>image/x-portable-graymap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pgn</extension> - <mime-type>application/x-chess-pgn</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pgp</extension> - <mime-type>application/pgp-encrypted</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pic</extension> - <mime-type>image/pict</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pict</extension> - <mime-type>image/pict</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pkg</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pki</extension> - <mime-type>application/pkixcmp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pkipath</extension> - <mime-type>application/pkix-pkipath</mime-type> - </mime-mapping> - <mime-mapping> - <extension>plb</extension> - <mime-type>application/vnd.3gpp.pic-bw-large</mime-type> - </mime-mapping> - <mime-mapping> - <extension>plc</extension> - <mime-type>application/vnd.mobius.plc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>plf</extension> - <mime-type>application/vnd.pocketlearn</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pls</extension> - <mime-type>audio/x-scpls</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pml</extension> - <mime-type>application/vnd.ctc-posml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>png</extension> - <mime-type>image/png</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pnm</extension> - <mime-type>image/x-portable-anymap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pnt</extension> - <mime-type>image/x-macpaint</mime-type> - </mime-mapping> - <mime-mapping> - <extension>portpkg</extension> - <mime-type>application/vnd.macports.portpkg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pot</extension> - <mime-type>application/vnd.ms-powerpoint</mime-type> - </mime-mapping> - <mime-mapping> - <extension>potm</extension> - <mime-type>application/vnd.ms-powerpoint.template.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>potx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.presentationml.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ppam</extension> - <mime-type>application/vnd.ms-powerpoint.addin.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ppd</extension> - <mime-type>application/vnd.cups-ppd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ppm</extension> - <mime-type>image/x-portable-pixmap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pps</extension> - <mime-type>application/vnd.ms-powerpoint</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ppsm</extension> - <mime-type>application/vnd.ms-powerpoint.slideshow.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ppsx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.presentationml.slideshow</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ppt</extension> - <mime-type>application/vnd.ms-powerpoint</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pptm</extension> - <mime-type>application/vnd.ms-powerpoint.presentation.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pptx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.presentationml.presentation</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pqa</extension> - <mime-type>application/vnd.palm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>prc</extension> - <mime-type>application/x-mobipocket-ebook</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pre</extension> - <mime-type>application/vnd.lotus-freelance</mime-type> - </mime-mapping> - <mime-mapping> - <extension>prf</extension> - <mime-type>application/pics-rules</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ps</extension> - <mime-type>application/postscript</mime-type> - </mime-mapping> - <mime-mapping> - <extension>psb</extension> - <mime-type>application/vnd.3gpp.pic-bw-small</mime-type> - </mime-mapping> - <mime-mapping> - <extension>psd</extension> - <mime-type>image/vnd.adobe.photoshop</mime-type> - </mime-mapping> - <mime-mapping> - <extension>psf</extension> - <mime-type>application/x-font-linux-psf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pskcxml</extension> - <mime-type>application/pskc+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ptid</extension> - <mime-type>application/vnd.pvi.ptid1</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pub</extension> - <mime-type>application/x-mspublisher</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pvb</extension> - <mime-type>application/vnd.3gpp.pic-bw-var</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pwn</extension> - <mime-type>application/vnd.3m.post-it-notes</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pya</extension> - <mime-type>audio/vnd.ms-playready.media.pya</mime-type> - </mime-mapping> - <mime-mapping> - <extension>pyv</extension> - <mime-type>video/vnd.ms-playready.media.pyv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qam</extension> - <mime-type>application/vnd.epson.quickanime</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qbo</extension> - <mime-type>application/vnd.intu.qbo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qfx</extension> - <mime-type>application/vnd.intu.qfx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qps</extension> - <mime-type>application/vnd.publishare-delta-tree</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qt</extension> - <mime-type>video/quicktime</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qti</extension> - <mime-type>image/x-quicktime</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qtif</extension> - <mime-type>image/x-quicktime</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qwd</extension> - <mime-type>application/vnd.quark.quarkxpress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qwt</extension> - <mime-type>application/vnd.quark.quarkxpress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qxb</extension> - <mime-type>application/vnd.quark.quarkxpress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qxd</extension> - <mime-type>application/vnd.quark.quarkxpress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qxl</extension> - <mime-type>application/vnd.quark.quarkxpress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>qxt</extension> - <mime-type>application/vnd.quark.quarkxpress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ra</extension> - <mime-type>audio/x-pn-realaudio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ram</extension> - <mime-type>audio/x-pn-realaudio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rar</extension> - <mime-type>application/x-rar-compressed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ras</extension> - <mime-type>image/x-cmu-raster</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rcprofile</extension> - <mime-type>application/vnd.ipunplugged.rcprofile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rdf</extension> - <mime-type>application/rdf+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rdz</extension> - <mime-type>application/vnd.data-vision.rdz</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rep</extension> - <mime-type>application/vnd.businessobjects</mime-type> - </mime-mapping> - <mime-mapping> - <extension>res</extension> - <mime-type>application/x-dtbresource+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rgb</extension> - <mime-type>image/x-rgb</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rif</extension> - <mime-type>application/reginfo+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rip</extension> - <mime-type>audio/vnd.rip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ris</extension> - <mime-type>application/x-research-info-systems</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rl</extension> - <mime-type>application/resource-lists+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rlc</extension> - <mime-type>image/vnd.fujixerox.edmics-rlc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rld</extension> - <mime-type>application/resource-lists-diff+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rm</extension> - <mime-type>application/vnd.rn-realmedia</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rmi</extension> - <mime-type>audio/midi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rmp</extension> - <mime-type>audio/x-pn-realaudio-plugin</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rms</extension> - <mime-type>application/vnd.jcp.javame.midlet-rms</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rmvb</extension> - <mime-type>application/vnd.rn-realmedia-vbr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rnc</extension> - <mime-type>application/relax-ng-compact-syntax</mime-type> - </mime-mapping> - <mime-mapping> - <extension>roa</extension> - <mime-type>application/rpki-roa</mime-type> - </mime-mapping> - <mime-mapping> - <extension>roff</extension> - <mime-type>text/troff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rp9</extension> - <mime-type>application/vnd.cloanto.rp9</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rpss</extension> - <mime-type>application/vnd.nokia.radio-presets</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rpst</extension> - <mime-type>application/vnd.nokia.radio-preset</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rq</extension> - <mime-type>application/sparql-query</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rs</extension> - <mime-type>application/rls-services+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rsd</extension> - <mime-type>application/rsd+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rss</extension> - <mime-type>application/rss+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rtf</extension> - <mime-type>application/rtf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>rtx</extension> - <mime-type>text/richtext</mime-type> - </mime-mapping> - <mime-mapping> - <extension>s</extension> - <mime-type>text/x-asm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>s3m</extension> - <mime-type>audio/s3m</mime-type> - </mime-mapping> - <mime-mapping> - <extension>saf</extension> - <mime-type>application/vnd.yamaha.smaf-audio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sbml</extension> - <mime-type>application/sbml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sc</extension> - <mime-type>application/vnd.ibm.secure-container</mime-type> - </mime-mapping> - <mime-mapping> - <extension>scd</extension> - <mime-type>application/x-msschedule</mime-type> - </mime-mapping> - <mime-mapping> - <extension>scm</extension> - <mime-type>application/vnd.lotus-screencam</mime-type> - </mime-mapping> - <mime-mapping> - <extension>scq</extension> - <mime-type>application/scvp-cv-request</mime-type> - </mime-mapping> - <mime-mapping> - <extension>scs</extension> - <mime-type>application/scvp-cv-response</mime-type> - </mime-mapping> - <mime-mapping> - <extension>scurl</extension> - <mime-type>text/vnd.curl.scurl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sda</extension> - <mime-type>application/vnd.stardivision.draw</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sdc</extension> - <mime-type>application/vnd.stardivision.calc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sdd</extension> - <mime-type>application/vnd.stardivision.impress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sdkd</extension> - <mime-type>application/vnd.solent.sdkm+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sdkm</extension> - <mime-type>application/vnd.solent.sdkm+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sdp</extension> - <mime-type>application/sdp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sdw</extension> - <mime-type>application/vnd.stardivision.writer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>see</extension> - <mime-type>application/vnd.seemail</mime-type> - </mime-mapping> - <mime-mapping> - <extension>seed</extension> - <mime-type>application/vnd.fdsn.seed</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sema</extension> - <mime-type>application/vnd.sema</mime-type> - </mime-mapping> - <mime-mapping> - <extension>semd</extension> - <mime-type>application/vnd.semd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>semf</extension> - <mime-type>application/vnd.semf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ser</extension> - <mime-type>application/java-serialized-object</mime-type> - </mime-mapping> - <mime-mapping> - <extension>setpay</extension> - <mime-type>application/set-payment-initiation</mime-type> - </mime-mapping> - <mime-mapping> - <extension>setreg</extension> - <mime-type>application/set-registration-initiation</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sfd-hdstx</extension> - <mime-type>application/vnd.hydrostatix.sof-data</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sfs</extension> - <mime-type>application/vnd.spotfire.sfs</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sfv</extension> - <mime-type>text/x-sfv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sgi</extension> - <mime-type>image/sgi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sgl</extension> - <mime-type>application/vnd.stardivision.writer-global</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sgm</extension> - <mime-type>text/sgml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sgml</extension> - <mime-type>text/sgml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sh</extension> - <mime-type>application/x-sh</mime-type> - </mime-mapping> - <mime-mapping> - <extension>shar</extension> - <mime-type>application/x-shar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>shf</extension> - <mime-type>application/shf+xml</mime-type> - </mime-mapping> - <!-- - <mime-mapping> - <extension>shtml</extension> - <mime-type>text/x-server-parsed-html</mime-type> - </mime-mapping> - --> - <mime-mapping> - <extension>sid</extension> - <mime-type>image/x-mrsid-image</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sig</extension> - <mime-type>application/pgp-signature</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sil</extension> - <mime-type>audio/silk</mime-type> - </mime-mapping> - <mime-mapping> - <extension>silo</extension> - <mime-type>model/mesh</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sis</extension> - <mime-type>application/vnd.symbian.install</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sisx</extension> - <mime-type>application/vnd.symbian.install</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sit</extension> - <mime-type>application/x-stuffit</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sitx</extension> - <mime-type>application/x-stuffitx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>skd</extension> - <mime-type>application/vnd.koan</mime-type> - </mime-mapping> - <mime-mapping> - <extension>skm</extension> - <mime-type>application/vnd.koan</mime-type> - </mime-mapping> - <mime-mapping> - <extension>skp</extension> - <mime-type>application/vnd.koan</mime-type> - </mime-mapping> - <mime-mapping> - <extension>skt</extension> - <mime-type>application/vnd.koan</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sldm</extension> - <mime-type>application/vnd.ms-powerpoint.slide.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sldx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.presentationml.slide</mime-type> - </mime-mapping> - <mime-mapping> - <extension>slt</extension> - <mime-type>application/vnd.epson.salt</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sm</extension> - <mime-type>application/vnd.stepmania.stepchart</mime-type> - </mime-mapping> - <mime-mapping> - <extension>smf</extension> - <mime-type>application/vnd.stardivision.math</mime-type> - </mime-mapping> - <mime-mapping> - <extension>smi</extension> - <mime-type>application/smil+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>smil</extension> - <mime-type>application/smil+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>smv</extension> - <mime-type>video/x-smv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>smzip</extension> - <mime-type>application/vnd.stepmania.package</mime-type> - </mime-mapping> - <mime-mapping> - <extension>snd</extension> - <mime-type>audio/basic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>snf</extension> - <mime-type>application/x-font-snf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>so</extension> - <mime-type>application/octet-stream</mime-type> - </mime-mapping> - <mime-mapping> - <extension>spc</extension> - <mime-type>application/x-pkcs7-certificates</mime-type> - </mime-mapping> - <mime-mapping> - <extension>spf</extension> - <mime-type>application/vnd.yamaha.smaf-phrase</mime-type> - </mime-mapping> - <mime-mapping> - <extension>spl</extension> - <mime-type>application/x-futuresplash</mime-type> - </mime-mapping> - <mime-mapping> - <extension>spot</extension> - <mime-type>text/vnd.in3d.spot</mime-type> - </mime-mapping> - <mime-mapping> - <extension>spp</extension> - <mime-type>application/scvp-vp-response</mime-type> - </mime-mapping> - <mime-mapping> - <extension>spq</extension> - <mime-type>application/scvp-vp-request</mime-type> - </mime-mapping> - <mime-mapping> - <extension>spx</extension> - <mime-type>audio/ogg</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sql</extension> - <mime-type>application/x-sql</mime-type> - </mime-mapping> - <mime-mapping> - <extension>src</extension> - <mime-type>application/x-wais-source</mime-type> - </mime-mapping> - <mime-mapping> - <extension>srt</extension> - <mime-type>application/x-subrip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sru</extension> - <mime-type>application/sru+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>srx</extension> - <mime-type>application/sparql-results+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ssdl</extension> - <mime-type>application/ssdl+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sse</extension> - <mime-type>application/vnd.kodak-descriptor</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ssf</extension> - <mime-type>application/vnd.epson.ssf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ssml</extension> - <mime-type>application/ssml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>st</extension> - <mime-type>application/vnd.sailingtracker.track</mime-type> - </mime-mapping> - <mime-mapping> - <extension>stc</extension> - <mime-type>application/vnd.sun.xml.calc.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>std</extension> - <mime-type>application/vnd.sun.xml.draw.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>stf</extension> - <mime-type>application/vnd.wt.stf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sti</extension> - <mime-type>application/vnd.sun.xml.impress.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>stk</extension> - <mime-type>application/hyperstudio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>stl</extension> - <mime-type>application/vnd.ms-pki.stl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>str</extension> - <mime-type>application/vnd.pg.format</mime-type> - </mime-mapping> - <mime-mapping> - <extension>stw</extension> - <mime-type>application/vnd.sun.xml.writer.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sub</extension> - <mime-type>text/vnd.dvb.subtitle</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sus</extension> - <mime-type>application/vnd.sus-calendar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>susp</extension> - <mime-type>application/vnd.sus-calendar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sv4cpio</extension> - <mime-type>application/x-sv4cpio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sv4crc</extension> - <mime-type>application/x-sv4crc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>svc</extension> - <mime-type>application/vnd.dvb.service</mime-type> - </mime-mapping> - <mime-mapping> - <extension>svd</extension> - <mime-type>application/vnd.svd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>svg</extension> - <mime-type>image/svg+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>svgz</extension> - <mime-type>image/svg+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>swa</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>swf</extension> - <mime-type>application/x-shockwave-flash</mime-type> - </mime-mapping> - <mime-mapping> - <extension>swi</extension> - <mime-type>application/vnd.aristanetworks.swi</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sxc</extension> - <mime-type>application/vnd.sun.xml.calc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sxd</extension> - <mime-type>application/vnd.sun.xml.draw</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sxg</extension> - <mime-type>application/vnd.sun.xml.writer.global</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sxi</extension> - <mime-type>application/vnd.sun.xml.impress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sxm</extension> - <mime-type>application/vnd.sun.xml.math</mime-type> - </mime-mapping> - <mime-mapping> - <extension>sxw</extension> - <mime-type>application/vnd.sun.xml.writer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>t</extension> - <mime-type>text/troff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>t3</extension> - <mime-type>application/x-t3vm-image</mime-type> - </mime-mapping> - <mime-mapping> - <extension>taglet</extension> - <mime-type>application/vnd.mynfc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tao</extension> - <mime-type>application/vnd.tao.intent-module-archive</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tar</extension> - <mime-type>application/x-tar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tcap</extension> - <mime-type>application/vnd.3gpp2.tcap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tcl</extension> - <mime-type>application/x-tcl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>teacher</extension> - <mime-type>application/vnd.smart.teacher</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tei</extension> - <mime-type>application/tei+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>teicorpus</extension> - <mime-type>application/tei+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tex</extension> - <mime-type>application/x-tex</mime-type> - </mime-mapping> - <mime-mapping> - <extension>texi</extension> - <mime-type>application/x-texinfo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>texinfo</extension> - <mime-type>application/x-texinfo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>text</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tfi</extension> - <mime-type>application/thraud+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tfm</extension> - <mime-type>application/x-tex-tfm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tga</extension> - <mime-type>image/x-tga</mime-type> - </mime-mapping> - <mime-mapping> - <extension>thmx</extension> - <mime-type>application/vnd.ms-officetheme</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tif</extension> - <mime-type>image/tiff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tiff</extension> - <mime-type>image/tiff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tmo</extension> - <mime-type>application/vnd.tmobile-livetv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>torrent</extension> - <mime-type>application/x-bittorrent</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tpl</extension> - <mime-type>application/vnd.groove-tool-template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tpt</extension> - <mime-type>application/vnd.trid.tpt</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tr</extension> - <mime-type>text/troff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tra</extension> - <mime-type>application/vnd.trueapp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>trm</extension> - <mime-type>application/x-msterminal</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tsd</extension> - <mime-type>application/timestamped-data</mime-type> - </mime-mapping> - <mime-mapping> - <extension>tsv</extension> - <mime-type>text/tab-separated-values</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ttc</extension> - <mime-type>application/x-font-ttf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ttf</extension> - <mime-type>application/x-font-ttf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ttl</extension> - <mime-type>text/turtle</mime-type> - </mime-mapping> - <mime-mapping> - <extension>twd</extension> - <mime-type>application/vnd.simtech-mindmapper</mime-type> - </mime-mapping> - <mime-mapping> - <extension>twds</extension> - <mime-type>application/vnd.simtech-mindmapper</mime-type> - </mime-mapping> - <mime-mapping> - <extension>txd</extension> - <mime-type>application/vnd.genomatix.tuxedo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>txf</extension> - <mime-type>application/vnd.mobius.txf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>txt</extension> - <mime-type>text/plain</mime-type> - </mime-mapping> - <mime-mapping> - <extension>u32</extension> - <mime-type>application/x-authorware-bin</mime-type> - </mime-mapping> - <mime-mapping> - <extension>udeb</extension> - <mime-type>application/x-debian-package</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ufd</extension> - <mime-type>application/vnd.ufdl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ufdl</extension> - <mime-type>application/vnd.ufdl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ulw</extension> - <mime-type>audio/basic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ulx</extension> - <mime-type>application/x-glulx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>umj</extension> - <mime-type>application/vnd.umajin</mime-type> - </mime-mapping> - <mime-mapping> - <extension>unityweb</extension> - <mime-type>application/vnd.unity</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uoml</extension> - <mime-type>application/vnd.uoml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uri</extension> - <mime-type>text/uri-list</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uris</extension> - <mime-type>text/uri-list</mime-type> - </mime-mapping> - <mime-mapping> - <extension>urls</extension> - <mime-type>text/uri-list</mime-type> - </mime-mapping> - <mime-mapping> - <extension>ustar</extension> - <mime-type>application/x-ustar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>utz</extension> - <mime-type>application/vnd.uiq.theme</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uu</extension> - <mime-type>text/x-uuencode</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uva</extension> - <mime-type>audio/vnd.dece.audio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvd</extension> - <mime-type>application/vnd.dece.data</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvf</extension> - <mime-type>application/vnd.dece.data</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvg</extension> - <mime-type>image/vnd.dece.graphic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvh</extension> - <mime-type>video/vnd.dece.hd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvi</extension> - <mime-type>image/vnd.dece.graphic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvm</extension> - <mime-type>video/vnd.dece.mobile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvp</extension> - <mime-type>video/vnd.dece.pd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvs</extension> - <mime-type>video/vnd.dece.sd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvt</extension> - <mime-type>application/vnd.dece.ttml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvu</extension> - <mime-type>video/vnd.uvvu.mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvv</extension> - <mime-type>video/vnd.dece.video</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvva</extension> - <mime-type>audio/vnd.dece.audio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvd</extension> - <mime-type>application/vnd.dece.data</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvf</extension> - <mime-type>application/vnd.dece.data</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvg</extension> - <mime-type>image/vnd.dece.graphic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvh</extension> - <mime-type>video/vnd.dece.hd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvi</extension> - <mime-type>image/vnd.dece.graphic</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvm</extension> - <mime-type>video/vnd.dece.mobile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvp</extension> - <mime-type>video/vnd.dece.pd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvs</extension> - <mime-type>video/vnd.dece.sd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvt</extension> - <mime-type>application/vnd.dece.ttml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvu</extension> - <mime-type>video/vnd.uvvu.mp4</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvv</extension> - <mime-type>video/vnd.dece.video</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvx</extension> - <mime-type>application/vnd.dece.unspecified</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvvz</extension> - <mime-type>application/vnd.dece.zip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvx</extension> - <mime-type>application/vnd.dece.unspecified</mime-type> - </mime-mapping> - <mime-mapping> - <extension>uvz</extension> - <mime-type>application/vnd.dece.zip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vcard</extension> - <mime-type>text/vcard</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vcd</extension> - <mime-type>application/x-cdlink</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vcf</extension> - <mime-type>text/x-vcard</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vcg</extension> - <mime-type>application/vnd.groove-vcard</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vcs</extension> - <mime-type>text/x-vcalendar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vcx</extension> - <mime-type>application/vnd.vcx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vis</extension> - <mime-type>application/vnd.visionary</mime-type> - </mime-mapping> - <mime-mapping> - <extension>viv</extension> - <mime-type>video/vnd.vivo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vob</extension> - <mime-type>video/x-ms-vob</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vor</extension> - <mime-type>application/vnd.stardivision.writer</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vox</extension> - <mime-type>application/x-authorware-bin</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vrml</extension> - <mime-type>model/vrml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vsd</extension> - <mime-type>application/vnd.visio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vsf</extension> - <mime-type>application/vnd.vsf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vss</extension> - <mime-type>application/vnd.visio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vst</extension> - <mime-type>application/vnd.visio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vsw</extension> - <mime-type>application/vnd.visio</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vtu</extension> - <mime-type>model/vnd.vtu</mime-type> - </mime-mapping> - <mime-mapping> - <extension>vxml</extension> - <mime-type>application/voicexml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>w3d</extension> - <mime-type>application/x-director</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wad</extension> - <mime-type>application/x-doom</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wav</extension> - <mime-type>audio/x-wav</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wax</extension> - <mime-type>audio/x-ms-wax</mime-type> - </mime-mapping> - <mime-mapping> - <!-- Wireless Bitmap --> - <extension>wbmp</extension> - <mime-type>image/vnd.wap.wbmp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wbs</extension> - <mime-type>application/vnd.criticaltools.wbs+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wbxml</extension> - <mime-type>application/vnd.wap.wbxml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wcm</extension> - <mime-type>application/vnd.ms-works</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wdb</extension> - <mime-type>application/vnd.ms-works</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wdp</extension> - <mime-type>image/vnd.ms-photo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>weba</extension> - <mime-type>audio/webm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>webm</extension> - <mime-type>video/webm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>webp</extension> - <mime-type>image/webp</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wg</extension> - <mime-type>application/vnd.pmi.widget</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wgt</extension> - <mime-type>application/widget</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wks</extension> - <mime-type>application/vnd.ms-works</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wm</extension> - <mime-type>video/x-ms-wm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wma</extension> - <mime-type>audio/x-ms-wma</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wmd</extension> - <mime-type>application/x-ms-wmd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wmf</extension> - <mime-type>application/x-msmetafile</mime-type> - </mime-mapping> - <mime-mapping> - <!-- WML Source --> - <extension>wml</extension> - <mime-type>text/vnd.wap.wml</mime-type> - </mime-mapping> - <mime-mapping> - <!-- Compiled WML --> - <extension>wmlc</extension> - <mime-type>application/vnd.wap.wmlc</mime-type> - </mime-mapping> - <mime-mapping> - <!-- WML Script Source --> - <extension>wmls</extension> - <mime-type>text/vnd.wap.wmlscript</mime-type> - </mime-mapping> - <mime-mapping> - <!-- Compiled WML Script --> - <extension>wmlsc</extension> - <mime-type>application/vnd.wap.wmlscriptc</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wmv</extension> - <mime-type>video/x-ms-wmv</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wmx</extension> - <mime-type>video/x-ms-wmx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wmz</extension> - <mime-type>application/x-msmetafile</mime-type> - </mime-mapping> - <mime-mapping> - <extension>woff</extension> - <mime-type>application/x-font-woff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wpd</extension> - <mime-type>application/vnd.wordperfect</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wpl</extension> - <mime-type>application/vnd.ms-wpl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wps</extension> - <mime-type>application/vnd.ms-works</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wqd</extension> - <mime-type>application/vnd.wqd</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wri</extension> - <mime-type>application/x-mswrite</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wrl</extension> - <mime-type>model/vrml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wsdl</extension> - <mime-type>application/wsdl+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wspolicy</extension> - <mime-type>application/wspolicy+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wtb</extension> - <mime-type>application/vnd.webturbo</mime-type> - </mime-mapping> - <mime-mapping> - <extension>wvx</extension> - <mime-type>video/x-ms-wvx</mime-type> - </mime-mapping> - <mime-mapping> - <extension>x32</extension> - <mime-type>application/x-authorware-bin</mime-type> - </mime-mapping> - <mime-mapping> - <extension>x3d</extension> - <mime-type>model/x3d+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>x3db</extension> - <mime-type>model/x3d+binary</mime-type> - </mime-mapping> - <mime-mapping> - <extension>x3dbz</extension> - <mime-type>model/x3d+binary</mime-type> - </mime-mapping> - <mime-mapping> - <extension>x3dv</extension> - <mime-type>model/x3d+vrml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>x3dvz</extension> - <mime-type>model/x3d+vrml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>x3dz</extension> - <mime-type>model/x3d+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xaml</extension> - <mime-type>application/xaml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xap</extension> - <mime-type>application/x-silverlight-app</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xar</extension> - <mime-type>application/vnd.xara</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xbap</extension> - <mime-type>application/x-ms-xbap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xbd</extension> - <mime-type>application/vnd.fujixerox.docuworks.binder</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xbm</extension> - <mime-type>image/x-xbitmap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xdf</extension> - <mime-type>application/xcap-diff+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xdm</extension> - <mime-type>application/vnd.syncml.dm+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xdp</extension> - <mime-type>application/vnd.adobe.xdp+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xdssc</extension> - <mime-type>application/dssc+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xdw</extension> - <mime-type>application/vnd.fujixerox.docuworks</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xenc</extension> - <mime-type>application/xenc+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xer</extension> - <mime-type>application/patch-ops-error+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xfdf</extension> - <mime-type>application/vnd.adobe.xfdf</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xfdl</extension> - <mime-type>application/vnd.xfdl</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xht</extension> - <mime-type>application/xhtml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xhtml</extension> - <mime-type>application/xhtml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xhvml</extension> - <mime-type>application/xv+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xif</extension> - <mime-type>image/vnd.xiff</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xla</extension> - <mime-type>application/vnd.ms-excel</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlam</extension> - <mime-type>application/vnd.ms-excel.addin.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlc</extension> - <mime-type>application/vnd.ms-excel</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlf</extension> - <mime-type>application/x-xliff+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlm</extension> - <mime-type>application/vnd.ms-excel</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xls</extension> - <mime-type>application/vnd.ms-excel</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlsb</extension> - <mime-type>application/vnd.ms-excel.sheet.binary.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlsm</extension> - <mime-type>application/vnd.ms-excel.sheet.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlsx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlt</extension> - <mime-type>application/vnd.ms-excel</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xltm</extension> - <mime-type>application/vnd.ms-excel.template.macroenabled.12</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xltx</extension> - <mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.template</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xlw</extension> - <mime-type>application/vnd.ms-excel</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xm</extension> - <mime-type>audio/xm</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xml</extension> - <mime-type>application/xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xo</extension> - <mime-type>application/vnd.olpc-sugar</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xop</extension> - <mime-type>application/xop+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xpi</extension> - <mime-type>application/x-xpinstall</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xpl</extension> - <mime-type>application/xproc+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xpm</extension> - <mime-type>image/x-xpixmap</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xpr</extension> - <mime-type>application/vnd.is-xpr</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xps</extension> - <mime-type>application/vnd.ms-xpsdocument</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xpw</extension> - <mime-type>application/vnd.intercon.formnet</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xpx</extension> - <mime-type>application/vnd.intercon.formnet</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xsl</extension> - <mime-type>application/xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xslt</extension> - <mime-type>application/xslt+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xsm</extension> - <mime-type>application/vnd.syncml+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xspf</extension> - <mime-type>application/xspf+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xul</extension> - <mime-type>application/vnd.mozilla.xul+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xvm</extension> - <mime-type>application/xv+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xvml</extension> - <mime-type>application/xv+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xwd</extension> - <mime-type>image/x-xwindowdump</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xyz</extension> - <mime-type>chemical/x-xyz</mime-type> - </mime-mapping> - <mime-mapping> - <extension>xz</extension> - <mime-type>application/x-xz</mime-type> - </mime-mapping> - <mime-mapping> - <extension>yang</extension> - <mime-type>application/yang</mime-type> - </mime-mapping> - <mime-mapping> - <extension>yin</extension> - <mime-type>application/yin+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z</extension> - <mime-type>application/x-compress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>Z</extension> - <mime-type>application/x-compress</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z1</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z2</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z3</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z4</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z5</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z6</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z7</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>z8</extension> - <mime-type>application/x-zmachine</mime-type> - </mime-mapping> - <mime-mapping> - <extension>zaz</extension> - <mime-type>application/vnd.zzazz.deck+xml</mime-type> - </mime-mapping> - <mime-mapping> - <extension>zip</extension> - <mime-type>application/zip</mime-type> - </mime-mapping> - <mime-mapping> - <extension>zir</extension> - <mime-type>application/vnd.zul</mime-type> - </mime-mapping> - <mime-mapping> - <extension>zirz</extension> - <mime-type>application/vnd.zul</mime-type> - </mime-mapping> - <mime-mapping> - <extension>zmm</extension> - <mime-type>application/vnd.handheld-entertainment+xml</mime-type> - </mime-mapping> - - <!-- ==================== Default Welcome File List ===================== --> - <!-- When a request URI refers to a directory, the default servlet looks --> - <!-- for a "welcome file" within that directory and, if present, to the --> - <!-- corresponding resource URI for display. --> - <!-- If no welcome files are present, the default servlet either serves a --> - <!-- directory listing (see default servlet configuration on how to --> - <!-- customize) or returns a 404 status, depending on the value of the --> - <!-- listings setting. --> - <!-- --> - <!-- If you define welcome files in your own application's web.xml --> - <!-- deployment descriptor, that list *replaces* the list configured --> - <!-- here, so be sure to include any of the default values that you wish --> - <!-- to use within your application. --> - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - <welcome-file>index.htm</welcome-file> - <welcome-file>index.jsp</welcome-file> - </welcome-file-list> - -</web-app> diff --git a/catalog-core/httpserver/src/main/assembly/tomcat/logs/delete.me b/catalog-core/httpserver/src/main/assembly/tomcat/logs/delete.me deleted file mode 100644 index e69de29b..00000000 --- a/catalog-core/httpserver/src/main/assembly/tomcat/logs/delete.me +++ /dev/null diff --git a/catalog-core/pom.xml b/catalog-core/pom.xml deleted file mode 100644 index 660fca19..00000000 --- a/catalog-core/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalog-root</artifactId> - <version>1.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>catalog-core-parent</artifactId> - <name>common-tosca-catalog/catalog-core</name> - <packaging>pom</packaging> - - <modules> - <module>catalog-mgr</module> - <module>httpserver</module> - <module>distribution</module> - </modules> -</project> diff --git a/catalog-parent/catalogparent-lite/pom.xml b/catalog-parent/catalogparent-lite/pom.xml deleted file mode 100644 index 36238a3e..00000000 --- a/catalog-parent/catalogparent-lite/pom.xml +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.oparent</groupId> - <artifactId>oparent</artifactId> - <version>1.1.0-SNAPSHOT</version> - <relativePath>../../../oparent</relativePath> - </parent> - - <modelVersion>4.0.0</modelVersion> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalogparent-lite</artifactId> - <name>common-tosca-catalog/catalog-parent/catalogparent-lite</name> - <packaging>pom</packaging> - - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.3</version> - <configuration> - <verbose>true</verbose> - <fork>true</fork> - <compilerVersion>1.7</compilerVersion> - <source>1.7</source> - <target>1.7</target> - <encoding>UTF-8</encoding> - <debug>true</debug> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.6</version> - <configuration> - <archive> - <addMavenDescriptor>false</addMavenDescriptor> - </archive> - <forceCreation>true</forceCreation> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>2.4</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>2.10</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <version>2.7</version> - <configuration> - <encoding>UTF-8</encoding> - <nonFilteredFileExtensions> - <nonFilteredFileExtension>pdf</nonFilteredFileExtension> - <nonFilteredFileExtension>swf</nonFilteredFileExtension> - <nonFilteredFileExtension>exe</nonFilteredFileExtension> - <nonFilteredFileExtension>png</nonFilteredFileExtension> - <nonFilteredFileExtension>gif</nonFilteredFileExtension> - <nonFilteredFileExtension>jpg</nonFilteredFileExtension> - <nonFilteredFileExtension>jpeg</nonFilteredFileExtension> - <nonFilteredFileExtension>bmp</nonFilteredFileExtension> - <nonFilteredFileExtension>eot</nonFilteredFileExtension> - <nonFilteredFileExtension>ttf</nonFilteredFileExtension> - <nonFilteredFileExtension>svg</nonFilteredFileExtension> - <nonFilteredFileExtension>woff</nonFilteredFileExtension> - <nonFilteredFileExtension>woff2</nonFilteredFileExtension> - <nonFilteredFileExtension>mso</nonFilteredFileExtension> - <nonFilteredFileExtension>wmz</nonFilteredFileExtension> - <nonFilteredFileExtension>emz</nonFilteredFileExtension> - <nonFilteredFileExtension>otf</nonFilteredFileExtension> - </nonFilteredFileExtensions> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>1.10</version> - </plugin> - <plugin> - <groupId>com.mycila</groupId> - <artifactId>license-maven-plugin</artifactId> - <version>3.0.rc1</version> - </plugin> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <version>1.8</version> - </plugin> - </plugins> - </pluginManagement> - </build> -</project> diff --git a/catalog-parent/catalogparent/pom.xml b/catalog-parent/catalogparent/pom.xml deleted file mode 100644 index c87c6559..00000000 --- a/catalog-parent/catalogparent/pom.xml +++ /dev/null @@ -1,233 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalogparent-lite</artifactId> - <version>1.1.0-SNAPSHOT</version> - <relativePath>../catalogparent-lite</relativePath> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>catalogparent</artifactId> - <name>common-tosca-catalog/catalog-parent/catalogparent</name> - <packaging>pom</packaging> - - <properties> - <dropwizard.version>0.8.0</dropwizard.version> - <swagger.version>1.5.3</swagger.version> - <lombok.version>1.16.4</lombok.version> - <jersey.version>2.16</jersey.version> - <jaxrs.consumer.version>5.0</jaxrs.consumer.version> - <jackson-version>2.5.1</jackson-version> - <gson.version>2.2.4</gson.version> - <yamlbeans.version>1.08</yamlbeans.version> - <dom4j.version>1.6</dom4j.version> - <cometd.version>3.0.7</cometd.version> - <commons-net.version>3.3</commons-net.version> - <mysql-connector-java.version>5.1.18</mysql-connector-java.version> - <commons-fileupload.version>1.2.1</commons-fileupload.version> - <commons-io.version>1.4</commons-io.version> - <junit.version>4.10</junit.version> - <org.powermock.version>1.4.10</org.powermock.version> - <org.mockito.version>1.9.5</org.mockito.version> - <h2database.version>1.4.182</h2database.version> - <org.apache.ant.version>1.8.2</org.apache.ant.version> - <tomcat.version>8.5.6</tomcat.version> - </properties> - - <dependencyManagement> - <dependencies> - <!-- dropwizard --> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-core</artifactId> - <version>${dropwizard.version}</version> - </dependency> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-assets</artifactId> - <version>${dropwizard.version}</version> - </dependency> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-hibernate</artifactId> - <version>${dropwizard.version}</version> - </dependency> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-migrations</artifactId> - <version>${dropwizard.version}</version> - </dependency> - <!-- swagger --> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-jersey2-jaxrs</artifactId> - <version>${swagger.version}</version> - </dependency> - <!-- lombok --> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - <version>${lombok.version}</version> - </dependency> - <!-- jersey --> - <dependency> - <groupId>org.glassfish.jersey.core</groupId> - <artifactId>jersey-server</artifactId> - <version>${jersey.version}</version> - </dependency> - <dependency> - <groupId>org.glassfish.jersey.media</groupId> - <artifactId>jersey-media-multipart</artifactId> - <version>${jersey.version}</version> - </dependency> - <dependency> - <groupId>org.glassfish.jersey.containers</groupId> - <artifactId>jersey-container-servlet-core</artifactId> - <version>${jersey.version}</version> - </dependency> - <!-- consumer --> - <dependency> - <groupId>com.eclipsesource.jaxrs</groupId> - <artifactId>consumer</artifactId> - <version>${jaxrs.consumer.version}</version> - </dependency> - <!-- jackson --> - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-xml</artifactId> - <version>${jackson-version}</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - <version>${jackson-version}</version> - </dependency> - <!-- gson --> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>${gson.version}</version> - </dependency> - <!-- dom4j --> - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>${dom4j.version}</version> - </dependency> - <!-- cometd --> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>bayeux-api</artifactId> - <version>${cometd.version}</version> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-annotations</artifactId> - <version>${cometd.version}</version> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-client</artifactId> - <version>${cometd.version}</version> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-common</artifactId> - <version>${cometd.version}</version> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-oort</artifactId> - <version>${cometd.version}</version> - </dependency> - <dependency> - <groupId>org.cometd.java</groupId> - <artifactId>cometd-java-server</artifactId> - <version>${cometd.version}</version> - </dependency> - <!-- ftp --> - <dependency> - <groupId>commons-net</groupId> - <artifactId>commons-net</artifactId> - <version>${commons-net.version}</version> - </dependency> - <!-- mysql --> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>${mysql-connector-java.version}</version> - </dependency> - <!-- http server --> - <dependency> - <groupId>commons-fileupload</groupId> - <artifactId>commons-fileupload</artifactId> - <version>${commons-fileupload.version}</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>${commons-io.version}</version> - </dependency> - <!-- UT --> - <dependency> - <groupId>io.dropwizard</groupId> - <artifactId>dropwizard-testing</artifactId> - <version>${dropwizard.version}</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>${junit.version}</version> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4</artifactId> - <version>${org.powermock.version}</version> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito</artifactId> - <version>${org.powermock.version}</version> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> - <version>${org.mockito.version}</version> - </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <version>${h2database.version}</version> - </dependency> - <dependency> - <groupId>org.apache.ant</groupId> - <artifactId>ant</artifactId> - <version>${org.apache.ant.version}</version> - </dependency> - <!-- UT end --> - <dependency> - <groupId>org.apache.tomcat</groupId> - <artifactId>tomcat</artifactId> - <version>${tomcat.version}</version> - </dependency> - </dependencies> - </dependencyManagement> -</project> diff --git a/catalog-parent/pom.xml b/catalog-parent/pom.xml deleted file mode 100644 index 05146a63..00000000 --- a/catalog-parent/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalogparent-lite</artifactId> - <version>1.1.0-SNAPSHOT</version> - <relativePath>catalogparent-lite</relativePath> - </parent> - - <modelVersion>4.0.0</modelVersion> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalogparent-aggregator</artifactId> - <name>common-tosca-catalog/catalog-parent</name> - <packaging>pom</packaging> - - <modules> - <module>catalogparent</module> - <module>catalogparent-lite</module> - </modules> -</project> diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 469285b4..00000000 --- a/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0"?> -<!-- - - Copyright 2016 ZTE Corporation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.openo.common-tosca.catalog</groupId> - <artifactId>catalogparent</artifactId> - <version>1.1.0-SNAPSHOT</version> - <relativePath>catalog-parent/catalogparent</relativePath> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>catalog-root</artifactId> - <name>common-tosca-catalog</name> - <packaging>pom</packaging> - - <modules> - <module>catalog-parent</module> - <module>catalog-core</module> - </modules> - - <build> - <plugins> - <plugin> - <groupId>com.mycila</groupId> - <artifactId>license-maven-plugin</artifactId> - </plugin> - </plugins> - </build> -</project> |