Re: Sling Type System: started a wiki page for concepts, ideas, motivation

2019-01-13 Thread Christanto Leonardo
Hi,

> Christanto's types know about "multiple" and "required" attributes

Those are for AttributeDefinition. I don't think we need complex validation
for Attribute.
But for Property, pluggable validation is already supported by its API [1].

Cheers,
Christanto

[1]
https://github.com/christanto/sling-whiteboard/blob/a2cf3643b0c94181200705b7a11c756dc8684bd3/modeling/org.apache.sling.types.api/src/main/java/org/apache/sling/types/data/Property.java#L92



On Thu, Jan 10, 2019 at 10:45 PM Bertrand Delacretaz 
wrote:

> On Thu, Jan 10, 2019 at 3:36 PM Carsten Ziegeler 
> wrote:
> > This seems to have a lot in common what we already tried with the
> > validator api/module.
> >
> > https://github.com/apache/sling-org-apache-sling-validation-api ...
>
> Indeed, thanks for pointing this out.
>
> I was planning to merge ideas once we progress - for now I think
> Christanto's types know about "multiple" and "required" attributes, we
> probably need to add a more opaque Validator interface that might use
> this existing module underneath.
>
> But that can happen once we have at least an embryo of the Types API
> which I think should start as small as possible.
>
> -Bertrand
>


Re: Sling Type System: started a wiki page for concepts, ideas, motivation

2019-01-13 Thread Christanto Leonardo
Hi,

I extract out the module into API bundle and implementation bundle.
I also provide an example based on SlingShot content to generate HAL
response.
See the details at
https://github.com/christanto/sling-whiteboard/tree/master/modeling

Cheers,
Christanto


On Thu, Jan 10, 2019 at 8:59 PM Bertrand Delacretaz 
wrote:

> On Thu, Jan 10, 2019 at 4:33 AM Christanto Leonardo
>  wrote:
> > ...BTW I rename things to use "type" instead of "model"...
>
> Great!
>
> Would it be ok for you to extract the key interfaces into a separate
> module?
>
> I'm thinking of Types, DataType, AttributeDefinition and maybe a few
> others - just a minimal core that can be used to use the types,
> without considering how they are actually defined and with ideally no
> implementation details.
>
> My angle is to try to reduce the amount of things on which we need to
> agree on at this point - I'd then be able to recreate my minimal
> resource-schemas example based on these APIs, to verify that they
> provide what I need there, and you could pursue explorations
> independently on your side.
>
> -Bertrand
>


[jira] [Resolved] (SLING-8210) CMS - Support page templates to be json object

2019-01-13 Thread Mahsum Demir (JIRA)


 [ 
https://issues.apache.org/jira/browse/SLING-8210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahsum Demir resolved SLING-8210.
-
Resolution: Fixed

> CMS - Support page templates to be json object
> --
>
> Key: SLING-8210
> URL: https://issues.apache.org/jira/browse/SLING-8210
> Project: Sling
>  Issue Type: New Feature
>  Components: App CMS
>Reporter: Mahsum Demir
>Priority: Minor
>
> Currently page templates only support escaped json strings but these strings 
> are hard to change so I propose making page templates json objects.
>  
> For example, rather than writing:
>  
> {code:java}
> "template": "{\r\n \"jcr:primaryType\": \"sling:Page\",\r\n \"jcr:content\": 
> {\r\n \"jcr:primaryType\": \"nt:unstructured\",\r\n \"jcr:title\": 
> \"title\",\r\n \"sling:template\": 
> \"/conf/global/site/templates/base-page\",\r\n \"sling:resourceType\": 
> \"reference/components/pages/base\",\r\n \"published\": false\r\n }\r\n}"
> {code}
>  
> we will write:
> {code:java}
> "template": {
>   "jcr:primaryType": "sling:Page",
>   "jcr:content": {
> "jcr:primaryType": "nt:unstructured",
> "jcr:title": "{{title}}",
> "sling:template": "/conf/blog/site/templates/blog-post",
> "sling:resourceType": "blog/pages/blog-post",
> "published": false,
> "container": {
>   "blog_post_header": {
> "sling:resourceType": "blog/components/blog-header"
>   }
> }
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)