Initial import.

This commit is contained in:
Erik C. Thauvin 2004-01-13 00:23:43 +00:00
parent 6c7ec8561a
commit 191381492e
24 changed files with 2514 additions and 0 deletions

View file

@ -0,0 +1,3 @@
build
dist
*.bat

View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="false">
<component name="LvcsConfiguration">
<option name="LOCAL_VCS_ENABLED" value="false" />
<option name="LOCAL_VCS_PURGING_PERIOD" value="259200000" />
</component>
<component name="ModuleRootManager" />
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/build/google-rss" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="1.4.x" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="googleapi">
<CLASSES>
<root url="jar://C:/Documents and Settings/erik/My Documents/My Projects/sourceforge/google-taglib/lib/googleapi.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="google">
<CLASSES>
<root url="jar://C:/projects/sourceforge/google-taglib/dist/google.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="servlet">
<CLASSES>
<root url="jar://C:/projects/sourceforge/google-taglib/lib/servlet.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4" relativePaths="false">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/build.xml">
<useEmacsModeOutput value="true" />
<maximumHeapSize value="128" />
<useCustomJdk value="false" />
<useJavaw value="false" />
<includeProjectClasspath value="false" />
<includeParser value="true" />
</buildFile>
</component>
<component name="CodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS" />
<option name="USE_PER_PROJECT_SETTINGS" value="false" />
</component>
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<option name="CLEAR_OUTPUT_DIRECTORY" value="false" />
<resourceExtensions>
<entry name=".+\.(properties|xml|html|dtd|tld)" />
<entry name=".+\.(gif|png|jpeg|jpg)" />
</resourceExtensions>
</component>
<component name="DataSourceManager" />
<component name="EntryPointsManager">
<entry_points />
</component>
<component name="ExportToHTMLSettings">
<option name="PRINT_LINE_NUMBERS" value="false" />
<option name="OPEN_IN_BROWSER" value="false" />
<option name="OUTPUT_DIRECTORY" />
</component>
<component name="GUI Designer component loader factory" />
<component name="ImportConfiguration">
<option name="VENDOR" />
<option name="RELEASE_TAG" />
<option name="LOG_MESSAGE" />
<option name="CHECKOUT_AFTER_IMPORT" value="true" />
<option name="KEYWORD_SUBSTITUTION_WRAPPERS" value="" />
</component>
<component name="J2EEManager" />
<component name="JavacSettings">
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="DEPRECATION" value="true" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
<option name="MAXIMUM_HEAP_SIZE" value="128" />
<option name="USE_GENERICS_COMPILER" value="false" />
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="true" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="true" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="true" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" />
<option name="HEAP_SIZE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="JikesSettings">
<option name="JIKES_PATH" value="" />
<option name="DEBUGGING_INFO" value="true" />
<option name="DEPRECATION" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="IS_EMACS_ERRORS_MODE" value="true" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/GoogleRSS.iml" filepath="$PROJECT_DIR$/GoogleRSS.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" assert-keyword="false" />
<component name="UI designer component loader factory" />
<component name="WebManager">
<option enabled="true" />
</component>
<component name="WebRootContainer">
<root url="file://$PROJECT_DIR$/google-rss-examples" name="google-rss-examples" validate="false" />
</component>
<component name="libraryTable" />
<component name="uidesigner-configuration">
<option name="INSTRUMENT_CLASSES" value="true" />
</component>
</project>

View file

