[Hippo-cms7-user] Import tool

nvankampenhout nvankampenhout at yahoo.co.uk
Sun Nov 29 21:03:07 CET 2009



marijan milicevic-2 wrote:
> 
> it should look like something like:
> 
> @ImportField(name = "myns:categories",  repositoryType =
> RepositoryTypes.REPO_TYPE_NODE, nodeType = true, nodeTypeName =
> "myns:category"..)
> List<Category> categories;
> 
> 
> 
> and category class:
> 
> @ImportDocument(documentType = "myns:category")
> public class Category{
> 
> @ImportField(name = "myns:id"..., xpath=...)
> private String id;    
> 
> ....
> }
> 

Thanks Marijan. I now have:

    @ImportField(name = "myns:categories", 
    		nodeTypeName = "myns:category",
    		xpath = "/document/categories", 
    		converter = CategoriesConverter.class, 
    		repositoryType = RepositoryTypes.REPO_TYPE_NODE,
    		nodeType = true)
	private List<Category> categories;

in my "top level" document bean, and a Category bean:

@ImportDocument(documentType = "myns:category")
public class Category extends BaseImportBean {
	
	@ImportField(name = "myns:id", xpath = "id", converter =
StringImportConverter.class)
	private String id;
	
	@ImportField(name = "myns:name", xpath = "name", converter =
StringImportConverter.class)
	private String name;

	...
}


But when running the importer I get an exception:

29.11.2009 20:54:59 ERROR Error saving document
javax.jcr.nodetype.ConstraintViolationException: no matching property
definition found for {http://mycompany.com/hippo/1.5}categories


Any ideas? I thought I had myns:categories marked as node
(RepositoryTypes.REPO_TYPE_NODE) instead of property so I don't understand
why the importer is trying to save a property.

Thanks,
Niels

-- 
View this message in context: http://n2.nabble.com/Import-tool-tp4074577p4084162.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.



More information about the Hippo-cms7-user mailing list