svg-edit

an integration of the nice browser based svg editor svg-edit

Overview

Name:
svg-edit
Namespace:
http://www.litwan.com/yanel/resource/1.0
Universal Name:
<{http://www.litwan.com/yanel/resource/1.0}svg-edit/>
Description:
svg-edit resource type.
Java Class:
com.litwan.yanel.impl.resources.imageresizer.SvgEditResource

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:/svg-edit.jelly</template>
        <mime-type>text/html</mime-type>
      </view>
      <view id="done" type="jelly-text">
        <template>rthtdocs:/svg-edit-status.jelly</template>
        <mime-type>text/plain</mime-type>
        <serializer key="TEXT"/>
      </view>
      <view id="cancel" type="jelly-text">
        <template>rthtdocs:/svg-edit-status-html.jelly</template>
        <xslt>/app1/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/svg-edit/" compile="true"/>

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

  <matcher pattern="**.svg.svg-edit.html" rcpath="/usecases/svg-edit.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="svg-edit" namespace="http://www.litwan.com/yanel/resource/1.0"/>
    <yanel:custom-config>
     <views>
      <view id="default" type="jelly-XML">
        <template>rthtdocs:/svg-edit.jelly</template>
        <mime-type>text/html</mime-type>
      </view>
      <view id="done" type="jelly-text">
        <template>rthtdocs:/svg-edit-status.jelly</template>
        <mime-type>text/plain</mime-type>
        <serializer key="TEXT"/>
      </view>
      <view id="cancel" type="jelly-text">
        <template>rthtdocs:/svg-edit-status-html.jelly</template>
        <xslt>/app1/xslt/global.xsl</xslt>
        <mime-type>text/html</mime-type>
      </view>
    </views>
  </yanel:custom-config>
</yanel:resource-config>

to edit http://localhost:8080/realm/svg/test.svg go to http://localhost:8080/3k3-resource-type-demo/svg/test.svg.svg-edit.html

Demo

http://demo.yanel-contribution.3k3.org/svg/test.svg.svg-edit.html

Source

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

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

License

apache license 2.0