Permalink
Browse files

Moved further classes to the API package

  • Loading branch information...
stephan
stephan committed Apr 7, 2005
1 parent fcc72cc commit 61cfea61cad7c7482666cfc450aed53f69a64345
Showing with 153 additions and 250 deletions.
  1. +1 −1 build.xml
  2. +1 −1 documentation/DeveloperGuide/DeveloperGuide.xml
  3. +1 −1 src/apps/default/admin/config/theme.jsp
  4. +1 −1 src/apps/default/admin/config/users.jsp
  5. +1 −1 src/apps/default/admin/config/users.list.jsp
  6. +1 −1 src/apps/default/main.jsp
  7. +1 −1 src/org/snipsnap/config/ConfigurationManager.java
  8. +1 −1 src/org/snipsnap/config/InitializeDatabase.java
  9. +2 −1 src/org/snipsnap/container/PicoContainer.java
  10. +2 −2 src/org/snipsnap/graph/NameSpaceTreeBuilder.java
  11. +1 −1 src/org/snipsnap/interceptor/custom/ACLInterceptor.java
  12. +1 −1 src/org/snipsnap/interceptor/custom/BlogACLInterceptor.java
  13. +2 −2 src/org/snipsnap/jsp/NewCheckPermission.java
  14. +2 −2 src/org/snipsnap/net/AddLabelServlet.java
  15. +2 −2 src/org/snipsnap/net/ChangePasswordServlet.java
  16. +2 −2 src/org/snipsnap/net/CommentStoreServlet.java
  17. +1 −1 src/org/snipsnap/net/CssHandlerServlet.java
  18. +2 −2 src/org/snipsnap/net/DiffServlet.java
  19. +2 −2 src/org/snipsnap/net/FileDownloadServlet.java
  20. +1 −1 src/org/snipsnap/net/FileUploadServlet.java
  21. +1 −1 src/org/snipsnap/net/GroovyTemplateServlet.java
  22. +1 −1 src/org/snipsnap/net/HistoryServlet.java
  23. +1 −1 src/org/snipsnap/net/LabelsServlet.java
  24. +1 −1 src/org/snipsnap/net/LoginServlet.java
  25. +1 −1 src/org/snipsnap/net/MailPasswordKeyServlet.java
  26. +1 −1 src/org/snipsnap/net/NewUserServlet.java
  27. +2 −1 src/org/snipsnap/net/PluginServlet.java
  28. +2 −2 src/org/snipsnap/net/RobotServlet.java
  29. +0 −41 src/org/snipsnap/net/ServletPlugin.java
  30. +3 −2 src/org/snipsnap/net/ServletPluginLoader.java
  31. +2 −2 src/org/snipsnap/net/SnipCopyServlet.java
  32. +3 −3 src/org/snipsnap/net/SnipEditServlet.java
  33. +2 −2 src/org/snipsnap/net/SnipRawServlet.java
  34. +1 −1 src/org/snipsnap/net/SnipRemoveServlet.java
  35. +2 −2 src/org/snipsnap/net/SnipSearchServlet.java
  36. +3 −3 src/org/snipsnap/net/SnipStoreServlet.java
  37. +1 −1 src/org/snipsnap/net/SnipVersionServlet.java
  38. +2 −2 src/org/snipsnap/net/SnipViewServlet.java
  39. +1 −1 src/org/snipsnap/net/StoreLabelServlet.java
  40. +2 −2 src/org/snipsnap/net/ThemeImageServlet.java
  41. +2 −2 src/org/snipsnap/net/XmlRpcServlet.java
  42. +2 −2 src/org/snipsnap/net/admin/ConfigureServlet.java
  43. +2 −2 src/org/snipsnap/net/admin/DatabaseExport.java
  44. +2 −2 src/org/snipsnap/net/admin/Maintenance.java
  45. +1 −1 src/org/snipsnap/net/admin/ManageSearchEngine.java
  46. +2 −2 src/org/snipsnap/net/admin/ManageUsers.java
  47. +1 −1 src/org/snipsnap/net/admin/SetupTheme.java
  48. +2 −2 src/org/snipsnap/net/admin/ThemeHelper.java
  49. +2 −2 src/org/snipsnap/net/admin/ThemeImageServlet.java
  50. +5 −5 src/org/snipsnap/net/filter/InitFilter.java
  51. +3 −1 src/org/snipsnap/net/handler/TestStoreHandler.java
  52. +2 −2 src/org/snipsnap/net/iCalServlet.java
  53. +1 −1 src/org/snipsnap/notification/NotificationService.java
  54. +1 −1 src/org/snipsnap/render/SnipRenderEngine.java
  55. +1 −1 src/org/snipsnap/render/filter/context/SnipFilterContext.java
  56. +1 −1 src/org/snipsnap/render/macro/AnchorMacro.java
  57. +1 −1 src/org/snipsnap/render/macro/HotSnipMacro.java
  58. +2 −2 src/org/snipsnap/render/macro/LabelSearchMacro.java
  59. +1 −1 src/org/snipsnap/render/macro/RecentWeblogMacro.java
  60. +1 −1 src/org/snipsnap/render/macro/SnipXrefMacro.java
  61. +1 −1 src/org/snipsnap/render/macro/UserCountMacro.java
  62. +2 −2 src/org/snipsnap/render/macro/list/VerticalListFormatter.java
  63. +3 −3 src/org/snipsnap/render/macro/loader/GroovyMacroLoader.java
  64. +3 −3 src/org/snipsnap/render/macro/parameter/SnipMacroParameter.java
  65. +3 −3 src/org/snipsnap/semanticweb/rss/RssSnip.java
  66. +1 −1 src/org/snipsnap/snip/Access.java
  67. +2 −2 src/org/snipsnap/snip/Content.java
  68. +1 −1 src/org/snipsnap/snip/Modified.java
  69. +4 −4 src/org/snipsnap/snip/SnipFormatter.java
  70. +2 −2 src/org/snipsnap/snip/SnipImpl.java
  71. +1 −1 src/org/snipsnap/snip/SnipSpaceImpl.java
  72. +1 −1 src/org/snipsnap/snip/XMLSnipExport.java
  73. +3 −3 src/org/snipsnap/snip/XMLSnipImport.java
  74. +3 −3 src/org/snipsnap/snip/attachment/Attachments.java
  75. +3 −3 src/org/snipsnap/snip/label/CategoryLabel.java
  76. +1 −1 src/org/snipsnap/snip/label/LabelManager.java
  77. +1 −1 src/org/snipsnap/snip/label/RenderEngineLabel.java
  78. +2 −2 src/org/snipsnap/snip/label/SnipLabel.java
  79. +3 −3 src/org/snipsnap/snip/label/TaxonomyLabel.java
  80. +1 −1 src/org/snipsnap/user/DefaultUserManager.java
  81. +2 −2 src/org/snipsnap/user/Security.java
  82. +1 −1 src/org/snipsnap/user/UserManagerFactory.java
  83. +1 −1 src/org/snipsnap/util/mail/PostDaemon.java
  84. +1 −1 src/org/snipsnap/xmlrpc/MetaWeblogHandler.java
  85. +0 −63 src/org/snipsnap/xmlrpc/SnipSnapPing.java
  86. +1 −1 src/org/snipsnap/xmlrpc/WeblogsPing.java
  87. +3 −1 src/org/snipsnap/xmlrpc/WeblogsPingHandler.java
  88. +1 −1 src/snipsnap/api/app/Application.java
  89. +2 −2 src/snipsnap/api/label/Labels.java
  90. +3 −3 src/{org/snipsnap → snipsnap/api}/render/context/SnipRenderContext.java
  91. +2 −2 src/snipsnap/api/snip/SnipSpaceFactory.java
