Create a new resource type from scratch
Run build Script
Your resource type directory contains the following:
- ./yanel-htdocs/doc/index.html
- ./yanel-htdocs/icons/scalable/rt-icon.svg
- ./yanel-htdocs/icons/32x32/rt-icon.png
- ./yanel-htdocs/icons/22x22/rt-icon.png
- ./yanel-htdocs/icons/16x16/rt-icon.png
- ./resource.xml
- ./build.xml
- ./src/build/dependencies.xml
- ./src/build/build.properties
- ./src/java/org/yourname/yanel/impl/resources/ YourResource.java
Register New Resource
- Register your newly created resource to the local.resource-type.xml ($YANELHOME/conf/local/local.resource-type.xml) by adding following line:
<resource-type src="@YANEL_SRC_DIR@/src/contributions/resources/your-resource/" compile="true"/>
Implement Functionality
- Implement necessary functionality in the YourResource.java.
Rebuild Yanel
- Rebuild the Yanel so that yanel can build our newly created resource-type also.
- Please note that a resource type can also be built on its own
(e.g. ./build.sh -f src/resources/xml/build.xml), whereas one might has to
update the dependencies (e.g. src/resources/xml/src/build/dependencies.xml)
Restart Yanel
- Type build script ./yanel.sh start for Linux or start-yanel.bat for Windows
- Your new resource type should be listed now at http://127.0.0.1:8080/yanel/
Add Resource Type configuration
- Yanel looks up
a configuration for a requested URL, to determine what resource-type to use.
This resource-type configuration files are located in the repository which is configured
as the rti (resource type identifier) repository in a realm.
- (e.g $YANELHOME/src/realms/use-cases/yanel/rti/your-resource.html.yanel-rc)
<?xml version="1.0"?><yanel:resource-config xmlns:yanel="http://www.wyona.org/yanel/rti/1.0">
<yanel:rti name="hello-world"namespace="http://yourname.org/yanel/resource/1.0"/></yanel:resource-config>
Browse Resource
- You can view the newly created resource by browsing
http://localhost:8080/yanel/test/use-cases/your-resource.html.