@ -0,0 +1,747 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4" relativePaths="false">
<component name="AppServerRunManager" />
<component name="AspectsView" />
<component name="BookmarkManager" />
<component name="CheckinPanelState" />
<component name="Commander">
<leftPanel />
<rightPanel />
<splitter proportion="0.5" />
</component>
<component name="CompilerWorkspaceConfiguration">
<option name="COMPILE_IN_BACKGROUND" value="false" />
<option name="AUTO_SHOW_ERRORS_IN_EDITOR" value="true" />
</component>
<component name="Cvs2Configuration">
<option name="ON_FILE_ADDING" value="0" />
<option name="ON_FILE_REMOVING" value="0" />
<option name="PRUNE_EMPTY_DIRECTORIES" value="true" />
<option name="SHOW_UPDATE_OPTIONS" value="true" />
<option name="SHOW_ADD_OPTIONS" value="true" />
<option name="SHOW_REMOVE_OPTIONS" value="true" />
<option name="MERGING_MODE" value="0" />
<option name="MERGE_WITH_BRANCH1_NAME" value="HEAD" />
<option name="MERGE_WITH_BRANCH2_NAME" value="HEAD" />
<option name="RESET_STICKY" value="false" />
<option name="CREATE_NEW_DIRECTORIES" value="true" />
<option name="DEFAULT_TEXT_FILE_SUBSTITUTION" value="v" />
<option name="PROCESS_UNKNOWN_FILES" value="false" />
<option name="PROCESS_DELETED_FILES" value="false" />
<option name="SHOW_EDIT_DIALOG" value="false" />
<option name="RESERVED_EDIT" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
<option name="SHOW_CHECKOUT_OPTIONS" value="true" />
<option name="CHECKOUT_DATE_OR_REVISION_SETTINGS">
<value>
<option name="BRANCH" value="" />
<option name="DATE" value="" />
<option name="USE_BRANCH" value="false" />
<option name="USE_DATE" value="false" />
</value>
</option>
<option name="UPDATE_DATE_OR_REVISION_SETTINGS">
<value>
<option name="BRANCH" value="" />
<option name="DATE" value="" />
<option name="USE_BRANCH" value="false" />
<option name="USE_DATE" value="false" />
</value>
</option>
<option name="SHOW_CHANGES_REVISION_SETTINGS">
<value>
<option name="BRANCH" value="" />
<option name="DATE" value="" />
<option name="USE_BRANCH" value="false" />
<option name="USE_DATE" value="false" />
</value>
</option>
<option name="SHOW_OUTPUT" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="ADD_WATCH_INDEX" value="0" />
<option name="REMOVE_WATCH_INDEX" value="0" />
<option name="UPDATE_KEYWORD_SUBSTITUTION" />
<option name="MAKE_NEW_FILES_READONLY" value="false" />
<option name="PUT_FOCUS_INTO_COMMENT" value="false" />
<option name="SHOW_CHECKIN_OPTIONS" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="LAST_COMMIT_MESSAGE" value="" />
<option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
<option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<line_breakpoints />
<exception_breakpoints>
<breakpoint_any>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="SUSPEND_VM" value="true" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="LOG_MESSAGE" value="" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
</breakpoint_any>
</exception_breakpoints>
<field_breakpoints />
<method_breakpoints />
</component>
<component name="DebuggerSettings">
<option name="TRACING_FILTERS_ENABLED" value="true" />
<option name="VALUE_LOOKUP_DELAY" value="700" />
<option name="DEBUGGER_TRANSPORT" value="0" />
<option name="FORCE_CLASSIC_VM" value="true" />
<option name="HIDE_DEBUGGER_ON_PROCESS_TERMINATION" value="false" />
<option name="SKIP_SYNTHETIC_METHODS" value="true" />
<option name="SKIP_CONSTRUCTORS" value="false" />
<option name="STEP_THREAD_SUSPEND_POLICY" value="SuspendThread" />
<option name="RUN_HOTSWAP_AFTER_COMPILE" value="RunHotswapAsk" />
<filter>
<option name="PATTERN" value="com.sun.*" />
<option name="ENABLED" value="true" />
</filter>
<filter>
<option name="PATTERN" value="java.*" />
<option name="ENABLED" value="true" />
</filter>
<filter>
<option name="PATTERN" value="javax.*" />
<option name="ENABLED" value="true" />
</filter>
<filter>
<option name="PATTERN" value="org.omg.*" />
<option name="ENABLED" value="true" />
</filter>
<filter>
<option name="PATTERN" value="sun.*" />
<option name="ENABLED" value="true" />
</filter>
<filter>
<option name="PATTERN" value="junit.*" />
<option name="ENABLED" value="true" />
</filter>
<data_representation>
<array_representation qualified_name="java.lang.Object[]" use_class_filters="true">
<option name="NAME" value="Arrays defaults" />
<option name="ENABLED" value="false" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="false" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="toString()" />
</label>
<children>
<option name="START_INDEX" value="0" />
<option name="END_INDEX" value="500" />
<option name="HIDE_NULL_ARRAY_ELEMENTS" value="false" />
</children>
</array_representation>
<class_representation qualified_name="java.lang.Object" use_class_filters="true">
<option name="NAME" value="Classes defaults" />
<option name="ENABLED" value="false" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="false" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="toString()" />
</label>
<children>
<option name="CHILDREN_EXPRESSION_ENABLED" value="false" />
<option name="SORT_ASCENDING" value="false" />
<option name="SHOW_SYNTHETICS" value="true" />
<option name="SHOW_STATIC" value="true" />
<option name="SHOW_STATIC_FINAL" value="true" />
<option name="CHILDREN_EXPRESSION" value="" />
</children>
</class_representation>
<primitive_representation>
<option name="NAME" value="Primitives defaults" />
<option name="ENABLED" value="false" />
<option name="SHOW_HEX" value="false" />
</primitive_representation>
<group>
<option name="NAME" value="Alternative collections view" />
<option name="ENABLED" value="false" />
<renderers>
<class_representation qualified_name="java.util.Map$Entry" use_class_filters="true">
<option name="NAME" value="view key and value" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="getKey() + &quot; -&gt; &quot; + getValue()" />
</label>
<children>
<option name="CHILDREN_EXPRESSION_ENABLED" value="true" />
<option name="SORT_ASCENDING" value="false" />
<option name="SHOW_SYNTHETICS" value="false" />
<option name="SHOW_STATIC" value="true" />
<option name="SHOW_STATIC_FINAL" value="false" />
<option name="CHILDREN_EXPRESSION" value="new Object() { Object key = getKey(); Object value = getValue(); }" />
</children>
<filters>
<option name="PATTERN" value="*" />
<option name="ENABLED" value="true" />
</filters>
</class_representation>
<class_representation qualified_name="java.util.Collection" use_class_filters="true">
<option name="NAME" value="view 'size()'" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="&quot;size = &quot; + size()" />
</label>
<filters>
<option name="PATTERN" value="*" />
<option name="ENABLED" value="true" />
</filters>
</class_representation>
<class_representation qualified_name="java.util.Set" use_class_filters="true">
<option name="NAME" value="view 'toArray()'" />
<option name="ENABLED" value="true" />
<children>
<option name="CHILDREN_EXPRESSION_ENABLED" value="true" />
<option name="SORT_ASCENDING" value="false" />
<option name="SHOW_SYNTHETICS" value="false" />
<option name="SHOW_STATIC" value="true" />
<option name="SHOW_STATIC_FINAL" value="false" />
<option name="CHILDREN_EXPRESSION" value="toArray()" />
</children>
<filters>
<option name="PATTERN" value="*" />
<option name="ENABLED" value="true" />
</filters>
</class_representation>
<class_representation qualified_name="java.util.List" use_class_filters="true">
<option name="NAME" value="view 'toArray()'" />
<option name="ENABLED" value="true" />
<children>
<option name="CHILDREN_EXPRESSION_ENABLED" value="true" />
<option name="SORT_ASCENDING" value="false" />
<option name="SHOW_SYNTHETICS" value="false" />
<option name="SHOW_STATIC" value="true" />
<option name="SHOW_STATIC_FINAL" value="false" />
<option name="CHILDREN_EXPRESSION" value="toArray()" />
</children>
<filters>
<option name="PATTERN" value="*" />
<option name="ENABLED" value="true" />
</filters>
</class_representation>
<class_representation qualified_name="java.util.Map" use_class_filters="true">
<option name="NAME" value="view 'entrySet()'" />
<option name="ENABLED" value="true" />
<children>
<option name="CHILDREN_EXPRESSION_ENABLED" value="true" />
<option name="SORT_ASCENDING" value="false" />
<option name="SHOW_SYNTHETICS" value="false" />
<option name="SHOW_STATIC" value="true" />
<option name="SHOW_STATIC_FINAL" value="false" />
<option name="CHILDREN_EXPRESSION" value="entrySet().toArray()" />
</children>
<filters>
<option name="PATTERN" value="*" />
<option name="ENABLED" value="true" />
</filters>
</class_representation>
</renderers>
</group>
<group>
<option name="NAME" value="Type wrappers" />
<option name="ENABLED" value="true" />
<renderers>
<class_representation qualified_name="java.lang.Integer" use_class_filters="true">
<option name="NAME" value="view 'intValue()'" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="intValue()" />
</label>
</class_representation>
<class_representation qualified_name="java.lang.Byte" use_class_filters="true">
<option name="NAME" value="view 'byteValue()'" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="byteValue()" />
</label>
</class_representation>
<class_representation qualified_name="java.lang.Double" use_class_filters="true">
<option name="NAME" value="view 'doubleValue()'" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="doubleValue()" />
</label>
</class_representation>
<class_representation qualified_name="java.lang.Float" use_class_filters="true">
<option name="NAME" value="view 'floatValue()'" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="floatValue()" />
</label>
</class_representation>
<class_representation qualified_name="java.lang.Long" use_class_filters="true">
<option name="NAME" value="view 'longValue()'" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="longValue()" />
</label>
</class_representation>
<class_representation qualified_name="java.lang.Short" use_class_filters="true">
<option name="NAME" value="view 'shortValue()'" />
<option name="ENABLED" value="true" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="true" />
<option name="LABEL_EXPRESSION" value="shortValue()" />
</label>
</class_representation>
</renderers>
</group>
<class_representation qualified_name="java.lang.Object" use_class_filters="true">
<option name="NAME" value="Show 'toString()'" />
<option name="ENABLED" value="false" />
<label>
<option name="LABEL_EXPRESSION_ENABLED" value="true" />
<option name="SHOW_OBJECTID" value="false" />
<option name="LABEL_EXPRESSION" value="toString()" />
</label>
</class_representation>
</data_representation>
</component>
<component name="ErrorTreeViewConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="HIDE_WARNINGS" value="false" />
</component>
<component name="FileEditorManager" split-orientation="vertical" split-proportion="0.5">
<first-group selected-file="file://$PROJECT_DIR$/src/com/clevercactus/google/taglibs/SearchResults.java">
<entry file="file://$PROJECT_DIR$/LICENSE.txt" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="2" column="19" selection-start="51" selection-end="51" vertical-scroll-proportion="0.055829227">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.txt" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/taglibs/SearchResults.java" pinned="false">
<provider selected="true" editor-type-id="text-editor">
<state line="40" column="26" selection-start="1769" selection-end="1769" vertical-scroll-proportion="-0.055555556">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</first-group>
<second-group />
</component>
<component name="HierarchyBrowserManager">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="SORT_ALPHABETICALLY" value="false" />
<option name="HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED" value="false" />
</component>
<component name="InspectionManager">
<option name="AUTOSCROLL_TO_SOURCE" value="false" />
<option name="SPLITTER_PROPORTION" value="0.5" />
<profile name="Default" />
</component>
<component name="J2EEProjectPane" />
<component name="LvcsProjectConfiguration">
<option name="ADD_LABEL_ON_PROJECT_OPEN" value="true" />
<option name="ADD_LABEL_ON_PROJECT_COMPILATION" value="true" />
<option name="ADD_LABEL_ON_FILE_PACKAGE_COMPILATION" value="true" />
<option name="ADD_LABEL_ON_PROJECT_MAKE" value="true" />
<option name="ADD_LABEL_ON_RUNNING" value="true" />
<option name="ADD_LABEL_ON_DEBUGGING" value="true" />
<option name="ADD_LABEL_ON_UNIT_TEST_PASSED" value="true" />
<option name="ADD_LABEL_ON_UNIT_TEST_FAILED" value="true" />
</component>
<component name="PackagesPane" />
<component name="ProjectPane">
<expanded_node url="file://$PROJECT_DIR$/tlds" module="GoogleRSS" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/com" module="GoogleRSS" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/com/clevercactus/google/taglibs" module="GoogleRSS" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/com/clevercactus" module="GoogleRSS" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src" module="GoogleRSS" type="directory" />
<expanded_node url="file://$PROJECT_DIR$" module="GoogleRSS" type="directory" />
<expanded_node url="file://$PROJECT_DIR$/src/com/clevercactus/google" module="GoogleRSS" type="directory" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showLibraryContents />
<flattenPackages />
<hideEmptyPackages />
<showStructure />
<autoscrollToSource />
</navigator>
</component>
<component name="PropertiesComponent">
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="GoToClass.includeLibraries" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.sorted" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
</component>
<component name="RunManager">
<option name="SHOW_SETTINGS_BEFORE_RUNNING" value="true" />
<option name="COMPILE_BEFORE_RUNNING" value="true" />
<option name="USE_LAUNCHER_FOR_RUNNING" value="false" />
<activeType name="WebApp" />
<configuration name="&lt;template&gt;" type="Application" default="true" selected="false">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<module name="GoogleRSS" />
</configuration>
<configuration name="&lt;template&gt;" type="Applet" default="true" selected="false">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
</configuration>
<configuration name="&lt;template&gt;" type="JUnit" default="true" selected="false">
<module name="GoogleRSS" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ADDITIONAL_CLASS_PATH" />
</configuration>
<configuration name="&lt;template&gt;" type="Remote" default="true" selected="false">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<module name="" />
<WebServerIntegration name="" />
<Host>localhost</Host>
<Port>5050</Port>
<LaunchServer>false</LaunchServer>
</configuration>
<configuration name="&lt;template&gt;" type="WebLogic Instance" default="true" selected="false">
<option name="WEBLOGIC_INSTANCE_CONFIGURATION_NAME" />
</configuration>
<configuration name="RSSGenerator" type="Application" default="false" selected="true">
<option name="MAIN_CLASS_NAME" value="com.clevercactus.google.RSSGenerator" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<module name="GoogleRSS" />
</configuration>
<configuration name="Examples" type="WebApp" default="false" selected="true">
<module name="GoogleRSS" />
<WebServerIntegration name="Tomcat 4.0.x Server">
<option name="MAIN_CLASS" value="org.apache.catalina.startup.Bootstrap" />
<option name="TOMCAT_HOME" value="C:/Program Files/Apache Group/Tomcat 4.1" />
<option name="CONFIG_DIRECTORY" value="C:/Program Files/Apache Group/Tomcat 4.1/conf" />
<option name="CONTEXT_PATH" value="/google-examples" />
<option name="VM_ARGUMENTS" value="" />
<option name="INCLUDE_MODULE_CLASSPATH" value="false" />
</WebServerIntegration>
<Host>localhost</Host>
<Port>5050</Port>
<LaunchServer>false</LaunchServer>
</configuration>
</component>
<component name="SelectInManager" />
<component name="StarteamConfiguration">
<option name="SERVER" value="" />
<option name="PORT" value="49201" />
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="PROJECT" value="" />
<option name="VIEW" value="" />
<option name="ALTERNATIVE_WORKING_PATH" value="" />
<option name="PUT_FOCUS_INTO_COMMENT" value="false" />
<option name="SHOW_CHECKIN_OPTIONS" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="LAST_COMMIT_MESSAGE" value="" />
<option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
<option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
</component>
<component name="StructureViewFactory">
<option name="SORT_MODE" value="0" />
<option name="GROUP_INHERITED" value="true" />
<option name="AUTOSCROLL_MODE" value="true" />
<option name="SHOW_FIELDS" value="true" />
<option name="AUTOSCROLL_FROM_SOURCE" value="false" />
<option name="GROUP_GETTERS_AND_SETTERS" value="true" />
<option name="SHOW_INHERITED" value="false" />
<option name="HIDE_NOT_PUBLIC" value="false" />
</component>
<component name="TodoView" selected-index="0">
<todo-panel id="selected-file">
<are-packages-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-4" y="-4" width="1032" height="776" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="7" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.28061223" order="0" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33026114" order="1" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.2489796" order="1" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33024693" order="8" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="6" />
<window_info id="Aspects" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="3" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.18673469" order="1" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33026114" order="2" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
<window_info id="CVS File View" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="3" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="4" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="0" />
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="0" />
<window_info id="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="3" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="5" />
</layout>
</component>
<component name="VCS.FileViewConfiguration">
<option name="SELECTED_STATUSES" value="DEFAULT" />
<option name="SELECTED_COLUMNS" value="DEFAULT" />
<option name="SHOW_FILTERS" value="true" />
<option name="CUSTOMIZE_VIEW" value="true" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="true" />
</component>
<component name="VcsManagerConfiguration">
<option name="ACTIVE_VCS_NAME" value="CVS" />
</component>
<component name="VssConfiguration">
<CheckoutOptions>
<option name="COMMENT" value="" />
<option name="DO_NOT_GET_LATEST_VERSION" value="false" />
<option name="REPLACE_WRITABLE" value="false" />
<option name="RECURSIVE" value="false" />
</CheckoutOptions>
<CheckinOptions>
<option name="COMMENT" value="" />
<option name="KEEP_CHECKED_OUT" value="false" />
<option name="RECURSIVE" value="false" />
</CheckinOptions>
<AddOptions>
<option name="COMMENT" value="" />
<option name="STORE_ONLY_LATEST_VERSION" value="false" />
<option name="CHECK_OUT_IMMEDIATELY" value="false" />
<option name="FILE_TYPE" value="0" />
</AddOptions>
<UndocheckoutOptions>
<option name="MAKE_WRITABLE" value="false" />
<option name="REPLACE_LOCAL_COPY" value="0" />
<option name="RECURSIVE" value="false" />
</UndocheckoutOptions>
<GetOptions>
<option name="REPLACE_WRITABLE" value="0" />
<option name="MAKE_WRITABLE" value="false" />
<option name="RECURSIVE" value="false" />
</GetOptions>
<option name="CLIENT_PATH" value="" />
<option name="SRCSAFEINI_PATH" value="" />
<option name="USER_NAME" value="" />
<option name="PWD" value="" />
<option name="SHOW_CHECKOUT_OPTIONS" value="true" />
<option name="SHOW_ADD_OPTIONS" value="true" />
<option name="VSS_IS_INITIALIZED" value="false" />
<option name="SHOW_UNDOCHECKOUT_OPTIONS" value="true" />
<option name="SHOW_DIFF_OPTIONS" value="true" />
<option name="SHOW_GET_OPTIONS" value="true" />
<option name="REUSE_LAST_COMMENT" value="false" />
<option name="PUT_FOCUS_INTO_COMMENT" value="false" />
<option name="SHOW_CHECKIN_OPTIONS" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="LAST_COMMIT_MESSAGE" value="" />
<option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
<option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="OPTIMIZE_IMPORTS_BEFORE_FILE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
</component>
<component name="WebViewSettings">
<webview flattenPackages="false" showMembers="false" autoscrollToSource="false" />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
<buildFile url="file://$PROJECT_DIR$/build.xml">
<runInBackground value="false" />
<viewClosedWhenNoErrors value="false" />
<treeView value="true" />
<verbose value="true" />
</buildFile>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/tlds/google-rss.tld">
<provider selected="true" editor-type-id="text-editor">
<state line="16" column="23" selection-start="779" selection-end="779" vertical-scroll-proportion="0.7619048">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/build.properties">
<provider selected="true" editor-type-id="text-editor">
<state line="16" column="29" selection-start="257" selection-end="257" vertical-scroll-proportion="0.7619048">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/google-rss-examples/WEB-INF/web.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/google-rss-examples/rss.jsp">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="193" selection-start="193" selection-end="193" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/build.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="90" column="62" selection-start="3459" selection-end="3459" vertical-scroll-proportion="2.562814">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/RSSGenerator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="6" selection-start="1975" selection-end="1975" vertical-scroll-proportion="1.464991">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/AtomGenerator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="6" selection-start="1975" selection-end="1975" vertical-scroll-proportion="0.8330341">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/FeedGenerationException.java">
<provider selected="true" editor-type-id="text-editor">
<state line="42" column="6" selection-start="1842" selection-end="1842" vertical-scroll-proportion="0.33213645">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/FeedGenerator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="56" column="6" selection-start="2305" selection-end="2305" vertical-scroll-proportion="1.1310593">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/FeedGeneratorFactory.java">
<provider selected="true" editor-type-id="text-editor">
<state line="41" column="6" selection-start="1704" selection-end="1704" vertical-scroll-proportion="0.33213645">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/GoogleResultsWrapper.java">
<provider selected="true" editor-type-id="text-editor">
<state line="33" column="0" selection-start="1616" selection-end="1616" vertical-scroll-proportion="0.9389587">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/GoogleResultsWrapperItem.java">
<provider selected="true" editor-type-id="text-editor">
<state line="33" column="0" selection-start="1616" selection-end="1616" vertical-scroll-proportion="0.49371633">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/LICENSE.txt">
<provider selected="true" editor-type-id="text-editor">
<state line="2" column="19" selection-start="51" selection-end="51" vertical-scroll-proportion="0.055829227">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.txt">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/clevercactus/google/taglibs/SearchResults.java">
<provider selected="true" editor-type-id="text-editor">
<state line="40" column="26" selection-start="1769" selection-end="1769" vertical-scroll-proportion="-0.055555556">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View file

