You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2007/12/10 16:20:43 UTC
[jira] Commented: (SLING-129) microsling SyntheticResource, can be
used for request paths which do not have matching repository Nodes
[ https://issues.apache.org/jira/browse/SLING-129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550101 ]
Bertrand Delacretaz commented on SLING-129:
-------------------------------------------
Committed a simple implementation in revision 602927, SyntheticResource objects are created if no JCR Resource is found, and the path (iterated by ResourcePathIterator) matches one of the following default regexps:
public static String [] DEFAULT_PATH_REGEXP = {
"/search(/.*)?", // everything under /search
".*\\*$" // everything ending with *
};
We can of course make these regexps configurable, even if it's just in web.xml.
The "everything ending with *" is useful to solve the chicken-and-egg problem described in b) above, I'll try to explain more on the sling dev list as there's more to consider about this.
> microsling SyntheticResource, can be used for request paths which do not have matching repository Nodes
> -------------------------------------------------------------------------------------------------------
>
> Key: SLING-129
> URL: https://issues.apache.org/jira/browse/SLING-129
> Project: Sling
> Issue Type: Improvement
> Components: microsling
> Reporter: Bertrand Delacretaz
> Priority: Minor
>
> The Sling SyntheticResource [1] might be useful in microsling, for example:
> a) To implement search functions under /search, without having the corresponding nodes. For example, "/search/customer/foo" could mean "find all customers named foo", even though customers are not stored under /search
> b) To solve the chicken-and-egg problem of starting with an empty repository for a blog application, for example, where /content/blog/*.post.html should display an editing page, before any content exists.
> I'll implement a simple SyntheticResource based on path regexps: if the MicroslingResourceResolver doesn't find a Resource and the request path matches one of the regexps of the SyntheticResourceProvider, a SyntheticResource is selected.
> [1] https://svn.apache.org/repos/asf/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProvider.java
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.