You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org> on 2011/03/12 16:57:59 UTC

[jira] Created: (CLEREZZA-460) Use whiteboard pattern for Renderlets

Use whiteboard pattern for Renderlets
-------------------------------------

                 Key: CLEREZZA-460
                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
             Project: Clerezza
          Issue Type: Improvement
            Reporter: Reto Bachmann-Gmür


The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.

The priority for selecting renderlets should be:
- type, according to type-priority list
- length of regex math (the matching regex with the most alphanumeric characters wins)
- startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür resolved CLEREZZA-460.
-----------------------------------------

    Resolution: Fixed

it seems my comment of April 2nd was wrong, and Daniel's patch can only unregisters renderlets actually registered by the manager. So no change needed.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür closed CLEREZZA-460.
---------------------------------------

    Resolution: Fixed

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Daniel Spicar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Spicar updated CLEREZZA-460:
-----------------------------------

    Attachment: renderletmgr_patch.diff

Attached a patch that fixes the issue of multiplied renderlet registrations when using RenderletManager

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008787#comment-13008787 ] 

Henry Story commented on CLEREZZA-460:
--------------------------------------

Adapted person_panel and profile_panel in the accountcontrolpanel to use the TypeRenderlet. Code committed.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027609#comment-13027609 ] 

Reto Bachmann-Gmür commented on CLEREZZA-460:
---------------------------------------------

Hi Daniel

I thought its good to discuss the issue you rise re. double registration
before closing the issue.

With the current ScalaServerPagesService the service needs to be
unregistered by the registering component, do you think this should be
different?

To allow registering the ssp with the bundleContext of the registering
component we could add a method which return the TypeRenderlet leaving it to
the caller to register it. Alternatively an oveloaded
registerScalaServerPage could take a BundleContext. What do you think?

Cheers,
Reto

2011/5/2 Reto Bachmann-Gmür (JIRA) <ji...@apache.org>



> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011228#comment-13011228 ] 

Reto Bachmann-Gmür commented on CLEREZZA-460:
---------------------------------------------

Thanks Daniel. I applied your patch. There is a hidden (by specifying the classname as a string) circular dependency to scala server pages, this should be avoided, the easiest I think would be to integrate this template in the ExceptionMapper, but this would require scala to java conversion (or changing to scala the rest).

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007405#comment-13007405 ] 

Bertrand Delacretaz commented on CLEREZZA-460:
----------------------------------------------

Using bundle startlevel to define service priorities is very unusual, I'd recommend using the service ranking instead.

Sorting the ServiceReference objects that a ServiceTracker returns is sufficient to take that value into account, see 
http://www.osgi.org/javadoc/r4v42/org/osgi/framework/ServiceReference.html

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007402#comment-13007402 ] 

Henry Story commented on CLEREZZA-460:
--------------------------------------

I am not sure about the priority maths, but I suppose we will when we see the code. Having a system that makes it easier to register renderlets seems like a good idea.

btw. I just came across this
http://doc.akka.io/http

A Scala, JSR311 actor based framework that functions with Jetty.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür reopened CLEREZZA-460:
-----------------------------------------


forgot about ScalaServerPagesService unregistering.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Daniel Spicar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Spicar updated CLEREZZA-460:
-----------------------------------

    Attachment: patch-typerendering-core.diff

I have seen that the TypeRenderinfExceptionMapper is always unsatisfied because it references RenderingManagerImpl instead of RenderletManager. I attached a patch to correct this.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Daniel Spicar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013526#comment-13013526 ] 

Daniel Spicar commented on CLEREZZA-460:
----------------------------------------