@ -0,0 +1,30 @@
Google RSS Tag Library License
Copyright (c) 2003-2004, clevercactus ltd.
Copyright (c) 2003-2004, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of the author nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1,71 @@
Google RSS Tag Library README
=============================
Overview
========
This README file describes the Google RSS Tag Library distribution.
The Google RSS Tag Library is an extension to, and thus requires,
the Google Tag Library, which can be found at:
<http://google-taglib.sourceforge.net/>
See the "LICENSE.txt" file for licensing details.
The Google RSS Tag Library uses the Google Web APIs, but is not associated
with or sponsored by Google, Inc.
Installation
============
The Google RSS Tag Library requires a JSP (1.1 or higher) container, such
as Tomcat.
To use the Google RSS Tag Library, simply copy the library's JAR file
(google-rss.jar) to your application's WEB-INF/lib directory. The Tag Library
Descriptor (google-rss.tld) should be placed in your application's WEB-INF
directory.
You should also modify your web application deployment descriptor (web.xml)
file to map the Google RSS Tag Library TLD URI to its location:
<taglib>
<taglib-uri>/google-rss-taglib</taglib-uri>
<taglib-location>/WEB-INF/google-rss.tld</taglib-location>
</taglib>
TagLib Directive
================
Using the Google RSS Tag Library is easy; you simply need to import it into
your JSP pages using the taglib directive. For instance, you would include
the following line at the top of your JSP page:
<%@taglib uri="/google-rss-taglib" prefix="rss"%>
SearchResults Tag
=================
The <rss:searchResults/> tag is used to display the search results returned
by a Google search (performed using the Google Tag Library) in RSS format.
For example:
<%@ page contentType="text/xml" %>
<%@ taglib uri="/google-taglib" prefix="google" %>
<%@ taglib uri="/google-rss-taglib" prefix="rss" %>
<google:search>my search query</google:search>
<rss:searchResults>
Please refer to the Google Tag Library documentation for detailed information
on performing searches.
===========================================================================
$Id$

