Hello
I need some help to write my code in Android to get the Tags.
I try to follow getPicturesFromAlbum sample without results.
Can anyone in the forum can share some code with Tags implemented?
Thanks, Mario
Piwigo version: 2.9.1
Piwigo URL: http://www.FaceTrip.com.ar/galeria
Android App: FaceTrip (in alfa)
Offline
Ok, I found a different interpretation in the code the list of tags by default is the AdminList
I edit TagDaoImpl
Document doc = sessionManager.executeReturnDocument(MethodsEnum.TAGS_ADMIN_LIST.getLabel());
to
Document doc = sessionManager.executeReturnDocument(MethodsEnum.LISTER_TAGS.getLabel());
and problem solve!
Offline
Another error in the code at TagDaoImpl:
Always send the same tags because is wrong.
private List<Tag> getTagsFromDocument(Element element) {
NodeList listTags = element.getElementsByTagName("tag");
ArrayList tags = new ArrayList();
for(int i = 0; i < listTags.getLength(); ++i) {
Node nodeTag = listTags.item(0);
if(nodeTag.getNodeType() == 1) {
Element tagElement = (Element)nodeTag;
Tag tag = new Tag();
tag.setIdentifier(Integer.valueOf(tagElement.getAttribute(TagEnum.ID.getLabel())));
tag.setName(tagElement.getAttribute(TagEnum.NAME.getLabel()));
tags.add(tag);
}
}
return tags;
}
must change to:
Node nodeTag = listTags.item(i);
Offline