public static Photoset initializePhotoset(String id, String title, String description) { Photoset photoset = new Photoset(); photoset.setId(id); photoset.setTitle(title); photoset.setDescription(description); return photoset; }
new PhotoAlbum(photoSet.getId(), photoSet.getTitle(), photoSet.getDescription())); subResources.add(new IdOnlyContainerResource(photoSet.getId()));
Photoset photoset = new Photoset(); photoset.setId(photosetElement.getAttribute("id")); photoset.setOwner(owner); primaryPhoto.setServer(photosetElement.getAttribute("server")); // TODO verify that this is the server for the photo primaryPhoto.setFarm(photosetElement.getAttribute("farm")); photoset.setPrimaryPhoto(primaryPhoto); photoset.setSecret(photosetElement.getAttribute("secret")); photoset.setServer(photosetElement.getAttribute("server")); photoset.setFarm(photosetElement.getAttribute("farm")); photoset.setPhotoCount(photosetElement.getAttribute("count_photos")); photoset.setVideoCount(Integer.parseInt(photosetElement.getAttribute("count_videos"))); photoset.setViewCount(Integer.parseInt(photosetElement.getAttribute("count_views"))); photoset.setCommentCount(Integer.parseInt(photosetElement.getAttribute("count_comments"))); photoset.setDateCreate(photosetElement.getAttribute("date_create")); photoset.setDateUpdate(photosetElement.getAttribute("date_update")); photoset.setIsCanComment("1".equals(photosetElement.getAttribute("can_comment"))); photoset.setTitle(XMLUtilities.getChildValue(photosetElement, "title")); photoset.setDescription(XMLUtilities.getChildValue(photosetElement, "description")); photoset.setPrimaryPhoto(primaryPhoto);
/** * Create a new photoset. * * @param title * The photoset title * @param description * The photoset description * @param primaryPhotoId * The primary photo id * @return The new Photset * @throws FlickrException */ public Photoset create(String title, String description, String primaryPhotoId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_CREATE); parameters.put("title", title); parameters.put("description", description); parameters.put("primary_photo_id", primaryPhotoId); Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element photosetElement = response.getPayload(); Photoset photoset = new Photoset(); photoset.setId(photosetElement.getAttribute("id")); photoset.setUrl(photosetElement.getAttribute("url")); return photoset; }
tempData.addAlbumId(oldAlbumId, photoset.getId()); tempData.removeTempPhotoAlbum(oldAlbumId); } else {
@Override protected PhotoList<Photo> flickrProcess(String path) { try { final PhotosetsInterface setsInterface = flickr.getPhotosetsInterface(); final Matcher matcher = r.matcher(path); matcher.find(); final String setId = matcher.group(1); final Photoset set = setsInterface.getInfo(setId); return setsInterface.getPhotos(setId, set.getPhotoCount(), 0); } catch (final Exception e) { e.printStackTrace(); } return null; } }
Photoset photoset = new Photoset(); photoset.setId(photosetElement.getAttribute("id")); photoset.setOwner(owner); primaryPhoto.setServer(photosetElement.getAttribute("server")); // TODO verify that this is the server for the photo primaryPhoto.setFarm(photosetElement.getAttribute("farm")); photoset.setPrimaryPhoto(primaryPhoto); photoset.setSecret(photosetElement.getAttribute("secret")); photoset.setServer(photosetElement.getAttribute("server")); photoset.setFarm(photosetElement.getAttribute("farm")); photoset.setPhotoCount(photosetElement.getAttribute("count_photos")); photoset.setVideoCount(Integer.parseInt(photosetElement.getAttribute("count_videos"))); photoset.setViewCount(Integer.parseInt(photosetElement.getAttribute("count_views"))); photoset.setCommentCount(Integer.parseInt(photosetElement.getAttribute("count_comments"))); photoset.setDateCreate(photosetElement.getAttribute("date_create")); photoset.setDateUpdate(photosetElement.getAttribute("date_update")); photoset.setIsCanComment("1".equals(photosetElement.getAttribute("can_comment"))); photoset.setTitle(XMLUtilities.getChildValue(photosetElement, "title")); photoset.setDescription(XMLUtilities.getChildValue(photosetElement, "description")); photoset.setPrimaryPhoto(primaryPhoto);
/** * Create a new photoset. * * @param title * The photoset title * @param description * The photoset description * @param primaryPhotoId * The primary photo id * @return The new Photset * @throws FlickrException */ public Photoset create(String title, String description, String primaryPhotoId) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_CREATE); parameters.put("title", title); parameters.put("description", description); parameters.put("primary_photo_id", primaryPhotoId); Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element photosetElement = response.getPayload(); Photoset photoset = new Photoset(); photoset.setId(photosetElement.getAttribute("id")); photoset.setUrl(photosetElement.getAttribute("url")); return photoset; }
for (int i = 0; i < photosetElements.getLength(); i++) { Element photosetElement = (Element) photosetElements.item(i); Photoset photoset = new Photoset(); photoset.setId(photosetElement.getAttribute("id")); photoset.setOwner(owner); primaryPhoto.setServer(photosetElement.getAttribute("server")); // TODO verify that this is the server for the photo primaryPhoto.setFarm(photosetElement.getAttribute("farm")); photoset.setPrimaryPhoto(primaryPhoto); photoset.setSecret(photosetElement.getAttribute("secret")); photoset.setServer(photosetElement.getAttribute("server")); photoset.setFarm(photosetElement.getAttribute("farm")); photoset.setPhotoCount(photosetElement.getAttribute("photos")); photoset.setVideoCount(Integer.parseInt(photosetElement.getAttribute("videos"))); photoset.setViewCount(Integer.parseInt(photosetElement.getAttribute("count_views"))); photoset.setCommentCount(Integer.parseInt(photosetElement.getAttribute("count_comments"))); photoset.setDateCreate(photosetElement.getAttribute("date_create")); photoset.setDateUpdate(photosetElement.getAttribute("date_update")); photoset.setIsCanComment("1".equals(photosetElement.getAttribute("can_comment"))); photoset.setIsNeedsInterstitial("1".equals(photosetElement.getAttribute("needs_interstitial"))); photoset.setIsVisible("1".equals(photosetElement.getAttribute("visibility_can_see_set"))); photoset.setDescription(XMLUtilities.getChildValue(photosetElement, "description")); photoset.setTitle(XMLUtilities.getChildValue(photosetElement, "title")); photoset.setDescription(XMLUtilities.getChildValue(photosetElement, "description"));
/** * * @param childPhotosetElement * @return */ private Photoset createPhotoset(Element childPhotosetElement) { Photoset photoset = new Photoset(); photoset.setId(childPhotosetElement.getAttribute("id")); photoset.setTitle(childPhotosetElement.getAttribute("title")); photoset.setDescription(childPhotosetElement.getAttribute("description")); return photoset; }
for (int i = 0; i < photosetElements.getLength(); i++) { Element photosetElement = (Element) photosetElements.item(i); Photoset photoset = new Photoset(); photoset.setId(photosetElement.getAttribute("id")); photoset.setOwner(owner); primaryPhoto.setServer(photosetElement.getAttribute("server")); // TODO verify that this is the server for the photo primaryPhoto.setFarm(photosetElement.getAttribute("farm")); photoset.setPrimaryPhoto(primaryPhoto); photoset.setSecret(photosetElement.getAttribute("secret")); photoset.setServer(photosetElement.getAttribute("server")); photoset.setFarm(photosetElement.getAttribute("farm")); photoset.setPhotoCount(photosetElement.getAttribute("photos")); photoset.setVideoCount(Integer.parseInt(photosetElement.getAttribute("videos"))); photoset.setViewCount(Integer.parseInt(photosetElement.getAttribute("count_views"))); photoset.setCommentCount(Integer.parseInt(photosetElement.getAttribute("count_comments"))); photoset.setDateCreate(photosetElement.getAttribute("date_create")); photoset.setDateUpdate(photosetElement.getAttribute("date_update")); photoset.setIsCanComment("1".equals(photosetElement.getAttribute("can_comment"))); photoset.setIsNeedsInterstitial("1".equals(photosetElement.getAttribute("needs_interstitial"))); photoset.setIsVisible("1".equals(photosetElement.getAttribute("visibility_can_see_set"))); photoset.setDescription(XMLUtilities.getChildValue(photosetElement, "description")); photoset.setTitle(XMLUtilities.getChildValue(photosetElement, "title")); photoset.setDescription(XMLUtilities.getChildValue(photosetElement, "description"));
/** * * @param childPhotosetElement * @return */ private Photoset createPhotoset(Element childPhotosetElement) { Photoset photoset = new Photoset(); photoset.setId(childPhotosetElement.getAttribute("id")); photoset.setTitle(childPhotosetElement.getAttribute("title")); photoset.setDescription(childPhotosetElement.getAttribute("description")); return photoset; }