forked from Archives/Athou_commafeed
package refactoring
This commit is contained in:
@@ -12,11 +12,11 @@ import com.commafeed.backend.dao.FeedCategoryService;
|
||||
import com.commafeed.backend.dao.FeedService;
|
||||
import com.commafeed.backend.dao.FeedSubscriptionService;
|
||||
import com.commafeed.backend.dao.UserService;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.backend.security.PasswordEncryptionService;
|
||||
import com.commafeed.model.Feed;
|
||||
import com.commafeed.model.FeedCategory;
|
||||
import com.commafeed.model.FeedSubscription;
|
||||
import com.commafeed.model.User;
|
||||
|
||||
@Startup
|
||||
@Singleton
|
||||
|
||||
@@ -4,9 +4,9 @@ import java.util.List;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||
import com.commafeed.model.FeedCategory;
|
||||
import com.commafeed.model.User;
|
||||
|
||||
@Stateless
|
||||
public class FeedCategoryService extends GenericDAO<FeedCategory, Long> {
|
||||
|
||||
@@ -8,10 +8,10 @@ import javax.ejb.Stateless;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||
import com.commafeed.model.Feed;
|
||||
import com.commafeed.model.FeedEntry;
|
||||
import com.commafeed.model.User;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
@Stateless
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.commafeed.backend.dao;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
|
||||
import com.commafeed.model.FeedEntryStatus;
|
||||
import com.commafeed.backend.model.FeedEntryStatus;
|
||||
|
||||
@Stateless
|
||||
public class FeedEntryStatusService extends GenericDAO<FeedEntryStatus, Long> {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.commafeed.backend.dao;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
|
||||
import com.commafeed.model.Feed;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
|
||||
@Stateless
|
||||
public class FeedService extends GenericDAO<Feed, Long> {
|
||||
|
||||
@@ -8,10 +8,10 @@ import javax.persistence.TypedQuery;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||
import com.commafeed.model.FeedCategory;
|
||||
import com.commafeed.model.FeedSubscription;
|
||||
import com.commafeed.model.User;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.uaihebert.factory.EasyCriteriaFactory;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@@ -5,9 +5,9 @@ import java.util.List;
|
||||
import javax.ejb.Stateless;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.backend.security.PasswordEncryptionService;
|
||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||
import com.commafeed.model.User;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
@Stateless
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.apache.http.util.EntityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.commafeed.model.Feed;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
|
||||
@Singleton
|
||||
public class FeedFetcher {
|
||||
|
||||
@@ -11,8 +11,8 @@ import org.apache.commons.lang.SystemUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
||||
import com.commafeed.model.Feed;
|
||||
import com.commafeed.model.FeedEntry;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.sun.syndication.feed.synd.SyndContent;
|
||||
|
||||
@@ -9,7 +9,7 @@ import javax.inject.Inject;
|
||||
|
||||
import com.commafeed.backend.dao.FeedEntryService;
|
||||
import com.commafeed.backend.dao.FeedService;
|
||||
import com.commafeed.model.Feed;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@Singleton
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.model;
|
||||
package com.commafeed.backend.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -26,9 +26,9 @@ import org.apache.wicket.request.cycle.RequestCycle;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.commafeed.frontend.components.auth.LoginPage;
|
||||
import com.commafeed.frontend.components.auth.LogoutPage;
|
||||
import com.commafeed.frontend.pages.home.HomePage;
|
||||
import com.commafeed.frontend.pages.HomePage;
|
||||
import com.commafeed.frontend.pages.LoginPage;
|
||||
import com.commafeed.frontend.pages.LogoutPage;
|
||||
import com.commafeed.frontend.utils.exception.DisplayExceptionPage;
|
||||
|
||||
public class CommaFeedApplication extends AuthenticatedWebApplication {
|
||||
|
||||
@@ -8,8 +8,8 @@ import org.apache.wicket.authroles.authorization.strategies.role.Roles;
|
||||
import org.apache.wicket.request.Request;
|
||||
|
||||
import com.commafeed.backend.dao.UserService;
|
||||
import com.commafeed.frontend.components.auth.Role;
|
||||
import com.commafeed.model.User;
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.frontend.pages.auth.Role;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class CommaFeedSession extends AuthenticatedWebSession {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.rest.model;
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.rest.model;
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.rest.model;
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.rest.model;
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.commafeed.frontend.pages.home;
|
||||
package com.commafeed.frontend.pages;
|
||||
|
||||
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
|
||||
import com.commafeed.frontend.components.auth.Role;
|
||||
import com.commafeed.frontend.pages.auth.Role;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@AuthorizeInstantiation(Role.USER)
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.commafeed.frontend.components.auth;
|
||||
package com.commafeed.frontend.pages;
|
||||
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
|
||||
import com.commafeed.frontend.pages.auth.LoginPanel;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class LoginPage extends WebPage {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.components.auth;
|
||||
package com.commafeed.frontend.pages;
|
||||
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.components.auth;
|
||||
package com.commafeed.frontend.pages.auth;
|
||||
|
||||
import org.apache.wicket.authroles.authentication.panel.SignInPanel;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.components.auth;
|
||||
package com.commafeed.frontend.pages.auth;
|
||||
|
||||
public class Role {
|
||||
public static final String USER = "user";
|
||||
@@ -5,6 +5,8 @@ import java.util.Set;
|
||||
import javax.ws.rs.ApplicationPath;
|
||||
import javax.ws.rs.core.Application;
|
||||
|
||||
import com.commafeed.frontend.rest.resources.EntriesREST;
|
||||
import com.commafeed.frontend.rest.resources.SubscriptionsREST;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@ApplicationPath("/rest")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.rest;
|
||||
package com.commafeed.frontend.rest.resources;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
@@ -18,8 +18,8 @@ import com.commafeed.backend.dao.FeedCategoryService;
|
||||
import com.commafeed.backend.dao.FeedEntryService;
|
||||
import com.commafeed.backend.dao.FeedEntryStatusService;
|
||||
import com.commafeed.backend.dao.FeedSubscriptionService;
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.frontend.CommaFeedSession;
|
||||
import com.commafeed.model.User;
|
||||
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public abstract class AbstractREST {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.rest;
|
||||
package com.commafeed.frontend.rest.resources;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -11,13 +11,13 @@ import javax.ws.rs.PathParam;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
|
||||
import com.commafeed.frontend.rest.model.Entries;
|
||||
import com.commafeed.frontend.rest.model.Entry;
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.commafeed.backend.model.FeedEntryStatus;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
import com.commafeed.frontend.model.Entries;
|
||||
import com.commafeed.frontend.model.Entry;
|
||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||
import com.commafeed.model.FeedCategory;
|
||||
import com.commafeed.model.FeedEntry;
|
||||
import com.commafeed.model.FeedEntryStatus;
|
||||
import com.commafeed.model.FeedSubscription;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.commafeed.frontend.rest;
|
||||
package com.commafeed.frontend.rest.resources;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,10 +7,10 @@ import javax.ws.rs.Path;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
|
||||
import com.commafeed.frontend.rest.model.Category;
|
||||
import com.commafeed.frontend.rest.model.Subscription;
|
||||
import com.commafeed.model.FeedCategory;
|
||||
import com.commafeed.model.FeedSubscription;
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
import com.commafeed.frontend.model.Category;
|
||||
import com.commafeed.frontend.model.Subscription;
|
||||
|
||||
@Path("subscriptions")
|
||||
public class SubscriptionsREST extends AbstractREST {
|
||||
Reference in New Issue
Block a user