added logs when appending body to genericResources

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/rmp-common-library@84985 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-11-05 15:57:56 +00:00
parent 98a422c6cf
commit 5b89e5423a
1 changed files with 4 additions and 1 deletions

View File

@ -227,6 +227,9 @@ public class GenericResourceManager extends AbstractResourceManager {
* @throws ParserConfigurationException
*/
public static void appendXmlFragment(Profile profile, String fragment) throws IOException, ParserConfigurationException {
ServerConsole.debug(LOG_PREFIX, "Appending to <Body> " + fragment);
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Element elem = profile.newBody();
Node fragmentNode;
@ -236,7 +239,7 @@ public class GenericResourceManager extends AbstractResourceManager {
elem.appendChild(fragmentNode);
} catch (SAXException e) {
//in case no xml is entered, just text
System.out.println("to append: " + fragment);
ServerConsole.warn("no valid xml appending this:" + fragment);
profile.newBody(fragment);
}