cancel
Showing results for 
Search instead for 
Did you mean: 

Unicode string as NamedValue

amarinkovic
Champ in-the-making
Champ in-the-making
I'm accessing Alfresco content server via web service and importing some content into it. I'm trying to import it as a custom type and want  to set UTF-8(cyrillic) string on a property of that type we previously defined in our custom model. I keep getting Sax parser exception:

org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1b) was found in the element content of the document.

I'm using alfesco community version 2.9B.

How can I import content with cyrillic property values?
2 REPLIES 2

amarinkovic
Champ in-the-making
Champ in-the-making
Maybe I was a little bit confusing. How do I import content with cyrillic NamedValue?



NamedValue[] namedValueProperties = new NamedValue[2];

namedValueProperties[0] = Utils.createNamedValue(Constants.PROP_NAME, name );
namedValueProperties[1] = Utils.createNamedValue("{my.custom.model}myProperty", "CYRILLIC STRING!");

CMLCreate create = new CMLCreate("1", parentReference, null, null, null, documentType, namedValueProperties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] results = null;
       
try {
   results = WebServiceFactory.getRepositoryService().update(cml);
} catch (…)
    …
}

amarinkovic
Champ in-the-making
Champ in-the-making
The problem was that alfresco-web-service-client.jar library I used was from 2.9B distribution(I am hitting 2.9B community content server), and dependency libs bcprov-jdk15-136.jar and xmlsec-1.4.0.jar were not adequate(remained old from 2.1 dist). I should have used bcprov-jdk15-137.jar and xmlsec-1.4.1.jar which are deployed along with 2.9B distribution.