Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Custom Node Type not being added with .cnd file

Avatar

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
marissaw9851252
Level 2

15-10-2015

I added a custom node type to the nodetypes.cnd file.  That file is in the META-INF/vault folder.  When the package is built, I cannot find this file in the package.  Is that a problem?  If so, where should this file be copied to?  To test if this may be the issue, I manually added the nodetypes.cnd file to the META-IN/vault folder of the package, but this did not solve the problem either.  I had successfully use a nodetype.cnd file a few months ago with AEM 6.0 to add a new namespace.  I am having an issue doing this now.  This time I an using AEM 6.1.

 

Contents of the nodetypes.cnd file: 

<'testXmpExt'='testXmpExt>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

15-10-2015

Did you also installed this file using package manager. If you just created this file manually then it won't work. To test your use case, I created a package with this file in AEM 6.1 and installed this package. Package installation logs below shows that it is installing new new node types- 

Installing node types... - sling -> http://sling.apache.org/jcr/sling/1.0 - nt -> http://www.jcp.org/jcr/nt/1.0 A testXmpExt -> testXmpExt - rep -> internal - sling:Folder - rep:RepoAccessControllable Installing privileges... 

Also, after this step I checked the node type administration page and I could see the new namespace registered.  - http://localhost:4502/crx/explorer/ui/namespace_editor.jsp?Path=&Callback=reload

Answers (9)

Answers (9)

Avatar

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
marissaw9851252
Level 2

15-10-2015

The package you provided installed fine.  I tweaked mine and it now seems to work.  The nodetypes.cnd file in the META-INF/vault folder has the following contents.  At first I added another cnd file under apps/shared/nodetypes, but I didn't end up needing it.  Thanks for the help.

<'sling'='http://sling.apache.org/jcr/sling/1.0'>
<'nt'='http://www.jcp.org/jcr/nt/1.0'>
<'rep'='internal'>
<'testXmpExt'='testXmpExt'>

[sling:Folder] > nt:folder
  - * (undefined) multiple
  - * (undefined)
  + * (nt:base) = sling:Folder version

[rep:RepoAccessControllable]
  mixin
  + rep:repoPolicy (rep:Policy) protected ignore

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

15-10-2015

I tested the attached package. Change the extension to ".zip" after download.

Avatar

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
marissaw9851252
Level 2

15-10-2015

I installed the package using package manager.  Can you attach the package that you created so I can compare it to mine?

Avatar

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
marissaw9851252
Level 2

15-10-2015

I tried both of the following and neither worked.

<'testXmpExt'='testXmpExt'>

<testXmpExt='testXmpExt'>

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

15-10-2015

I think the contents of the file are not right as per CND file notations. Can you check the documentation here and verify - https://jackrabbit.apache.org/jcr/node-type-notation.html

Avatar

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
marissaw9851252
Level 2

15-10-2015

I tried adding this file under /apps/testproject/nodetype and it still didn't work.

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

15-10-2015

I think the META-INF/vault location works when you include the cnd file as part of the OSGI bundle and configure the maven-bundle plugin for the same. But to install it using the package manager you can just include this file as normal content in any folder. For example, you can define filters in your package to deploy this file to /apps/<project>/nodetypes/nodetypes.cnd

Avatar

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
marissaw9851252
Level 2

Like

1 like

Total Posts

43 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
marissaw9851252
Level 2

15-10-2015

Yes.  I have this.

Avatar

Avatar
Validate 1
Employee
Opkar_Gill
Employee

Likes

138 likes

Total Posts

952 posts

Correct Reply

280 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Employee
Opkar_Gill
Employee

Likes

138 likes

Total Posts

952 posts

Correct Reply

280 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Opkar_Gill
Employee

15-10-2015

Did you include the meta-inf folder in your resource element to be included in your bundle?

<build>

        <resources>
            <resource>
                <directory>src/main/content/jcr_root</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/.vlt</exclude>
                    <exclude>**/.vltignore</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/content/META-INF/vault</directory>
                <targetPath>../vault-work/META-INF/vault</targetPath>
            </resource>
        </resources>