import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.RepositoryException;
-import javax.jcr.Session;
import javax.jcr.query.Query;
import javax.jcr.query.QueryManager;
// We add the tags
Map<String, String> tags = elements.get(key).getTags();
for (String tag : tags.keySet()) {
- childNode.setProperty(tag, tags.get(tag));
+ // remove forbidden characters
+ String cleanTag = JcrUtils.removeForbiddenCharacters(tag);
+ if (!cleanTag.equals(tag))
+ log.warn("Tag '" + tag + "' persisted as '" + cleanTag
+ + "'");
+ childNode.setProperty(cleanTag, tags.get(tag));
}
// We set the class in order to be able to retrieve
Node listNode;
int i;
for (i = 0; i < list.size(); i++) {
- TestResultPart trp = list.get(i);
+ // TestResultPart trp = list.get(i);
// FIXME : ResultParts are systematicaly added.
// There no check to see if already exists.
listNode = childNode.addNode("resultpart");
if (log.isTraceEnabled())
log.debug("Map node " + node.getPath() + " to bean " + clssName);
-
- // It's a very specific implementation,
+ // It's a very specific implementation,
// We don't need to use a bean wrapper.
TreeTestResult ttr = new TreeTestResult();
props: while (propIt.hasNext()) {
Property prop = propIt.nextProperty();
- //TODO Define a rule to generalize it (Namespace ??)
+ // TODO Define a rule to generalize it (Namespace ??)
// Get rid of specific case. mainly uuid
if ("uuid".equals(prop.getName())
|| prop.getName().equals(getClassProperty())
ttr.setAttachments(attachments);
}
- // STRUCTURED ELEMENTS
-
+ // STRUCTURED ELEMENTS
+
String basePath = node.getPath();
SortedMap<TreeSPath, PartSubList> resultParts = new TreeMap<TreeSPath, PartSubList>();
SortedMap<TreeSPath, StructureElement> elements = new TreeMap<TreeSPath, StructureElement>();
PropertyIterator tagIt = curNode.getProperties();
tags: while (tagIt.hasNext()) {
Property prop = tagIt.nextProperty();
- log.debug("Handling property named : " + prop.getName());
+ //log.debug("Handling property named : " + prop.getName());
- //TODO Define a rule to generalize it
+ // TODO Define a rule to generalize it
// Specific case. mainly uuid
if ("uuid".equals(prop.getName())
|| prop.getName().equals(getClassProperty())
ttr.setElements(elements);
// RESULTPARTS
-
+
// We have to had the uuid of the current node to be sure that we are in
// its sub tree
queryString = "//testresult[@uuid='" + uuid + "']";