View
@@ -223,7 +223,7 @@
<fileset dir="${target}/util/" includes="snipsnap/api/**"/>
</jar>
</target>
<!-- create server code -->
<target depends="compile-jsp, compile-server,installer-war,snipsnap-war" description="create server jar" name="jar-server">
<copy file="conf/copyright.txt" tofile="${target}/server/conf/copyright.txt" filtering="true">
@@ -143,7 +143,7 @@ to be accessed through Application though.
<subsubsection title="SnipViewServlet">
HTTP requests are handled by \textit{org.snipsnap.net.SnipViewServlet} which is
mapped to /space in the default application. The URL is parsed to extract the snip name and
the SnipSpace is retrieved via \textit{org.snipsnap.container.Components} which stores
the SnipSpace is retrieved via \textit{snipsnap.api.container.Components} which stores
all components in a PicoContainer. Then the snip is loaded by name and
placed in request scope.
@@ -9,7 +9,7 @@
org.dom4j.Node,
java.io.FilenameFilter,
snipsnap.api.snip.Snip,
org.snipsnap.container.Components,
snipsnap.api.container.Components,
snipsnap.api.snip.SnipSpace,
org.snipsnap.net.admin.ThemeHelper"%>
<%--
@@ -1,7 +1,7 @@
<%@ page import="java.util.*,
snipsnap.api.config.Configuration,
snipsnap.api.app.Application,
org.snipsnap.container.Components,
snipsnap.api.container.Components,
org.snipsnap.user.UserManager"%>
<%--
** User management
@@ -1,5 +1,5 @@
<%@ page import="org.snipsnap.user.UserManager,
org.snipsnap.container.Components,
snipsnap.api.container.Components,
java.util.List"
%>
<%--
@@ -7,7 +7,7 @@
<%@ page import="snipsnap.api.snip.SnipSpace,
snipsnap.api.app.Application,
snipsnap.api.snip.SnipSpaceFactory,
org.snipsnap.container.Components,
snipsnap.api.container.Components,
snipsnap.api.snip.Snip"%>
<%@ page pageEncoding="iso-8859-1" %>
<% response.setContentType("text/html; charset="+Application.get().getConfiguration().getEncoding()); %>
@@ -30,7 +30,7 @@
import snipsnap.api.snip.Snip;
import snipsnap.api.config.*;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.radeox.util.logging.Logger;
import java.util.HashMap;
@@ -27,7 +27,7 @@
import snipsnap.api.app.Application;
import org.snipsnap.app.ApplicationManager;
import org.snipsnap.app.ApplicationStorage;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.snip.HomePage;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpace;
@@ -35,6 +35,7 @@
import org.snipsnap.versioning.cookbook.CookbookDifferenceService;
import org.snipsnap.xmlrpc.*;
import snipsnap.api.snip.SnipSpace;
import snipsnap.api.container.*;
import javax.sql.DataSource;
import java.util.ArrayList;
@@ -83,7 +84,7 @@ public void init() {
addComponent(AuthenticationService.class, DefaultAuthenticationService.class);
addComponent(PasswordService.class);
addComponent(SessionService.class, DefaultSessionService.class);
addComponent(Components.DEFAULT_ENGINE, SnipRenderEngine.class);
addComponent(snipsnap.api.container.Components.DEFAULT_ENGINE, SnipRenderEngine.class);
addComponent(PlainTextRenderEngine.class);
addComponent(SnipSpace.class, SnipSpaceImpl.class);
@@ -24,7 +24,7 @@
*/
package org.snipsnap.graph;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.graph.builder.TreeBuilder;
import org.snipsnap.graph.graph.Tree;
import org.snipsnap.graph.graph.TreeNode;
@@ -39,7 +39,7 @@ public NameSpaceTreeBuilder(String root) {
}
public Tree build() {
SnipSpace space = (snipsnap.api.snip.SnipSpace) Components.getComponent(SnipSpace.class);
SnipSpace space = (snipsnap.api.snip.SnipSpace) snipsnap.api.container.Components.getComponent(SnipSpace.class);
snipsnap.api.snip.Snip[] snips = space.match(root);
@@ -31,7 +31,7 @@
import org.snipsnap.user.Roles;
import snipsnap.api.user.User;
import org.snipsnap.security.AccessController;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import java.security.GeneralSecurityException;
@@ -28,7 +28,7 @@
import snipsnap.api.app.Application;
import snipsnap.api.user.User;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.security.AccessController;
import java.security.GeneralSecurityException;
@@ -28,7 +28,7 @@
import gabriel.components.context.OwnerAccessContext;
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.security.AccessController;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpaceFactory;
@@ -81,7 +81,7 @@ public void setPermission(String permission) {
}
protected boolean condition() throws JspTagException {
AccessController controller = (AccessController) Components.getComponent(AccessController.class);
AccessController controller = (AccessController) snipsnap.api.container.Components.getComponent(AccessController.class);
Application app = snipsnap.api.app.Application.get();
User user = app.getUser();
@@ -32,7 +32,7 @@
import snipsnap.api.snip.SnipSpaceFactory;
import snipsnap.api.label.Label;
import org.snipsnap.snip.label.LabelManager;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.net.filter.MultipartWrapper;
import org.radeox.util.logging.Logger;
@@ -83,7 +83,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro
request.setAttribute("snip", snip);
String labelType = request.getParameter("labeltype");
LabelManager manager = (LabelManager)Components.getComponent(LabelManager.class);
LabelManager manager = (LabelManager)snipsnap.api.container.Components.getComponent(LabelManager.class);
snipsnap.api.label.Label label = manager.getLabel(labelType);
request.setAttribute("label", label);
@@ -30,7 +30,7 @@
import org.snipsnap.user.UserManager;
import org.snipsnap.user.PasswordService;
import org.snipsnap.user.UserManagerFactory;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.container.SessionService;
import snipsnap.api.config.Configuration;
@@ -63,7 +63,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
if (request.getParameter("cancel") == null) {
snipsnap.api.user.User user;
if (null != password1 && password1.equals(password2)) {
PasswordService passwordService = (PasswordService) Components.getComponent(PasswordService.class);
PasswordService passwordService = (PasswordService) snipsnap.api.container.Components.getComponent(PasswordService.class);
user = passwordService.changePassWord(key, password1);
} else {
request.setAttribute("error", "user.password.error.nomatch");
@@ -27,7 +27,7 @@
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.net.filter.MultipartWrapper;
import snipsnap.api.snip.Snip;
import org.snipsnap.snip.SnipFormatter;
@@ -81,7 +81,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
HttpSession session = request.getSession();
if (session != null) {
snipsnap.api.user.User user = snipsnap.api.app.Application.get().getUser();
AuthenticationService service = (AuthenticationService) Components.getComponent(AuthenticationService.class);
AuthenticationService service = (AuthenticationService) snipsnap.api.container.Components.getComponent(AuthenticationService.class);
if (snip != null && service.isAuthenticated(user)) {
snip.getComments().postComment(content);
@@ -26,7 +26,7 @@
import snipsnap.api.app.Application;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpace;
import org.snipsnap.util.ApplicationAwareMap;
@@ -26,7 +26,7 @@
import snipsnap.api.app.Application;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpace;
import org.snipsnap.versioning.VersionManager;
@@ -61,7 +61,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
int oldVersion = Integer.parseInt(oldString);
int newVersion = Integer.parseInt(newString);
snipsnap.api.snip.SnipSpace space = (snipsnap.api.snip.SnipSpace)Components.getComponent(snipsnap.api.snip.SnipSpace.class);
snipsnap.api.snip.SnipSpace space = (snipsnap.api.snip.SnipSpace)snipsnap.api.container.Components.getComponent(snipsnap.api.snip.SnipSpace.class);
snipsnap.api.snip.Snip snip = space.load(name);
VersionManager versionManager = (VersionManager) Components.getComponent(VersionManager.class);
@@ -30,7 +30,7 @@
import snipsnap.api.snip.Snip;
import org.snipsnap.snip.attachment.Attachment;
import org.snipsnap.snip.attachment.storage.AttachmentStorage;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
@@ -75,7 +75,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
AttachmentStorage attachmentStorage = (AttachmentStorage) Components.getComponent(AttachmentStorage.class);
AttachmentStorage attachmentStorage = (AttachmentStorage) snipsnap.api.container.Components.getComponent(AttachmentStorage.class);
Snip snip = (Snip) request.getAttribute(SNIP);
String fileName = (String) request.getAttribute(FILENAME);
@@ -39,7 +39,7 @@
import org.snipsnap.user.Roles;
import org.snipsnap.user.Security;
import snipsnap.api.user.User;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.security.AccessController;
import javax.servlet.RequestDispatcher;
@@ -27,7 +27,7 @@
import groovy.text.SimpleTemplateEngine;
import groovy.text.Template;
import snipsnap.api.app.Application;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import snipsnap.api.snip.SnipSpace;
import javax.servlet.ServletException;
@@ -26,7 +26,7 @@
import snipsnap.api.app.Application;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpace;
import org.snipsnap.versioning.VersionManager;
@@ -33,7 +33,7 @@
import snipsnap.api.label.Labels;
import snipsnap.api.app.Application;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.net.filter.MultipartWrapper;
import org.radeox.util.logging.Logger;
@@ -27,7 +27,7 @@
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.container.SessionService;
import org.snipsnap.net.filter.MultipartWrapper;
import org.snipsnap.user.AuthenticationService;
@@ -32,7 +32,7 @@
import org.snipsnap.user.PasswordService;
import org.snipsnap.user.UserManagerFactory;
import org.snipsnap.util.mail.Mail;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
@@ -27,7 +27,7 @@
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
import snipsnap.api.config.Configuration;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import org.snipsnap.container.SessionService;
import org.snipsnap.net.filter.MultipartWrapper;
import org.snipsnap.snip.HomePage;
@@ -28,9 +28,10 @@
import groovy.text.Template;
import org.radeox.util.logging.Logger;
import snipsnap.api.app.Application;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpace;
import snipsnap.api.plugin.ServletPlugin;
import org.snipsnap.snip.label.TypeLabel;
import org.snipsnap.user.Permissions;
import org.snipsnap.user.Roles;
@@ -26,7 +26,7 @@
import snipsnap.api.snip.SnipSpace;
import snipsnap.api.snip.Snip;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import snipsnap.api.config.Configuration;
import javax.servlet.ServletException;
@@ -49,7 +49,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
String name = request.getHeader("User-Agent");
String host = request.getRemoteHost();
SnipSpace space = (SnipSpace) Components.getComponent(SnipSpace.class);
SnipSpace space = (SnipSpace) snipsnap.api.container.Components.getComponent(SnipSpace.class);
if(space.exists(Configuration.SNIPSNAP_CONFIG_ROBOTS_TXT)) {
snipsnap.api.snip.Snip robotstxt = space.load(Configuration.SNIPSNAP_CONFIG_ROBOTS_TXT);
PrintWriter writer = new PrintWriter(response.getOutputStream());
@@ -1,41 +0,0 @@
/*
* This file is part of "SnipSnap Wiki/Weblog".
*
* Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
* All Rights Reserved.
*
* Please visit http://snipsnap.org/ for updates and contact.
*
* --LICENSE NOTICE--
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* --LICENSE NOTICE--
*/
package org.snipsnap.net;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletException;
import java.io.IOException;
/**
* Interface for servlet plugins
*/
public interface ServletPlugin {
public void service(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException;
public String getPath();
}
@@ -27,11 +27,12 @@
import org.radeox.util.Service;
import org.radeox.util.logging.Logger;
import org.snipsnap.container.Components;
import snipsnap.api.container.Components;
import snipsnap.api.snip.Snip;
import snipsnap.api.snip.SnipSpace;
import snipsnap.api.label.Label;
import snipsnap.api.label.Labels;
import snipsnap.api.plugin.ServletPlugin;
import org.snipsnap.snip.label.TypeLabel;
import org.snipsnap.xmlrpc.XmlRpcHandler;
import org.picocontainer.PicoContainer;
@@ -94,7 +95,7 @@ private static void initServletPlugins() {
if (null == pluginServlets) {
pluginServlets = new HashMap();
Collection components = Components.findComponents(ServletPlugin.class);
Collection components = snipsnap.api.container.Components.findComponents(ServletPlugin.class);
Iterator iterator = components.iterator();
while (iterator.hasNext()) {
Oops, something went wrong.

0 comments on commit 61cfea6

Please sign in to comment.