View file

@ -0,0 +1,27 @@
# Version
version=1.0
# Project
project.name=google-rss
release.name=${project.name}-taglib-${version}
# Locations
src.dir=src
build.dir=build
dist.dir=dist
lib.dir=../lib
tlds.dir=tlds
# Google
google.jar=../dist/google.jar
google.tld=../dist/google.tld
# Examples
ex.dir=${project.name}-examples
# Source
src.excludes=${lib.dir}/googleapi.jar
# Docs
doc.license=LICENSE.txt
doc.readme=README.txt

112
google-taglib/rss/build.xml Normal file
View file

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="google-rss" default="jar" basedir=".">
<description>Google RSS Tag Library</description>
<!-- Load the properties -->
<property file="build.properties"/>
<!-- Build Locations -->
<property name="build.library" value="${build.dir}/${project.name}"/>
<property name="build.ex" value="${build.dir}/${ex.dir}"/>
<property name="build.release" value="${build.dir}/${release.name}"/>
<!-- Jar excludes directories and files -->
<patternset id="jar.excludes">
<exclude name="**/*.java"/>
<exclude name="**/*.xml"/>
<exclude name="**/*.html"/>
<exclude name="**/.dependency-info/**"/>
</patternset>
<!-- Classpath -->
<path id="classpath">
<pathelement location="."/>
<pathelement location="${google.jar}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<!-- Prepare target -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<!-- Compile target -->
<target name="compile" depends="prepare" description="Compiles sources">
<mkdir dir="${build.library}"/>
<javac srcdir="${src.dir}" destdir="${build.library}" target="1.2">
<classpath refid="classpath"/>
</javac>
</target>
<!-- JAR target -->
<target name="jar" depends="compile" description="Builds the JAR">
<!-- Create the JAR -->
<jar jarfile="${dist.dir}/${project.name}.jar">
<fileset dir="${build.library}">
<patternset refid="jar.excludes"/>
</fileset>
</jar>
</target>
<!-- TLD target -->
<target name="tld" description="Builds the TLD">
<!-- Copy the TLDs -->
<filter token="version" value="${version}"/>
<copy file="${tlds.dir}/${project.name}.tld" todir="${dist.dir}" filtering="true"/>
</target>
<!-- Release target -->
<target name="release" depends="jar,tld" description="Builds the release archives">
<mkdir dir="${build.release}"/>
<!-- Copy the TLD -->
<filter token="version" value="${version}"/>
<copy file="${tlds.dir}/${project.name}.tld" todir="${build.release}" filtering="true"/>
<!-- Copy the readme -->
<copy file="${doc.readme}" todir="${build.release}"/>
<!-- Copy the license -->
<copy file="${doc.license}" todir="${build.release}"/>
<!-- Copy the JAR -->
<copy file="${dist.dir}/${project.name}.jar" todir="${build.release}"/>
<!-- Freeze the mod dates -->
<touch>
<fileset dir="${build.release}"/>
</touch>
<!-- Create the ZIP archive -->
<zip destfile="${dist.dir}/${release.name}.zip" basedir="${build.dir}" includes="${release.name}/**"/>
<!-- Create the TAR archive -->
<tar tarfile="${dist.dir}/${release.name}.tar.gz" compression="gzip">
<tarfileset dir="${build.release}" prefix="${release.name}" mode="644"/>
</tar>
</target>
<!-- Examples target -->
<target name="examples" depends="jar,tld" description="Builds the Examples WAR">
<!-- Copy the WAR dir -->
<copy todir="${build.ex}">
<fileset dir="${ex.dir}"/>
</copy>
<!-- Copy the TLD -->
<copy file="${dist.dir}/${project.name}.tld" todir="${build.ex}/WEB-INF"/>
<!-- Copy the license -->
<copy file="${doc.license}" todir="${build.ex}"/>
<!-- Copy the JAR -->
<copy file="${dist.dir}/${project.name}.jar" todir="${build.ex}/WEB-INF/lib/"/>
<!-- Copy the Google JAR -->
<copy file="${google.jar}" todir="${build.ex}/WEB-INF/lib/"/>
<!-- Copy the Google TLD -->
<copy file="${google.tld}" todir="${build.ex}/WEB-INF/"/>
<!-- Freeze the mod dates -->
<touch>
<fileset dir="${build.ex}"/>
</touch>
<!-- Create the web archive -->
<jar jarfile="${dist.dir}/${ex.dir}-${version}.war" basedir="${build.ex}"/>
</target>
<!-- Clean Build target -->
<target name="clean-build" description="Cleans the build directory">
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${build.dir}" includes="*,*/**"/>
</delete>
<mkdir dir="${build.library}"/>
</target>
<!-- Clean target -->
<target name="clean" depends="clean-build" description="Cleans the build and dist directories">
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${dist.dir}" includes="*,*/**"/>
</delete>
</target>
</project>

