Package com.aetrion.flickr

Examples of com.aetrion.flickr.Parameter


     * @throws IOException
     * @throws SAXException
     */
    public void deleteComment(String commentId) throws FlickrException, IOException, SAXException {
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_DELETE_COMMENT));
        parameters.add(new Parameter("api_key", apiKey));

        parameters.add(new Parameter("comment_id", commentId));
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here


     * @throws SAXException
     * @throws FlickrException
     */
    public void editComment(String commentId, String commentText) throws IOException, SAXException, FlickrException {
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_EDIT_COMMENT));
        parameters.add(new Parameter("api_key", apiKey));

        parameters.add(new Parameter("comment_id", commentId));
        parameters.add(new Parameter("comment_text", commentText));
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here

     * @throws IOException
     * @throws FlickrException
     */
    public List getList(String photosetId) throws IOException, SAXException, FlickrException {
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_GET_LIST));
        parameters.add(new Parameter("api_key", apiKey));

        parameters.add(new Parameter("photoset_id", photosetId));
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here

    public Category browse(String catId) throws IOException, SAXException, FlickrException {
        List subcategories = new ArrayList();
        List groups = new ArrayList();

        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_BROWSE));
        parameters.add(new Parameter("api_key", apiKey));

        if (catId != null) {
            parameters.add(new Parameter("cat_id", catId));
        }
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );
View Full Code Here

     * @param groupId The group id
     * @return The Group object
     */
    public Group getInfo(String groupId) throws IOException, SAXException, FlickrException {
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_GET_INFO));
        parameters.add(new Parameter("api_key", apiKey));

        parameters.add(new Parameter("group_id", groupId));
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here

     * @throws FlickrException
     */
    public Collection search(String text, int perPage, int page) throws FlickrException, IOException, SAXException {
        GroupList groupList = new GroupList();
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_SEARCH));
        parameters.add(new Parameter("api_key", apiKey));

        parameters.add(new Parameter("text", text));

        if (perPage > 0) {
            parameters.add(new Parameter("per_page", new Integer(perPage)));
        }
        if (page > 0) {
            parameters.add(new Parameter("page", new Integer(page)));
        }
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here

    /**
     * @return A collection of License objects
     */
    public Collection getInfo() throws IOException, SAXException, FlickrException {
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_GET_INFO));
        parameters.add(new Parameter("api_key", apiKey));
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here

     * @throws SAXException
     * @throws FlickrException
     */
    public void setLicense(String photoId, int licenseId) throws IOException, SAXException, FlickrException {
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_SET_LICENSE));
        parameters.add(new Parameter("api_key", apiKey));
        parameters.add(new Parameter("photo_id", photoId));
        parameters.add(new Parameter("license_id", licenseId));
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here

    public Collection getAsParameters() {
        List parameters = new ArrayList();

        String lat = getLatitude();
        if (lat != null) {
            parameters.add(new Parameter("lat", lat));
        }

        String lon = getLongitude();
        if (lon != null) {
            parameters.add(new Parameter("lon", lon));
        }

        int radius = getRadius();
        if (radius > 0) {
            parameters.add(new Parameter("radius", radius));
        }

        String radiusUnits = getRadiusUnits();
        if (radiusUnits != null) {
            parameters.add(new Parameter("radius_units", radiusUnits));
        }

        String media = getMedia();
        if (media != null) {
            parameters.add(new Parameter("media", media));
        }

        String userId = getUserId();
        if (userId != null) {
            parameters.add(new Parameter("user_id", userId));
            String contacts = getContacts();
            if (contacts != null) {
                parameters.add(new Parameter("contacts", contacts));
            }
        }

        String groupId = getGroupId();
        if (groupId != null) {
            parameters.add(new Parameter("group_id", groupId));
        }

        String[] tags = getTags();
        if (tags != null) {
            parameters.add(new Parameter("tags", StringUtilities.join(tags, ",")));
        }

        String tagMode = getTagMode();
        if (tagMode != null) {
            parameters.add(new Parameter("tag_mode", tagMode));
        }

        String[] mtags = getMachineTags();
        if (mtags != null) {
          parameters.add(new Parameter("machine_tags", StringUtilities.join(mtags, ",")));
        }

        String mtagMode = getMachineTagMode();
        if (mtagMode != null) {
            parameters.add(new Parameter("machine_tag_mode", mtagMode));
        }

        String text = getText();
        if (text != null) {
            parameters.add(new Parameter("text", text));
        }

        Date minUploadDate = getMinUploadDate();
        if (minUploadDate != null) {
            parameters.add(new Parameter("min_upload_date", new Long(minUploadDate.getTime() / 1000L)));
        }

        Date maxUploadDate = getMaxUploadDate();
        if (maxUploadDate != null) {
            parameters.add(new Parameter("max_upload_date", new Long(maxUploadDate.getTime() / 1000L)));
        }

        Date minTakenDate = getMinTakenDate();
        if (minTakenDate != null) {
            parameters.add(new Parameter("min_taken_date", ((DateFormat)MYSQL_DATE_FORMATS.get()).format(minTakenDate)));
        }

        Date maxTakenDate = getMaxTakenDate();
        if (maxTakenDate != null) {
            parameters.add(new Parameter("max_taken_date", ((DateFormat)MYSQL_DATE_FORMATS.get()).format(maxTakenDate)));
        }

        String license = getLicense();
        if (license != null) {
            parameters.add(new Parameter("license", license));
        }

        Date intrestingnessDate = getInterestingnessDate();
        if (intrestingnessDate != null) {
            parameters.add(new Parameter("date", ((DateFormat)DATE_FORMATS.get()).format(intrestingnessDate)));
        }

        String[] bbox = getBBox();
        if (bbox != null) {
            parameters.add(new Parameter("bbox", StringUtilities.join(bbox, ",")));
            if (accuracy > 0) {
                parameters.add(new Parameter("accuracy", accuracy));
            }
        } else {
            String woeId = getWoeId();
            if (woeId != null) {
                parameters.add(new Parameter("woe_id", woeId));
            }
        }

        String safeSearch = getSafeSearch();
        if (safeSearch != null) {
            parameters.add(new Parameter("safe_search", safeSearch));
        }

        boolean hasGeo = getHasGeo();
        if (hasGeo) {
            parameters.add(new Parameter("has_geo", "true"));
        }

        if (extrasLicense || extrasDateUpload ||
           extrasDateTaken || extrasOwnerName ||
           extrasIconServer || extrasOriginalFormat ||
           extrasLastUpdate || extrasGeo ||
           extrasTags || extrasMachineTags) {
            Vector argsList = new Vector();
            if (extrasLicense) argsList.add("license");
            if (extrasDateUpload) argsList.add("date_upload");
            if (extrasDateTaken) argsList.add("date_taken");
            if (extrasOwnerName) argsList.add("owner_name");
            if (extrasIconServer) argsList.add("icon_server");
            if (extrasOriginalFormat) argsList.add("original_format");
            if (extrasLastUpdate) argsList.add("last_update");
            if (extrasGeo) argsList.add("geo");
            if (extrasTags) argsList.add("tags");
            if (extrasMachineTags) argsList.add("machine_tags");
            parameters.add(new Parameter("extras", StringUtilities.join(argsList,",")));
        }

        if (sort != DATE_POSTED_DESC) {
            String sortArg = null;
            if(sort == DATE_POSTED_ASC) sortArg = "date-posted-asc";
            if(sort == DATE_TAKEN_DESC) sortArg = "date-taken-desc";
            if(sort == DATE_TAKEN_ASC) sortArg = "date-taken-asc";
            if(sort == INTERESTINGNESS_DESC) sortArg = "interestingness-desc";
            if(sort == INTERESTINGNESS_ASC) sortArg = "interestingness-asc";
            if(sort == RELEVANCE) sortArg = "relevance";
            if(sortArg != null) parameters.add(new Parameter("sort", sortArg));
        }

        return parameters;
    }
View Full Code Here

     * @throws FlickrException
     */
    public void delete(String photoId)
        throws IOException, SAXException, FlickrException {
        List parameters = new ArrayList();
        parameters.add(new Parameter("method", METHOD_DELETE));
        parameters.add(new Parameter("api_key", apiKey));

        parameters.add(new Parameter("photo_id", photoId));
        parameters.add(
            new Parameter(
                "api_sig",
                AuthUtilities.getSignature(sharedSecret, parameters)
            )
        );

View Full Code Here

TOP

Related Classes of com.aetrion.flickr.Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.