/*
 * Copyright 2006 Wyona
 */

package org.wyona.yanel.impl.resources;

import org.wyona.yanel.core.Resource;
import org.wyona.yanel.core.api.attributes.ViewableV2;
import org.wyona.yanel.core.attributes.viewable.View;
import org.wyona.yanel.core.attributes.viewable.ViewDescriptor;

import org.apache.log4j.Category;

/**
 *
 */
public class CalendarResource extends Resource implements ViewableV2 {

    private static Category log = Category.getInstance(CalendarResource.class);

    /**
     *
     */
    public CalendarResource() {
    }

    /**
     *
     */
    public long getSize() throws Exception {
        log.warn("Not implemented yet!");
        return -1;
    }

    /**
     *
     */
    public boolean exists() throws Exception {
        log.warn("Not implemented yet!");
        return false;
    }

    /**
     *
     */
    public View getView(String viewId) throws Exception {
        log.warn("Not implemented yet!");
        //response.getOutputStream();

        View view = new View();
        //view.setResponse(false);
	view.setMimeType("text/plain");
	view.setInputStream(new java.io.StringBufferInputStream("Hello Calendar"));
        return view;
    }

    /**
     *
     */
    public ViewDescriptor[] getViewDescriptors() {
        log.warn("Not implemented yet!");
        return null;
    }
}

@@ -909,41 +909,768 @@
     
-log.warn(%22Not implemented yet!%22);
+org.wyona.yarep.core.Repository dataRepo = getRealm().getRepository();%0A        org.wyona.yarep.core.Path%5B%5D children = dataRepo.getChildren(new org.wyona.yarep.core.Path(getPath().toString()));%0A        for (int i = 0; i %3C children.length; i++) %7B%0A            log.error(%22DEBUG: Child: %22 + children%5Bi%5D);%0A            if (dataRepo.isResource(children%5Bi%5D)) %7B%0A            java.io.InputStream in = dataRepo.getInputStream(children%5Bi%5D);%0A            StringBuffer event = new StringBuffer();%0A            %0A            byte%5B%5D buffer = new byte%5B8192%5D;%0A            int bytesRead;%0A            while ((bytesRead = in.read(buffer)) != -1) %7B%0A                event.append(new String(buffer));%0A            %7D%0A%0A            log.error(%22DEBUG: Event: %22 + event);%0A            %7D%0A        %7D%0A
 %0A   

read events