View file

@ -0,0 +1,66 @@
Google RSS Tag Library Examples README
======================================
Overview
========
This README file describes the Google RSS Tag Library Examples web
application.
This web application contains a collection of examples demonstrating the
usage of the Google JSP RSS Tag Library. For more information about using
the custom tag library in your own web applications, please refer to the
Google RSS Tag Library documentation.
The Google RSS Tag Library is an extension to the Google Tag Library, which
can be found at:
<http://google-taglib.sourceforge.net/>
See the "LICENSE.txt" file for licensing details.
The Google RSS Tag Library uses the Google Web APIs, but is not associated
with or sponsored by Google, Inc.
Google Web APIs
===============
The Google Web APIs Java library is required in order to use the Examples web
application. The library's JAR file (googleapi.jar) should be placed into the
application's WEB-INF/lib directory.
http://www.google.com/apis/download.html
You must also register with Google (free) in order to obtain a license key.
The license key is required to access Google's Web Services.
https://www.google.com/accounts/NewAccount
Google License Key
==================
The license key can be specified as a context parameter in the web
application deployment descriptor (web.xml) as follows:
<context-param>
<param-name>google_key</param-name>
<param-value>000000000000000000000000</param-value>
</context-param>
The license key can also be temporarily specified from the index page of
the web application.
Examples
========
The following example is included:
- Perform a simple Google RSS search
===========================================================================
$Id$

View file

@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>google-rss-examples</display-name>
<description>Google RSS Examples Web Application</description>
<context-param>
<param-name>google_key</param-name>
<param-value/>
<description>The Google Web APIs client authorization key.</description>
</context-param>
<context-param>
<param-name>google_proxy_host</param-name>
<param-value/>
<description>The host to use as an HTTP proxy.</description>
</context-param>
<context-param>
<param-name>google_proxy_port</param-name>
<param-value/>
<description>The port to use as an HTTP proxy.</description>
</context-param>
<context-param>
<param-name>google_proxy_username</param-name>
<param-value/>
<description>The username required for the HTTP proxy.</description>
</context-param>
<context-param>
<param-name>google_proxy_password</param-name>
<param-value/>
<description>The password required for the HTTP proxy.</description>
</context-param>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>/google-taglib</taglib-uri>
<taglib-location>/WEB-INF/google.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/google-rss-taglib</taglib-uri>
<taglib-location>/WEB-INF/google-rss.tld</taglib-location>
</taglib>
</web-app>

View file

@ -0,0 +1,71 @@
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Google RSS Tag Library Examples</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {font-family:arial,sans-serif}
-->
</style>
</head>
<!--
Copyright (c) 2003-2004, Erik C. Thauvin
All rights reserved.
-->
<body bgcolor="#FFFFFF" text="#000000">
<b><font size="+2">Google RSS Tag Library Examples</font></b>
<p>
This is a collection of examples demonstrating the usage of the <a href="http://google-taglib.sourceforge.net">Google RSS JSP Tag Library</a>.
</p>
<p>
The Google RSS Tag Library is an extension to the <a href="http://google-taglib.sourceforge.net">Google Tag Library</a>.
</p>
<p>
The Google Web APIs Java library is required in order to use the Google RSS Tag
Library. The library's JAR file (<code>googleapi.jar</code>) should be placed
into the application's <code>WEB-INF/lib</code> directory.
</p>
<ul>
<li>
<a href="http://www.google.com/apis/download.html"><b>Download the Google Web
APIs developer's kit</b></a>
</li>
</ul>
<p>
You must also register with Google (free) in order to obtain a license key. The
license key is required to access Google's Web Services.
</p>
<ul>
<li>
<a href="https://www.google.com/accounts/NewAccount"><b>Sign up for a Google
account</b></a>
</ul>
<p>
The license key can be specified as a context parameter in the web application
deployment descriptor (<code>web.xml</code>) as follows:
</p>
<blockquote>
<pre>&lt;context-param&gt;<br> &lt;param-name&gt;google_key&lt;/param-name&gt;<br> &lt;param-value&gt;000000000000000000000000&lt;/param-value&gt;<br>&lt;/context-param&gt;</pre>
</blockquote>
<p>
The license key can also be temporarily specified using the following:
</p>
<ul>
<li>
<a href="key.html"><b>Set the Google Web APIs license key</b></a>
</li>
</ul>
<p>
The included examples will allow you to:
</p>
<ul>
<li> <a href="search.html"><b>Perform a simple Google RSS search</b></a></li>
</ul>
<p>&nbsp;</p>
<p>
<small>The Google RSS Tag Library uses the Google Web APIs, but is not associated with or sponsored by Google, Inc.<br>
Click <a href="LICENSE.txt">here</a> for licensing information.</small>
</p>
</body>
</html>

View file

@ -0,0 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Set Google Key</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<!--
Copyright (c) 2002-2004, Erik C. Thauvin
All rights reserved.
-->
<body bgcolor="#FFFFFF" text="#000000">
<form action="key.jsp" method="post">
<input size="35" name="key" value="">&nbsp;<input type="submit" value="Set Google Key" name="btnG">
</form>
</body>
</html>

View file

@ -0,0 +1,21 @@
<%
// Copyright (c) 2002-2004, Erik C. Thauvin
// All rights reserved.
String key = request.getParameter("key");
if ((key != null)&& (key.trim().length() > 0))
{
pageContext.setAttribute("google_key", key, PageContext.APPLICATION_SCOPE);
%>
<%@include file="search.html"%>
<%
}
else
{
%>
<%@include file="key.html"%>
<%
}
%>

View file

@ -0,0 +1 @@
<%@ page contentType="text/xml" %><%@ taglib uri="/google-taglib" prefix="google" %><%@ taglib uri="/google-rss-taglib" prefix="rss" %><google:search/><rss:searchResults/>

View file

@ -0,0 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Search Google</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<!--
Copyright (c) 2002-2004, Erik C. Thauvin
All rights reserved.
-->
<body bgcolor="#FFFFFF" text="#000000">
<form action="rss.jsp" method="get">
<input type="hidden" name="maxResults" value="5"><input maxLength="255" size="35" name="q" value="">&nbsp;<input type="submit" value="Google RSS Search" name="btnG">
</form>
</body>
</html>

View file

