W3C logo
Jigsaw

CC/PP and Jigsaw


Jigsaw Home / Documentation Overview / Tutorials

Introduction

Jigsaw has an simple implementation of CC/PP, it's mainly a framework for CC/PP developpers. It is assumed that you are familiar with Jigsaw architecture, and that you have understand the configuration tutorial.

Here we describe the CC/PP framework available in Jigsaw, it is based on the "CC/PP exchange protocol based on HTTP Extension Framework" W3C Note.

Jigsaw provide a set of classes that developpers can use to build a CC/PP application:

org.w3c.jigsaw.ccpp.CCPPFrame
Should take replace the usual HTTPFrame
org.w3c.jigsaw.ccpp.CCPPRequest
A wrapper for the classic Request class, provide some CC/PP functionalities.
org.w3c.jigsaw.ccpp.CCPPWarning
the CC/PP Warning
org.w3c.jigsaw.ccpp.ProfileRef
The CC/PP Profile Reference

Writing a CC/PP application

If you want to write a CC/PP application you will need to write a new Frame that inherits from CCPPFrame and define the behaviour of the usual HTTP methods (GET, HEAD, PUT, ...).


    public class MyCCPPFrame extends CCPPFrame {

        /**
         * My CC/PP GET method.
         * @param request The request to handle.
         * @exception ProtocolException If processsing the request failed.
         * @exception ResourceException If the resource got a fatal error.
         */

        public Reply get(Request request) 
    	    throws ProtocolException, ResourceException
        {
            CCPPRequest ccpprequest = getCCPPRequest(request);
            
            Reply reply = createDefaultReply(request, HTTP.OK);

            ProfileRef[] refs = ccpprequest.getProfileReferences();
 
            // ...

            return reply;
        }

    }
	
When your frame is written, you just have to modify the Jigsaw configuration in order to use your frame instead of the classic HTTPFrame. You should read the documenation about indexers.