001 /**
002 * Copyright 2005-2011 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.edl.impl;
017
018 import java.io.StringReader;
019
020 import javax.xml.parsers.DocumentBuilderFactory;
021 import javax.xml.xpath.XPathExpressionException;
022
023 import org.kuali.rice.edl.framework.workflow.EDocLitePostProcessor;
024 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
025 import org.w3c.dom.Document;
026 import org.xml.sax.InputSource;
027
028
029 /**
030 * Used by {@link EDocLitePostProcessorTest} to test the {@link #postEvent(Long, Object, String)} method
031 *
032 * @author Kuali Rice Team (rice.collab@kuali.org)
033 *
034 */
035 public class TestEDocLitePostProcessor extends EDocLitePostProcessor {
036
037 public static final String CONTEXT_NAME = "/edl-test";
038
039 public static String getURL(Document edlDoc) throws XPathExpressionException {
040 return System.getProperty("basedir") + CONTEXT_NAME;
041 }
042
043 public static Document getEDLContent(DocumentRouteHeaderValue routeHeader) throws Exception {
044 String content = "<content><data>yahoo</data></content>";
045 Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(content)));
046 return doc;
047 }
048
049 }