1 5 6 package org.exoplatform.services.xml.querying.impl.xtas.helper; 7 8 import org.exoplatform.services.xml.querying.InvalidStatementException; 9 import org.exoplatform.services.xml.querying.Statement; 10 import org.exoplatform.services.xml.querying.XMLData; 11 import org.exoplatform.services.xml.querying.XMLWellFormedData; 12 import org.exoplatform.services.xml.querying.helper.SimpleStatementHelper; 13 import org.exoplatform.services.xml.querying.impl.xtas.QueryType; 14 import org.exoplatform.services.xml.querying.impl.xtas.SimpleStatement; 15 import org.exoplatform.services.xml.querying.impl.xtas.UniFormTree; 16 import org.exoplatform.services.xml.querying.impl.xtas.UniFormTreeFragment; 17 import org.exoplatform.services.xml.querying.impl.xtas.WellFormedUniFormTree; 18 19 20 21 29 30 public class SimpleStatementHelperImpl implements SimpleStatementHelper 31 { 32 37 public Statement select(String match) throws InvalidStatementException 38 { 39 return select(match, null, null); 40 } 41 42 48 public Statement select(String match, String resource) throws InvalidStatementException 49 { 50 return select(match, resource, resource); 51 } 52 53 60 public Statement select(String match, String source, String destination) throws InvalidStatementException 61 { 62 return new SimpleStatement( QueryType.SELECT, match, (UniFormTreeFragment)null, source, destination); 63 } 64 65 70 public Statement delete(String match) throws InvalidStatementException 71 { 72 return delete(match, null, null); 73 } 74 75 81 public Statement delete(String match, String resource) throws InvalidStatementException 82 { 83 return delete(match, resource, resource); 84 } 85 86 93 public Statement delete(String match, String source, String destination) throws InvalidStatementException 94 { 95 return new SimpleStatement( QueryType.DELETE, match, (UniFormTreeFragment)null, source, destination); 96 } 97 98 104 public Statement append(String match, XMLData value) throws InvalidStatementException 105 { 106 return append(match, null, null, (UniFormTree)value); 107 } 108 109 116 public Statement append(String match, String resource, XMLData value) throws InvalidStatementException 117 { 118 return append(match, resource, resource, (UniFormTree)value); 119 } 120 121 129 public Statement append(String match, String source, String destination, XMLData value) throws InvalidStatementException 130 { 131 return new SimpleStatement( QueryType.APPEND, match, (UniFormTree)value, source, destination); 132 } 133 134 140 public Statement update(String match, XMLData value) throws InvalidStatementException 141 { 142 return update(match, null, null, (UniFormTree)value); 143 } 144 145 152 public Statement update(String match, String resource, XMLData value) throws InvalidStatementException 153 { 154 return update(match, resource, resource, (UniFormTree)value); 155 } 156 157 165 public Statement update(String match, String source, String destination, XMLData value) throws InvalidStatementException 166 { 167 return new SimpleStatement( QueryType.UPDATE, match, (UniFormTree)value, source, destination); 168 } 169 170 176 public Statement create(String resource, XMLWellFormedData initTree) throws InvalidStatementException 177 { 178 return new SimpleStatement( QueryType.CREATE, resource, (WellFormedUniFormTree)initTree, null, resource); 179 } 180 181 186 public Statement drop(String resource) throws InvalidStatementException 187 { 188 return new SimpleStatement( QueryType.DROP, resource, (UniFormTreeFragment)null, null, resource); 189 } 190 191 } 192 | Popular Tags |