1 9 package org.jboss.portal.test.cms.stress; 10 11 import org.jboss.portal.cms.NodeFactory; 12 import org.jboss.portal.cms.Node; 13 import org.jboss.portal.cms.Content; 14 import org.jboss.portal.cms.NodeException; 15 16 20 public class CreateContentCommand extends Command 21 { 22 23 private final String uri; 24 private final String s; 25 26 public CreateContentCommand(String uri, String s) 27 { 28 this.uri = uri; 29 this.s = s; 30 } 31 32 public void execute(Client.Result result, NodeFactory factory) throws NodeException 33 { 34 Content content = new Content(s.getBytes(), "text/html"); 35 Node node = factory.getNode(uri); 36 node.createContent(content, true); 37 } 38 39 protected String describe() 40 { 41 return "[createcontent," + uri + "," + s + "]"; 42 } 43 } 44 | Popular Tags |