Hello Marius,
I read the code and noticed that the doc.tags fields was not been handled
-> i have modified the part of code below and now it is importing the tags:
However, the code is not handling the case if the doc already exist and has
tags. in my code the existing tags are replaced from the of the docs.
} else if (key.equals("doc.tags")){
List<String> myList = new
ArrayList<String>(Arrays.asList(value.toString().split(",")));
com.xpn.xwiki.api.Object newTagsObject =
newDoc.getObject("XWiki.TagClass");
if (newTagsObject == null) {
newTagsObject = newDoc.newObject("XWiki.TagClass");
}
debug("My 2 cents"+ myList);
newTagsObject.set("tags", myList);
}
}
//
// if (fieldsfortags != null && fieldsfortags.size() > 0) {
// com.xpn.xwiki.api.Object newTagsObject =
newDoc.getObject("XWiki.TagClass");
// if (newTagsObject == null) {
// newTagsObject = newDoc.newObject("XWiki.TagClass");
// }
// debug("verifyif enter in condition");
// newTagsObject.set("tags", tagList);
// }
2014-08-01 9:09 GMT-03:00 Danilo Oliveira <[email protected]>:
> Marius I have this example csv:
>
> title.field1,tags
> "Name Page","test","tag1,tag2,tag3"
>
> on the first page of the batchimport process, I map the import fields as
> followed below:
>
> name of the page:title
> FieldClass: field1
> doc.tags:tags
>
> On the next steps: example data, simulation and real importation log there
> were no errors however the tags did not show in the final pages.
>
> I was reading the btach import coding and I discovered this comment in the
> DefaultBatchImport Class:
> // column in the xls that will turn into tags
> // TODO: this tags needs to be reimplemented, now it works only
> with xwiki fields in the list: so you can
> // add something in the tags only if you import it as well. You
> should be able to configure it to be a
> // column in the csv / xls and that column needs to be handled as
> a list with the list separator. Implement as
> // doc.tags
> link>
> https://github.com/xwiki-contrib/batchimport/blob/master/xwiki-batchimport-api/src/main/java/org/xwiki/batchimport/internal/DefaultBatchImport.java#L650
>
> I did not understand very well the mean, Is it the tags field import
> implemented?
>
> Thanks!
> Danilo
>
>
>
> 2014-08-01 5:04 GMT+00:00 Marius Dumitru Florea <
> [email protected]>:
>
> On Thu, Jul 31, 2014 at 10:34 PM, Danilo Oliveira
>> <[email protected]> wrote:
>> > Hello All,
>> >
>> > I am trying to use the batchimport application to import some data in my
>> > XWiki 6.1.
>> >
>> > I created a class with appwithinminutes, and the import for the class
>> > fields and title is working perfectly.
>>
>> You need to give more details because I don't see any relation between
>> what you just said before and the following.
>>
>> > However when I try to map some data
>> > to doc.tags, not happens... And the extension does not return any
>> errors as
>> > well.
>>
>> What do you mean by "map some data to doc.tags"?
>>
>> > is there a way to turn a detailed log? or anyone could make this kind of
>> > import in other versions of XWiki below the 6.1?
>> >
>> > Thanks.
>> >
>> > Danilo
>> >
>> > --
>> > Danilo Amaral de Oliveira
>> > Engenheiro de Computação
>> > celular (32) 9111 - 6867
>> > _______________________________________________
>> > users mailing list
>> > [email protected]
>> > http://lists.xwiki.org/mailman/listinfo/users
>> _______________________________________________
>> users mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
>
>
> --
> Danilo Amaral de Oliveira
> Engenheiro de Computação
> celular (32) 9111 - 6867
>
>
--
Danilo Amaral de Oliveira
Engenheiro de Computação
celular (32) 9111 - 6867
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users