2011/12/01

Templates

This is a blog about the practical stuff that softens the learning curve of NetKernel. Now, I've been working with NetKernel since 2006, so my view of the learning curve might be somewhat skewed. Therefore your input on what I should discuss in this blog is welcomed at practical<dot>netkernel<at>gmail<dot>com.

This week I want to take a look at every developers' best friends (if, like me, your answer to the statement : Get a life ! is : Great, where can I download one of those ?) ... templates.

I don't like flame wars (or wars of any kind for that matter), so whatever your favorite development environment is, is fine by me. I use Scite, Eclipse, IntelliJ, NetBeans, Vim, Emacs, Textmate or whatever is available on the system I happen to be working on.

Templates feature in all of them. NetKernel is XML based (= lots of tags) and mostly - nCoDE is an exception - does not (and has no intention to) shield you from the basic layer ... the files.

So you need templates.

Name : nk:importhook
Description : NetKernel SimpleDynamicImportHook.xml Basics
Content :

<?xml version="1.0" encoding="${encoding}"?>
<connection>
  <type>[HTTPFulcrum]</type>
</connection>

Name : nk:books
Description : NetKernel Books.xml Basics
Content :

<?xml version="1.0" encoding="${encoding}"?>
<books>
  <book>
    <id>book:[moduleuri]</id>
    <title>[Module Name]</title>
    <desc>[modulename] documentation</desc>
    <toc>
      <item id="doc:[endpointid]"/>
    </toc>
  </book>
</books>

Name : nk:docs
Description : NetKernel Docs.xml Basics
Content :
<?xml version="1.0" encoding="${encoding}"?>
<docs>
  <doc>
    <id>doc:[endpointid]</id>
    <title>[Endpoint Name]</title>
    <desc>[endpointname] documentation</desc>
    <uri>res:/resources/documentation/doc_[endpointname].txt</uri>
  </doc>
</docs>

Name : nk:palette
Description : NetKernel CDEPalette.xml Basics
Content : 

<?xml version="1.0" encoding="${encoding}"?>
<palette>
  <group name="[groupname]" id="[groupid]" order="[100]"/>
  <endpoint id="[endpointid]" name="[endpointname]" group="[groupid]"/>
</palette>


Name : nk:tests
Description : NetKernel Tests.xml Basics
Content : 

<?xml version="1.0" encoding="${encoding}"?>
<tests>
  <test>
    <id>test:[moduleuri]</id>
    <name>[Module Name]</name>
    <desc>[modulename] unittest</desc>
    <uri>res:/resources/unittest/testlist.xml</uri>
  </test>
</tests>

There you have them. Note that my template system allows for the variable ${encoding}. Yours may or may not, replace with UTF-8 in the latter case. Anything between [square brackets] needs to be replaced or revised.


With those the work in /etc/system is as good as done. And so is the post for this week. Enjoy !