remove initial data

This commit is contained in:
Athou
2013-04-14 18:11:55 +02:00
parent 9275ab4b61
commit cad38e5e31

View File

@@ -20,10 +20,6 @@ import com.commafeed.backend.dao.FeedSubscriptionDAO;
import com.commafeed.backend.dao.UserDAO;
import com.commafeed.backend.feeds.FeedRefreshWorker;
import com.commafeed.backend.model.ApplicationSettings;
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.model.UserRole.Role;
import com.commafeed.backend.services.ApplicationSettingsService;
import com.commafeed.backend.services.UserService;
@@ -78,58 +74,9 @@ public class StartupBean {
private void initialData() {
log.info("Populating database with default values");
applicationSettingsService.save(new ApplicationSettings());
User user = userService.register(ADMIN_NAME, "admin",
userService.register(ADMIN_NAME, "admin",
Arrays.asList(Role.ADMIN, Role.USER));
userService.register("test", "test", Arrays.asList(Role.USER));
Feed dilbert = new Feed("http://feed.dilbert.com/dilbert/daily_strip");
feedDAO.save(dilbert);
Feed engadget = new Feed("http://www.engadget.com/rss.xml");
feedDAO.save(engadget);
Feed frandroid = new Feed("http://feeds.feedburner.com/frandroid");
feedDAO.save(frandroid);
FeedCategory newsCategory = new FeedCategory();
newsCategory.setName("News");
newsCategory.setUser(user);
feedCategoryDAO.save(newsCategory);
FeedCategory comicsCategory = new FeedCategory();
comicsCategory.setName("Comics");
comicsCategory.setUser(user);
comicsCategory.setParent(newsCategory);
feedCategoryDAO.save(comicsCategory);
FeedCategory techCategory = new FeedCategory();
techCategory.setName("Tech");
techCategory.setUser(user);
techCategory.setParent(newsCategory);
feedCategoryDAO.save(techCategory);
FeedSubscription sub = new FeedSubscription();
sub.setCategory(comicsCategory);
sub.setFeed(dilbert);
sub.setTitle("Dilbert - Strips");
sub.setUser(user);
feedSubscriptionDAO.save(sub);
FeedSubscription sub2 = new FeedSubscription();
sub2.setCategory(techCategory);
sub2.setFeed(engadget);
sub2.setTitle("Engadget");
sub2.setUser(user);
feedSubscriptionDAO.save(sub2);
FeedSubscription sub3 = new FeedSubscription();
sub3.setFeed(frandroid);
sub3.setTitle("Frandroid");
sub3.setUser(user);
feedSubscriptionDAO.save(sub3);
}
public long getStartupTime() {