The main question to answer is the following: Is the node '/content' a content or are contents only the nodes under '/content'? (I would now balance to '/content' not being a content)
There are many inconsistencies at different level:
At data level:
Not treated as a content: The node '/content' has a _nodeType "default" and not "content", unlike other contents
Treated as a content: The node '/content' has a type "base:folder", a displayName "Content", ... Basically all the properties of a content
Content Service:
Treated as a content: Retrieving the content for the path '/' through the content service will return the node '/content'
ContentPath:
Not treated as a content: You cannot really create a ContentPath for the content path '/'. There is event a check "No content can be "root content": " somewhere in the code.
The main question to answer is the following: Is the node '/content' a content or are contents only the nodes under '/content'? (I would now balance to '/content' not being a content)
There are many inconsistencies at different level:
At data level: Not treated as a content: The node '/content' has a _nodeType "default" and not "content", unlike other contents Treated as a content: The node '/content' has a type "base:folder", a displayName "Content", ... Basically all the properties of a content
Content Service: Treated as a content: Retrieving the content for the path '/' through the content service will return the node '/content'
ContentPath: Not treated as a content: You cannot really create a ContentPath for the content path '/'. There is event a check "No content can be "root content": " somewhere in the code.
Portal: Treated as a content: If you call a controller (example: http://localhost:8080/portal/draft/_/service/com.enonic.app.myapp/myservice) without a content path, the current content is the node '/content'. A call to portalLib.getContent will return the node '/content' as a content.
An obvious impact of this inconsistencies is for URL generation,
Example of test:
Correct: http://localhost:8080/portal/draft/features/_/service/com.enonic.app.features/test
/portal/draft/features/_/service/com.enonic.app.features/myservice
http://localhost:8080/portal/draft/features/subcontent/_/service/com.enonic.app.features/test/portal/draft/features/subcontent/_/service/com.enonic.app.features/myservice
Incorrect(execute while being admin or cms.cm.app) http://localhost:8080/portal/draft/_/service/com.enonic.app.features/test
/portal/draft/content/_/service/com.enonic.app.features/myservice