[Yanel-dev] Create new page (resource-creator Resource Contribution)

Michael Wechner michael.wechner at wyona.com
Wed Feb 9 16:11:33 CET 2011


Hi Balz

On 2/9/11 2:37 PM, Balz Schreier wrote:
> Hi,
>
> does anybody know this:
>
> - Via Yanel Toolbar, you can create a new page in your realm (static 
> web page).
> - 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!

it shouldn't actually, see 
src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java

     private void createResourceConfiguration(Resource newResource) 
throws Exception {
         // Check on resource configuration map first
         org.wyona.yanel.core.map.Realm realm = newResource.getRealm();
         String rcPath = 
org.wyona.yanel.core.ResourceConfigurationMap.getRCPath(realm, 
newResource.getPath());
         if (rcPath != null) {
             if (realm.getRTIRepository().existsNode(rcPath)) {
                 ResourceConfiguration rc = new 
ResourceConfiguration(realm.getRTIRepository().getNode(rcPath));
                 if (rc != null && 
newResource.getRTD().getResourceTypeLocalName().equals(rc.getName()) && 
newResource.getRTD().getResourceTypeNamespace().equals(rc.getNamespace())) {
                     log.warn("Path of new resource '" + 
newResource.getPath() + "' matches within resource configuration map and 
hence no resource config will be created!");
                     return;
>
> <rc-repo>/<path>/<name>.html
>
> - Is there a way how you can configure it?

what do mean exactly to configure it? That it does not get created?


Thanks

Michael

>
> If not:
> I wrote the attached patch, so that you can configure the resource 
> whether it should create the RC file too.
> If you are happy with the extension, please commit :-)
>
> 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.
>
> Thanks!
>



More information about the Yanel-development mailing list