report IDL



Hi all!

Here is the latest report IDL. As you can see, I've converted the
Converter enum to an interface to do what was proposed on this list:
that is, to have a way of letting people add their own converters. Thus,
to add a converter, you create a CORBA server which implements the
Converter interface.

Of course, as with the rest of CORBA stuff in libgda, this interface
will be wrapped in a nice lib to make it easier to implement the
converters.

So, I'm waiting for your comments.

cheers




/* GDA Report Engine
 * Copyright (C) 2000 Rodrigo Moya
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef __gda_report_idl__
#define __gda_report_idl__

module GDA {
	
	/*
	 * Report I/O operations
	 */
	interface Stream {
		readonly attribute any contents;
		
		any  readChunk (in long start, in long size);
		long writeChunk (in any data, in long size);
	};
	
	/*
	 * Report structure
	 */
	struct Attribute {
		string name;
		string value;
	};
	typedef sequence<Attribute> AttributeList;
	
	interface Element;
	typedef sequence<Element> ElementList;
	enum ContentType {
		AnElement,
		PCDATA
	};
	union VE switch (ContentType) {
		case AnElement :
			ElementList elem_list;
		case PCDATA :
			string contents;
	};
	interface Element {
		readonly attribute string name;
		readonly attribute AttributeList attr_list;
		readonly attribute VE contents;
		
		void      addAttribute (in string name, in string value);
		void      removeAttribute (in string name);
		Attribute getAttribute (in string name);
		void      setAttribute (in string name, in string value);
		
		Element   addChild (in string name);
		void      removeChild (in string name);
	};
	
	interface Format {
		readonly attribute string xml;
		
		ElementList getStructure ();
		Stream      getStream ();
	};
	
	/*
	 * Report output format
	 */
	interface Converter {
	};
	typedef sequence<Converter> ConverterList;
	
	interface Output : Format {
		Stream convert (in Converter format, in long flags);
	};
	
	struct Param {
		string name;
		any value;
	};
	typedef sequence<Param> ParamList;
	
	interface Report {
		attribute string   name;
		attribute string   description;
		readonly attribute Format format;
		attribute boolean  is_locked;
		
		void   fromStream (in Stream stream);
		void   fromXML (in string xml);
		Output run (in ParamList params, in long flags);
		
		/* for shared I/O access */
		void lock   ();
		void unlock ();
	};
	typedef sequence<Report> ReportList;

	/*
	 * The report engine
	 */
	interface ReportEngine {
		readonly attribute ConverterList conv_list;
		
		ReportList queryReports (in string condition, in long flags);
		Report     openReport (in string rep_name);
		
		Report     addReport (in string rep_name, in string description);
		void       removeReport (in string rep_name);
		
		boolean    registerConverter (in string format, in Converter converter);
		void       unregisterConverter (in Converter converter);
	};
};

#endif






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]