You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2013/07/08 07:11:01 UTC
[4/5] Remove unused components related to commit
79c88a9e98b82a0030cf1f57579f58a6e02fb387
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62dc2f7f/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/internal/GoogleAnalyticsUIServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/internal/GoogleAnalyticsUIServiceComponent.java b/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/internal/GoogleAnalyticsUIServiceComponent.java
deleted file mode 100644
index 27ef59f..0000000
--- a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/internal/GoogleAnalyticsUIServiceComponent.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-*
-* WSO2 Inc. 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.
-*/
-package org.wso2.carbon.google.analytics.ui.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.service.component.ComponentContext;
-
-import javax.servlet.ServletContext;
-
-/**
- * @scr.component name="org.wso2.carbon.google.analyzer.ui" immediate="true"
- * @scr.reference name="servlet.context.service"
- * interface="javax.servlet.ServletContext"
- * cardinality="1..1"
- * policy="dynamic"
- * bind="setServletContextService"
- * unbind="unsetServletContextService"
- */
-
-/**
- * org.wso2.carbon.google.analytics.ui bundle has implemented for giving google-analytics support
- * for stratos.
- */
-
-public class GoogleAnalyticsUIServiceComponent {
-
- private static final Log log = LogFactory.getLog(GoogleAnalyticsUIServiceComponent.class);
-
- private static ServletContext servletCtx = null;
-
- protected void activate(ComponentContext context) {
- try {
- log.debug("Google Analytics UI Component bundle is activated");
- } catch (Exception e) {
- log.debug("Failed to activate Google Analytics UI Component bundle");
- }
- }
-
- protected void deactivate(ComponentContext context) {
- log.debug("Google Analytics UI Component bundle is deactivated");
- }
-
- protected void setServletContextService(ServletContext servletContext) {
- this.servletCtx = servletContext;
-
- }
-
- protected void unsetServletContextService(ServletContext servletContext) {
- }
-}
-
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62dc2f7f/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/servlets/GoogleAnalyticsServlet.java
----------------------------------------------------------------------
diff --git a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/servlets/GoogleAnalyticsServlet.java b/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/servlets/GoogleAnalyticsServlet.java
deleted file mode 100644
index c3e6711..0000000
--- a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/java/org/wso2/carbon/google/analytics/ui/servlets/GoogleAnalyticsServlet.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-* Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-*
-* WSO2 Inc. 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.
-*/
-package org.wso2.carbon.google.analytics.ui.servlets;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.stratos.common.util.CommonUtil;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.net.URLConnection;
-
-/**
- * GoogleAnalyticsServlet use for sending a request to a remote URL in where a js snippet which
- * is required to process google analytics is hosted.Then this servlet get back the content of
- * that js snippet and set it as the response.Then by using a javascript,this servlet response will
- * be embedded into another html/jsp page and make use of the js snippet content from that html/jsp
- * page.
- */
-public class GoogleAnalyticsServlet extends HttpServlet {
- private static final Log log = LogFactory.getLog(GoogleAnalyticsServlet.class);
- private static String GOOGLE_ANALYTICS_URL = "GoogleAnalyticsURL";
- private static String googleAnalyticsURL = "googleAnalyticUrl";
-
- public void init(ServletConfig servletConfig) throws ServletException {
- super.init(servletConfig);
-
- }
-
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- String url = null;
- try {
- //Read Google analytic url from stratos.xml
- url = CommonUtil.loadStratosConfiguration().getGoogleAnalyticsURL();
- if (url != null && !(url.equals(""))) {
- //Create a new connection to above read google analytic url and read content of url.
- URL googleAnalyticUrl = new URL(url);
- URLConnection connection = googleAnalyticUrl.openConnection();
- //Set the input stream of created URL connection to a reader
- BufferedReader in = new BufferedReader(
- new InputStreamReader(
- connection.getInputStream()));
- String inputLine;
- //Set servlet response as 'text/javascript'
- response.setContentType("text/javascript");
- PrintWriter out = response.getWriter();
- //Read the input stream which has fetched to buffered reader,line by line and then
- //write those content into the servlet response.
- while ((inputLine = in.readLine()) != null) {
- out.write(inputLine);
- }
- in.close();
- out.flush();
- out.close();
- }
- } catch (Exception e) {
- String msg = "Failed to get content from the url." + url + e.getMessage();
- log.error(msg, e);
- response.setStatus(500);
- }
-
-
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62dc2f7f/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index bafedb9..0000000
--- a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.
- -->
-<component xmlns="http://products.wso2.org/carbon">
- <servlets>
- <servlet id="googleAnalyticsServlet">
- <servlet-name>googleAnalyticsServlet</servlet-name>
- <url-pattern>/google-analytics</url-pattern>
- <display-name>Google Analytics Servlet</display-name>
- <servlet-class>org.wso2.carbon.google.analytics.ui.servlets.GoogleAnalyticsServlet
- </servlet-class>
- </servlet>
- </servlets>
- <framework-configuration>
- <bypass>
- <authentication>
- <link>/google-analytics</link>
- </authentication>
- <tiles>
- <link>/google-analytics</link>
- </tiles>
- <httpUrls>
- <link>/google-analytics</link>
- </httpUrls>
- </bypass>
- </framework-configuration>
-
-
-</component>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62dc2f7f/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/web.googleanalytics/js/googleAnalyticsProcessor.js
----------------------------------------------------------------------
diff --git a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/web.googleanalytics/js/googleAnalyticsProcessor.js b/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/web.googleanalytics/js/googleAnalyticsProcessor.js
deleted file mode 100644
index 44803eb..0000000
--- a/components/stratos/org.wso2.carbon.google.analytics.ui/2.1.0/src/main/resources/web.googleanalytics/js/googleAnalyticsProcessor.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. 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.
- */
-
-/**
- * Following jquery function sends an AJAX request to the googleAnalyticsServlet and get back the
- * response from the servlet and append it into html/jsp file 'body' section,once the html/jsp
- * file is ready
- */
-$('document').ready(function() {
- $.ajax({
- type: "GET",
- url: "/google-analytics",
- data: null,
- success: function(response) {
- if (response != "googleAnalyticUrl") {
- $("body").append(response);
- }
- }
- });
-});