@ -0,0 +1,222 @@
/*
* Copyright (c) 2003-2004 clevercactus ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.clevercactus.google;
import org.xml.sax.SAXException;
import java.io.PrintWriter;
import java.util.Date;
/**
* A class that uses JAXP and SAX to print an SearchResults 2.0 feed to a PrintWriter.
* Output of the SearchResults happens as data is added. See the main() method for a
* simple usage example.
*
* @version 1.0, 29/08/2003
* @author Diego Doval
*/
public
class AtomGenerator
extends FeedGenerator
{
/**
* The one and only constructor.
*/
public
AtomGenerator()
{
}
/**
* Prints a valid SearchResults 2.0 header based on the information passed.
*
* @param title feed title
* @param link feed link
* @param description feed description
* @param author feed author (must be an email address)
* @param lastBuildDate the date the feed was built
* @throws FeedGenerationException
*/
public
void
printHeader(String title, String link, String description, String author, Date lastBuildDate)
throws FeedGenerationException
{
try {
String language = "en-us";
String generatorName = "clevercactus atom generator 1.0";
String generatorURL = "http://www.clevercactus.com/google/";
String copyright = "Copyright (c) 2003-2004 clevercactus ltd.";
String authorName = "Diego Doval";
feedAttributes_d.clear();
feedAttributes_d.addAttribute("", "", "version", "", "0.2");
feedAttributes_d.addAttribute("", "", "xmlns", "", "http://purl.org/atom/ns#");
feedAttributes_d.addAttribute("", "", "xml:lang", "", "en");
transformerHandler_d.startElement("","","feed",feedAttributes_d);
feedAttributes_d.clear();
transformerHandler_d.startElement("","","author",feedAttributes_d);
transformerHandler_d.startElement("","","name",feedAttributes_d);
transformerHandler_d.characters(authorName.toCharArray(),0,authorName.length());
transformerHandler_d.endElement("","","name");
transformerHandler_d.endElement("","","author");
feedAttributes_d.clear();
transformerHandler_d.startElement("","","title",feedAttributes_d);
transformerHandler_d.characters(title.toCharArray(),0,title.length());
transformerHandler_d.endElement("","","title");
transformerHandler_d.startElement("","","link",feedAttributes_d);
transformerHandler_d.characters(link.toCharArray(),0,link.length());
transformerHandler_d.endElement("","","link");
transformerHandler_d.startElement("","","tagline", feedAttributes_d);
transformerHandler_d.characters(description.toCharArray(),0,description.length());
transformerHandler_d.endElement("","","tagline");
transformerHandler_d.startElement("","","modified",elementAttributes_d);
String dtString = getAsISO8601String(lastBuildDate);
transformerHandler_d.characters(dtString.toCharArray(),0,dtString.length());
transformerHandler_d.endElement("","","modified");
feedAttributes_d.addAttribute("", "", "name", "", generatorName);
transformerHandler_d.startElement("","","generator", feedAttributes_d);
transformerHandler_d.characters(generatorURL.toCharArray(),0, generatorURL.length());
transformerHandler_d.endElement("","","generator");
feedAttributes_d.clear();
transformerHandler_d.startElement("","","copyright", feedAttributes_d);
transformerHandler_d.characters(copyright.toCharArray(),0,copyright.length());
transformerHandler_d.endElement("","","copyright");
}
catch (SAXException e) {
throw new FeedGenerationException(e);
}
}
/**
* Prints a valid SearchResults 2.0 item based on the information passed.
*
* @param title the entry title
* @param description the entry body/description
* @param link the entry's GUID
* @param date the entry publication date
* @throws FeedGenerationException
*/
public
void
printItem(String title, String description, String link, Date date)
throws FeedGenerationException
{
try {
elementAttributes_d.clear();
transformerHandler_d.startElement("","","entry",elementAttributes_d);
transformerHandler_d.startElement("","","title",elementAttributes_d);
transformerHandler_d.characters(title.toCharArray(),0,title.length());
transformerHandler_d.endElement("","","title");
transformerHandler_d.startElement("","","issued",elementAttributes_d);
String dtString = getAsISO8601String(date);
transformerHandler_d.characters(dtString.toCharArray(),0,dtString.length());
transformerHandler_d.endElement("","","issued");
transformerHandler_d.startElement("","","modified",elementAttributes_d);
transformerHandler_d.characters(dtString.toCharArray(),0,dtString.length());
transformerHandler_d.endElement("","","modified");
transformerHandler_d.startElement("","","created",elementAttributes_d);
transformerHandler_d.characters(dtString.toCharArray(),0,dtString.length());
transformerHandler_d.endElement("","","created");
transformerHandler_d.startElement("","","link",elementAttributes_d);
transformerHandler_d.characters(link.toCharArray(),0,link.length());
transformerHandler_d.endElement("","","link");
transformerHandler_d.startElement("","","id",elementAttributes_d);
transformerHandler_d.characters(link.toCharArray(),0,link.length());
transformerHandler_d.endElement("","","id");
elementAttributes_d.clear();
elementAttributes_d.addAttribute("", "", "type", "", "text/html");
elementAttributes_d.addAttribute("", "", "mode", "", "escaped");
elementAttributes_d.addAttribute("", "", "xml:lang", "", "en");
transformerHandler_d.startElement("","","content",elementAttributes_d);
transformerHandler_d.startCDATA();
transformerHandler_d.characters(description.toCharArray(),0,description.length());
transformerHandler_d.endCDATA();
transformerHandler_d.endElement("","","content");
transformerHandler_d.endElement("","","entry");
}
catch (SAXException e) {
throw new FeedGenerationException(e);
}
}
/**
* Closes the feed's main elements (i.e., "rss" and "channel").
* @throws FeedGenerationException
*/
public
void
close()
throws FeedGenerationException
{
try {
transformerHandler_d.endElement("","","feed");
transformerHandler_d.endDocument();
}
catch (SAXException e) {
throw new FeedGenerationException(e);
}
}
/**
* Simple test to generate a 2.0 feed.
*/
public static
void
main(String[] args)
{
try {
AtomGenerator gen = new AtomGenerator();
gen.init(new PrintWriter(System.out));
gen.printHeader("Test feed", "http://something/", "test feed desc", "test@test.com", new Date());
gen.printItem("Item title 1", "Item <b>desc</b> 1", "http://guid/1234", new Date());
gen.printItem("Item title 2", "Item <b>desc</b> 2", "http://guid/12342", new Date());
gen.close();
}
catch (FeedGenerationException e) {
e.printStackTrace();
}
}
}

View file

@ -0,0 +1,68 @@
/*
* Copyright (c) 2003-2004 clevercactus ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.clevercactus.google;
/**
* Used to simplify exception handling in the RSSGenerator class. Internal
* Exceptions in that class will be wrapped in an FeedGenerationException.
*
* @version 1.0, 29/08/2003
* @author Diego Doval
*/
public
class FeedGenerationException
extends Exception
{
public
FeedGenerationException()
{
}
public
FeedGenerationException(Throwable cause)
{
super(cause);
}
public
FeedGenerationException(String message)
{
super(message);
}
public
FeedGenerationException(String message, Throwable cause)
{
super(message, cause);
}
}

View file

