/*
 */

package au.gov.ansto.bragg.nexus.tool;

import java.net.MalformedURLException;

/** A NeXus project with all known URLs for the NeXus SVN base class templates.
 * 
 * @author drck
 * @version "%I%, %G%"
 */
public class SvnProject_ 
extends Project_ {

    /** SVN URL as of 2007-04-08: may be changed by user at run time */
    public static String $URL_SVN_BASE = "http://svn.nexusformat.org/definitions/trunk/base_classes/";
    
    /** All classes as of 2007-04-08: may be changed by user at run time */
    public static String[] CLASSES = {
    "NXaperture.xml",
    "NXattenuator.xml",
    "NXbeam.xml",
    "NXbeam_stop.xml",
    "NXbending_magnet.xml",
    "NXcharacterizations.xml",
    "NXcollimator.xml",
    "NXcrystal.xml",
    "NXdata.xml",
    "NXdetector.xml",
    "NXdisk_chopper.xml",
    "NXentry.xml",
    "NXenvironment.xml",
    "NXevent_data.xml",
    "NXfermi_chopper.xml",
    "NXfilter.xml",
    "NXflipper.xml",
    "NXgeometry.xml",
    "NXguide.xml",
    "NXinsertion_device.xml",
    "NXinstrument.xml",
    "NXlog.xml",
    "NXmirror.xml",
    "NXmoderator.xml",
    "NXmonitor.xml",
    "NXmonochromator.xml",
    "NXnote.xml",
    "NXorientation.xml",
    "NXpolarizer.xml",
    "NXpositioner.xml",
    "NXprocess.xml",
    "NXroot.xml",
    "NXsample.xml",
    "NXsensor.xml",
    "NXshape.xml",
    "NXsource.xml",
    "NXtranslation.xml",
    "NXuser.xml",
    "NXvelocity_selector.xml"
    };

    /** Constructs a project with the given directory and adds all remote templates from the NeXus SVN.
     */
    public SvnProject_(String $directory) {
        super($directory);
        
        for (String $class : CLASSES) {
            try {
                addXmlTemplate($URL_SVN_BASE+$class);
            } catch (MalformedURLException ex) {
                error(ex);
            }
        }
    }
    
}
