<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Balz<br>
    <br>
    On 2/9/11 4:38 PM, Balz Schreier wrote:
    <blockquote
      cite="mid:AANLkTi=xypWdT2f5aP-CuHE5MiqA+YfDLjiDo8UQZb3r@mail.gmail.com"
      type="cite">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>
    </blockquote>
    <br>
    no, but it validates the resource name and namespace and this is
    what seems to fail in your case.<br>
    This specific check is not a bug, but there should be a warning
    about this, whereas I have added now<br>
    one<br>
    <br>
    Sending       
src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java<br>
    Transmitting file data .<br>
    Committed revision 56690.<br>
    <br>
    Cheers<br>
    <br>
    Michael<br>
    <br>
    <br>
    <blockquote
      cite="mid:AANLkTi=xypWdT2f5aP-CuHE5MiqA+YfDLjiDo8UQZb3r@mail.gmail.com"
      type="cite">
      <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=ISO-8859-1">
        <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 moz-do-not-send="true"
              href="mailto:michael.wechner@wyona.com">michael.wechner@wyona.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            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: 0pt 0pt 0pt
                0.8ex; border-left: 1px solid rgb(204, 204, 204);
                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: 0pt 0pt 0pt
                0.8ex; border-left: 1px solid rgb(204, 204, 204);
                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 class="h5"><br>
                <br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  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 moz-do-not-send="true"
                href="mailto:Yanel-development@wyona.com"
                target="_blank">Yanel-development@wyona.com</a><br>
              <a moz-do-not-send="true"
                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>
    </blockquote>
    <br>
  </body>
</html>