tomailer-commit Mailing List for tomailer
Status: Beta
Brought to you by:
dbrosius
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(75) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <dbr...@us...> - 2010-06-09 06:12:39
|
Revision: 93
http://tomailer.svn.sourceforge.net/tomailer/?rev=93&view=rev
Author: dbrosius
Date: 2010-06-09 06:12:32 +0000 (Wed, 09 Jun 2010)
Log Message:
-----------
warnings
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2010-06-07 02:58:14 UTC (rev 92)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2010-06-09 06:12:32 UTC (rev 93)
@@ -31,7 +31,7 @@
/**
* the different types of selectors
*/
- enum SelectorType { Id, Class, Path, Name };
+ enum SelectorType { Id, Class, Path, Name }
/**
* the main interface method of the comparator
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2010-06-07 02:58:14 UTC (rev 92)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2010-06-09 06:12:32 UTC (rev 93)
@@ -83,16 +83,11 @@
ServletFileUpload upload = new ServletFileUpload();
String webUrl = null;
- boolean useFile = true;
FileItemIterator iter = upload.getItemIterator(request);
while (iter.hasNext()) {
FileItemStream item = iter.next();
String name = item.getFieldName();
- if (name.equals("usefile")) {
- useFile = true;
- } else if (name.equals("useurl")) {
- useFile = false;
- } else if (name.equals("webpage")) {
+ if (name.equals("webpage")) {
is = item.openStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtils.copy(is, baos);
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java 2010-06-07 02:58:14 UTC (rev 92)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java 2010-06-09 06:12:32 UTC (rev 93)
@@ -53,7 +53,7 @@
private DocumentBuilderFactory dbf;
private XPathFactory xpf;
private TransformerFactory tf;
- private CssParser parser = new CssParser();
+ private final CssParser parser = new CssParser();
/**
* constructs the delegate and orchestrates the conversion of the page
@@ -161,7 +161,7 @@
IOUtils.copy(is, baos);
parser.add(new String(baos.toByteArray(), "UTF-8"));
- Element linkNode = (Element)a.getOwnerElement();
+ Element linkNode = a.getOwnerElement();
Element parent = (Element)linkNode.getParentNode();
parent.removeChild(linkNode);
IOUtils.closeQuietly(is);
@@ -231,7 +231,7 @@
default:
path.append("/").append(selPath);
if (lastPath) {
- path.append("[not(@class) or (@class!='").append(PROCESSED_CLASS).append("')]");;
+ path.append("[not(@class) or (@class!='").append(PROCESSED_CLASS).append("')]");
}
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-06-07 02:58:20
|
Revision: 92
http://tomailer.svn.sourceforge.net/tomailer/?rev=92&view=rev
Author: dbrosius
Date: 2010-06-07 02:58:14 +0000 (Mon, 07 Jun 2010)
Log Message:
-----------
fat fingers
Modified Paths:
--------------
trunk/tomailer/htdocs/mbfg_menu.shtml
Modified: trunk/tomailer/htdocs/mbfg_menu.shtml
===================================================================
--- trunk/tomailer/htdocs/mbfg_menu.shtml 2010-06-07 02:35:34 UTC (rev 91)
+++ trunk/tomailer/htdocs/mbfg_menu.shtml 2010-06-07 02:58:14 UTC (rev 92)
@@ -12,7 +12,7 @@
<li><a href="http://schemalizer.sf.net">Schemalizer</a></li>
<li><a href="http://tomailer.sf.net">ToMailer</a></li>
<li><a href="http://jd4a.sf.net">JavaDoc for Android</a></li>
- <il><a href="http://damus.sf.net">Damus</a></il>
+ <li><a href="http://damus.sf.net">Damus</a></li>
<li><a href="http://www.heartofgoldfarm.com">Heart of Gold Farm</a></li>
</ul>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-06-07 02:35:42
|
Revision: 91
http://tomailer.svn.sourceforge.net/tomailer/?rev=91&view=rev
Author: dbrosius
Date: 2010-06-07 02:35:34 +0000 (Mon, 07 Jun 2010)
Log Message:
-----------
more projects
Modified Paths:
--------------
trunk/tomailer/htdocs/mbfg_menu.shtml
Modified: trunk/tomailer/htdocs/mbfg_menu.shtml
===================================================================
--- trunk/tomailer/htdocs/mbfg_menu.shtml 2010-01-01 01:09:02 UTC (rev 90)
+++ trunk/tomailer/htdocs/mbfg_menu.shtml 2010-06-07 02:35:34 UTC (rev 91)
@@ -10,7 +10,9 @@
<li><a href="http://pixelle.sf.net">Pixelle</a></li>
<li><a href="http://polycasso.sf.net">Polycasso</a></li>
<li><a href="http://schemalizer.sf.net">Schemalizer</a></li>
- <li><a href="http://tomailer.sf.net">ToMailer</a></li>
+ <li><a href="http://tomailer.sf.net">ToMailer</a></li>
+ <li><a href="http://jd4a.sf.net">JavaDoc for Android</a></li>
+ <il><a href="http://damus.sf.net">Damus</a></il>
<li><a href="http://www.heartofgoldfarm.com">Heart of Gold Farm</a></li>
</ul>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-01-01 02:27:39
|
Revision: 90
http://tomailer.svn.sourceforge.net/tomailer/?rev=90&view=rev
Author: dbrosius
Date: 2010-01-01 01:09:02 +0000 (Fri, 01 Jan 2010)
Log Message:
-----------
(c) 2010
Modified Paths:
--------------
trunk/tomailer/build.xml
trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java
trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java
trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java
Modified: trunk/tomailer/build.xml
===================================================================
--- trunk/tomailer/build.xml 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/build.xml 2010-01-01 01:09:02 UTC (rev 90)
@@ -90,7 +90,7 @@
destdir="${javadoc.dir}"
windowtitle="tomailer api">
<doctitle><![CDATA[<h1>tomailer javadoc</h1>]]></doctitle>
- <bottom><![CDATA[<i>Copyright © 2009 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
+ <bottom><![CDATA[<i>Copyright © 2009-2010 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java 2010-01-01 01:09:02 UTC (rev 90)
@@ -1,6 +1,6 @@
/*
- * Copyright 2009 MeBigFatGuy.com
- * Copyright 2009 Dave Brosius
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java 2010-01-01 01:09:02 UTC (rev 90)
@@ -1,6 +1,6 @@
/*
- * Copyright 2009 MeBigFatGuy.com
- * Copyright 2009 Dave Brosius
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2010-01-01 01:09:02 UTC (rev 90)
@@ -1,6 +1,6 @@
/*
- * Copyright 2009 MeBigFatGuy.com
- * Copyright 2009 Dave Brosius
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2010-01-01 01:09:02 UTC (rev 90)
@@ -1,6 +1,6 @@
/*
- * Copyright 2009 MeBigFatGuy.com
- * Copyright 2009 Dave Brosius
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java 2010-01-01 01:09:02 UTC (rev 90)
@@ -1,6 +1,6 @@
/*
- * Copyright 2009 MeBigFatGuy.com
- * Copyright 2009 Dave Brosius
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java 2010-01-01 01:09:02 UTC (rev 90)
@@ -1,6 +1,6 @@
/*
- * Copyright 2009 MeBigFatGuy.com
- * Copyright 2009 Dave Brosius
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java 2009-12-28 07:03:12 UTC (rev 89)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java 2010-01-01 01:09:02 UTC (rev 90)
@@ -1,6 +1,6 @@
/*
- * Copyright 2009 MeBigFatGuy.com
- * Copyright 2009 Dave Brosius
+ * Copyright 2009-2010 MeBigFatGuy.com
+ * Copyright 2009-2010 Dave Brosius
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-28 07:03:22
|
Revision: 89
http://tomailer.svn.sourceforge.net/tomailer/?rev=89&view=rev
Author: dbrosius
Date: 2009-12-28 07:03:12 +0000 (Mon, 28 Dec 2009)
Log Message:
-----------
rename index.html to .shtml for ssi
Added Paths:
-----------
trunk/tomailer/htdocs/index.shtml
Removed Paths:
-------------
trunk/tomailer/htdocs/index.html
Deleted: trunk/tomailer/htdocs/index.html
===================================================================
--- trunk/tomailer/htdocs/index.html 2009-12-28 07:01:53 UTC (rev 88)
+++ trunk/tomailer/htdocs/index.html 2009-12-28 07:03:12 UTC (rev 89)
@@ -1,56 +0,0 @@
-<html>
- <head>
- <meta name="keywords" content="tomailer,html,email,css,relative,absolute,links"/>
- <title>tomailer™: An web-page to email page converter</title>
- <style type="text/css">
- h1 {
- font-size:20px;
- margin-bottom: -10px;
- }
-
- h2 {
- font-size: 14px;
- }
- </style>
- <script src="mbfg.js">
- </script>
- <link rel="stylesheet" type="text/css" href="mbfg.css" />
- </head>
- <body>
- <div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);">
- </div>
- <div style="position:absolute;top:50;left:20;z-index:2;">
- <h1>tomailer™</h1>
- <h2> a web application for converting modern web pages into html that most mail programs can render</h2>
-
- <hr/>
- <a href="http://www.sourceforge.net/projects/tomailer">Project Page</a>
- <img src="vbar.gif" height="12"/>
- <a href="javadoc/index.html">JavaDoc</a>
- <!--#include virtual="mbfg_menu.shtml" -->
- <hr/>
-
- <p>tomailer is a simple web application that will convert modern web pages that use css, relative links and other items
- that are not friendly towards the current crop of email programs, and convert them to html files that will render reasonably
- well in those programs. Things it does is:
- <ul>
- <li>convert internal and external stylesheets into style attributes</li>
- <li>convert relative links into absolute ones</li>
- <li>tbd...</li>
- </ul>
- It is a work in progress, i'd love your feedback, bugs, etc. Eventually i will deploy in google app engine. Enjoy!
- </p>
- </div>
-
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- try {
- var pageTracker = _gat._getTracker("UA-249537-8");
- pageTracker._trackPageview();
- } catch(err) {}
- </script>
- </body>
-</html>
\ No newline at end of file
Copied: trunk/tomailer/htdocs/index.shtml (from rev 88, trunk/tomailer/htdocs/index.html)
===================================================================
--- trunk/tomailer/htdocs/index.shtml (rev 0)
+++ trunk/tomailer/htdocs/index.shtml 2009-12-28 07:03:12 UTC (rev 89)
@@ -0,0 +1,56 @@
+<html>
+ <head>
+ <meta name="keywords" content="tomailer,html,email,css,relative,absolute,links"/>
+ <title>tomailer™: An web-page to email page converter</title>
+ <style type="text/css">
+ h1 {
+ font-size:20px;
+ margin-bottom: -10px;
+ }
+
+ h2 {
+ font-size: 14px;
+ }
+ </style>
+ <script src="mbfg.js">
+ </script>
+ <link rel="stylesheet" type="text/css" href="mbfg.css" />
+ </head>
+ <body>
+ <div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);">
+ </div>
+ <div style="position:absolute;top:50;left:20;z-index:2;">
+ <h1>tomailer™</h1>
+ <h2> a web application for converting modern web pages into html that most mail programs can render</h2>
+
+ <hr/>
+ <a href="http://www.sourceforge.net/projects/tomailer">Project Page</a>
+ <img src="vbar.gif" height="12"/>
+ <a href="javadoc/index.html">JavaDoc</a>
+ <!--#include virtual="mbfg_menu.shtml" -->
+ <hr/>
+
+ <p>tomailer is a simple web application that will convert modern web pages that use css, relative links and other items
+ that are not friendly towards the current crop of email programs, and convert them to html files that will render reasonably
+ well in those programs. Things it does is:
+ <ul>
+ <li>convert internal and external stylesheets into style attributes</li>
+ <li>convert relative links into absolute ones</li>
+ <li>tbd...</li>
+ </ul>
+ It is a work in progress, i'd love your feedback, bugs, etc. Eventually i will deploy in google app engine. Enjoy!
+ </p>
+ </div>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-249537-8");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+ </body>
+</html>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-28 07:02:05
|
Revision: 88
http://tomailer.svn.sourceforge.net/tomailer/?rev=88&view=rev
Author: dbrosius
Date: 2009-12-28 07:01:53 +0000 (Mon, 28 Dec 2009)
Log Message:
-----------
add mbfg projects menu
Modified Paths:
--------------
trunk/tomailer/htdocs/index.html
Modified: trunk/tomailer/htdocs/index.html
===================================================================
--- trunk/tomailer/htdocs/index.html 2009-12-28 07:01:12 UTC (rev 87)
+++ trunk/tomailer/htdocs/index.html 2009-12-28 07:01:53 UTC (rev 88)
@@ -12,6 +12,9 @@
font-size: 14px;
}
</style>
+ <script src="mbfg.js">
+ </script>
+ <link rel="stylesheet" type="text/css" href="mbfg.css" />
</head>
<body>
<div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);">
@@ -20,9 +23,12 @@
<h1>tomailer™</h1>
<h2> a web application for converting modern web pages into html that most mail programs can render</h2>
+ <hr/>
<a href="http://www.sourceforge.net/projects/tomailer">Project Page</a>
<img src="vbar.gif" height="12"/>
<a href="javadoc/index.html">JavaDoc</a>
+ <!--#include virtual="mbfg_menu.shtml" -->
+ <hr/>
<p>tomailer is a simple web application that will convert modern web pages that use css, relative links and other items
that are not friendly towards the current crop of email programs, and convert them to html files that will render reasonably
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-12-28 07:01:25
|
Revision: 87
http://tomailer.svn.sourceforge.net/tomailer/?rev=87&view=rev
Author: dbrosius
Date: 2009-12-28 07:01:12 +0000 (Mon, 28 Dec 2009)
Log Message:
-----------
add files for mbfg other projects menu
Added Paths:
-----------
trunk/tomailer/htdocs/mbfg.css
trunk/tomailer/htdocs/mbfg.js
trunk/tomailer/htdocs/mbfg_menu.shtml
Added: trunk/tomailer/htdocs/mbfg.css
===================================================================
--- trunk/tomailer/htdocs/mbfg.css (rev 0)
+++ trunk/tomailer/htdocs/mbfg.css 2009-12-28 07:01:12 UTC (rev 87)
@@ -0,0 +1,32 @@
+#mbfg_div {
+ float:right;
+}
+
+#mbfg_menu {
+ margin-right: 20px;
+}
+
+#mbfg_projects {
+ position: absolute;
+ display: none;
+ z-order: 2;
+}
+
+#mbfg_projects ul li {
+ list-style-type: none;
+}
+
+#mbfg_projects ul li a {
+ display:block;
+ border-color: #404040;
+ border-width: 1px;
+ border-style: solid;
+ padding: 6px 40px 6px 40px;
+ background-color: #DDDDFF;
+ margin-right: 20px;
+ text-decoration: none;
+}
+
+#mbfg_projects ul li a:hover {
+ background-color: #FFDDDD;
+}
Property changes on: trunk/tomailer/htdocs/mbfg.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: trunk/tomailer/htdocs/mbfg.js
===================================================================
--- trunk/tomailer/htdocs/mbfg.js (rev 0)
+++ trunk/tomailer/htdocs/mbfg.js 2009-12-28 07:01:12 UTC (rev 87)
@@ -0,0 +1,9 @@
+
+function toggleDiv(divId)
+{
+ var dv = document.getElementById(divId);
+ if (dv.style.display == 'block')
+ dv.style.display = 'none';
+ else
+ dv.style.display = 'block';
+}
\ No newline at end of file
Property changes on: trunk/tomailer/htdocs/mbfg.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: trunk/tomailer/htdocs/mbfg_menu.shtml
===================================================================
--- trunk/tomailer/htdocs/mbfg_menu.shtml (rev 0)
+++ trunk/tomailer/htdocs/mbfg_menu.shtml 2009-12-28 07:01:12 UTC (rev 87)
@@ -0,0 +1,17 @@
+ <div id="mbfg_div" onMouseover="javascript:toggleDiv('mbfg_projects')" onMouseout="javascript:toggleDiv('mbfg_projects')">
+ <a id="mbfg_menu" href="#" >Other MeBigFatGuy Projects</a>
+ <div id="mbfg_projects">
+ <ul>
+ <li><a href="http://beansource.sf.net">Beansource</a></li>
+ <li><a href="http://fb-contrib.sf.net">FB-Contrib</a></li>
+ <li><a href="http://mongobrowser.sf.net">MongoBrowser</a></li>
+ <li><a href="http://mysfstats.sf.net">MySFStats</a></li>
+ <li><a href="http://patchanim.sf.net">PatchAnim</a></li>
+ <li><a href="http://pixelle.sf.net">Pixelle</a></li>
+ <li><a href="http://polycasso.sf.net">Polycasso</a></li>
+ <li><a href="http://schemalizer.sf.net">Schemalizer</a></li>
+ <li><a href="http://tomailer.sf.net">ToMailer</a></li>
+ <li><a href="http://www.heartofgoldfarm.com">Heart of Gold Farm</a></li>
+ </ul>
+ </div>
+ </div>
Property changes on: trunk/tomailer/htdocs/mbfg_menu.shtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-30 05:03:09
|
Revision: 86
http://tomailer.svn.sourceforge.net/tomailer/?rev=86&view=rev
Author: dbrosius
Date: 2009-11-30 05:02:37 +0000 (Mon, 30 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-27 05:17:17 UTC (rev 85)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-30 05:02:37 UTC (rev 86)
@@ -78,7 +78,7 @@
/**
* returns the relative score for a selector that is a path
*
- * @param cssPath the path to score
+ * @param selectorList the path to score
* @return the score
*/
private int getPathScore(String selectorList) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-27 05:17:30
|
Revision: 85
http://tomailer.svn.sourceforge.net/tomailer/?rev=85&view=rev
Author: dbrosius
Date: 2009-11-27 05:17:17 +0000 (Fri, 27 Nov 2009)
Log Message:
-----------
when comparing two paths, score them and compare the scores
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-23 22:47:21 UTC (rev 84)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-27 05:17:17 UTC (rev 85)
@@ -46,7 +46,15 @@
SelectorType type1 = classifySelector(item1);
SelectorType type2 = classifySelector(item2);
- return type1.ordinal() - type2.ordinal();
+ int diff = type1.ordinal() - type2.ordinal();
+ if (diff != 0)
+ return diff;
+
+ if (type1 == SelectorType.Path) {
+ return getPathScore(item2.getSelector()) - getPathScore(item1.getSelector());
+ }
+
+ return 0;
}
/**
@@ -66,5 +74,26 @@
String[] selectors = selectorList.split("\\s+");
return (selectors.length > 1) ? SelectorType.Path : SelectorType.Name;
}
+
+ /**
+ * returns the relative score for a selector that is a path
+ *
+ * @param cssPath the path to score
+ * @return the score
+ */
+ private int getPathScore(String selectorList) {
+ int score = 0;
+ String[] selectors = selectorList.split("\\s+");
+ for (String selector : selectors) {
+ if (selector.startsWith("#"))
+ score += 3;
+ else if (selector.startsWith("."))
+ score += 2;
+ else
+ score += 1;
+ }
+
+ return score;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-23 22:47:28
|
Revision: 84
http://tomailer.svn.sourceforge.net/tomailer/?rev=84&view=rev
Author: dbrosius
Date: 2009-11-23 22:47:21 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
add tomailer tracking code
Modified Paths:
--------------
trunk/tomailer/htdocs/index.html
Modified: trunk/tomailer/htdocs/index.html
===================================================================
--- trunk/tomailer/htdocs/index.html 2009-11-15 01:09:09 UTC (rev 83)
+++ trunk/tomailer/htdocs/index.html 2009-11-23 22:47:21 UTC (rev 84)
@@ -36,11 +36,15 @@
</p>
</div>
- <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
- _uacct = "UA-249537-3";
- urchinTracker();
+ try {
+ var pageTracker = _gat._getTracker("UA-249537-8");
+ pageTracker._trackPageview();
+ } catch(err) {}
</script>
</body>
</html>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-15 01:33:46
|
Revision: 81
http://tomailer.svn.sourceforge.net/tomailer/?rev=81&view=rev
Author: dbrosius
Date: 2009-11-15 01:06:37 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
engrish
Modified Paths:
--------------
trunk/tomailer/htdocs/index.html
Modified: trunk/tomailer/htdocs/index.html
===================================================================
--- trunk/tomailer/htdocs/index.html 2009-11-15 01:05:15 UTC (rev 80)
+++ trunk/tomailer/htdocs/index.html 2009-11-15 01:06:37 UTC (rev 81)
@@ -26,7 +26,7 @@
<p>tomailer is a simple web application that will convert modern web pages that use css, relative links and other items
that are not friendly towards the current crop of email programs, and convert them to html files that will render reasonably
- well in those programs. Thinks it does is:
+ well in those programs. Things it does is:
<ul>
<li>convert internal and external stylesheets into style attributes</li>
<li>convert relative links into absolute ones</li>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-15 01:33:38
|
Revision: 83
http://tomailer.svn.sourceforge.net/tomailer/?rev=83&view=rev
Author: dbrosius
Date: 2009-11-15 01:09:09 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
jd
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java 2009-11-15 01:08:32 UTC (rev 82)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java 2009-11-15 01:09:09 UTC (rev 83)
@@ -19,7 +19,7 @@
import java.util.Arrays;
/**
- * represents a one css item, consisting of a css selector and rules
+ * represents one css item, consisting of a css selector and rules
* for that selector
*/
public class CssItem {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-15 01:33:33
|
Revision: 82
http://tomailer.svn.sourceforge.net/tomailer/?rev=82&view=rev
Author: dbrosius
Date: 2009-11-15 01:08:32 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
jd
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-15 01:06:37 UTC (rev 81)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-15 01:08:32 UTC (rev 82)
@@ -20,7 +20,7 @@
import java.util.Comparator;
/**
- * a comparator that orders CssItems based on the selector
+ * a comparator that orders CssItems based on the selector.
* Id selectors have highest priority, followed by class selectors,
* then path selectors, and finally single element selectors.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-15 01:05:24
|
Revision: 80
http://tomailer.svn.sourceforge.net/tomailer/?rev=80&view=rev
Author: dbrosius
Date: 2009-11-15 01:05:15 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
add google analytics code
Modified Paths:
--------------
trunk/tomailer/htdocs/index.html
Modified: trunk/tomailer/htdocs/index.html
===================================================================
--- trunk/tomailer/htdocs/index.html 2009-11-15 00:26:14 UTC (rev 79)
+++ trunk/tomailer/htdocs/index.html 2009-11-15 01:05:15 UTC (rev 80)
@@ -35,5 +35,12 @@
It is a work in progress, i'd love your feedback, bugs, etc. Eventually i will deploy in google app engine. Enjoy!
</p>
</div>
+
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-249537-3";
+ urchinTracker();
+ </script>
</body>
</html>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-15 00:26:21
|
Revision: 79
http://tomailer.svn.sourceforge.net/tomailer/?rev=79&view=rev
Author: dbrosius
Date: 2009-11-15 00:26:14 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
allow for a web page url, in addition to a file
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
trunk/tomailer/war/index.xhtml
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2009-11-15 00:12:35 UTC (rev 78)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2009-11-15 00:26:14 UTC (rev 79)
@@ -16,6 +16,7 @@
*/
package com.mebigfatguy.tomailer;
+import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -24,6 +25,7 @@
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.net.URL;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
@@ -80,16 +82,34 @@
ServletFileUpload upload = new ServletFileUpload();
+ String webUrl = null;
+ boolean useFile = true;
FileItemIterator iter = upload.getItemIterator(request);
while (iter.hasNext()) {
FileItemStream item = iter.next();
String name = item.getFieldName();
- if (name.equals("webpage")) {
+ if (name.equals("usefile")) {
+ useFile = true;
+ } else if (name.equals("useurl")) {
+ useFile = false;
+ } else if (name.equals("webpage")) {
is = item.openStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtils.copy(is, baos);
- page = new ByteArrayInputStream(baos.toByteArray());
- } else if (name.equals("url")) {
+ page = new ByteArrayInputStream(baos.toByteArray());
+ } else if (name.equals("weburl")) {
+ InputStream wpIs = null;
+ try {
+ webUrl = Streams.asString(item.openStream());
+ URL u = new URL(webUrl);
+ wpIs = new BufferedInputStream(u.openStream());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOUtils.copy(wpIs, baos);
+ page = new ByteArrayInputStream(baos.toByteArray());
+ } finally {
+ IOUtils.closeQuietly(wpIs);
+ }
+ } else if (name.equals("rooturl")) {
rootUrl = Streams.asString(item.openStream());
}
}
Modified: trunk/tomailer/war/index.xhtml
===================================================================
--- trunk/tomailer/war/index.xhtml 2009-11-15 00:12:35 UTC (rev 78)
+++ trunk/tomailer/war/index.xhtml 2009-11-15 00:26:14 UTC (rev 79)
@@ -99,7 +99,7 @@
</div>
</div>
<div class="rootdiv">
- Root URL <input type="text" name="url" size="50" />
+ Root URL <input type="text" name="rooturl" size="50" />
</div>
<div class="center">
<input type="submit" name="Generate" value="Generate" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-15 00:17:45
|
Revision: 78
http://tomailer.svn.sourceforge.net/tomailer/?rev=78&view=rev
Author: dbrosius
Date: 2009-11-15 00:12:35 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
allow for url as well as file
Modified Paths:
--------------
trunk/tomailer/war/index.xhtml
Modified: trunk/tomailer/war/index.xhtml
===================================================================
--- trunk/tomailer/war/index.xhtml 2009-11-14 04:17:48 UTC (rev 77)
+++ trunk/tomailer/war/index.xhtml 2009-11-15 00:12:35 UTC (rev 78)
@@ -20,7 +20,7 @@
margin-top: 20px;
margin-right:auto;
margin-left:auto;
- width:600px;
+ width:650px;
background-color: #DDDDFF;
border-color: #000000;
border-style: solid;
@@ -34,6 +34,20 @@
margin-left:auto;
}
+ .rootdiv {
+ padding-left: 30px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ margin-right:auto;
+ margin-left:auto;
+ }
+
+ .sourcediv {
+ border-color: #000000;
+ border-style: solid;
+ border-width: 1px;
+ }
+
.center {
margin-top: 10px;
margin-bottom: 10px;
@@ -42,16 +56,49 @@
text-align: center;
}
</style>
+
+ <script type="text/javascript">
+ function toggle(radio_id)
+ {
+ if (radio_id == 'useurl')
+ {
+ var e = document.getElementById('useurl');
+ e.checked = true;
+ e = document.getElementById('usefile');
+ e.checked = false;
+ e = document.getElementById('weburl');
+ e.disabled = false;
+ e = document.getElementById('webpage');
+ e.disabled = true;
+ }
+ else
+ {
+ var e = document.getElementById('useurl');
+ e.checked=false;
+ e = document.getElementById('usefile');
+ e.checked = true;
+ e = document.getElementById('weburl');
+ e.disabled = true;
+ e = document.getElementById('webpage');
+ e.disabled = false;
+ }
+ }
+ </script>
</head>
<body>
<form method="POST" enctype="multipart/form-data" action="tomailer/generate">
<div class="maindiv">
<h1>ToMailer</h1>
<h2> - convert a validating web page into something that will render in an email program.</h2>
- <div class="childdiv">
- Web Page <input type="file" name="webpage" size="50" />
+ <div class="sourcediv">
+ <div class="childdiv">
+ <input type="radio" id="useurl" name="useurl" onclick="javascript:toggle('useurl')" checked="true"/> Web URL <input type="text" id="weburl" name="weburl" size="50" />
+ </div>
+ <div class="childdiv">
+ <input type="radio" id="usefile" name="usefile" onclick="javascript:toggle('usefile')"/> Web Page <input type="file" id="webpage" name="webpage" size="50" disabled="true" />
+ </div>
</div>
- <div class="childdiv">
+ <div class="rootdiv">
Root URL <input type="text" name="url" size="50" />
</div>
<div class="center">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-14 04:17:55
|
Revision: 77
http://tomailer.svn.sourceforge.net/tomailer/?rev=77&view=rev
Author: dbrosius
Date: 2009-11-14 04:17:48 +0000 (Sat, 14 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java 2009-11-14 04:11:41 UTC (rev 76)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerDelegate.java 2009-11-14 04:17:48 UTC (rev 77)
@@ -43,6 +43,9 @@
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
+/**
+ * the main processer for converting web pages to email pages
+ */
public class ToMailerDelegate {
private static final String PROCESSED_CLASS = "_TOMAILER_PROCESSED_";
private String rootUrl;
@@ -52,6 +55,14 @@
private TransformerFactory tf;
private CssParser parser = new CssParser();
+ /**
+ * constructs the delegate and orchestrates the conversion of the page
+ *
+ * @param is the stream that represents the web page
+ * @param url the base url to use for relative links
+ *
+ * @throws ToMailerException if conversion fails
+ */
public ToMailerDelegate(InputStream is, String url) throws ToMailerException {
rootUrl = url;
if (!rootUrl.endsWith("/"))
@@ -95,10 +106,21 @@
}
}
- public byte[] getMailer() throws IOException {
+ /**
+ * get the generated email version
+ *
+ * @return an array of bytes that represents the page
+ */
+ public byte[] getMailer() {
return mailer;
}
+ /**
+ * looks for and parses css that is found in style tags directly in the html
+ *
+ * @param d the document to parse
+ * @throws XPathExpressionException if the xpath expressions are misformed
+ */
private void parseEmbeddedCss(Document d) throws XPathExpressionException {
XPath xp = xpf.newXPath();
@@ -113,6 +135,13 @@
}
}
+ /**
+ * looks for and parses css that is found in references of link tags to external resources
+ *
+ * @param d the document to parse
+ * @throws XPathExpressionException if the xpath expressions are misformed
+ * @throws IOException if the external css can't be fetched
+ */
private void parseExternalCss(Document d) throws XPathExpressionException, IOException {
InputStream is = null;
try {
@@ -143,6 +172,14 @@
}
}
+ /**
+ * inject css into style attributes of the appropriate elements
+ *
+ * @param d the document to parse
+ * @param items the css items ordered by importance
+ *
+ * @throws XPathExpressionException if the xpath used is invalid
+ */
private void embedStyles(Document d, CssItem[] items) throws XPathExpressionException {
XPath xp = xpf.newXPath();
for (CssItem item : items) {
@@ -161,6 +198,14 @@
}
}
+ /**
+ * returns an xpath that represents a css selector. The xpath is embellished
+ * so that elements that have already been processed are ignored.
+ *
+ * @param selector the css item to build an xpath out of
+ *
+ * @return the xpath
+ */
private String buildXPathFromSelector(String selector) {
StringBuilder path = new StringBuilder();
path.append("/");
@@ -195,6 +240,12 @@
return path.toString();
}
+ /**
+ * remoevs all class attributes from a document
+ *
+ * @param d the document to remove the attributes from
+ * @throws XPathExpressionException if the xpath used is invalid
+ */
private void stripClassAttributes(Document d) throws XPathExpressionException {
XPath xp = xpf.newXPath();
XPathExpression xpe = xp.compile("//@class");
@@ -206,6 +257,13 @@
}
}
+ /**
+ * finds all relative links and adjusts them by prepending the root url to them
+ * so that the urls can be used from email
+ *
+ * @param d the document to find urls in
+ * @throws XPathExpressionException if the xpath used is invalid
+ */
private void adjustRelativeLinks(Document d) throws XPathExpressionException {
XPath xp = xpf.newXPath();
XPathExpression xpe = xp.compile("//img/@src|//a/@href");
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java 2009-11-14 04:11:41 UTC (rev 76)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java 2009-11-14 04:17:48 UTC (rev 77)
@@ -49,7 +49,7 @@
* @param publicId the constant that defines the specified dtd
* @param systemId the url of the default implementation (ignored)
*
- * @returns a stream that represents the desired dtd
+ * @return a stream that represents the desired dtd
*/
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-14 04:11:47
|
Revision: 76
http://tomailer.svn.sourceforge.net/tomailer/?rev=76&view=rev
Author: dbrosius
Date: 2009-11-14 04:11:41 +0000 (Sat, 14 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2009-11-14 04:08:34 UTC (rev 75)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2009-11-14 04:11:41 UTC (rev 76)
@@ -37,15 +37,32 @@
import org.apache.commons.fileupload.util.Streams;
import org.apache.commons.io.IOUtils;
+/**
+ * the basic servlet that handles requests to convert web page html
+ * to email html
+ */
public class ToMailer extends HttpServlet {
private static final long serialVersionUID = 6120664829482395241L;
+ /**
+ * a handler for get requests, that just forwards to a Post handler.
+ * This shouldn't be used, but is here for completeness.
+ *
+ * @param request the http request
+ * @param response the http response
+ */
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
doPost(request, response);
}
+ /**
+ * the main servlet processing method for converting web page html to email html
+ *
+ * @param request the http request
+ * @param response the http response
+ */
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
InputStream is = null;
@@ -97,6 +114,16 @@
}
}
+ /**
+ * convert a caught exception to a page to be displayed
+ *
+ * @param request the http request
+ * @param response the http response
+ * @param e the exception to display
+ *
+ * @throws IOException
+ * @throws ServletException
+ */
private void streamException(HttpServletRequest request, HttpServletResponse response, Exception e) throws IOException, ServletException {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-14 04:08:41
|
Revision: 75
http://tomailer.svn.sourceforge.net/tomailer/?rev=75&view=rev
Author: dbrosius
Date: 2009-11-14 04:08:34 +0000 (Sat, 14 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java 2009-11-14 04:06:25 UTC (rev 74)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerException.java 2009-11-14 04:08:34 UTC (rev 75)
@@ -16,17 +16,35 @@
*/
package com.mebigfatguy.tomailer;
+/**
+ * a general exception for problems that occur while trying to convert
+ * web page html to email htmls.
+ */
public class ToMailerException extends Exception {
private static final long serialVersionUID = -7205416696929190234L;
+ /**
+ * creates a default exception. Here for completeness.
+ */
public ToMailerException() {
}
+ /**
+ * creates an exception with a supplied message
+ *
+ * @param msg the exception message
+ */
public ToMailerException(String msg) {
super(msg);
}
+ /**
+ * creates an exception with a supplied messages and initial cause
+ *
+ * @param msg the exception message
+ * @param cause the original exception that this exception wraps
+ */
public ToMailerException(String msg, Throwable cause) {
super(msg, cause);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-14 04:06:32
|
Revision: 74
http://tomailer.svn.sourceforge.net/tomailer/?rev=74&view=rev
Author: dbrosius
Date: 2009-11-14 04:06:25 +0000 (Sat, 14 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java 2009-11-14 04:03:35 UTC (rev 73)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailerEntityResolver.java 2009-11-14 04:06:25 UTC (rev 74)
@@ -25,6 +25,11 @@
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+/**
+ * resolves entities around html strict, transitional and frameset dtds, along
+ * with the entity definitions so that the code doesn't access the w3.org definitions,
+ * which will deny access with 503 errors.
+ */
public class ToMailerEntityResolver implements EntityResolver {
private static final Map<String, String> entitySources = new HashMap<String, String>();
@@ -37,6 +42,15 @@
entitySources.put("-//W3C//ENTITIES Special for XHTML//EN", "com/mebigfatguy/tomailer/xhtml-special.ent");
}
+ /**
+ * the main interface method of the EntityResolver, if it's one of the primary dtds,
+ * return the local cache. Otherwise it just uses the default resolver.
+ *
+ * @param publicId the constant that defines the specified dtd
+ * @param systemId the url of the default implementation (ignored)
+ *
+ * @returns a stream that represents the desired dtd
+ */
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-14 04:03:41
|
Revision: 73
http://tomailer.svn.sourceforge.net/tomailer/?rev=73&view=rev
Author: dbrosius
Date: 2009-11-14 04:03:35 +0000 (Sat, 14 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-14 03:40:35 UTC (rev 72)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssSelectorComparator.java 2009-11-14 04:03:35 UTC (rev 73)
@@ -19,12 +19,28 @@
import java.io.Serializable;
import java.util.Comparator;
+/**
+ * a comparator that orders CssItems based on the selector
+ * Id selectors have highest priority, followed by class selectors,
+ * then path selectors, and finally single element selectors.
+ */
public class CssSelectorComparator implements Comparator<CssItem>, Serializable {
private static final long serialVersionUID = 2407708173082661568L;
+ /**
+ * the different types of selectors
+ */
enum SelectorType { Id, Class, Path, Name };
+ /**
+ * the main interface method of the comparator
+ *
+ * @param item1 the first css item
+ * @param item2 the second css item
+ *
+ * @return how item1 compares to item2
+ */
@Override
public int compare(CssItem item1, CssItem item2) {
SelectorType type1 = classifySelector(item1);
@@ -33,6 +49,13 @@
return type1.ordinal() - type2.ordinal();
}
+ /**
+ * returns what type of selector @see SelectorType that the currently
+ * selector is
+ *
+ * @param item the cssItem
+ * @return what type of selector the item is
+ */
private SelectorType classifySelector(CssItem item) {
String selectorList = item.getSelector();
if (selectorList.contains("#"))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-14 03:40:47
|
Revision: 72
http://tomailer.svn.sourceforge.net/tomailer/?rev=72&view=rev
Author: dbrosius
Date: 2009-11-14 03:40:35 +0000 (Sat, 14 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java 2009-11-14 02:59:12 UTC (rev 71)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssParser.java 2009-11-14 03:40:35 UTC (rev 72)
@@ -22,14 +22,21 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+/**
+ * parses a css block that is found in between style tags, or referenced
+ * from an external link tag.
+ */
public class CssParser {
private static final Pattern cssPattern = Pattern.compile("([^\\{]*)\\{([^\\}]*)\\}");
private List<CssItem> items = new ArrayList<CssItem>();
- public CssParser() {
- }
-
+ /**
+ * takes a block of css, and parses out individual rules, and adds them
+ * to a collection of rules found.
+ *
+ * @param cssBlock text that represents a set of rules found in a style block
+ */
public void add(String cssBlock) {
Matcher m = cssPattern.matcher(cssBlock);
@@ -48,6 +55,12 @@
}
}
+ /**
+ * sorts the css based on how specific the rules are. Rules applied
+ * to ids are highest, followed by classes, paths and single elements.
+ *
+ * @return a sorted list of css items
+ */
public CssItem[] prioritizeCss() {
Collections.<CssItem>sort(items, new CssSelectorComparator());
return items.toArray(new CssItem[items.size()]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-14 02:59:20
|
Revision: 71
http://tomailer.svn.sourceforge.net/tomailer/?rev=71&view=rev
Author: dbrosius
Date: 2009-11-14 02:59:12 +0000 (Sat, 14 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java 2009-11-13 14:42:46 UTC (rev 70)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/CssItem.java 2009-11-14 02:59:12 UTC (rev 71)
@@ -18,24 +18,50 @@
import java.util.Arrays;
+/**
+ * represents a one css item, consisting of a css selector and rules
+ * for that selector
+ */
public class CssItem {
private String selector;
private String[] styles;
+ /**
+ * constructs a CssItem consisting of one selector and an array of
+ * styles
+ *
+ * @param cssSelector the selector
+ * @param cssStyle and array of styles;
+ */
public CssItem(String cssSelector, String[] cssStyle) {
selector = cssSelector;
styles = cssStyle;
}
+ /**
+ * get the selector for this item
+ *
+ * @return the selector
+ */
public String getSelector() {
return selector;
}
+ /**
+ * get the array of styles for this item
+ *
+ * @return the styles
+ */
public String[] getStyles() {
return styles;
}
+ /**
+ * creates a human readable string of this item
+ *
+ * @return the string representation of this item
+ */
@Override
public String toString() {
return selector + ": " + Arrays.toString(styles);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-13 14:42:56
|
Revision: 70
http://tomailer.svn.sourceforge.net/tomailer/?rev=70&view=rev
Author: dbrosius
Date: 2009-11-13 14:42:46 +0000 (Fri, 13 Nov 2009)
Log Message:
-----------
oi
Modified Paths:
--------------
trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
Modified: trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java
===================================================================
--- trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2009-11-13 14:34:03 UTC (rev 69)
+++ trunk/tomailer/src/com/mebigfatguy/tomailer/ToMailer.java 2009-11-13 14:42:46 UTC (rev 70)
@@ -16,7 +16,6 @@
*/
package com.mebigfatguy.tomailer;
-import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2009-11-13 14:34:13
|
Revision: 69
http://tomailer.svn.sourceforge.net/tomailer/?rev=69&view=rev
Author: dbrosius
Date: 2009-11-13 14:34:03 +0000 (Fri, 13 Nov 2009)
Log Message:
-----------
webpage
Added Paths:
-----------
trunk/tomailer/htdocs/index.html
Added: trunk/tomailer/htdocs/index.html
===================================================================
--- trunk/tomailer/htdocs/index.html (rev 0)
+++ trunk/tomailer/htdocs/index.html 2009-11-13 14:34:03 UTC (rev 69)
@@ -0,0 +1,39 @@
+<html>
+ <head>
+ <meta name="keywords" content="tomailer,html,email,css,relative,absolute,links"/>
+ <title>tomailer™: An web-page to email page converter</title>
+ <style type="text/css">
+ h1 {
+ font-size:20px;
+ margin-bottom: -10px;
+ }
+
+ h2 {
+ font-size: 14px;
+ }
+ </style>
+ </head>
+ <body>
+ <div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);">
+ </div>
+ <div style="position:absolute;top:50;left:20;z-index:2;">
+ <h1>tomailer™</h1>
+ <h2> a web application for converting modern web pages into html that most mail programs can render</h2>
+
+ <a href="http://www.sourceforge.net/projects/tomailer">Project Page</a>
+ <img src="vbar.gif" height="12"/>
+ <a href="javadoc/index.html">JavaDoc</a>
+
+ <p>tomailer is a simple web application that will convert modern web pages that use css, relative links and other items
+ that are not friendly towards the current crop of email programs, and convert them to html files that will render reasonably
+ well in those programs. Thinks it does is:
+ <ul>
+ <li>convert internal and external stylesheets into style attributes</li>
+ <li>convert relative links into absolute ones</li>
+ <li>tbd...</li>
+ </ul>
+ It is a work in progress, i'd love your feedback, bugs, etc. Eventually i will deploy in google app engine. Enjoy!
+ </p>
+ </div>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/tomailer/htdocs/index.html
___________________________________________________________________
Added: svn:mime-type
+ text/html
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|