You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Ted Husted <hu...@apache.org> on 2006/07/19 19:53:16 UTC

[s2] Snippet Macro

I'm trying to get a backup of the Struts 2 site running locally. By
raising Tomcat's heap size to 512mb, I was able to restore the backup,
but I need to install the infamous snippet macro.

How does one go about doing that?

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Snippet Macro

Posted by Patrick Lightbody <fo...@opensymphony.com>.
Ted,
Can you email me the changed files? I'll get them checked in once I have them in my inbox.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=37908&messageID=81289#81289


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Snippet Macro

Posted by Ted Husted <hu...@apache.org>.
On 8/20/06, tm jee <tm...@yahoo.co.uk> wrote:
> shouldn't it be "com.opensymphony..." instead?

Yep. It should be fixed now.

-T.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Snippet Macro

Posted by tm jee <tm...@yahoo.co.uk>.
The xwork2 snippet can't seems to be referenced. I was trying to change this

http://cwiki.apache.org/confluence/display/WW/Model+Driven+Interceptor

from refering to the old xwork to the new xwork2.

Looks like it is still refering to cvs instead of the new svn. 

Just notice this in the diff 
-         if (urlParam.startsWith("com.opensymphony.")) {
+         if (urlParam.startsWith("org.opensymphony.")) {

shouldn't it be "com.opensymphony..." instead?

Thx in advance.



----- Original Message ----
From: tm jee <tm...@yahoo.co.uk>
To: Struts Developers List <de...@struts.apache.org>
Sent: Saturday, 19 August, 2006 12:51:16 AM
Subject: Re: [s2] Snippet Macro

Cheers. Ted.

----- Original Message ----
From: Ted Husted <hu...@apache.org>
To: Struts Developers List <de...@struts.apache.org>
Sent: Friday, 18 August, 2006 11:09:14 PM
Subject: Re: [s2] Snippet Macro

OK, the snippet macro is up and running on the ASF Struts 2 wiki,
complete with shortcuts.

h2. Description

 {snippet:id=javadoc|javadoc=true|url=org.apache.struts2.components.If}

h2. Parameters

{snippet:id=tagattributes|javadoc=false|url=struts2/docs/tags/If.html}

h2. Examples

{snippet:id=example|lang=xml|javadoc=true|url=struts2/core/src/main/java/org/apache/struts2/components/If.java}

I'll start a final pass on the wiki to update the snippets and catch
other stragglers.

(Note that when updating the references pages, we should rachet the
headings down a knotch, so that the largest is h2. (h1 being reserved
for the top-level page title.))

I didn't have the karma to check the snippet macro back in, but here's
the patch.

----

Index: snippet/src/java/atlassian-plugin.xml
===================================================================
--- snippet/src/java/atlassian-plugin.xml    (revision 279)
+++ snippet/src/java/atlassian-plugin.xml    (working copy)
@@ -2,8 +2,8 @@
 <atlassian-plugin name='Snippet Macros' key='confluence.extra.snippet'>
     <plugin-info>
         <description>Macro that gets a snippet of the content from a
URL</description>
-        <vendor name="Codehaus" url="http://www.codehaus.com"/>
-        <version>0.5</version>
+        <vendor name="opensymphony.dev.java.net"
url="https://opensymphony.dev.java.net/source/browse/opensymphony/wiki/snippet/"/>
+        <version>r280</version>
     </plugin-info>

     <macro name='snippet' class='snippet.SnippetMacro' key='snippet' >
Index: snippet/src/java/snippet/SnippetMacro.java
===================================================================
--- snippet/src/java/snippet/SnippetMacro.java    (revision 279)
+++ snippet/src/java/snippet/SnippetMacro.java    (working copy)
@@ -106,7 +106,7 @@
         String urlParam = (String) parameters.get("url");
         required(urlParam, "url");

-         if (urlParam.startsWith("com.opensymphony.")) {
+         if (urlParam.startsWith("org.opensymphony.")) {
             // ok, this is a direct class reference, we can fix this
             // first, figure out which module we're talking about
             int nextDot = urlParam.indexOf('.', "com.opensymphony.".length());
@@ -121,18 +121,18 @@
             } else {
                 urlParam = module + "/src/java/" +
urlParam.replaceAll("\\.", "/") + ".java";
             }
-        } else if (urlParam.startsWith("org.apache.struts.action2.")) {
-            // ex:
https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/org/apache/struts/action2/
-            // support for SAF 2.0
-            String url =
"https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/";;;
+        } else if (urlParam.startsWith("org.apache.struts2.")) {
+            // ex:
https://svn.apache.org/repos/asf/struts/strut2/trunk/core/src/main/java/org/apache/struts/action2/
+            // support for Struts 2.0
+            String url =
"https://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/";;;
             urlParam = url + urlParam.replaceAll("\\.", "/") + ".java";
         }

         if (!urlParam.startsWith("http")) {
-            if (urlParam.startsWith("action2")) {
-                // cut out the action2 part
-                urlParam = urlParam.substring("action2".length());
-                urlParam =
"https://svn.apache.org/repos/asf/struts/action2/trunk/";; + urlParam;
+            if (urlParam.startsWith("struts2")) {
+                // cut out the struts2 part
+                urlParam = urlParam.substring("struts2".length());
+                urlParam =
"https://svn.apache.org/repos/asf/struts/struts2/trunk/";; + urlParam;
             } else {
                 urlParam =
"https://opensymphony.dev.java.net/source/browse/*checkout*/";; +
urlParam;
             }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org










Re: [s2] Snippet Macro

Posted by tm jee <tm...@yahoo.co.uk>.
Cheers. Ted.

----- Original Message ----
From: Ted Husted <hu...@apache.org>
To: Struts Developers List <de...@struts.apache.org>
Sent: Friday, 18 August, 2006 11:09:14 PM
Subject: Re: [s2] Snippet Macro

OK, the snippet macro is up and running on the ASF Struts 2 wiki,
complete with shortcuts.

h2. Description

 {snippet:id=javadoc|javadoc=true|url=org.apache.struts2.components.If}

h2. Parameters

{snippet:id=tagattributes|javadoc=false|url=struts2/docs/tags/If.html}

h2. Examples

{snippet:id=example|lang=xml|javadoc=true|url=struts2/core/src/main/java/org/apache/struts2/components/If.java}

I'll start a final pass on the wiki to update the snippets and catch
other stragglers.

(Note that when updating the references pages, we should rachet the
headings down a knotch, so that the largest is h2. (h1 being reserved
for the top-level page title.))

I didn't have the karma to check the snippet macro back in, but here's
the patch.

----

Index: snippet/src/java/atlassian-plugin.xml
===================================================================
--- snippet/src/java/atlassian-plugin.xml    (revision 279)
+++ snippet/src/java/atlassian-plugin.xml    (working copy)
@@ -2,8 +2,8 @@
 <atlassian-plugin name='Snippet Macros' key='confluence.extra.snippet'>
     <plugin-info>
         <description>Macro that gets a snippet of the content from a
URL</description>
-        <vendor name="Codehaus" url="http://www.codehaus.com"/>
-        <version>0.5</version>
+        <vendor name="opensymphony.dev.java.net"
url="https://opensymphony.dev.java.net/source/browse/opensymphony/wiki/snippet/"/>
+        <version>r280</version>
     </plugin-info>

     <macro name='snippet' class='snippet.SnippetMacro' key='snippet' >
Index: snippet/src/java/snippet/SnippetMacro.java
===================================================================
--- snippet/src/java/snippet/SnippetMacro.java    (revision 279)
+++ snippet/src/java/snippet/SnippetMacro.java    (working copy)
@@ -106,7 +106,7 @@
         String urlParam = (String) parameters.get("url");
         required(urlParam, "url");

-         if (urlParam.startsWith("com.opensymphony.")) {
+         if (urlParam.startsWith("org.opensymphony.")) {
             // ok, this is a direct class reference, we can fix this
             // first, figure out which module we're talking about
             int nextDot = urlParam.indexOf('.', "com.opensymphony.".length());
@@ -121,18 +121,18 @@
             } else {
                 urlParam = module + "/src/java/" +
urlParam.replaceAll("\\.", "/") + ".java";
             }
-        } else if (urlParam.startsWith("org.apache.struts.action2.")) {
-            // ex:
https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/org/apache/struts/action2/
-            // support for SAF 2.0
-            String url =
"https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/";;
+        } else if (urlParam.startsWith("org.apache.struts2.")) {
+            // ex:
https://svn.apache.org/repos/asf/struts/strut2/trunk/core/src/main/java/org/apache/struts/action2/
+            // support for Struts 2.0
+            String url =
"https://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/";;
             urlParam = url + urlParam.replaceAll("\\.", "/") + ".java";
         }

         if (!urlParam.startsWith("http")) {
-            if (urlParam.startsWith("action2")) {
-                // cut out the action2 part
-                urlParam = urlParam.substring("action2".length());
-                urlParam =
"https://svn.apache.org/repos/asf/struts/action2/trunk/"; + urlParam;
+            if (urlParam.startsWith("struts2")) {
+                // cut out the struts2 part
+                urlParam = urlParam.substring("struts2".length());
+                urlParam =
"https://svn.apache.org/repos/asf/struts/struts2/trunk/"; + urlParam;
             } else {
                 urlParam =
"https://opensymphony.dev.java.net/source/browse/*checkout*/"; +
urlParam;
             }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org






Re: [s2] Snippet Macro

Posted by Ted Husted <hu...@apache.org>.
OK, the snippet macro is up and running on the ASF Struts 2 wiki,
complete with shortcuts.

h2. Description

 {snippet:id=javadoc|javadoc=true|url=org.apache.struts2.components.If}

h2. Parameters

{snippet:id=tagattributes|javadoc=false|url=struts2/docs/tags/If.html}

h2. Examples

{snippet:id=example|lang=xml|javadoc=true|url=struts2/core/src/main/java/org/apache/struts2/components/If.java}

I'll start a final pass on the wiki to update the snippets and catch
other stragglers.

(Note that when updating the references pages, we should rachet the
headings down a knotch, so that the largest is h2. (h1 being reserved
for the top-level page title.))

I didn't have the karma to check the snippet macro back in, but here's
the patch.

----

Index: snippet/src/java/atlassian-plugin.xml
===================================================================
--- snippet/src/java/atlassian-plugin.xml	(revision 279)
+++ snippet/src/java/atlassian-plugin.xml	(working copy)
@@ -2,8 +2,8 @@
 <atlassian-plugin name='Snippet Macros' key='confluence.extra.snippet'>
     <plugin-info>
         <description>Macro that gets a snippet of the content from a
URL</description>
-        <vendor name="Codehaus" url="http://www.codehaus.com"/>
-        <version>0.5</version>
+        <vendor name="opensymphony.dev.java.net"
url="https://opensymphony.dev.java.net/source/browse/opensymphony/wiki/snippet/"/>
+        <version>r280</version>
     </plugin-info>

     <macro name='snippet' class='snippet.SnippetMacro' key='snippet' >
Index: snippet/src/java/snippet/SnippetMacro.java
===================================================================
--- snippet/src/java/snippet/SnippetMacro.java	(revision 279)
+++ snippet/src/java/snippet/SnippetMacro.java	(working copy)
@@ -106,7 +106,7 @@
         String urlParam = (String) parameters.get("url");
         required(urlParam, "url");

-         if (urlParam.startsWith("com.opensymphony.")) {
+         if (urlParam.startsWith("org.opensymphony.")) {
             // ok, this is a direct class reference, we can fix this
             // first, figure out which module we're talking about
             int nextDot = urlParam.indexOf('.', "com.opensymphony.".length());
@@ -121,18 +121,18 @@
             } else {
                 urlParam = module + "/src/java/" +
urlParam.replaceAll("\\.", "/") + ".java";
             }
-        } else if (urlParam.startsWith("org.apache.struts.action2.")) {
-            // ex:
https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/org/apache/struts/action2/
-            // support for SAF 2.0
-            String url =
"https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/";
+        } else if (urlParam.startsWith("org.apache.struts2.")) {
+            // ex:
https://svn.apache.org/repos/asf/struts/strut2/trunk/core/src/main/java/org/apache/struts/action2/
+            // support for Struts 2.0
+            String url =
"https://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/";
             urlParam = url + urlParam.replaceAll("\\.", "/") + ".java";
         }

         if (!urlParam.startsWith("http")) {
-            if (urlParam.startsWith("action2")) {
-                // cut out the action2 part
-                urlParam = urlParam.substring("action2".length());
-                urlParam =
"https://svn.apache.org/repos/asf/struts/action2/trunk/" + urlParam;
+            if (urlParam.startsWith("struts2")) {
+                // cut out the struts2 part
+                urlParam = urlParam.substring("struts2".length());
+                urlParam =
"https://svn.apache.org/repos/asf/struts/struts2/trunk/" + urlParam;
             } else {
                 urlParam =
"https://opensymphony.dev.java.net/source/browse/*checkout*/" +
urlParam;
             }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Snippet Macro

Posted by Ted Husted <hu...@apache.org>.
On 7/24/06, Patrick Lightbody <fo...@opensymphony.com> wrote:
> The snippet binary is attached with a comment indicating the source and date.

Assuming the Java.net source is current, could we patch it for the
latest (and hopefully) last changes

- org.apache.struts.action2.
+ org.apache.struts2.

- https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/org/apache/struts/action2/
+ https://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/

- action2
+ struts2 (twice)

- https://svn.apache.org/repos/asf/struts/action2/trunk/
+ https://svn.apache.org/repos/asf/struts/struts2/trunk/


        } else if (urlParam.startsWith("org.apache.struts.action2.")) {
            // ex:
https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/org/apache/struts/action2/
            // support for SAF 2.0
            String url =
"https://svn.apache.org/repos/asf/struts/action2/trunk/core/src/main/java/";
            urlParam = url + urlParam.replaceAll("\\.", "/") + ".java";
        }

        if (!urlParam.startsWith("http")) {
            if (urlParam.startsWith("action2")) {
                // cut out the action2 part
                urlParam = urlParam.substring("action2".length());
                urlParam =
"https://svn.apache.org/repos/asf/struts/action2/trunk/" + urlParam;
            } else {
                urlParam =
"https://opensymphony.dev.java.net/source/browse/*checkout*/" +
urlParam;
            }
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Snippet Macro

Posted by Patrick Lightbody <fo...@opensymphony.com>.
The snippet binary is attached with a comment indicating the source and date.

Our snippet macro is a lot more advanced than the one you linked to. It is based on that one, however.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=37908&messageID=75313#75313


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Snippet Macro

Posted by Ted Husted <hu...@apache.org>.
On 7/19/06, Patrick Lightbody <fo...@opensymphony.com> wrote:
> I would say we should eventually make a copy of the snippet macro and check it in to the
> struts codebase.

The source is probably fine where it is, but could you attach a copy
of the JAR to

* http://confluence.twdata.org/display/WW/Colophon

Then, it will be backed up with the wiki itself, and I woudl be able
to try and install it on my local version. (And, hopefully before
long, the ASF instance.)

Is ours different from this one?

* http://confluence.atlassian.com/display/CONFEXT/Snippet+Macro+Library

TIA, -Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Snippet Macro

Posted by Patrick Lightbody <fo...@opensymphony.com>.
Ted - you have to ask me nicely. Just kidding.

Basically, the snippet macro is currently located here:

https://opensymphony.dev.java.net/source/browse/opensymphony/wiki/snippet/

I build it in IDEA (really ghetto, I know) and just upload the jar. The macro binary works in both the OpenSymphony and Struts wikis (see the SnippetMacro.java for the URLs that are encoded).

I would say we should eventually make a copy of the snippet macro and check it in to the struts codebase.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=37908&messageID=74505#74505


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org