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

Balz Schreier balz.schreier at gmail.com
Wed Feb 9 15:37:05 CET 2011


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!

<rc-repo>/<path>/<name>.html

- Is there a way how you can configure it?

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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wyona.org/pipermail/yanel-development/attachments/20110209/4139e205/attachment.html>
-------------- next part --------------
Index: src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java
===================================================================
--- src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java	(revision 56674)
+++ src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java	(working copy)
@@ -491,7 +491,16 @@
                 ((CreatableV2) newResource).create(request);
 
                 if (pathOfNewResource != null) {
-                    createResourceConfiguration(newResource);
+                    boolean createRC = true;
+                    try {
+                        String createRCString = getResourceConfigProperty("createRC");
+                        if (createRCString != null && "false".equals(createRCString)) {
+                            createRC = false;
+                        }
+                    }
+                    if (createRC == true) {
+                        createResourceConfiguration(newResource);
+                    }
                     addToSitetree(newResource, type);
                 }
             } else {


More information about the Yanel-development mailing list