mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
@@ -51,6 +51,13 @@ public class FeedCategoryDAO extends GenericDAO<FeedCategory> {
|
||||
return category;
|
||||
}
|
||||
|
||||
public List<FeedCategory> findByParent(User user, FeedCategory parent) {
|
||||
EasyCriteria<FeedCategory> criteria = createCriteria();
|
||||
criteria.andEquals(FeedCategory_.user.getName(), user);
|
||||
criteria.andEquals(FeedCategory_.parent.getName(), parent);
|
||||
return criteria.getResultList();
|
||||
}
|
||||
|
||||
public List<FeedCategory> findAllChildrenCategories(User user,
|
||||
FeedCategory parent) {
|
||||
List<FeedCategory> list = Lists.newArrayList();
|
||||
@@ -77,4 +84,5 @@ public class FeedCategoryDAO extends GenericDAO<FeedCategory> {
|
||||
}
|
||||
return isChild;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ public class FeedCategory extends AbstractModel {
|
||||
|
||||
private boolean collapsed;
|
||||
|
||||
private Integer position;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -86,4 +88,12 @@ public class FeedCategory extends AbstractModel {
|
||||
this.collapsed = collapsed;
|
||||
}
|
||||
|
||||
public Integer getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(Integer position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ public class FeedSubscription extends AbstractModel {
|
||||
@OneToMany(mappedBy = "subscription", cascade = CascadeType.REMOVE)
|
||||
private Set<FeedEntryStatus> statuses;
|
||||
|
||||
private Integer position;
|
||||
|
||||
public Feed getFeed() {
|
||||
return feed;
|
||||
}
|
||||
@@ -73,4 +75,12 @@ public class FeedSubscription extends AbstractModel {
|
||||
this.statuses = statuses;
|
||||
}
|
||||
|
||||
public Integer getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(Integer position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.List;
|
||||
import javax.ejb.ApplicationException;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.commafeed.backend.dao.FeedEntryDAO;
|
||||
import com.commafeed.backend.dao.FeedEntryStatusDAO;
|
||||
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
||||
@@ -50,7 +52,7 @@ public class FeedSubscriptionService {
|
||||
FeedCategory category) {
|
||||
|
||||
final String pubUrl = applicationSettingsService.get().getPublicUrl();
|
||||
if (pubUrl == null) {
|
||||
if (StringUtils.isBlank(pubUrl)) {
|
||||
throw new FeedSubscriptionException(
|
||||
"Public URL of this CommaFeed instance is not set");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user