Currently it is possible to register the same Renderlet multiple times when using the (old) RenderletManager. This might be quite serious considering that most services still use the RenderletManager to register SSPs. When I register in the activate method, the renderlet gets registered each time the activate method is called resulting (according to the GUI) in the exact same renderlet specification being registered multiple times.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Assigned: (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür reassigned CLEREZZA-460:
-------------------------------------------

    Assignee: Reto Bachmann-Gmür

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Daniel Spicar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016325#comment-13016325 ] 

Daniel Spicar commented on CLEREZZA-460:
----------------------------------------

HI reto,

I am not really sure what you mean.

Are you saying that:

Bundle/Service A registered an SSP x with RenderletManagerImpl.
Service B wants to override SSP x using RenderletManagerImpl.
A is restarted during the override phase (for what reason do you mean? because of the unregister call in the update process or by coincidence for some other reason?)
B disappears before it finishes overriding?


> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007470#comment-13007470 ] 

Reto Bachmann-Gmür commented on CLEREZZA-460:
---------------------------------------------

The idea behind using the bundle-startlevel is for consistency with static resources. A Style bundle with a higher startlevel will overwrite resources /and/ renderlets with the same mode pattern and type.

As style bundles may not define styles for every resource one might want to load multiple style bundles on an instance. For example might one load the style "pink-world"  which defines templates for many resources making them look pink and "funny-persons" which provides templates for persons making them look more funny, if the latter has a lower startlevel persons look pink otherise funny. In general I thinkyou want to set the priority on the style-bundle-level and not on individual renderlets.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007714#comment-13007714 ] 

Reto Bachmann-Gmür commented on CLEREZZA-460:
---------------------------------------------

Committed a first version, deprectaing the RenderletManager. The next step is to adapt ScalaServerPages so that an SSP results in a TypeRenderlet without the indirection of the old renderlets.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Daniel Spicar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013897#comment-13013897 ] 

Daniel Spicar commented on CLEREZZA-460:
----------------------------------------

I investigated the problem of duplicated renderlet registration today. The problem does not lie in the fact of duplicates primarily. The major problem is that the number of registered renderlets can grow very fast when bundles/services are started stopped (a refresh in the OSGi framework may call the activate methods of many other bundles). 

I am not sure which rendering specification is chosen when duplicates exist. But this may also be problematic.

When implementing TypeRenderlets there the OSGi framework takes care of service registration and unregistration properly. The problem appears when either the RenderletManagerImpl or the ScalaServerPageService register Renderlets (upon request from another bundle). Then the Renderlets are registered using the bundleContext of the RenderletManagerImpl/ScalaServerPageService, and thus they are not unregistered when the bundle that called the registerScalaServerPage/registerRenderlet method disappears The corresponding Renderlets would only be unregistered when the typerendering.core/typerendering.scalaserpages bundle disappears.

One way of solving this is to check all registered renderlets to prevent duplication (semantics, add if no equal renderlet exists (what exactly is equal?), update with new specification when an equal renderlet exists.). But I think this defeats the purpose of changing to the whiteboard pattern, at least for Renderlets registered through the named services.

Another approach is to register the renderlets using the bundlecontext of the bundle that called registerrRenderlet/registerScalaServerPage. I did not test it but I expect that then the registered renderlets are unregistered when their bundle disappears. I think this requires a change of the Interface to get that bundlecontext. This interface change is not very sensible for the deprecated, old style RenderletManager. Also this will not really prevent duplicates, but will make sure that each Renderlet registered in a bundle will be unregistered when that bundle disappears. However another bundle may register the exact same renderlet again, then duplicates would exist. But this seems to be less of a problem than uncontrolled growth of registered renderlets that may occur currently.

Anyway. For now I suggest a quick fix in RenderletManagerImpl that checks all already registered renderlets before registering new renderlets.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Tsuyoshi Ito (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027574#comment-13027574 ] 

Tsuyoshi Ito commented on CLEREZZA-460:
---------------------------------------

What is about the problems mentioned by Daniel from 31/Mar/11 09:33 

When implementing TypeRenderlets...

Is this not an issue?

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015076#comment-13015076 ] 

Reto Bachmann-Gmür commented on CLEREZZA-460:
---------------------------------------------

Thanks Daniel for the patch, thanks to Tsuy for applying it. It might be better to keep a map of renderingspecifications to rendelter registrations so that RenderletManagerImpl nevers unregister renderlets register by other means, with the current version if a bundle tries to override a RenderletManager-renderlet the overriding service disappears when the bundle provideing the ssp it wants to override gets restarted.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-460) Use whiteboard pattern for Renderlets

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016349#comment-13016349 ] 

Reto Bachmann-Gmür commented on CLEREZZA-460:
---------------------------------------------

Hi Daniel,

The situation I was thinking at is:
Bundle A registered an SSP x with RenderletManager.
Bundle B wants to override the Renderlet  created for SSP x by implementing a typerenderlet.

If A is restared the service provided by B will disappear and only the typerenderlet provided by RenderletManagerImpl will be available, ven though the other typerenderlet would have a higher priority.


Problems also occur when one registers a service via ScalaServePagesService.registerScalaServerPage and duly unregisters it in the deactivate method.

> Use whiteboard pattern for Renderlets
> -------------------------------------
>
>                 Key: CLEREZZA-460
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-460
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>         Attachments: patch-typerendering-core.diff, renderletmgr_patch.diff
>
>
> The current mechanism for renderlets is overly complex. Instead of describing renderlets in a graph rendelets should be services that have properties indicating the rdf type and the mode-pattern they handle.
> The priority for selecting renderlets should be:
> - type, according to type-priority list
> - length of regex math (the matching regex with the most alphanumeric characters wins)
> - startlevel of the bundle providing the service

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira