... throw your laptop through the glass block window.
Yes. I'm back at it in spades on something that should be pretty simple. Problem is there is lots of rhetoric on how it should/could/would be done, but honestly nothing of practical use. This was not simply 10 minutes of Googling, throw my hand up and "Ach du lieber gott!" No no no. My most egregious sin is once I get it in my head that it should be simple and should be done a certain way, I'm not likely to give up any easier then my dog is to give up her chew toy.
What was the issue? I simply wanted to register a new Namespace programmatically. Simply, right? Well, this also related to registering new Nodetypes as well as I discovered. Pretend I never wrote that last sentence.
So my main man Center of Excellence has been slogging through the Sling source (say 10 times fast please) as of late, When I pinged him about my Namespace registration issue, he shot me a link to a particular POM in the Sling source. Et viola...the skies part, and the little bearded face from Monty Python's The Holy Grail appears... Well, maybe less dramatic.
I had been following some of the various links I found about creating CND files, making sure the right sling:resourceType/jcr:primaryType is set, and all kinds of crazy crap you try when you are ready to done with something that should have taken 15 minutes. I just wanted to register a new Namespace!
So, for posterities sake, Sling JCR Resource project is the place. Look at the Sling Bundle section, and there are two areas: <Sling-Namespaces> and <Sling-Nodetypes>. These are what you need. Thats it. Thats all.
Now, I will say that in 5+ years of CQ development I have never had the necessity of creating custom Nodetypes. Should I be ashamed? Doubtful.
This is what I have equated creating custom Node types with: the "good/bad thing". You know the good/bad thing: ".. all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light" - that good/bad thing. Now its likely that I have not pushed the technology hard enough to need something like that. But, in my onion, why would I want to move from relational database backed systems with schema's and schemes and little bitty gotcha's to our great and wonderful JCR backed CMS... only to recreate what I just left? Database's have their uses, as well as "well formed content". But most things I have worked with don't require the strict structure similar to nt:file where certain properties are mandatory. I wont mention hard or soft references either. I could tell you a story about a CMS called Vignette VCM ... but I would start to have nightmares again.
K - maybe there is the need for it, but I haven't met it yet. Just sayin.
Enjoy.