@ -0,0 +1,172 @@
/*
* Copyright (c) 2003-2004 clevercactus ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.clevercactus.google;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.SAXException;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.Transformer;
import javax.xml.transform.OutputKeys;
import java.io.Writer;
import java.util.Date;
import java.util.Locale;
import java.text.SimpleDateFormat;
/**
* A class that uses JAXP and SAX to print an feed to a PrintWriter.
* Output of the actual happens as data is added on the subclass. See the main() method for a
* simple usage example.
*
* @version 1.0, 29/08/2003
* @author Diego Doval
*/
public abstract
class FeedGenerator
{
protected Writer output_d;
protected StreamResult streamResult_d;
protected TransformerHandler transformerHandler_d;
protected SAXTransformerFactory saxTransformerFactory_d;
protected AttributesImpl elementAttributes_d;
protected AttributesImpl feedAttributes_d;
public static SimpleDateFormat iso8601DateFormat_sd = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
public static SimpleDateFormat rfc822DateFormat_sd = new SimpleDateFormat("EEE', 'dd' 'MMM' 'yy' 'HH:mm:ss' 'z", Locale.US);
/**
* The one and only constructor.
*/
public
FeedGenerator()
{
}
/**
* @param output writer to use for outputting the SearchResults
* @throws FeedGenerationException
*/
public
void
init(Writer output)
throws FeedGenerationException
{
output_d = output;
streamResult_d = new StreamResult(output_d);
feedAttributes_d = new AttributesImpl();
elementAttributes_d = new AttributesImpl();
try {
saxTransformerFactory_d = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
transformerHandler_d = saxTransformerFactory_d.newTransformerHandler();
Transformer trans = transformerHandler_d.getTransformer();
trans.setOutputProperty(OutputKeys.ENCODING,"ISO-8859-1");
trans.setOutputProperty(OutputKeys.INDENT,"yes");
transformerHandler_d.setResult(streamResult_d);
transformerHandler_d.startDocument();
}
catch (Exception e) {
throw new FeedGenerationException(e);
}
}
/**
* Prints a valid header based on the information passed.
*
* @param title feed title
* @param link feed link
* @param description feed description
* @param author feed author (must be an email address)
* @param lastBuildDate the date the feed was built
* @throws FeedGenerationException
*/
public abstract
void
printHeader(String title, String link, String description, String author, Date lastBuildDate)
throws FeedGenerationException;
/**
* Prints a valid SearchResults 2.0 item based on the information passed.
*
* @param title the entry title
* @param description the entry body/description
* @param link the entry's GUID
* @param date the entry publication date
* @throws FeedGenerationException
*/
public abstract
void
printItem(String title, String description, String link, Date date)
throws FeedGenerationException;
/**
* Closes the feed's main elements
* @throws FeedGenerationException
*/
public abstract
void
close()
throws FeedGenerationException;
/**
* Utility method to obtain a date in a string in RFC 822 date format
*
* @param date the date to
* @return a string with the date in RFC 822 format
*/
public final
String
getAsISO8601String(Date date)
{
String result = iso8601DateFormat_sd.format(date);
//convert 20030509T00:32:35+0100 returned by Java into 20030509T00:32:35+01:00
//from the spec <dateTime.iso8601> date/time 19980717T14:08:55
result = result.substring(0, result.length()-2) + ":" + result.substring(result.length()-2);
return result;
}
/**
* Utility method to obtain a date in a string in RFC 822 date format
*
* @param date the date to
* @return a string with the date in RFC 822 format
*/
public final
String
getAsRFC822String(Date date)
{
return rfc822DateFormat_sd.format(date);
}
}

View file

