textedit

an simple text editor with syntax highlighting (codemirror)
highlight for syntax configured at the moment:

  • html/xml
  • css

Overview

Name:
textedit
Namespace:
http://litwan.com/yanel/resource/1.0
Universal Name:
<{http://litwan.com/yanel/resource/1.0}textedit/>
Description:
textedit resource type.
Java Class:
com.litwan.yanel.impl.resources.imageresizer.TextEditResource

Resource Configuration

the svg-edit resource needs a ExecutableUsecaseResource alike custom-config e.g.

    <yanel:custom-config>
     <views>
      <view id="default" type="jelly-XML">
        <template>rthtdocs:/textedit.jelly</template>
        <mime-type>text/html</mime-type>
        <xslt>/xslt/global.xsl</xslt>
      </view>
      <view id="done" type="jelly-text">
        <template>rthtdocs:/textedit-status.jelly</template>
        <mime-type>text/html</mime-type>
        <xslt>/xslt/global.xsl</xslt>
      </view>
      <view id="cancel" type="jelly-text">
        <template>rthtdocs:/textedit-status.jelly</template>
        <xslt>/xslt/global.xsl</xslt>
        <mime-type>text/html</mime-type>
      </view>
    </views>
  </yanel:custom-config>

Request Paramter

yanel.resource.svg-edit.editor-content
the editors content
yanel.resource.svg-edit.continue-path
the path to go after the response.

Basic Example:

First you need to register the resource type as usual. add following line with the correct path to your (local.)resource-types.xml

<resource-type src="/home/simon/src/3k3-yanel-contrib/resource-types/textedit/" compile="true"/>

after this you need to add a matcher to the map.rc-map file e.g.

  <matcher pattern="**.textedit.html" rcpath="/usecases/textedit.html.yanel-rc"/>

then you need to create in /usecses an svg-edit.html.yanel-rc file with following content.

<?xml version="1.0"?>
<yanel:resource-config xmlns:yanel="http://www.wyona.org/yanel/rti/1.0">
  <yanel:rti name="textedit" namespace="http://litwan.com/yanel/resource/1.0"/>
    <yanel:property name="matcher-extension" value=".textedit.html"/>
    <yanel:custom-config>
     <views>
      <view id="default" type="jelly-XML">
        <template>rthtdocs:/textedit.jelly</template>
        <mime-type>text/html</mime-type>
        <xslt>/xslt/global.xsl</xslt>
      </view>
      <view id="done" type="jelly-text">
        <template>rthtdocs:/textedit-status.jelly</template>
        <mime-type>text/html</mime-type>
        <xslt>/xslt/global.xsl</xslt>
      </view>
      <view id="cancel" type="jelly-text">
        <template>rthtdocs:/textedit-status.jelly</template>
        <xslt>/xslt/global.xsl</xslt>
        <mime-type>text/html</mime-type>
      </view>
    </views>
  </yanel:custom-config>
</yanel:resource-config>


to edit http://localhost:8080/realm/css/screen.css go to http://localhost:8080/3k3-resource-type-demo/css/screen.css.textedit.html

Demo

no demo yet

Source

browse svn repo: http://trac.yanel-contribution.3k3.org/browser/resource-types/textedit
checkout source:

svn co https://svn.3k3.org/repos/public/yanel/resource-types/textedit

License

apache license 2.0