001: /********************************************************************************
002: * CruiseControl, a Continuous Integration Toolkit
003: * Copyright (c) 2007, ThoughtWorks, Inc.
004: * 200 E. Randolph, 25th Floor
005: * Chicago, IL 60601 USA
006: * All rights reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * + Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * + Redistributions in binary form must reproduce the above
016: * copyright notice, this list of conditions and the following
017: * disclaimer in the documentation and/or other materials provided
018: * with the distribution.
019: *
020: * + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
021: * names of its contributors may be used to endorse or promote
022: * products derived from this software without specific prior
023: * written permission.
024: *
025: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
026: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
027: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
028: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
029: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
030: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
031: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
032: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
033: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
034: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
035: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
036: ********************************************************************************/package net.sourceforge.cruisecontrol.dashboard.widgets;
037:
038: import java.util.Map;
039:
040: /**
041: * <pre>
042: * Widget is designed to help faciliate developers to contribute new output services,
043: * like emma, checkstyle, panopticode. the main function is getOutput which takes Map as parameter,
044: * CruiseControl reporting will pass in embedded values with keys:
045: *
046: * PARAM_PJT_ARTIFACTS_ROOT : Artifacts root of project, e.g. artifacts/project1
047: * PARAM_BUILD_ARTIFACTS_ROOT : Artifacts root of build, e.g. artifacts/project1/20051209122103
048: * PARAM_CC_ROOT : Parent folder of config.xml
049: * PARAM_PJT_NAME : Name of project e.g. project1
050: * PARAM_PJT_LOG_ROOT : Root of project log e.g.logs/project1
051: * PARAM_BUILD_LOG_FILE : Log file of build e.g. log20051209122103.xml
052: * PARAM_WEB_CONTEXT_PATH : Web context root e.g. "/dashboard"
053: *
054: * <p> In order to enable your service in the system, go to the root directory of cruisecontrol,
055: * and simply add/edit widgets.cfg to include the class name. e.g. com.foo.Class <p>
056: * </pre>
057: */
058:
059: public interface Widget {
060: /**
061: * Widgets framework will associate artifacts root path with the following key.
062: */
063: public static final String PARAM_PJT_ARTIFACTS = "PJT_ARTIFACTS";
064:
065: /**
066: * Widgets framework will associate artifacts root path of the build with the following key.
067: */
068: public static final String PARAM_BUILD_ARTIFACTS_ROOT = "BUILD_ARTIFACTS_ROOT";
069:
070: /**
071: * Widgets framework will associate CruiseControl root path with the following key.
072: */
073: public static final String PARAM_CC_ROOT = "CC_ROOT";
074:
075: /**
076: * Widgets framework will associate project name with the following key.
077: */
078: public static final String PARAM_PJT_NAME = "PJT_NAME";
079:
080: /**
081: * Widgets framework will associate log root path with the following key.
082: */
083: public static final String PARAM_PJT_LOG_ROOT = "PJT_LOG_ROOT";
084:
085: /**
086: * Widgets framework will associate log file name with the following key.
087: */
088: public static final String PARAM_BUILD_LOG_FILE = "BUILD_LOG_FILE";
089:
090: /**
091: * CC Reporting system will pass in its web context root e.g. "/dashboard"
092: */
093: public static final String PARAM_WEB_CONTEXT_PATH = "WEB_CONTEXT_ROOT";
094:
095: /**
096: * @param parameters all the parameters user defined in widget, besides the embedded values.
097: * @return the Object to be displayed in the tab of build detail page
098: */
099: public Object getOutput(Map parameters);
100:
101: /**
102: * The displayed title in tab view in build detail page.
103: *
104: * @return the name displaied in tab view.
105: */
106: public String getDisplayName();
107:
108: }
|