You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2008/08/03 14:22:18 UTC
svn commit: r682148 [1/8] - in
/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki:
parser/ plugin/ preferences/ providers/ render/ rpc/ rpc/atom/ rpc/json/
rss/ search/ tags/ ui/ ui/admin/ ui/admin/beans/ ui/progress/
Author: ajaquith
Date: Sun Aug 3 05:22:13 2008
New Revision: 682148
URL: http://svn.apache.org/viewvc?rev=682148&view=rev
Log:
Massive re-factoring to make Stripes less invasive.
Added:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/preferences/package.html
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/package.html
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/search/package.html
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiRequestWrapper.java (with props)
Removed:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginResources.properties
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginResources_de.properties
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginResources_es.properties
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginResources_fi.properties
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/VotePlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/RSSCoffeeCupLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/GroupTypeConverter.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/PrincipalTypeConverter.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiExceptionHandler.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiInterceptor.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiPageTypeConverter.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiRuntimeConfiguration.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiTypeConverterFactory.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/beans/WikiWizardAdminBean.java
Modified:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/CreoleToJSPWikiTranslator.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/Heading.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/HeadingListener.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/JSPWikiMarkupParser.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/LinkParser.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/MarkupParser.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/ParseException.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/PluginContent.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/VariableContent.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/WikiDocument.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/BugReportHandler.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/Counter.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/CurrentTimePlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/Denounce.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/Groups.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/IfPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/Image.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/IndexPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/InitializablePlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/InsertPage.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/ListLocksPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/Note.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/ParserStagePlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginException.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/RPCSamplePlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/RecentChangesPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/ReferredPagesPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/ReferringPagesPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/Search.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/SessionsPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/TableOfContents.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/UndefinedPagesPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/UnusedPagesPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/WeblogArchivePlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/WeblogEntryPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/WeblogPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/WikiPlugin.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/preferences/Preferences.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/AbstractFileProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/BasicAttachmentProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/CachingAttachmentProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/CachingProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/FastSearch.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/FileSystemProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/NoSuchVersionException.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/ProviderException.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/RCSFileProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/RepositoryModifiedException.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/VersioningFileProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/VersioningProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/WikiAttachmentProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/providers/WikiPageProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/render/CleanTextRenderer.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/render/CreoleRenderer.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/render/RenderingManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/render/WikiRenderer.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/render/WysiwygEditingRenderer.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/render/XHTMLRenderer.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rpc/RPCManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rpc/atom/AtomAPIServlet.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rpc/json/JSONRPCManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/AtomFeed.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/Entry.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/Feed.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/RSS10Feed.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/RSS20Feed.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/RSSGenerator.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/rss/RSSThread.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/search/BasicSearchProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/search/LuceneSearchProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/search/SearchManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/search/SearchProvider.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/AdminBeanIteratorInfo.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/AdminBeanIteratorTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/AttachmentsIteratorInfo.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/AttachmentsIteratorTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/AuthorTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/BaseURLTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/BreadcrumbsTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/CalendarTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/CheckLockInfo.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/CheckLockTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/CheckRequestContextTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/CheckVersionTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/CommentLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/ContentEncodingTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/ContentTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/CookieTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/DiffLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/EditLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/EditorIteratorInfo.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/EditorIteratorTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/FeedDiscoveryTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/HasAttachmentsTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/HistoryIteratorTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/IncludeResourcesTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/IncludeTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/InsertDiffTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/InsertPageTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/IteratorTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/LinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/LinkToParentTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/LinkToTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/MessagesTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/NextVersionTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/NoSuchPageTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PageDateTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PageInfoLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PageNameTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PageSizeTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PageTypeTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PageVersionTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/ParamTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/ParentPageNameTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PermissionTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PluginTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/PreviousVersionTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/RSSImageLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/RSSLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/RequestResourceTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/SearchResultIteratorTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/SetPaginationTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/TabbedSectionTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/TemplateDirTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/TranslateTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/UploadLinkTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/UserCheckTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/UserNameTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/UserProfileTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/VariableTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/WikiBodyTag.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/tags/WikiTagBase.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/Editor.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/EditorManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/GenericHTTPHandler.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/InputValidator.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/Installer.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/TemplateManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/WikiServletFilter.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/AdminBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/AdminBeanManager.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/SimpleAdminBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/WikiFormAdminBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/beans/CoreBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/beans/PlainEditorAdminBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/beans/PluginBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/beans/SearchManagerBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/admin/beans/UserBean.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/progress/ProgressItem.java
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/ui/progress/ProgressManager.java
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/CreoleToJSPWikiTranslator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/CreoleToJSPWikiTranslator.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/CreoleToJSPWikiTranslator.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/CreoleToJSPWikiTranslator.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
-/*
+/*
JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -63,13 +64,17 @@
// [{$creolepagefilter.creoleversion}]
// [{$creolepagefilter.linebreak}] -> bloglike/wikilike
- public static String VAR_VERSION = "1.0.3";
+ /** The version of the filter. */
+ public static final String VAR_VERSION = "1.0.3";
- public static String VAR_CREOLE_VERSION = "1.0";
+ /** The version of Creole that this filter supports. */
+ public static final String VAR_CREOLE_VERSION = "1.0";
- public static String VAR_LINEBREAK_BLOGLIKE = "bloglike";
+ /** The linebreak style "bloglike". */
+ public static final String VAR_LINEBREAK_BLOGLIKE = "bloglike";
- public static String VAR_LINEBREAK_C2LIKE = "c2like";
+ /** The linebreak style "c2like". */
+ public static final String VAR_LINEBREAK_C2LIKE = "c2like";
private static final String CREOLE_BOLD = "\\*\\*((?s:.)*?)(\\*\\*|(\n\n|\r\r|\r\n\r\n))";
@@ -162,10 +167,18 @@
private static final String ESCAPE_PROTECTED = "~(\\*\\*|~|//|-|#|\\{\\{|}}|\\\\|~\\[~~[|]]|----|=|\\|)";
- private static Map c_protectionMap = new HashMap();
+ private static Map<String, String> c_protectionMap = new HashMap<String, String>();
- private ArrayList m_hashList = new ArrayList();
+ private ArrayList<String> m_hashList = new ArrayList<String>();
+ /**
+ * I have no idea what this method does. Could someone please tell me?
+ *
+ * @param wikiProps A property set
+ * @param content The content to translate?
+ * @param username The username in the signature?
+ * @return Probably some translated content.
+ */
public String translateSignature(Properties wikiProps, final String content, String username)
{
@@ -198,7 +211,13 @@
return result;
}
- /** Translates Creole markup to JSPWiki markup */
+ /**
+ * Translates Creole markup to JSPWiki markup
+ *
+ * @param wikiProps A set of Wiki Properties
+ * @param content Creole markup
+ * @return Wiki markup
+ */
public String translate(Properties wikiProps, final String content)
{
boolean blogLineBreaks = false;
@@ -308,6 +327,13 @@
}
counter = 0;
}
+
+ // Fixes testExtensions5
+ if( content.endsWith( "\n" ) && result.charAt( result.length()-1 ) != '\n' )
+ {
+ result.append( '\n' );
+ }
+
return result.toString();
}
@@ -333,7 +359,7 @@
for (int i = it.length - 1; i >= 0; i--)
{
String hash = (String) it[i];
- String protectedMarkup = (String) c_protectionMap.get(hash);
+ String protectedMarkup = c_protectionMap.get(hash);
content = content.replace(hash, protectedMarkup);
if ((protectedMarkup.length() < 3 || (protectedMarkup.length() > 2 &&
!protectedMarkup.substring(0, 3).equals("{{{")))&&replacePlugins)
@@ -356,12 +382,12 @@
* the protected markup with the the md5 hash of the markup.
*
* @param content
- * @return
+ * @return The content with protection
*/
private String protectMarkup(String content)
{
c_protectionMap.clear();
- this.m_hashList = new ArrayList();
+ m_hashList = new ArrayList<String>();
content = protectMarkup(content, PREFORMATTED_PROTECTED, "", "");
content = protectMarkup(content, URL_PROTECTED, "", "");
content = protectMarkup(content, ESCAPE_PROTECTED, "", "");
@@ -376,18 +402,18 @@
{
Set keySet = wikiProps.keySet();
Object[] keys = keySet.toArray();
- ArrayList result = new ArrayList();
+ ArrayList<String[]> result = new ArrayList<String[]>();
- for (int i = 0; i < keys.length; i++)
+ for( int i = 0; i < keys.length; i++ )
{
String key = keys[i] + "";
- String value = wikiProps.getProperty(keys[i] + "");
- if ((key).indexOf("creole.imagePlugin.para.%") > -1)
+ String value = wikiProps.getProperty( keys[i] + "" );
+ if( key.indexOf( "creole.imagePlugin.para.%" ) > -1 )
{
String[] pair = new String[2];
- pair[0] = key.replaceAll("creole.imagePlugin.para.%", "");
+ pair[0] = key.replaceAll( "creole.imagePlugin.para.%", "" );
pair[1] = value;
- result.add(pair);
+ result.add( pair );
}
}
return result;
@@ -496,7 +522,7 @@
String hash = bytesToHash(digest.digest());
matcher.appendReplacement(result, hash);
c_protectionMap.put(hash, protectedMarkup);
- this.m_hashList.add(hash);
+ m_hashList.add(hash);
}
catch (NoSuchAlgorithmException e)
{
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/Heading.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/Heading.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/Heading.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/Heading.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
/*
JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -24,16 +25,41 @@
* allow the building of a Table Of Contents.
*
* @since 2.4
- * @author Janne Jalkanen
*/
public class Heading
{
+ /**
+ * Defines a small heading.
+ */
public static final int HEADING_SMALL = 1;
+
+ /**
+ * Defines a medium-size heading.
+ */
public static final int HEADING_MEDIUM = 2;
+
+ /**
+ * Defines a large heading.
+ */
public static final int HEADING_LARGE = 3;
+ /**
+ * Denotes the level of the heading. Either HEADING_SMALL, HEADING_MEDIUM, or HEADING_LARGE.
+ */
public int m_level;
+
+ /**
+ * Contains the text of the heading.
+ */
public String m_titleText;
+
+ /**
+ * Contains the anchor to the heading
+ */
public String m_titleAnchor;
+
+ /**
+ * Contains a section link.
+ */
public String m_titleSection;
}
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/HeadingListener.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/HeadingListener.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/HeadingListener.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/HeadingListener.java Sun Aug 3 05:22:13 2008
@@ -1,33 +1,38 @@
/*
JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2004 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
import com.ecyrd.jspwiki.WikiContext;
/**
- * Provides a listener interface for headings
+ * Provides a listener interface for headings. This is used in parsing,
+ * and e.g. the TableOfContents is built using this listener.
*/
public interface HeadingListener
{
/**
* Is called whenever a heading is encountered in the stream.
+ *
+ * @param context The WikiContext
+ * @param hd The heading which was just encountered.
*/
public void headingAdded( WikiContext context, Heading hd );
}
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/JSPWikiMarkupParser.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/JSPWikiMarkupParser.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/JSPWikiMarkupParser.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/JSPWikiMarkupParser.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
/*
JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2005 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -53,7 +54,6 @@
* heart and soul of JSPWiki : make sure you test properly anything that is added,
* or else it breaks down horribly.
*
- * @author Janne Jalkanen
* @since 2.4
*/
public class JSPWikiMarkupParser
@@ -97,18 +97,18 @@
private boolean m_isPreBlock = false;
/** Contains style information, in multiple forms. */
- private Stack m_styleStack = new Stack();
+ private Stack<Boolean> m_styleStack = new Stack<Boolean>();
// general list handling
private int m_genlistlevel = 0;
- private StringBuffer m_genlistBulletBuffer = new StringBuffer(10); // stores the # and * pattern
+ private StringBuilder m_genlistBulletBuffer = new StringBuilder(10); // stores the # and * pattern
private boolean m_allowPHPWikiStyleLists = true;
private boolean m_isOpenParagraph = false;
/** Keeps image regexp Patterns */
- private List m_inlineImagePatterns;
+ private List<Pattern> m_inlineImagePatterns;
/** Parser for extended link functionality. */
private LinkParser m_linkParser = new LinkParser();
@@ -116,10 +116,13 @@
private PatternMatcher m_inlineMatcher = new Perl5Matcher();
/** Keeps track of any plain text that gets put in the Text nodes */
- private StringBuffer m_plainTextBuf = new StringBuffer(20);
+ private StringBuilder m_plainTextBuf = new StringBuilder(20);
private Element m_currentElement;
+ /** Keep track of duplicate header names. */
+ private Map<String, Integer> m_titleSectionCounter = new HashMap<String, Integer>();
+
/**
* This property defines the inline image pattern. It's current value
* is jspwiki.translatorReader.inlinePattern
@@ -142,8 +145,6 @@
/** If set to "true", all external links are tagged with 'rel="nofollow"' */
public static final String PROP_USERELNOFOLLOW = "jspwiki.translatorReader.useRelNofollow";
- private static final Map<String,String> NO_PARAMS = Collections.unmodifiableMap( new HashMap<String,String>() );
-
/** If true, then considers CamelCase links as well. */
private boolean m_camelCaseLinks = false;
@@ -188,7 +189,7 @@
* This array is sorted during class load, so you can just dump
* here whatever you want in whatever order you want.
*/
- static final String[] c_externalLinks = {
+ static final String[] EXTERNAL_LINKS = {
"http:", "ftp:", "https:", "mailto:",
"news:", "file:", "rtsp:", "mms:", "ldap:",
"gopher:", "nntp:", "telnet:", "wais:",
@@ -224,15 +225,18 @@
* This Comparator is used to find an external link from c_externalLinks. It
* checks if the link starts with the other arraythingie.
*/
- private static Comparator c_startingComparator = new StartingComparator();
+ private static Comparator<String> c_startingComparator = new StartingComparator();
static
{
- Arrays.sort( c_externalLinks );
+ Arrays.sort( EXTERNAL_LINKS );
}
/**
* Creates a markup parser.
+ *
+ * @param context The WikiContext which controls the parsing
+ * @param in Where the data is read from.
*/
public JSPWikiMarkupParser( WikiContext context, Reader in )
{
@@ -246,20 +250,21 @@
*/
// FIXME: parsers should be pooled for better performance.
+ @SuppressWarnings("unchecked")
private void initialize()
{
PatternCompiler compiler = new GlobCompiler();
- List compiledpatterns;
+ List<Pattern> compiledpatterns;
//
// We cache compiled patterns in the engine, since their creation is
// really expensive
//
- compiledpatterns = (List)m_engine.getAttribute( INLINE_IMAGE_PATTERNS );
+ compiledpatterns = (List<Pattern>)m_engine.getAttribute( INLINE_IMAGE_PATTERNS );
if( compiledpatterns == null )
{
- compiledpatterns = new ArrayList(20);
+ compiledpatterns = new ArrayList<Pattern>(20);
Collection ptrns = getImagePatterns( m_engine );
//
@@ -384,13 +389,15 @@
/**
* Figure out which image suffixes should be inlined.
* @return Collection of Strings with patterns.
+ *
+ * @param engine The WikiEngine from which the patterns are read.
*/
// FIXME: Does not belong here; should be elsewhere
public static Collection getImagePatterns( WikiEngine engine )
{
Properties props = engine.getWikiProperties();
- ArrayList ptrnlist = new ArrayList();
+ ArrayList<String> ptrnlist = new ArrayList<String>();
for( Enumeration e = props.propertyNames(); e.hasMoreElements(); )
{
@@ -515,16 +522,15 @@
}
ResourceBundle rb = m_context.getBundle(InternationalizationManager.CORE_BUNDLE);
Object[] args = { link };
- boolean makeAbsoluteLinks = "absolute".equals( m_context.getVariable( WikiEngine.PROP_REFSTYLE ) );
switch(type)
{
case READ:
- el = createAnchor( READ, m_context.getContext().getURL(ViewActionBean.class, link), text, section );
+ el = createAnchor( READ, m_context.getURL(WikiContext.VIEW, link), text, section );
break;
case EDIT:
- el = createAnchor( EDIT, m_context.getContext().getURL( EditActionBean.class, link, NO_PARAMS, makeAbsoluteLinks ), text, "" );
+ el = createAnchor( EDIT, m_context.getURL(WikiContext.EDIT,link), text, "" );
el.setAttribute("title", MessageFormat.format( rb.getString( "markupparser.link.create" ), args ) );
break;
@@ -569,7 +575,7 @@
break;
case IMAGEWIKILINK:
- String pagelink = m_context.getContext().getURL(ViewActionBean.class,text);
+ String pagelink = m_context.getURL(WikiContext.VIEW,text);
el = new Element("img").setAttribute("class","inline");
el.setAttribute("src",link);
el.setAttribute("alt",text);
@@ -586,14 +592,14 @@
break;
case ATTACHMENT:
- String attlink = m_context.getContext().getURL( AttachActionBean.class,
- link, NO_PARAMS, makeAbsoluteLinks );
+ String attlink = m_context.getURL( WikiContext.ATTACH,
+ link );
- String infolink = m_context.getContext().getURL( PageInfoActionBean.class,
- link, NO_PARAMS, makeAbsoluteLinks );
+ String infolink = m_context.getURL( WikiContext.INFO,
+ link );
- String imglink = m_context.getContext().getURL( NoneActionBean.class,
- "images/attachment_small.png", NO_PARAMS, makeAbsoluteLinks );
+ String imglink = m_context.getURL( WikiContext.NONE,
+ "images/attachment_small.png" );
el = createAnchor( ATTACHMENT, attlink, text, "" );
@@ -607,6 +613,7 @@
el.setAttribute("alt","(info)");
el = new Element("a").setAttribute("href",infolink).addContent(el);
+ el.setAttribute("class","infolink");
}
else
{
@@ -643,19 +650,21 @@
* Figures out if a link is an off-site link. This recognizes
* the most common protocols by checking how it starts.
*
+ * @param link The link to check.
+ * @return true, if this is a link outside of this wiki.
* @since 2.4
*/
public static boolean isExternalLink( String link )
{
- int idx = Arrays.binarySearch( c_externalLinks, link,
+ int idx = Arrays.binarySearch( EXTERNAL_LINKS, link,
c_startingComparator );
//
// We need to check here once again; otherwise we might
// get a match for something like "h".
//
- if( idx >= 0 && link.startsWith(c_externalLinks[idx]) ) return true;
+ if( idx >= 0 && link.startsWith(EXTERNAL_LINKS[idx]) ) return true;
return false;
}
@@ -743,7 +752,11 @@
/**
- * Writes HTML for error message.
+ * Writes HTML for error message. Does not add it to the document, you
+ * have to do it yourself.
+ *
+ * @param error The error string.
+ * @return An Element containing the error.
*/
public static Element makeError( String error )
@@ -772,7 +785,7 @@
// calling makeCamelCaseLink() is to call this routine.
//
- m_plainTextBuf = new StringBuffer(20);
+ m_plainTextBuf = new StringBuilder(20);
try
{
@@ -882,11 +895,11 @@
* entities that are already escaped).
*
* @param buf
- * @return
+ * @return An escaped string.
*/
private String escapeHTMLEntities(String buf)
{
- StringBuffer tmpBuf = new StringBuffer( buf.length() + 20 );
+ StringBuilder tmpBuf = new StringBuilder( buf.length() + 20 );
for( int i = 0; i < buf.length(); i++ )
{
@@ -1005,7 +1018,7 @@
private String readUntil( String endChars )
throws IOException
{
- StringBuffer sb = new StringBuffer( 80 );
+ StringBuilder sb = new StringBuilder( 80 );
int ch = nextToken();
while( ch != -1 )
@@ -1040,7 +1053,7 @@
private String readWhile( String endChars )
throws IOException
{
- StringBuffer sb = new StringBuffer( 80 );
+ StringBuilder sb = new StringBuilder( 80 );
int ch = nextToken();
while( ch != -1 )
@@ -1084,18 +1097,34 @@
* Modifies the "hd" parameter to contain proper values. Because
* an "id" tag may only contain [a-zA-Z0-9:_-], we'll replace the
* % after url encoding with '_'.
+ * <p>
+ * Counts also duplicate headings (= headings with similar name), and
+ * attaches a counter.
*/
- // FIXME: This method should probably be public and in an util class somewhere
private String makeHeadingAnchor( String baseName, String title, Heading hd )
{
hd.m_titleText = title;
title = MarkupParser.wikifyLink( title );
+
hd.m_titleSection = m_engine.encodeName(title);
+
+ if( m_titleSectionCounter.containsKey( hd.m_titleSection ) )
+ {
+ Integer count = m_titleSectionCounter.get( hd.m_titleSection );
+ count = count + 1;
+ m_titleSectionCounter.put( hd.m_titleSection, count );
+ hd.m_titleSection += "-" + count;
+ }
+ else
+ {
+ m_titleSectionCounter.put( hd.m_titleSection, 1 );
+ }
+
hd.m_titleAnchor = "section-"+m_engine.encodeName(baseName)+
"-"+hd.m_titleSection;
-
hd.m_titleAnchor = hd.m_titleAnchor.replace( '%', '_' );
hd.m_titleAnchor = hd.m_titleAnchor.replace( '/', '_' );
+
return hd.m_titleAnchor;
}
@@ -1123,11 +1152,12 @@
}
/**
- * Returns XHTML for the start of the heading. Also sets the
- * line-end emitter.
- * @param level
+ * Returns XHTML for the heading.
+ *
+ * @param level The level of the heading. @see Heading
* @param title the title for the heading
* @param hd a List to which heading should be added
+ * @return An Element containing the heading
*/
public Element makeHeading( int level, String title, Heading hd )
{
@@ -1202,7 +1232,7 @@
{
if( m_outlinkImageURL == null )
{
- m_outlinkImageURL = m_context.getContext().getURL( NoneActionBean.class, OUTLINK_IMAGE );
+ m_outlinkImageURL = m_context.getURL( WikiContext.NONE, OUTLINK_IMAGE );
}
el = new Element("img").setAttribute("class", "outlink");
@@ -1222,7 +1252,7 @@
* What a crappy problem.
*
* @param url
- * @return
+ * @return An anchor Element containing the link.
*/
private Element makeDirectURILink( String url )
{
@@ -1387,7 +1417,7 @@
{
ResourceBundle rb = m_context.getBundle(InternationalizationManager.CORE_BUNDLE);
- StringBuffer sb = new StringBuffer(linktext.length()+80);
+ StringBuilder sb = new StringBuilder(linktext.length()+80);
if( isAccessRule( linktext ) )
{
@@ -1406,10 +1436,16 @@
PluginContent pluginContent = m_engine.getPluginManager().parsePluginLine( m_context,
linktext,
pos );
+ //
+ // This might sometimes fail, especially if there is something which looks
+ // like a plugin invocation but is really not.
+ //
+ if( pluginContent != null )
+ {
+ addElement( pluginContent );
- addElement( pluginContent );
-
- pluginContent.executeParse( m_context );
+ pluginContent.executeParse( m_context );
+ }
}
catch( PluginException e )
{
@@ -1535,7 +1571,7 @@
if( isImageLink( linkref ) )
{
- attachment = m_context.getContext().getURL( AttachActionBean.class, attachment );
+ attachment = m_context.getURL( WikiContext.ATTACH, attachment );
sb.append( handleImageLink( attachment, linktext, link.hasReference() ) );
}
else
@@ -1880,11 +1916,11 @@
* Reads the stream until the next EOL or EOF. Note that it will also read the
* EOL from the stream.
*/
- private StringBuffer readUntilEOL()
+ private StringBuilder readUntilEOL()
throws IOException
{
int ch;
- StringBuffer buf = new StringBuffer( 256 );
+ StringBuilder buf = new StringBuilder( 256 );
while( true )
{
@@ -2053,7 +2089,7 @@
for( ; m_genlistlevel > numEqualBullets; m_genlistlevel-- )
{
popElement( getListType( m_genlistBulletBuffer.charAt(m_genlistlevel-1) ) );
- if( m_genlistlevel > 0 )
+ if( m_genlistlevel > numBullets )
{
popElement("li");
}
@@ -2117,7 +2153,7 @@
private Element handleOpenbracket()
throws IOException
{
- StringBuffer sb = new StringBuffer(40);
+ StringBuilder sb = new StringBuilder(40);
int pos = getPosition();
int ch = nextToken();
boolean isPlugin = false;
@@ -2214,7 +2250,7 @@
private String readBraceContent( char opening, char closing )
throws IOException
{
- StringBuffer sb = new StringBuffer(40);
+ StringBuilder sb = new StringBuilder(40);
int braceLevel = 1;
int ch;
while(( ch = nextToken() ) != -1 )
@@ -2244,7 +2280,7 @@
/**
* Handles constructs of type %%(style) and %%class
* @param newLine
- * @return
+ * @return An Element containing the div or span, depending on the situation.
* @throws IOException
*/
private Element handleDiv( boolean newLine )
@@ -2292,7 +2328,7 @@
try
{
- Boolean isSpan = (Boolean)m_styleStack.pop();
+ Boolean isSpan = m_styleStack.pop();
if( isSpan == null )
{
@@ -2621,7 +2657,7 @@
private String cleanupSuspectData( String s )
{
- StringBuffer sb = new StringBuffer( s.length() );
+ StringBuilder sb = new StringBuilder( s.length() );
for( int i = 0; i < s.length(); i++ )
{
@@ -2634,18 +2670,28 @@
return sb.toString();
}
- public static final int CHARACTER = 0;
- public static final int ELEMENT = 1;
- public static final int IGNORE = 2;
+ /** The token is a plain character. */
+ protected static final int CHARACTER = 0;
+
+ /** The token is a wikimarkup element. */
+ protected static final int ELEMENT = 1;
+
+ /** The token is to be ignored. */
+ protected static final int IGNORE = 2;
/**
* Return CHARACTER, if you think this was a plain character; ELEMENT, if
* you think this was a wiki markup element, and IGNORE, if you think
* we should ignore this altogether.
+ * <p>
+ * To add your own MarkupParser, you can override this method, but it
+ * is recommended that you call super.parseToken() as well to gain advantage
+ * of JSPWiki's own markup. You can call it at the start of your own
+ * parseToken() or end - it does not matter.
*
- * @param ch
+ * @param ch The character under investigation
* @return {@link #ELEMENT}, {@link #CHARACTER} or {@link #IGNORE}.
- * @throws IOException
+ * @throws IOException If parsing fails.
*/
protected int parseToken( int ch )
throws IOException
@@ -2812,6 +2858,13 @@
return el != null ? ELEMENT : CHARACTER;
}
+ /**
+ * Parses the entire document from the Reader given in the constructor or
+ * set by {@link #setInputReader(Reader)}.
+ *
+ * @return A WikiDocument, ready to be passed to the renderer.
+ * @throws IOException If parsing cannot be accomplished.
+ */
public WikiDocument parse()
throws IOException
{
@@ -2843,7 +2896,7 @@
if( rootElement.getChild("p") != null )
{
- ArrayList ls = new ArrayList();
+ ArrayList<Content> ls = new ArrayList<Content>();
int idxOfFirstContent = 0;
int count = 0;
@@ -2894,17 +2947,12 @@
* returns null. Otherwise just like the normal Comparator
* for strings.
*
- * @author jalkanen
- *
* @since
*/
- private static class StartingComparator implements Comparator
+ private static class StartingComparator implements Comparator<String>
{
- public int compare( Object arg0, Object arg1 )
+ public int compare( String s1, String s2 )
{
- String s1 = (String)arg0;
- String s2 = (String)arg1;
-
if( s1.length() > s2.length() )
{
if( s1.startsWith(s2) && s2.length() > 1 ) return 0;
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/LinkParser.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/LinkParser.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/LinkParser.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/LinkParser.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
/*
JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -343,10 +344,10 @@
*/
public static class Link
{
- private String m_text;
- private String m_ref = null;
- private int m_interwikiPoint = -1;
- private List m_attribs = null;
+ private String m_text;
+ private String m_ref = null;
+ private int m_interwikiPoint = -1;
+ private List<Attribute> m_attribs = null;
/**
* Create a new Link with text but no reference.
@@ -507,7 +508,7 @@
{
if( m_attribs == null )
{
- m_attribs = new ArrayList();
+ m_attribs = new ArrayList<Attribute>();
}
m_attribs.add(attr);
}
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/MarkupParser.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/MarkupParser.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/MarkupParser.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/MarkupParser.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
/*
- JSPWiki - a JSP-based WikiWiki clone.
+ JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -33,7 +34,6 @@
/**
* Provides an abstract class for the parser instances.
*
- * @author Janne Jalkanen
* @since 2.4
*/
public abstract class MarkupParser
@@ -48,11 +48,11 @@
protected WikiContext m_context;
/** Optionally stores internal wikilinks */
- protected ArrayList m_localLinkMutatorChain = new ArrayList();
- protected ArrayList m_externalLinkMutatorChain = new ArrayList();
- protected ArrayList m_attachmentLinkMutatorChain = new ArrayList();
- protected ArrayList m_headingListenerChain = new ArrayList();
- protected ArrayList m_linkMutators = new ArrayList();
+ protected ArrayList<StringTransmutator> m_localLinkMutatorChain = new ArrayList<StringTransmutator>();
+ protected ArrayList<StringTransmutator> m_externalLinkMutatorChain = new ArrayList<StringTransmutator>();
+ protected ArrayList<StringTransmutator> m_attachmentLinkMutatorChain = new ArrayList<StringTransmutator>();
+ protected ArrayList<HeadingListener> m_headingListenerChain = new ArrayList<HeadingListener>();
+ protected ArrayList<StringTransmutator> m_linkMutators = new ArrayList<StringTransmutator>();
protected boolean m_inlineImages = true;
@@ -73,6 +73,13 @@
/** Lists all punctuation characters allowed in page names. */
public static final String PUNCTUATION_CHARS_ALLOWED = " ()&+,-=._$";
+ /**
+ * Constructs a MarkupParser. The subclass must call this constructor
+ * to set up the necessary bits and pieces.
+ *
+ * @param context The WikiContext.
+ * @param in The reader from which we are reading the bytes from.
+ */
protected MarkupParser( WikiContext context, Reader in )
{
m_engine = context.getEngine();
@@ -155,6 +162,12 @@
}
}
+ /**
+ * Adds a HeadingListener to the parser chain. It will be called whenever
+ * a parsed header is found.
+ *
+ * @param listener The listener to add.
+ */
public void addHeadingListener( HeadingListener listener )
{
if( listener != null )
@@ -163,6 +176,9 @@
}
}
+ /**
+ * Disables access rule parsing.
+ */
public void disableAccessRules()
{
m_parseAccessRules = false;
@@ -183,7 +199,7 @@
/**
* Parses the document.
* @return the parsed document, as a WikiDocument
- * @throws IOException
+ * @throws IOException If something goes wrong.
*/
public abstract WikiDocument parse()
throws IOException;
@@ -207,7 +223,7 @@
* @throws NullPointerException If you have not yet created an input document.
*/
protected final int nextToken()
- throws IOException
+ throws IOException, NullPointerException
{
// if( m_in == null ) return -1;
m_pos++;
@@ -217,6 +233,9 @@
/**
* Push back any character to the current input. Does not
* push back a read EOF, though.
+ *
+ * @param c Character to push back.
+ * @throws IOException In case the character cannot be pushed back.
*/
protected void pushBack( int c )
throws IOException
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/ParseException.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/ParseException.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/ParseException.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/ParseException.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
/*
JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -25,12 +26,16 @@
* This is an exception which gets thrown whenever the parser cannot
* parse the parsing things.
*
- * @author jalkanen
*/
public class ParseException extends WikiException
{
private static final long serialVersionUID = 1L;
+ /**
+ * Constructs a new ParseException.
+ *
+ * @param msg {@inheritDoc}
+ */
public ParseException(String msg)
{
super(msg);
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/PluginContent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/PluginContent.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/PluginContent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/PluginContent.java Sun Aug 3 05:22:13 2008
@@ -1,27 +1,27 @@
/*
- JSPWiki - a JSP-based WikiWiki clone.
+ JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
import java.text.MessageFormat;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.ResourceBundle;
@@ -35,8 +35,15 @@
/**
* Stores the contents of a plugin in a WikiDocument DOM tree.
+ * <p>
+ * If the RenderingManager.WYSIWYG_EDITOR_MODE is set to Boolean.TRUE in the context,
+ * then the plugin
+ * is rendered as WikiMarkup. This allows an HTML editor to work without
+ * rendering the plugin each time as well.
+ * <p>
+ * If RenderingManager.VAR_EXECUTE_PLUGINS is set to Boolean.FALSE, then
+ * the plugin is not executed.
*
- * @author Janne Jalkanen
* @since 2.4
*/
public class PluginContent extends Text
@@ -52,37 +59,70 @@
private static final long serialVersionUID = 1L;
- private String m_pluginName;
- private Map m_params;
+ private String m_pluginName;
+ private Map<String,Object> m_params;
+ /**
+ * Creates a new DOM element with the given plugin name and a map of parameters.
+ *
+ * @param pluginName The FQN of a plugin.
+ * @param parameters A Map of parameters.
+ */
+ @SuppressWarnings("unchecked")
public PluginContent( String pluginName, Map parameters )
{
m_pluginName = pluginName;
m_params = parameters;
}
/**
- * @since 2.5.7
+ * Returns the name of the plugin invoked by the DOM element.
+ *
+ * @return Name of the plugin
+ * @since 2.5.7
*/
public String getPluginName()
{
return m_pluginName;
}
+ /**
+ * Returns a parameter value from the parameter map.
+ *
+ * @param name the name of the parameter.
+ * @return The value from the map, or null, if no such parameter exists.
+ */
public Object getParameter( String name )
{
return m_params.get(name);
}
+ /**
+ * Returns the parameter map given in the constructor.
+ *
+ * @return The parameter map.
+ */
public Map getParameters()
{
return m_params;
}
+ /**
+ * Returns the rendered plugin. Only calls getText().
+ *
+ * @return HTML
+ */
public String getValue()
{
return getText();
}
+ /**
+ * The main invocation for the plugin. When the getText() is called, it
+ * invokes the plugin and returns its contents. If there is no Document
+ * yet, only returns the plugin name itself.
+ *
+ * @return The plugin rendered according to the options set in the WikiContext.
+ */
public String getText()
{
String result;
@@ -136,15 +176,13 @@
WikiEngine engine = context.getEngine();
- HashMap parsedParams = new HashMap();
+ HashMap<String,Object> parsedParams = new HashMap<String,Object>();
//
// Parse any variable instances from the string
//
- for( Iterator i = m_params.entrySet().iterator(); i.hasNext(); )
+ for( Map.Entry e : m_params.entrySet() )
{
- Map.Entry e = (Map.Entry) i.next();
-
Object val = e.getValue();
if( val instanceof String )
@@ -152,7 +190,7 @@
val = engine.getVariableManager().expandVariables( context, (String)val );
}
- parsedParams.put( e.getKey(), val );
+ parsedParams.put( (String)e.getKey(), val );
}
result = engine.getPluginManager().execute( context,
@@ -183,12 +221,13 @@
/**
* Executes the executeParse() method.
*
- * @param m_context
+ * @param context The WikiContext
+ * @throws PluginException If something goes wrong.
*/
- public void executeParse(WikiContext m_context)
+ public void executeParse(WikiContext context)
throws PluginException
{
- m_context.getEngine().getPluginManager().executeParse( this, m_context );
+ context.getEngine().getPluginManager().executeParse( this, context );
}
}
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/VariableContent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/VariableContent.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/VariableContent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/VariableContent.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
/*
- JSPWiki - a JSP-based WikiWiki clone.
+ JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -28,7 +29,11 @@
/**
* Stores the contents of a WikiVariable in a WikiDocument DOM tree.
- * @author Janne Jalkanen
+ * <p>
+ * When the WikiDocument is rendered, if the {@link RenderingManager#WYSIWYG_EDITOR_MODE}
+ * is set to {@link Boolean#TRUE}, the variable declaration is rendered instead
+ * of the variable value.
+ *
* @since 2.4
*/
public class VariableContent extends Text
@@ -37,13 +42,20 @@
private String m_varName;
+ /**
+ * Create a VariableContent for the given variable.
+ *
+ * @param varName The name of the variable.
+ */
public VariableContent( String varName )
{
m_varName = varName;
}
/**
- * Evaluates the variable and returns the contents.
+ * Evaluates the variable and returns the contents.
+ *
+ * @return The rendered value of the variable.
*/
public String getValue()
{
@@ -82,11 +94,19 @@
return StringEscapeUtils.escapeXml( result );
}
+ /**
+ * Returns exactly getValue().
+ * @return Whatever getValue() returns.
+ */
public String getText()
{
return getValue();
}
+ /**
+ * Returns a debug-suitable string.
+ * @return Debug string
+ */
public String toString()
{
return "VariableElement[\""+m_varName+"\"]";
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/WikiDocument.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/WikiDocument.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/WikiDocument.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/parser/WikiDocument.java Sun Aug 3 05:22:13 2008
@@ -1,21 +1,22 @@
/*
JSPWiki - a JSP-based WikiWiki clone.
- Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program 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 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
*/
package com.ecyrd.jspwiki.parser;
@@ -34,17 +35,16 @@
* The document is not stored as metadata in the WikiPage because
* otherwise it could not be cached separately.
*
- * @author Janne Jalkanen
* @since 2.4
*/
public class WikiDocument extends Document
{
- private static final long serialVersionUID = 0L;
+ private static final long serialVersionUID = 1L;
- private WikiPage m_page;
- private String m_wikiText;
+ private WikiPage m_page;
+ private String m_wikiText;
- private WeakReference m_context;
+ private WeakReference<WikiContext> m_context;
/**
* Creates a new WikiDocument for a specific page.
@@ -56,24 +56,48 @@
m_page = page;
}
+ /**
+ * Set the WikiMarkup for this document.
+ *
+ * @param data The WikiMarkup
+ */
public void setPageData( String data )
{
m_wikiText = data;
}
+ /**
+ * Returns the wikimarkup used to render this document.
+ *
+ * @return The WikiMarkup
+ */
public String getPageData()
{
return m_wikiText;
}
+ /**
+ * Return the WikiPage for whom this WikiDocument exists.
+ *
+ * @return The WikiPage
+ */
public WikiPage getPage()
{
return m_page;
}
+ /**
+ * Set the WikiContext in which the WikiDocument is rendered. The
+ * WikiContext is stored in a WeakReference, which means that it
+ * can be garbagecollected away. This is to allow for caching of
+ * the WikiDocument without having to carry the WikiContext around
+ * for a long time.
+ *
+ * @param ctx A WikiContext.
+ */
public void setContext( WikiContext ctx )
{
- m_context = new WeakReference( ctx );
+ m_context = new WeakReference<WikiContext>( ctx );
}
/**
@@ -84,6 +108,6 @@
*/
public WikiContext getContext()
{
- return (WikiContext) m_context.get();
+ return m_context.get();
}
}
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/AbstractReferralPlugin.java Sun Aug 3 05:22:13 2008
@@ -21,10 +21,8 @@
package com.ecyrd.jspwiki.plugin;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
@@ -34,30 +32,62 @@
import com.ecyrd.jspwiki.*;
import com.ecyrd.jspwiki.parser.MarkupParser;
import com.ecyrd.jspwiki.parser.WikiDocument;
+import com.ecyrd.jspwiki.preferences.Preferences;
+import com.ecyrd.jspwiki.preferences.Preferences.TimeFormat;
import com.ecyrd.jspwiki.render.RenderingManager;
/**
* This is a base class for all plugins using referral things.
*
- * <p>Parameters:<br>
- * maxwidth: maximum width of generated links<br>
- * separator: separator between generated links (wikitext)<br>
- * after: output after the link
- * before: output before the link
+ * <p>Parameters also valid for all subclasses.</p>
+ * <ul>
+ * <li><b>maxwidth</b>: maximum width of generated links</li>
+ * <li><b>separator</b>: separator between generated links (wikitext)</li>
+ * <li><b>after</b>: output after the link</li>
+ * <li><b>before</b>: output before the link</li>
+ * <li><b>show</b>: Either "pages" (default) or "count". When "count", shows only the count
+ * of pages which match. (Since 2.8)</li>
+ * <li><b>showLastModified</b>: When show=count, shows also the last modified date. (Since 2.8)</li>
+ * </ul>
+ *
*/
public abstract class AbstractReferralPlugin
implements WikiPlugin
{
private static Logger log = Logger.getLogger( AbstractReferralPlugin.class );
- public static final int ALL_ITEMS = -1;
- public static final String PARAM_MAXWIDTH = "maxwidth";
- public static final String PARAM_SEPARATOR = "separator";
- public static final String PARAM_AFTER = "after";
- public static final String PARAM_BEFORE = "before";
-
- public static final String PARAM_EXCLUDE = "exclude";
- public static final String PARAM_INCLUDE = "include";
+ /** Magic value for rendering all items. */
+ public static final int ALL_ITEMS = -1;
+
+ /** Parameter name for setting the maximum width. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_MAXWIDTH = "maxwidth";
+
+ /** Parameter name for the separator string. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_SEPARATOR = "separator";
+
+ /** Parameter name for the output after the link. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_AFTER = "after";
+
+ /** Parameter name for the output before the link. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_BEFORE = "before";
+
+ /** Parameter name for setting the list of excluded patterns. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_EXCLUDE = "exclude";
+
+ /** Parameter name for setting the list of included patterns. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_INCLUDE = "include";
+
+ /** Parameter name for the show parameter. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_SHOW = "show";
+
+ /** Parameter name for setting show to "pages". Value is <tt>{@value}</tt>. */
+ public static final String PARAM_SHOW_VALUE_PAGES = "pages";
+
+ /** Parameter name for setting show to "count". Value is <tt>{@value}</tt>. */
+ public static final String PARAM_SHOW_VALUE_COUNT = "count";
+
+ /** Parameter name for showing the last modification count. Value is <tt>{@value}</tt>. */
+ public static final String PARAM_LASTMODIFIED = "showLastModified";
protected int m_maxwidth = Integer.MAX_VALUE;
protected String m_before = ""; // null not blank
@@ -66,20 +96,25 @@
protected Pattern[] m_exclude;
protected Pattern[] m_include;
+
+ protected String m_show = "pages";
+ protected boolean m_lastModified=false;
+ // the last modified date of the page that has been last modified:
+ protected Date m_dateLastModified = new Date(0);
+ protected SimpleDateFormat m_dateFormat;
protected WikiEngine m_engine;
/**
- * Used to initialize some things. All plugins must call this first.
- *
- * @since 1.6.4
+ * @param context the wiki context
+ * @param params parameters for initializing the plugin
+ * @throws PluginException if any of the plugin parameters are malformed
*/
-
// FIXME: The compiled pattern strings should really be cached somehow.
-
public void initialize( WikiContext context, Map params )
throws PluginException
{
+ m_dateFormat = Preferences.getDateFormat( context, TimeFormat.DATETIME );
m_engine = context.getEngine();
m_maxwidth = TextUtil.parseIntParameter( (String)params.get( PARAM_MAXWIDTH ), Integer.MAX_VALUE );
if( m_maxwidth < 0 ) m_maxwidth = 0;
@@ -157,11 +192,43 @@
}
// log.debug( "Requested maximum width is "+m_maxwidth );
- }
+ s = (String) params.get(PARAM_SHOW);
+ if( s != null )
+ {
+ if( s.equalsIgnoreCase( "count" ) )
+ {
+ m_show = "count";
+ }
+ }
+
+ s = (String) params.get( PARAM_LASTMODIFIED );
+
+ if( s != null )
+ {
+ if( s.equalsIgnoreCase( "true" ) )
+ {
+ if( m_show.equals( "count" ) )
+ {
+ m_lastModified = true;
+ }
+ else
+ {
+ throw new PluginException( "showLastModified=true is only valid if show=count is also specified" );
+ }
+ }
+ }
+ }
+
+ /**
+ * Filters a collection according to the include and exclude -parameters.
+ *
+ * @param c The collection to filter.
+ * @return A filtered collection.
+ */
protected Collection filterCollection( Collection c )
{
- ArrayList result = new ArrayList();
+ ArrayList<String> result = new ArrayList<String>();
PatternMatcher pm = new Perl5Matcher();
@@ -204,6 +271,26 @@
if( includeThis )
{
result.add( pageName );
+ //
+ // if we want to show the last modified date of the most recently change page, we keep a "high watermark" here:
+ WikiPage page = null;
+ if( m_lastModified )
+ {
+ page = m_engine.getPage( pageName );
+ if( page != null )
+ {
+ Date lastModPage = page.getLastModified();
+ if( log.isDebugEnabled() )
+ {
+ log.debug( "lastModified Date of page " + pageName + " : " + m_dateLastModified );
+ }
+ if( lastModPage.after( m_dateLastModified ) )
+ {
+ m_dateLastModified = lastModPage;
+ }
+ }
+
+ }
}
}
@@ -216,6 +303,7 @@
* @param links Collection to make into WikiText.
* @param separator Separator string to use.
* @param numItems How many items to show.
+ * @return The WikiText
*/
protected String wikitizeCollection( Collection links, String separator, int numItems )
{
@@ -258,6 +346,9 @@
/**
* Makes HTML with common parameters.
*
+ * @param context The WikiContext
+ * @param wikitext The wikitext to render
+ * @return HTML
* @since 1.6.4
*/
protected String makeHTML( WikiContext context, String wikitext )
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/BugReportHandler.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/BugReportHandler.java?rev=682148&r1=682147&r2=682148&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/BugReportHandler.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/plugin/BugReportHandler.java Sun Aug 3 05:22:13 2008
@@ -56,8 +56,11 @@
public static final String MAPPINGS = "map";
public static final String PAGE = "page";
- public static final String DEFAULT_DATEFORMAT = "dd-MMM-yyyy HH:mm:ss zzz";
+ private static final String DEFAULT_DATEFORMAT = "dd-MMM-yyyy HH:mm:ss zzz";
+ /**
+ * {@inheritDoc}
+ */
public String execute( WikiContext context, Map params )
throws PluginException
{