cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <iasan...@apache-korea.org>
Subject RE: [FYI] Stefano's Linotype
Date Tue, 06 May 2003 08:08:55 GMT
At last, I'm running my Linotype on
Cocoon-2.1-M2-dev
Tomcat 4.1.24-LE
JDK 1.4.1_02
Windows XP Pro SP1
at
http://168.126.185.211/linotype/ .

You can download this very running version from

Full version (i.e. including lib)
http://www.iasandcb.pe.kr/resources/ias-linotype-1.0-full.zip

Compact version (i.e. excluding lib)
http://www.iasandcb.pe.kr/resources/ias-linotype-1.0-compact.zip

Besides the previous modification on flow.js and news2edit.xslt, I made some
changes:

In org.betaversion.linotype.generation.RequestGenerator

    private void parse(String data)
    throws Exception {
        SAXParser parser = null;

data = data.replaceAll("&", "&amp;"); // added for accepting "&" character
at link input.

        try {
            parser = (SAXParser) manager.lookup(SAXParser.ROLE);
            StringReader inputStream = new StringReader(data);
            InputSource is = new InputSource(inputStream);
            parser.parse(is, new FilteringXMLConsumer(super.xmlConsumer));
        } catch (Exception e) {
            throw e;
        } finally {
            if (parser != null) manager.release((Component) parser);
        }
    }

In news2edit.xslt, added several actions for more convenience of editing,

    <div id="toolbar">
	 <span class="imagebutton" id="bold"><img
src="{$home}/images/icons/bold.gif" alt="Bold" title="Bold"/></span>
  	 <span class="imagebutton" id="italic"><img
src="{$home}/images/icons/italic.gif" alt="Italic" title="Italic"/></span>
	 <span class="imagebutton" style="margin-left: 10px"
id="underline"><img src="{$home}/images/icons/underline.gif" alt="Underline"
title="Underline"/></span>
	 <span class="imagebutton" id="insertorderedlist"><img
src="{$home}/images/icons/orderedlist.gif" alt="Ordered List" title="Ordered
List"/></span>
	 <span class="imagebutton" id="insertunorderedlist"><img
src="{$home}/images/icons/unorderedlist.gif" alt="Unordered List"
title="Unordered List"/></span>
	 <span class="imagebutton" style="margin-left: 10px"
id="outdent"><img src="{$home}/images/icons/outdent.gif" alt="Outdent"
title="Outdent"/></span>
	 <span class="imagebutton" id="indent"><img
src="{$home}/images/icons/indent.gif" alt="Indent" title="Indent"/></span>
	 <span class="imagebutton" id="justifyleft"><img
src="{$home}/images/icons/justifyleft.gif" alt="justifyleft"
title="justifyleft"/></span>
	 <span class="imagebutton" id="justifycenter"><img
src="{$home}/images/icons/justifycenter.gif" alt="justifycenter"
title="justifycenter"/></span>
	 <span class="imagebutton" id="justifyright"><img
src="{$home}/images/icons/justifyright.gif" alt="justifyright"
title="justifyright"/></span>
	 <span class="imagebutton" id="undo"><img
src="{$home}/images/icons/undo.gif" alt="undo" title="undo"/></span>
	 <span class="imagebutton" id="redo"><img
src="{$home}/images/icons/redo.gif" alt="redo" title="redo"/></span>
	 <span class="imagebutton" style="margin-left: 10px"
id="createlink"><img src="{$home}/images/icons/link.gif" alt="Insert Link"
title="Insert Link"/></span>
	 <input type="checkbox" name="online">
	  <xsl:if test="@online='on'"><xsl:attribute
name="checked">true</xsl:attribute></xsl:if>
	 </input>
	 <label for="online">published</label>
	</div>

(Sorry not to create patches due to the fact that Linotype is not based on
CVS.)

I hope this wonderful application would be developed and discussed more
broadly. Thank Stefano again.

P.S. Can we have a module for Linotype on some CVS repository? It could help
Linotype to evolve.

> -----Original Message-----
> From: news [mailto:news@main.gmane.org] On Behalf Of Stefano Mazzocchi
> Sent: Tuesday, April 29, 2003 12:15 PM
> To: cocoon-dev@xml.apache.org
> Subject: Re: [FYI] Stefano's Linotype
> 
> 
> on 4/28/03 6:03 PM Bernhard Huber wrote:
> 
> > hi,
> > as i'm using w2k it complains about sharing violation of
> document.xml
> > after editing it.
> > found in flow.js:
> > ....
> >                                 var output = new 
> > java.io.FileOutputStream(document + "/document.xml");
> >                                 process( "linotype/"
> +"action/save-" +
> > type,{},output);
> > ....
> > and i was missing some output.close(); statement, and changed it to:
> >                                 var output = new 
> > java.io.FileOutputStream(document + "/document.xml");
> >                                 process( "linotype/"
> +"action/save-" +
> > type,{},output);
> >                                 output.close();
> 
> uh, that's right. fixed.
> 
> > Moreover in Repository.java the method save(Part part, File
> file) does
> > not close its stream, too; but asfasik
> > it is never used, thus the missing close() is not
> harmfule,yet anyway
> > the correct method:
> >     public static void save(Part part, File file) throws Exception {
> >         log("[save] " + part.getFileName() + " -> " + file);
> >         InputStream in = null;
> >         FileOutputStream out = null;
> >         try {
> >             in = part.getInputStream();
> >             out = new FileOutputStream(file);
> > 
> >             copy(in, out);
> >         } finally {
> >             if (out != null) {
> >                 out.close();
> >             }
> >             if (in != null) {
> >                 in.close();
> >             }
> >         }
> >     }
> 
> This is used in the image upload code that is not yet ported to 
> linotype. I'm working on it.
> 
> --
> Stefano.
> 
> 
> 


Mime
View raw message