forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r365795 - in /forrest/trunk: main/ main/webapp/ main/webapp/WEB-INF/xconf/ whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/ whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/resources/stylesheets/ whiteboard/plug...
Date Wed, 04 Jan 2006 01:55:24 GMT
Author: rgardler
Date: Tue Jan  3 17:55:05 2006
New Revision: 365795

URL: http://svn.apache.org/viewcvs?rev=365795&view=rev
Log:
expose the site build directory to the sitemap and use it in devtools so we can remove hardcoded
paths

Modified:
    forrest/trunk/main/forrest.build.xml
    forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf
    forrest/trunk/main/webapp/default-forrest.properties
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/internal.xmap
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/resources/stylesheets/saveRequest-to-success.xsl
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/src/java/org/apache/forrest/actions/WriteToLocalBuildAction.java
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/status.xml

Modified: forrest/trunk/main/forrest.build.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/forrest.build.xml?rev=365795&r1=365794&r2=365795&view=diff
==============================================================================
--- forrest/trunk/main/forrest.build.xml (original)
+++ forrest/trunk/main/forrest.build.xml Tue Jan  3 17:55:05 2006
@@ -111,10 +111,10 @@
     <if>
         <equals arg1="${project.i18n}" arg2="true"/>
         <then>
-          <property name="project.site-dir"      location="${project.build-dir}/site/${user.language}"
   />
+          <property name="project.site-dir"      location="${project.build-dir}/${project.site}/${user.language}"
   />
         </then>
         <else>
-          <property name="project.site-dir"      location="${project.build-dir}/site"
   />
+          <property name="project.site-dir"      location="${project.build-dir}/${project.site}"
   />
         </else>
     </if>
     <property name="project.war"           location="${project.build-dir}/${project.name}.war"
/>

Modified: forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf?rev=365795&r1=365794&r2=365795&view=diff
==============================================================================
--- forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf (original)
+++ forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf Tue Jan  3 17:55:05 2006
@@ -168,6 +168,7 @@
     <component-instance name="project" class="org.apache.forrest.conf.ForrestConfModule">
       <values>
         <home>@project.home@</home>
+        <staging-dir>@project.build-dir@/@project.site@</staging-dir>
         <themer>@project.themer@</themer>
         <structurer>@project.stucturer@</structurer>
         <theme-sourcetypeDir>@project.theme-sourcetypeDir@</theme-sourcetypeDir>

Modified: forrest/trunk/main/webapp/default-forrest.properties
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/default-forrest.properties?rev=365795&r1=365794&r2=365795&view=diff
==============================================================================
--- forrest/trunk/main/webapp/default-forrest.properties (original)
+++ forrest/trunk/main/webapp/default-forrest.properties Tue Jan  3 17:55:05 2006
@@ -69,6 +69,7 @@
 project.translations-dir=${project.content-dir}/translations
 
 project.build-dir=${project.home}/build
+project.site=site
 project.temp-dir=${project.build-dir}/tmp
 
 

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/internal.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/internal.xmap?rev=365795&r1=365794&r2=365795&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/internal.xmap
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/internal.xmap
Tue Jan  3 17:55:05 2006
@@ -33,9 +33,11 @@
   <map:pipeline type="noncaching">    
     <map:match pattern="devTools/do/savePage.xml">
       <map:act type="write">
+        <map:parameter name="staging-dir" value="{project:staging-dir}"/>
         <map:generate type="request"/>
         <map:transform src="{lm:devTools.transform.saveRequest.success}">
           <map:paramaeter name="response" value="{message}"/>
+          <map:paramaeter name="staging-dir" value="{project:staging-dir}"/>
         </map:transform>
         <map:serialize type="xml-document"/>
       </map:act>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/resources/stylesheets/saveRequest-to-success.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/resources/stylesheets/saveRequest-to-success.xsl?rev=365795&r1=365794&r2=365795&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/resources/stylesheets/saveRequest-to-success.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/resources/stylesheets/saveRequest-to-success.xsl
Tue Jan  3 17:55:05 2006
@@ -22,6 +22,8 @@
   
   <!-- The response from the save action -->
   <xsl:param name="response"/>
+  <!-- The Staging Dir -->
+  <xsl:param name="staging-dir"/>
   
   <xsl:template match="h:request">
     <document>
@@ -45,6 +47,10 @@
         <section>
           <title>Details</title>
           <table>
+            <tr>
+              <th>Staging Directory</th>
+              <td><xsl:value-of select="$staging-dir"/></td>
+            </tr>
             <tr>
               <th>Staged URL</th>
               <td>/<xsl:value-of select="h:requestParameters/h:parameter[@name='URI']/h:value"/></td>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/src/java/org/apache/forrest/actions/WriteToLocalBuildAction.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/src/java/org/apache/forrest/actions/WriteToLocalBuildAction.java?rev=365795&r1=365794&r2=365795&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/src/java/org/apache/forrest/actions/WriteToLocalBuildAction.java
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/src/java/org/apache/forrest/actions/WriteToLocalBuildAction.java
Tue Jan  3 17:55:05 2006
@@ -43,13 +43,12 @@
 public class WriteToLocalBuildAction extends ServiceableAction implements ThreadSafe {
     Request request;
             
-    public String writeFile() {
-      String stagingDir = "D:\\openSource\\forrest\\whiteboard\\plugins\\org.apache.forrest.plugin.internal.DevTools\\build\\site";
+    public String writeFile(String stagingDir) {
       String url = request.getParameter("URI");
       String stagedFile = stagingDir + "/" + url;
-    
+          
       HttpClient client = new HttpClient();
-      GetMethod get = new GetMethod("http://localhost:8888/" + url);
+      GetMethod get = new GetMethod("http://" + request.getServerName() + ":" + request.getServerPort()
+"/" + url);
       
       try {
         int statusCode = client.executeMethod(get);
@@ -75,9 +74,11 @@
     
     public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String
src, Parameters par) throws Exception {      
         Map response = new HashMap();
+        String stagingDir = par.getParameter("staging-dir", "");
         
         request = ObjectModelHelper.getRequest(objectModel);
-        response.put("message", writeFile());
+        response.put("message", writeFile(stagingDir));
+        response.put("staging.dir", stagingDir);
 
         return response;
     }

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/status.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/status.xml?rev=365795&r1=365794&r2=365795&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/status.xml
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.DevTools/status.xml
Tue Jan  3 17:55:05 2006
@@ -50,17 +50,20 @@
 
   <todo>
     <actions priority="high">
-      <action context="docs" dev="open">
+      <action context="code" dev="open">
         <p>Provide a Javascript overlay menu that allows functions from this plugin
         to be easily accessed from within the browser. This can also provide information
         such as the validity of the page etc.</p>
       </action>
-      <action context="docs" dev="open">
+      <action context="code" dev="open">
         <p>Provide an indicator of how likely it is that a site, as a whole, is out
of date each time a page is saved.</p>
       </action>
-      <action context="docs" dev="open">
+      <action context="code" dev="open">
         <p>Provide an indicator on the page to show if the page is up to date in the
local site-build
         when previewing it.</p>
+      </action>
+      <action context="code" dev="open">
+        <p>Trap errors writng to files and report them to the user</p>
       </action>
     </actions>
   </todo>



Mime
View raw message