r1442 - in xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin: . adwords

Vincent Massol vmassol at users.forge.objectweb.org
Sun Oct 22 11:24:27 CEST 2006


Author: vmassol
Date: 2006-10-22 11:24:26 +0200 (Sun, 22 Oct 2006)
New Revision: 1442

Added:
   xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/
Removed:
   xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/GooglePlugin.java
   xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/GooglePluginApi.java
   xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/google/
Modified:
   xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/AdWordsPlugin.java
   xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/AdWordsPluginApi.java
Log:
XWIKI-385: Move Adwords plugin code outside of core into a plugin proper

* Restore google plugin in the core as it was moved by mistake

Copied: xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords (from rev 1440, xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/google)

Modified: xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/AdWordsPlugin.java
===================================================================
--- xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/google/AdWordsPlugin.java	2006-10-22 09:19:30 UTC (rev 1440)
+++ xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/AdWordsPlugin.java	2006-10-22 09:24:26 UTC (rev 1442)
@@ -20,7 +20,7 @@
  * @author sdumitriu
  */
 
-package com.xpn.xwiki.plugin.google;
+package com.xpn.xwiki.plugin.adwords;
 
 import com.xpn.xwiki.XWikiContext;
 import com.xpn.xwiki.api.Api;

Modified: xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/AdWordsPluginApi.java
===================================================================
--- xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/google/AdWordsPluginApi.java	2006-10-22 09:19:30 UTC (rev 1440)
+++ xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/AdWordsPluginApi.java	2006-10-22 09:24:26 UTC (rev 1442)
@@ -20,7 +20,7 @@
  * @author sdumitriu
  */
 
-package com.xpn.xwiki.plugin.google;
+package com.xpn.xwiki.plugin.adwords;
 
 import com.google.api.adwords.v2.*;
 import com.xpn.xwiki.XWikiContext;

Deleted: xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/GooglePlugin.java
===================================================================
--- xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/google/GooglePlugin.java	2006-10-22 09:19:30 UTC (rev 1440)
+++ xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/GooglePlugin.java	2006-10-22 09:24:26 UTC (rev 1442)
@@ -1,55 +0,0 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author sdumitriu
- */
-
-package com.xpn.xwiki.plugin.google;
-
-import com.xpn.xwiki.XWikiContext;
-import com.xpn.xwiki.api.Api;
-import com.xpn.xwiki.plugin.XWikiDefaultPlugin;
-import com.xpn.xwiki.plugin.XWikiPluginInterface;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class GooglePlugin extends XWikiDefaultPlugin implements XWikiPluginInterface {
-        private static Log mLogger =
-                LogFactory.getFactory().getInstance(com.xpn.xwiki.plugin.google.GooglePlugin.class);
-
-        public GooglePlugin(String name, String className, XWikiContext context) {
-            super(name, className, context);
-            init(context);
-        }
-
-    public String getName() {
-        return "google";
-    }
-
-    public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context) {
-        return new GooglePluginApi((GooglePlugin) plugin, context);
-    }
-
-    public void flushCache() {
-    }
-
-    public void init(XWikiContext context) {
-        super.init(context);
-    }
-}

Deleted: xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/GooglePluginApi.java
===================================================================
--- xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/google/GooglePluginApi.java	2006-10-22 09:19:30 UTC (rev 1440)
+++ xwiki-plugins/trunk/adwords/src/main/java/com/xpn/xwiki/plugin/adwords/GooglePluginApi.java	2006-10-22 09:24:26 UTC (rev 1442)
@@ -1,116 +0,0 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author sdumitriu
- */
-
-package com.xpn.xwiki.plugin.google;
-
-import com.google.api.search.GoogleSearchPort;
-import com.google.api.search.GoogleSearchResult;
-import com.google.api.search.GoogleSearchService;
-import com.google.api.search.GoogleSearchServiceLocator;
-import com.xpn.xwiki.XWikiContext;
-import com.xpn.xwiki.api.Api;
-
-import javax.xml.rpc.ServiceException;
-import java.rmi.RemoteException;
-
-public class GooglePluginApi extends Api {
-    private GooglePlugin plugin;
-
-    public GooglePluginApi(GooglePlugin plugin, XWikiContext context) {
-            super(context);
-            setPlugin(plugin);
-        }
-
-    public GooglePlugin getPlugin() {
-        return plugin;
-    }
-
-    public void setPlugin(GooglePlugin plugin) {
-        this.plugin = plugin;
-    }
-
-    public String doSpellingSuggestion(String clientKey, String text) throws ServiceException, RemoteException {
-        // Make a service
-        GoogleSearchService service = new GoogleSearchServiceLocator();
-
-        // Now use the service to get a stub to the Service Definition Interface (SDI)
-        GoogleSearchPort google = service.getGoogleSearchPort();
-
-        // Depending on user input, do search or cache query, then print out result
-        return google.doSpellingSuggestion(clientKey, text);
-    }
-
-    public byte[] doGetCachedPage(String clientKey, String url) throws RemoteException, ServiceException {
-        // Make a service
-        GoogleSearchService service = new GoogleSearchServiceLocator();
-        // Now use the service to get a stub to the Service Definition Interface (SDI)
-        GoogleSearchPort google = service.getGoogleSearchPort();
-
-        return google.doGetCachedPage(clientKey, url);
-    }
-
-    public GoogleSearchResult doGoogleSearch(String clientKey, String query, int start, int maxResults,
-                                             boolean filter, String restrict, boolean safeSearch,
-                                             String lr, String ie, String oe) throws RemoteException, ServiceException {
-        // Make a service
-        GoogleSearchService service = new GoogleSearchServiceLocator();
-        // Now use the service to get a stub to the Service Definition Interface (SDI)
-        GoogleSearchPort google = service.getGoogleSearchPort();
-
-        return google.doGoogleSearch(clientKey, query, start, maxResults,  filter,
-                restrict, safeSearch,  lr, ie,  oe);
-    }
-
-    public GoogleSearchResult doGoogleSearch(String clientKey, String query
-                                             ) throws RemoteException, ServiceException {
-        // Make a service
-        GoogleSearchService service = new GoogleSearchServiceLocator();
-        // Now use the service to get a stub to the Service Definition Interface (SDI)
-        GoogleSearchPort google = service.getGoogleSearchPort();
-
-        GoogleSearchResult result = google.doGoogleSearch(clientKey, query, 0, 10,  true,
-                "", true,  "", "",  "");
-        return result;
-    }
-
-    public GoogleSearchResult doGoogleSearch(String clientKey, String query, int start
-                                             ) throws RemoteException, ServiceException {
-        // Make a service
-        GoogleSearchService service = new GoogleSearchServiceLocator();
-        // Now use the service to get a stub to the Service Definition Interface (SDI)
-        GoogleSearchPort google = service.getGoogleSearchPort();
-
-        return google.doGoogleSearch(clientKey, query, start, 10,  true,
-                "", true,  "", "",  "");
-    }
-
-    public GoogleSearchResult doGoogleSearch(String clientKey, String query, int start, String lr
-                                             ) throws RemoteException, ServiceException {
-        // Make a service
-        GoogleSearchService service = new GoogleSearchServiceLocator();
-        // Now use the service to get a stub to the Service Definition Interface (SDI)
-        GoogleSearchPort google = service.getGoogleSearchPort();
-
-        return google.doGoogleSearch(clientKey, query, start, 10,  true,
-                "", true,  lr, "",  "");
-    }
-}





More information about the Xwiki-notifications mailing list