Hi Michi,<div>you are right, there is a return in that IF, but it obviously does not match the condition in my realm.</div><div>As I do not understand the whole code there, I can only guess: Does it only look for 1:1 mappings to a certain Realm-Path ?</div>
<div>In my realm, there is no single 1:1 mapping, all of the mapping is in the rc-map file.</div><div><br></div><div>Maybe a slight refactoring of that IF section would help?</div><div>I could think of the following way:</div>
<div>- Try to receive the resource instance for the newly created realm PATH.</div><div>- If the resource is not NULL, then there is no need to create the extra RC file, if it IS null, then you can go ahead and create the RC file.</div>
<div><br></div><div>I used the retrieval of resources in my code this way:</div><div><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
</style>


<p class="p1">Resource res = Yanel.getInstance().getResourceManager().getResource(environment, realm, path);</p></div><div><br></div><div>This works quite good.</div><div>Cheers</div><div>Balz</div><div><br><div class="gmail_quote">
On Wed, Feb 9, 2011 at 4:11 PM, Michael Wechner <span dir="ltr"><<a href="mailto:michael.wechner@wyona.com">michael.wechner@wyona.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Balz<div class="im"><br>
<br>
On 2/9/11 2:37 PM, Balz Schreier wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
does anybody know this:<br>
<br>
- Via Yanel Toolbar, you can create a new page in your realm (static web page).<br>
- This works fine, except that the creating resource does not only create the new HTML page but also saves a resource configuration file (RC) in the RC repository!<br>
</blockquote>
<br></div>
it shouldn't actually, see src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java<br>
<br>
    private void createResourceConfiguration(Resource newResource) throws Exception {<br>
        // Check on resource configuration map first<br>
        org.wyona.yanel.core.map.Realm realm = newResource.getRealm();<br>
        String rcPath = org.wyona.yanel.core.ResourceConfigurationMap.getRCPath(realm, newResource.getPath());<br>
        if (rcPath != null) {<br>
            if (realm.getRTIRepository().existsNode(rcPath)) {<br>
                ResourceConfiguration rc = new ResourceConfiguration(realm.getRTIRepository().getNode(rcPath));<br>
                if (rc != null && newResource.getRTD().getResourceTypeLocalName().equals(rc.getName()) && newResource.getRTD().getResourceTypeNamespace().equals(rc.getNamespace())) {<br>
                    log.warn("Path of new resource '" + newResource.getPath() + "' matches within resource configuration map and hence no resource config will be created!");<br>
                    return;<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<rc-repo>/<path>/<name>.html<br>
<br>
- Is there a way how you can configure it?<br>
</blockquote>
<br></div>
what do mean exactly to configure it? That it does not get created?<br>
<br>
<br>
Thanks<br>
<br>
Michael<div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If not:<br>
I wrote the attached patch, so that you can configure the resource whether it should create the RC file too.<br>
If you are happy with the extension, please commit :-)<br>
<br>
In the realm I am working for we do not want that RC file because we have a default resource dealing with any kind of static content.<br>
<br>
Thanks!<br>
<br>
</blockquote>
<br></div></div><font color="#888888">
-- <br>
Yanel-development mailing list <a href="mailto:Yanel-development@wyona.com" target="_blank">Yanel-development@wyona.com</a><br>
<a href="http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development" target="_blank">http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development</a><br>
</font></blockquote></div><br></div>