View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.edl.impl;
17  
18  import java.io.StringReader;
19  
20  import javax.xml.parsers.DocumentBuilderFactory;
21  import javax.xml.xpath.XPathExpressionException;
22  
23  import org.kuali.rice.edl.framework.workflow.EDocLitePostProcessor;
24  import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
25  import org.w3c.dom.Document;
26  import org.xml.sax.InputSource;
27  
28  
29  /**
30   * Used by {@link EDocLitePostProcessorTest} to test the {@link #postEvent(Long, Object, String)} method 
31   * 
32   * @author Kuali Rice Team (rice.collab@kuali.org)
33   *
34   */
35  public class TestEDocLitePostProcessor extends EDocLitePostProcessor {
36  
37      public static final String CONTEXT_NAME = "/edl-test";
38  
39      public static String getURL(Document edlDoc) throws XPathExpressionException {
40          return System.getProperty("basedir") + CONTEXT_NAME;
41      }
42  
43      public static Document getEDLContent(DocumentRouteHeaderValue routeHeader) throws Exception {
44          String content = "<content><data>yahoo</data></content>";
45          Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(content)));
46          return doc;
47      }
48  
49  }