Skip to content

Commit

Permalink
Version 1.2.0
Browse files Browse the repository at this point in the history
COllection support
Proxy Support
Scrapbook support
Better Gui input.
  • Loading branch information
dragoniade committed Apr 18, 2011
1 parent 72676b7 commit d53156d
Show file tree
Hide file tree
Showing 26 changed files with 1,273 additions and 351 deletions.
7 changes: 6 additions & 1 deletion Branches/1.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.dragoniade</groupId>
<artifactId>da-favorite</artifactId>
<version>1.1</version>
<version>1.2.0</version>
<url>http://dafavdownloader.sourceforge.net</url>
<name>deviantART Favorites Downloader</name>
<description>
Expand All @@ -15,6 +15,11 @@
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Deviation - POJO for a collection
* Copyright (C) 2009-2011 Philippe Busque
* https://sourceforge.net/projects/dafavdownloader/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.dragoniade.deviantart.deviation;

public class Collection {

private Long id;
private String name;

public Collection (Long id, String name) {
this.id = id;
this.name = name;
}

public Long getId() {
return id;
}

public String getName() {
return name;
}

public void setId(Long id) {
this.id = id;
}

public void setName(String name) {
this.name = name;
}

public String toString() {
return name + " (" + id + ")";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class Deviation implements Serializable {
private Date timestamp;
private String category;
private boolean mature;
private Collection collection;

public boolean isMature() {
return mature;
Expand Down Expand Up @@ -131,4 +132,13 @@ public void setDocumentDownloadUrl(String documentDownloadUrl) {
public void setDocumentFilename(String documentFilename) {
this.documentFilename = documentFilename;
}

public Collection getCollection() {
return collection;
}
public void setCollection(Collection collection) {
this.collection = collection;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,55 @@

import javax.swing.JFrame;

import org.apache.commons.httpclient.HttpClient;

import com.dragoniade.deviantart.ui.ProgressDialog;

public interface Search {

public enum SEARCH {
GALLERY ("gallery"),
FAVORITE ("favby");
FAVORITE ("favby","favby:%username%", "favourites", "Favorites"),
GALLERY ("gallery","gallery:%username%", "gallery", "Gallery"),
SCRAPBOOK ("scraps","gallery:%username%+in:scraps", null, "Scrapbook");

private final String id;
private final String search;
private final String label;
private final String collection;

private static final Map<String,SEARCH> lookup = new HashMap<String,SEARCH>();
static {
for(SEARCH s : EnumSet.allOf(SEARCH.class))
lookup.put(s.search, s);
lookup.put(s.id, s);
}
static public SEARCH lookup(String name) {
return lookup.get(name);
}
SEARCH(String search){

SEARCH(String id, String search, String collection, String label){
this.search = search;
this.id = id;
this.collection = collection;
this.label = label;
};
String getSearch() {

public String getSearch() {
return search;
}
public String toString() {
return search;

public String getLabel() {
return label;
}

public String getCollection() {
return collection;
}

public String getId() {
return id;
}
public static SEARCH getDefault() {
return FAVORITE;
}
}

Expand Down Expand Up @@ -77,7 +101,7 @@ public String toString() {
/*
* Get a search result iteration or null if there is no more results.
*/
public List<Deviation> search(ProgressDialog progress);
public List<Deviation> search(ProgressDialog progress, Collection collection);

/*
* Set the starting point, from the end of the results.
Expand All @@ -103,4 +127,10 @@ public String toString() {
*/
public String getName();

/*
* Set the Http Client to be used
*/
public void setClient(HttpClient client);

public List<Collection> getCollections();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
*/
package com.dragoniade.deviantart.deviation;

import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

import org.apache.commons.httpclient.HttpClient;

import com.dragoniade.deviantart.ui.ProgressDialog;

public class SearchHelloWorld implements Search{
Expand All @@ -41,7 +44,7 @@ public SearchHelloWorld() {
this.offset = this.offset * 1;
}

public List<Deviation> search(ProgressDialog progress) {
public List<Deviation> search(ProgressDialog progress, Collection collection) {
if ( user == null ) {
throw new IllegalStateException("You must set the user before searching.");
}
Expand Down Expand Up @@ -87,4 +90,10 @@ public String getName() {
public int priority() {
return 1;
}

public void setClient(HttpClient client) {}

public List<Collection> getCollections() {
return new ArrayList<Collection>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
*/
package com.dragoniade.deviantart.deviation;

import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

import org.apache.commons.httpclient.HttpClient;

import com.dragoniade.deviantart.ui.ProgressDialog;

public class SearchResources implements Search{
Expand All @@ -41,7 +44,7 @@ public SearchResources() {
this.offset = this.offset * 1;
}

public List<Deviation> search(ProgressDialog progress) {
public List<Deviation> search(ProgressDialog progress, Collection collection) {
if ( user == null ) {
throw new IllegalStateException("You must set the user before searching.");
}
Expand Down Expand Up @@ -88,4 +91,9 @@ public int priority() {
return 75;
}

public void setClient(HttpClient client) {}

public List<Collection> getCollections() {
return new ArrayList<Collection>();
}
}
Loading

0 comments on commit d53156d

Please sign in to comment.