@ -0,0 +1,84 @@
/*
* Copyright (c) 2003-2004 clevercactus ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.clevercactus.google;
import java.util.HashMap;
/**
* Date: 05-Sep-2003
* Time: 20:41:19
*/
public
class FeedGeneratorFactory
{
public static HashMap feedTypes_sd = new HashMap();
public static final String FEED_TYPE_RSS = "rss";
public static final String FEED_TYPE_ATOM = "atom";
static {
addGenerator(FEED_TYPE_RSS, RSSGenerator.class);
addGenerator(FEED_TYPE_ATOM, AtomGenerator.class);
}
public static
boolean
supportsFormat(String type)
{
return type != null && (type.equals(FEED_TYPE_RSS) || type.equals(FEED_TYPE_ATOM));
}
public static
void
addGenerator(String type, Class cls)
{
feedTypes_sd.put(type, cls);
}
public static
FeedGenerator
getGeneratorForType(String type)
{
Class cls = (Class) feedTypes_sd.get(type);
try {
return (FeedGenerator) cls.newInstance();
}
catch (InstantiationException e) {
e.printStackTrace();
}
catch (IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
}

View file

@ -0,0 +1,174 @@
/*
* Copyright (c) 2003-2004 clevercactus ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.clevercactus.google;
import com.google.soap.search.GoogleSearchResultElement;
import java.io.Writer;
import java.io.IOException;
import java.util.Iterator;
import java.util.Date;
import java.util.ArrayList;
/**
* Date: 30-Oct-2003
* Time: 13:41:41
* @author Diego Doval
* @author Erik C. Thauvin
*/
public
class GoogleResultsWrapper
{
ArrayList items_d = new ArrayList();
private
GoogleResultsWrapper()
{
}
private
Iterator
iterator()
{
return items_d.iterator();
}
private
void
addItem(GoogleResultsWrapperItem it)
{
items_d.add(it);
}
private static
GoogleResultsWrapper
createWrapper(GoogleSearchResultElement[] elements)
{
if (elements == null || elements.length == 0) {
return null;
}
GoogleResultsWrapper wrapper = new GoogleResultsWrapper();
for (int i = 0; i < elements.length; i++) {
GoogleSearchResultElement element = elements[i];
wrapper.addItem(new GoogleResultsWrapperItem(element.getTitle(), element.getURL(), element.getSnippet()));
}
return wrapper;
}
/**
* Output the results to a writer.
*
* @param out the writer to use
* @param elements the search result elements
* @param query the search query
* @param feedType the type of feed to use (options are "rss" and "atom")
*/
public static
void
outputResults(Writer out, GoogleSearchResultElement[] elements, String query, String feedType)
{
outputResults(out, createWrapper(elements), query, feedType);
}
/**
* Output the results to a writer.
*
* @param out the writer to use
* @param wrapper the results object obtained from the parsing of results
* @param query the search query
* @param feedType the type of feed to use (options are "rss" and "atom")
*/
private static
void
outputResults(Writer out, GoogleResultsWrapper wrapper, String query, String feedType)
{
try {
if (out == null || feedType == null) {
try {
out.write("Null parameter in output results.\n");
}
catch (IOException e1) {
}
return;
}
if (!feedType.equals(FeedGeneratorFactory.FEED_TYPE_RSS)
&& !feedType.equals(FeedGeneratorFactory.FEED_TYPE_ATOM)) {
try {
out.write("Invalid feed type ("+feedType+"). Supported types are 'rss' and 'atom'.\n");
}
catch (IOException e1) {
}
return;
}
try {
FeedGenerator gen = FeedGeneratorFactory.getGeneratorForType(feedType);
gen.init(out);
Date date = new Date();
String description;
if ((query == null) || (query.trim().length() == 0)) {
description = "Google Tag Library";
} else {
description = "Search results for: \"" + query + '"';
}
gen.printHeader("Google Search Feed Output", "http://google-taglib.sourceforge.net/", description, "check@page.for.info", date);
if (wrapper != null) {
Iterator items = wrapper.iterator();
while (items.hasNext()) {
GoogleResultsWrapperItem item = (GoogleResultsWrapperItem) items.next();
gen.printItem(item.getTitle(), item.getSnippet(), item.getURL(), date);
}
}
gen.close();
}
catch (FeedGenerationException e) {
try {
out.write("Error.\n");
out.write(e.getMessage());
}
catch (IOException e1) {
}
}
}
finally {
try {
out.close();
}
catch (IOException e) {
}
}
}
}

View file

@ -0,0 +1,82 @@
/*
* Copyright (c) 2003-2004 clevercactus ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.clevercactus.google;
/**
* Date: 30-Oct-2003
* Time: 13:51:43
* @author Diego Doval
*/
public
class GoogleResultsWrapperItem
{
String title_d;
String text_d;
String url_d;
public
GoogleResultsWrapperItem(String title, String url, String text)
{
title_d = title;
url_d = url;
text_d = text;
}
public
String
getTitle()
{
return title_d;
}
public
String
getSnippet()
{
return text_d;
}
public
String
getURL()
{
return url_d;
}
public
String
toString()
{
return "Title: "+title_d+"\nURL:"+url_d+"\nText:"+text_d+"\n";
}
}

View file

@ -0,0 +1,198 @@
/*
* Copyright (c) 2003-2004 clevercactus ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.clevercactus.google;
import org.xml.sax.SAXException;
import java.io.PrintWriter;
import java.util.Date;
/**
* A class that uses JAXP and SAX to print an SearchResults 2.0 feed to a PrintWriter.
* Output of the SearchResults happens as data is added. See the main() method for a
* simple usage example.
*
* @version 1.0, 29/08/2003
* @author Diego Doval
*/
public
class RSSGenerator
extends FeedGenerator
{
/**
* The one and only constructor.
*/
public
RSSGenerator()
{
}
/**
* Prints a valid SearchResults 2.0 header based on the information passed.
*
* @param title feed title
* @param link feed link
* @param description feed description
* @param author feed author (must be an email address)
* @param lastBuildDate the date the feed was built
* @throws FeedGenerationException
*/
public
void
printHeader(String title, String link, String description, String author, Date lastBuildDate)
throws FeedGenerationException
{
try {
String language = "en-us";
String generator = "clevercactus rss generator 1.0";
feedAttributes_d.clear();
feedAttributes_d.addAttribute("", "", "version", "", "2.0");
transformerHandler_d.startElement("","","rss",feedAttributes_d);
feedAttributes_d.clear();
transformerHandler_d.startElement("","","channel",feedAttributes_d);
transformerHandler_d.startElement("","","title",feedAttributes_d);
transformerHandler_d.characters(title.toCharArray(),0,title.length());
transformerHandler_d.endElement("","","title");
transformerHandler_d.startElement("","","link",feedAttributes_d);
transformerHandler_d.characters(link.toCharArray(),0,link.length());
transformerHandler_d.endElement("","","link");
transformerHandler_d.startElement("","","description", feedAttributes_d);
transformerHandler_d.characters(description.toCharArray(),0,description.length());
transformerHandler_d.endElement("","","description");
transformerHandler_d.startElement("","","language", feedAttributes_d);
transformerHandler_d.characters(language.toCharArray(),0,language.length());
transformerHandler_d.endElement("","","language");
transformerHandler_d.startElement("","","lastBuildDate",elementAttributes_d);
String dtString = getAsRFC822String(lastBuildDate);
transformerHandler_d.characters(dtString.toCharArray(),0,dtString.length());
transformerHandler_d.endElement("","","lastBuildDate");
transformerHandler_d.startElement("","","generator", feedAttributes_d);
transformerHandler_d.characters(generator.toCharArray(),0,generator.length());
transformerHandler_d.endElement("","","generator");
transformerHandler_d.startElement("","","managingEditor", feedAttributes_d);
transformerHandler_d.characters(author.toCharArray(),0,author.length());
transformerHandler_d.endElement("","","managingEditor");
transformerHandler_d.startElement("","","webMaster", feedAttributes_d);
transformerHandler_d.characters(author.toCharArray(),0,author.length());
transformerHandler_d.endElement("","","webMaster");
}
catch (SAXException e) {
throw new FeedGenerationException(e);
}
}
/**
* Prints a valid SearchResults 2.0 item based on the information passed.
*
* @param title the entry title
* @param description the entry body/description
* @param link the entry's GUID
* @param date the entry publication date
* @throws FeedGenerationException
*/
public
void
printItem(String title, String description, String link, Date date)
throws FeedGenerationException
{
try {
elementAttributes_d.clear();
transformerHandler_d.startElement("","","item",elementAttributes_d);
elementAttributes_d.clear();
transformerHandler_d.startElement("","","title",elementAttributes_d);
transformerHandler_d.characters(title.toCharArray(),0,title.length());
transformerHandler_d.endElement("","","title");
elementAttributes_d.clear();
transformerHandler_d.startElement("","","description",elementAttributes_d);
transformerHandler_d.characters(description.toCharArray(),0,description.length());
transformerHandler_d.endElement("","","description");
elementAttributes_d.clear();
transformerHandler_d.startElement("","","pubDate",elementAttributes_d);
String dtString = getAsRFC822String(date);
transformerHandler_d.characters(dtString.toCharArray(),0,dtString.length());
transformerHandler_d.endElement("","","pubDate");
elementAttributes_d.clear();
transformerHandler_d.startElement("","","link",elementAttributes_d);
transformerHandler_d.characters(link.toCharArray(),0,link.length());
transformerHandler_d.endElement("","","link");
transformerHandler_d.endElement("","","item");
}
catch (SAXException e) {
throw new FeedGenerationException(e);
}
}
/**
* Closes the feed's main elements (i.e., "rss" and "channel").
* @throws FeedGenerationException
*/
public
void
close()
throws FeedGenerationException
{
try {
transformerHandler_d.endElement("","","channel");
transformerHandler_d.endElement("","","rss");
transformerHandler_d.endDocument();
}
catch (SAXException e) {
throw new FeedGenerationException(e);
}
}
/**
* Simple test to generate a 2.0 feed.
*/
public static
void
main(String[] args)
{
try {
RSSGenerator gen = new RSSGenerator();
gen.init(new PrintWriter(System.out));
gen.printHeader("Test feed", "http://something/", "test feed desc", "test@test.com", new Date());
gen.printItem("Item title 1", "Item desc 1", "guid", new Date());
gen.printItem("Item title 2", "Item desc 2", "guid", new Date());
gen.close();
}
catch (FeedGenerationException e) {
e.printStackTrace();
}
}
}

View file

@ -0,0 +1,132 @@
/*
* @(#)SearchResults.java
*
* Copyright (c) 2003-2004, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
package com.clevercactus.google.taglibs;
import com.clevercactus.google.GoogleResultsWrapper;
import net.thauvin.google.GoogleSearchBean;
import net.thauvin.google.TagUtility;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
/**
* A custom tag used to display Google search results in RSS format.
*
* @author Erik C. Thauvin
* @version $Revision$, $Date$
*
* @created Oct 30, 2003
* @since 1.0
*/
public class SearchResults extends BodyTagSupport
{
/**
* The Google search bean.
*/
protected GoogleSearchBean bean = null;
/**
* doEndTag method.
*
* @return EVAL_PAGE
*
* @throws JspException
*/
public int doEndTag() throws JspException
{
try
{
// Is the result valid?
if (bean != null)
{
// Output the feed
GoogleResultsWrapper.outputResults(pageContext.getOut(),
bean.getResultElements(),
bean.getResultProperty("searchKeywords"),
"rss");
}
}
catch (Exception e)
{
throw TagUtility.outputError("rss", e);
}
// Reset the values
reset();
return EVAL_PAGE;
}
/**
* doStartTag method.
*
* @return SKIP_BODY.
*
* @throws JspException
*/
public int doStartTag() throws JspException
{
// Get the Google bean
bean = TagUtility.getGoogleSearchBean(pageContext);
return SKIP_BODY;
}
/**
* Release method.
*/
public void release()
{
super.release();
// Reset the bean
bean = null;
// Reset the values
reset();
}
/**
* Reset the values.
*/
protected void reset()
{
// super.reset();
}
}

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<!-- Tag library descriptor -->
<taglib>
<!-- The version number of this tag library -->
<tlibversion>@version@</tlibversion>
<!-- The JSP specification version required to function -->
<jspversion>1.1</jspversion>
<!-- The short name of this tag library -->
<shortname>google-rss</shortname>
<!-- Public URI that uniquely identifies this version of the tag library -->
<uri>http://www.thauvin.net/taglibs/google-rss-taglib-@version@</uri>
<!-- General information about this tag library -->
<info>The Google RSS Tag Library.</info>
<!-- SearchResults Tag -->
<tag>
<name>searchResults</name>
<tagclass>com.clevercactus.google.taglibs.SearchResults</tagclass>
<bodycontent>empty</bodycontent>
<info>Displays Google search results in RSS format.</info>
</tag>
</taglib>