├── src ├── main │ ├── webapp │ │ ├── index.html │ │ └── WEB-INF │ │ │ ├── layout │ │ │ ├── footer.jsp │ │ │ ├── taglib.jsp │ │ │ └── classic.jsp │ │ │ ├── jsp │ │ │ ├── index.jsp │ │ │ ├── login.jsp │ │ │ ├── users.jsp │ │ │ ├── user-detail.jsp │ │ │ ├── user-register.jsp │ │ │ └── user-account.jsp │ │ │ ├── database-dev.xml │ │ │ ├── dispatcher-servlet.xml │ │ │ ├── database-prod.xml │ │ │ ├── security.xml │ │ │ ├── defs │ │ │ └── general.xml │ │ │ ├── applicationContext.xml │ │ │ └── web.xml │ └── java │ │ ├── cz │ │ └── jiripinkas │ │ │ └── jba │ │ │ ├── exception │ │ │ └── RssException.java │ │ │ ├── repository │ │ │ ├── RoleRepository.java │ │ │ ├── UserRepository.java │ │ │ ├── BlogRepository.java │ │ │ └── ItemRepository.java │ │ │ ├── controller │ │ │ ├── LoginController.java │ │ │ ├── IndexController.java │ │ │ ├── AdminController.java │ │ │ ├── RegisterController.java │ │ │ └── UserController.java │ │ │ ├── annotation │ │ │ ├── UniqueUsername.java │ │ │ └── UniqueUsernameValidator.java │ │ │ ├── service │ │ │ ├── ItemService.java │ │ │ ├── BlogService.java │ │ │ ├── RssService.java │ │ │ ├── UserService.java │ │ │ └── InitDbService.java │ │ │ ├── entity │ │ │ ├── Role.java │ │ │ ├── Blog.java │ │ │ ├── Item.java │ │ │ └── User.java │ │ │ └── rss │ │ │ ├── TCloudProtocol.java │ │ │ ├── TCategory.java │ │ │ ├── TSource.java │ │ │ ├── TGuid.java │ │ │ ├── ObjectFactory.java │ │ │ ├── TEnclosure.java │ │ │ ├── TTextInput.java │ │ │ ├── TCloud.java │ │ │ ├── TRss.java │ │ │ ├── TImage.java │ │ │ ├── TRssItem.java │ │ │ └── TRssChannel.java │ │ └── META-INF │ │ └── persistence.xml └── test │ └── java │ └── cz │ └── jiripinkas │ └── jba │ └── service │ └── RssServiceTest.java ├── .settings ├── org.eclipse.wst.jsdt.ui.superType.name ├── org.eclipse.wst.validation.prefs ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.m2e.core.prefs ├── org.eclipse.jpt.core.prefs ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.common.project.facet.core.prefs.xml ├── org.eclipse.jdt.core.prefs ├── .jsdtscope └── org.eclipse.wst.common.component ├── .gitignore ├── README.md ├── .springBeans ├── .classpath ├── LICENCE.txt ├── .project ├── diagrams └── java-blog-aggregator.xml ├── test-rss └── javavids.xml ├── pom.xml └── rss.xsd /src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | # intellij related 3 | *.iml 4 | .idea 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jirkapinkas/java-blog-aggregator/HEAD/README.md -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layout/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | © Jiri Pinkas -------------------------------------------------------------------------------- /.settings/org.eclipse.jpt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jpt.core.platform=generic2_1 3 | org.eclipse.jpt.jpa.core.discoverAnnotatedClasses=false 4 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/exception/RssException.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.exception; 2 | 3 | public class RssException extends Exception { 4 | 5 | public RssException(Throwable cause) { 6 | super(cause); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layout/taglib.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 5 | <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> 6 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import cz.jiripinkas.jba.entity.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | 9 | Role findByName(String name); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import cz.jiripinkas.jba.entity.User; 6 | 7 | public interface UserRepository extends JpaRepository{ 8 | 9 | User findByName(String name); 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class LoginController { 8 | 9 | @RequestMapping("/login") 10 | public String login() { 11 | return "login"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.prefs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/repository/BlogRepository.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import cz.jiripinkas.jba.entity.Blog; 8 | import cz.jiripinkas.jba.entity.User; 9 | 10 | public interface BlogRepository extends JpaRepository{ 11 | 12 | List findByUser(User user); 13 | } 14 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.6 9 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/repository/ItemRepository.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.repository; 2 | 3 | import org.springframework.data.domain.Pageable; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | import cz.jiripinkas.jba.entity.Item; 7 | import cz.jiripinkas.jba.entity.Blog; 8 | 9 | import java.util.List; 10 | 11 | public interface ItemRepository extends JpaRepository { 12 | 13 | List findByBlog(Blog blog, Pageable pageable); 14 | 15 | Item findByBlogAndLink(Blog blog, String link); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | cz.jiripinkas.jba.entity.User 5 | cz.jiripinkas.jba.entity.Role 6 | cz.jiripinkas.jba.entity.Blog 7 | cz.jiripinkas.jba.entity.Item 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import cz.jiripinkas.jba.service.ItemService; 9 | 10 | @Controller 11 | public class IndexController { 12 | 13 | @Autowired 14 | private ItemService itemService; 15 | 16 | @RequestMapping("/index") 17 | public String index(Model model) { 18 | model.addAttribute("items", itemService.getItems()); 19 | return "index"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/annotation/UniqueUsername.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.annotation; 2 | 3 | import static java.lang.annotation.ElementType.FIELD; 4 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.Target; 8 | 9 | import javax.validation.Constraint; 10 | import javax.validation.Payload; 11 | 12 | @Target({ FIELD }) 13 | @Retention(RUNTIME) 14 | @Constraint(validatedBy = { UniqueUsernameValidator.class }) 15 | public @interface UniqueUsername { 16 | 17 | String message(); 18 | 19 | Class[] groups() default {}; 20 | 21 | Class[] payload() default {}; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/service/ItemService.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.domain.PageRequest; 7 | import org.springframework.data.domain.Sort.Direction; 8 | import org.springframework.stereotype.Service; 9 | 10 | import cz.jiripinkas.jba.entity.Item; 11 | import cz.jiripinkas.jba.repository.ItemRepository; 12 | 13 | @Service 14 | public class ItemService { 15 | 16 | @Autowired 17 | private ItemRepository itemRepository; 18 | 19 | public List getItems() { 20 | return itemRepository.findAll(new PageRequest(0, 20, Direction.DESC, "publishedDate")).getContent(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | src/main/webapp/WEB-INF/dispatcher-servlet.xml 11 | src/main/webapp/WEB-INF/applicationContext.xml 12 | src/main/webapp/WEB-INF/security.xml 13 | src/main/webapp/WEB-INF/database-dev.xml 14 | src/main/webapp/WEB-INF/database-prod.xml 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/annotation/UniqueUsernameValidator.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.annotation; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | import cz.jiripinkas.jba.repository.UserRepository; 9 | 10 | public class UniqueUsernameValidator implements ConstraintValidator { 11 | 12 | @Autowired 13 | private UserRepository userRepository; 14 | 15 | @Override 16 | public void initialize(UniqueUsername constraintAnnotation) { 17 | } 18 | 19 | @Override 20 | public boolean isValid(String username, ConstraintValidatorContext context) { 21 | if(userRepository == null) { 22 | return true; 23 | } 24 | return userRepository.findByName(username) == null; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | <%@ include file="../layout/taglib.jsp"%> 5 | 6 |

Latest news from the Java world:

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 33 | 34 | 35 | 36 |
dateitem
20 | 21 |
22 | 23 |
25 | 26 | " target="_blank"> 27 | 28 | 29 | 30 |
31 | ${item.description} 32 |
37 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/entity/Role.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.entity; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.Id; 8 | import javax.persistence.ManyToMany; 9 | 10 | @Entity 11 | public class Role { 12 | 13 | @Id 14 | @GeneratedValue 15 | private Integer id; 16 | 17 | private String name; 18 | 19 | @ManyToMany(mappedBy = "roles") 20 | private List users; 21 | 22 | public List getUsers() { 23 | return users; 24 | } 25 | 26 | public void setUsers(List users) { 27 | this.users = users; 28 | } 29 | 30 | public Integer getId() { 31 | return id; 32 | } 33 | 34 | public void setId(Integer id) { 35 | this.id = id; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/test/java/cz/jiripinkas/jba/service/RssServiceTest.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.service; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.io.File; 6 | import java.text.SimpleDateFormat; 7 | import java.util.List; 8 | 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import cz.jiripinkas.jba.entity.Item; 13 | import cz.jiripinkas.jba.exception.RssException; 14 | 15 | public class RssServiceTest { 16 | 17 | private RssService rssService; 18 | 19 | @Before 20 | public void setUp() throws Exception { 21 | rssService = new RssService(); 22 | } 23 | 24 | @Test 25 | public void testGetItemsFile() throws RssException { 26 | List items = rssService.getItems(new File("test-rss/javavids.xml")); 27 | assertEquals(10, items.size()); 28 | Item firstItem = items.get(0); 29 | assertEquals("How to generate web.xml in Eclipse", firstItem.getTitle()); 30 | assertEquals("23 03 2014 09:01:34", new SimpleDateFormat("dd MM yyyy HH:mm:ss").format(firstItem.getPublishedDate())); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | import cz.jiripinkas.jba.service.UserService; 10 | 11 | @Controller 12 | @RequestMapping("/users") 13 | public class AdminController { 14 | 15 | @Autowired 16 | private UserService userService; 17 | 18 | @RequestMapping 19 | public String users(Model model) { 20 | model.addAttribute("users", userService.findAll()); 21 | return "users"; 22 | } 23 | 24 | @RequestMapping("/{id}") 25 | public String detail(Model model, @PathVariable int id) { 26 | model.addAttribute("user", userService.findOneWithBlogs(id)); 27 | return "user-detail"; 28 | } 29 | 30 | @RequestMapping("/remove/{id}") 31 | public String removeUser(@PathVariable int id) { 32 | userService.delete(id); 33 | return "redirect:/users.html"; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/database-dev.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | true 18 | create 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/dispatcher-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | /WEB-INF/defs/general.xml 19 | 20 | 21 | 22 | 23 | 25 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/database-prod.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 24 | false 25 | update 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/jsp/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | <%@ include file="../layout/taglib.jsp" %> 5 | 6 | 48 | 49 | 55 | -------------------------------------------------------------------------------- /LICENCE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Jiri Pinkas 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | java-blog-aggregator 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | org.springframework.ide.eclipse.core.springbuilder 30 | 31 | 32 | 33 | 34 | org.eclipse.m2e.core.maven2Builder 35 | 36 | 37 | 38 | 39 | 40 | org.springframework.ide.eclipse.core.springnature 41 | org.eclipse.jem.workbench.JavaEMFNature 42 | org.eclipse.wst.common.modulecore.ModuleCoreNature 43 | org.eclipse.jdt.core.javanature 44 | org.eclipse.m2e.core.maven2Nature 45 | org.eclipse.wst.common.project.facet.core.nature 46 | org.eclipse.wst.jsdt.core.jsNature 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/security.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/controller/RegisterController.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.controller; 2 | 3 | import javax.validation.Valid; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.validation.BindingResult; 8 | import org.springframework.web.bind.annotation.ModelAttribute; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import cz.jiripinkas.jba.entity.User; 15 | import cz.jiripinkas.jba.service.UserService; 16 | 17 | @Controller 18 | @RequestMapping("/register") 19 | public class RegisterController { 20 | 21 | @Autowired 22 | private UserService userService; 23 | 24 | @ModelAttribute("user") 25 | public User constructUser() { 26 | return new User(); 27 | } 28 | 29 | @RequestMapping 30 | public String showRegister() { 31 | return "user-register"; 32 | } 33 | 34 | @RequestMapping(method = RequestMethod.POST) 35 | public String doRegister(@Valid @ModelAttribute("user") User user, BindingResult result) { 36 | if (result.hasErrors()) { 37 | return "user-register"; 38 | } 39 | userService.save(user); 40 | return "redirect:/register.html?success=true"; 41 | } 42 | 43 | @RequestMapping("/available") 44 | @ResponseBody 45 | public String available(@RequestParam String username) { 46 | Boolean available = userService.findOne(username) == null; 47 | return available.toString(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/entity/Blog.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.entity; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.Id; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToOne; 12 | import javax.persistence.OneToMany; 13 | import javax.validation.constraints.Size; 14 | 15 | import org.hibernate.validator.constraints.URL; 16 | 17 | @Entity 18 | public class Blog { 19 | 20 | @Id 21 | @GeneratedValue 22 | private Integer id; 23 | 24 | @Size(min = 1, message = "Invalid URL!") 25 | @URL(message = "Invalid URL!") 26 | @Column(length = 1000) 27 | private String url; 28 | 29 | @Size(min = 1, message = "Name must be at least 1 character!") 30 | private String name; 31 | 32 | @ManyToOne 33 | @JoinColumn(name = "user_id") 34 | private User user; 35 | 36 | @OneToMany(mappedBy = "blog", cascade = CascadeType.REMOVE) 37 | private List items; 38 | 39 | public User getUser() { 40 | return user; 41 | } 42 | 43 | public void setUser(User user) { 44 | this.user = user; 45 | } 46 | 47 | public List getItems() { 48 | return items; 49 | } 50 | 51 | public void setItems(List items) { 52 | this.items = items; 53 | } 54 | 55 | public Integer getId() { 56 | return id; 57 | } 58 | 59 | public void setId(Integer id) { 60 | this.id = id; 61 | } 62 | 63 | public String getUrl() { 64 | return url; 65 | } 66 | 67 | public void setUrl(String url) { 68 | this.url = url; 69 | } 70 | 71 | public String getName() { 72 | return name; 73 | } 74 | 75 | public void setName(String name) { 76 | this.name = name; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /diagrams/java-blog-aggregator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | cz.jiripinkas.jba.entity.Item 4 | 120 5 | 206 6 | 740 7 | 94 8 | false 9 | false 10 | false 11 | 12 | 13 | 14 | cz.jiripinkas.jba.entity.Blog 15 | 120 16 | 186 17 | 503 18 | 65 19 | false 20 | false 21 | false 22 | 23 | 24 | 25 | cz.jiripinkas.jba.entity.Role 26 | 120 27 | 146 28 | 18 29 | 87 30 | false 31 | false 32 | false 33 | 34 | 35 | 36 | cz.jiripinkas.jba.entity.User 37 | 120 38 | 206 39 | 290 40 | 55 41 | false 42 | false 43 | false 44 | 45 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/jsp/users.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | <%@ include file="../layout/taglib.jsp" %> 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 36 | 37 | 38 | 39 |
user nameoperations
27 | "> 28 | 29 | 30 | 32 | " class="btn btn-danger triggerRemove"> 33 | remove 34 | 35 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TCloudProtocol.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import javax.xml.bind.annotation.XmlEnum; 12 | import javax.xml.bind.annotation.XmlEnumValue; 13 | import javax.xml.bind.annotation.XmlType; 14 | 15 | 16 | /** 17 | *

Java class for tCloudProtocol. 18 | * 19 | *

The following schema fragment specifies the expected content contained within this class. 20 | *

21 | *

22 |  * <simpleType name="tCloudProtocol">
23 |  *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
24 |  *     <enumeration value="xml-rpc"/>
25 |  *     <enumeration value="http-post"/>
26 |  *     <enumeration value="soap"/>
27 |  *   </restriction>
28 |  * </simpleType>
29 |  * 
30 | * 31 | */ 32 | @XmlType(name = "tCloudProtocol") 33 | @XmlEnum 34 | public enum TCloudProtocol { 35 | 36 | @XmlEnumValue("xml-rpc") 37 | XML_RPC("xml-rpc"), 38 | @XmlEnumValue("http-post") 39 | HTTP_POST("http-post"), 40 | @XmlEnumValue("soap") 41 | SOAP("soap"); 42 | private final String value; 43 | 44 | TCloudProtocol(String v) { 45 | value = v; 46 | } 47 | 48 | public String value() { 49 | return value; 50 | } 51 | 52 | public static TCloudProtocol fromValue(String v) { 53 | for (TCloudProtocol c: TCloudProtocol.values()) { 54 | if (c.value.equals(v)) { 55 | return c; 56 | } 57 | } 58 | throw new IllegalArgumentException(v); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/entity/Item.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.entity; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.Lob; 11 | import javax.persistence.ManyToOne; 12 | 13 | import org.hibernate.annotations.Type; 14 | 15 | @Entity 16 | public class Item { 17 | 18 | @Id 19 | @GeneratedValue 20 | private Integer id; 21 | 22 | @Column(length = 1000) 23 | private String title; 24 | 25 | @Lob 26 | @Type(type = "org.hibernate.type.StringClobType") 27 | @Column(length = Integer.MAX_VALUE) 28 | private String description; 29 | 30 | @Column(name = "published_date") 31 | private Date publishedDate; 32 | 33 | @Column(length = 1000) 34 | private String link; 35 | 36 | @ManyToOne 37 | @JoinColumn(name = "blog_id") 38 | private Blog blog; 39 | 40 | public Blog getBlog() { 41 | return blog; 42 | } 43 | 44 | public void setBlog(Blog blog) { 45 | this.blog = blog; 46 | } 47 | 48 | public Integer getId() { 49 | return id; 50 | } 51 | 52 | public void setId(Integer id) { 53 | this.id = id; 54 | } 55 | 56 | public String getTitle() { 57 | return title; 58 | } 59 | 60 | public void setTitle(String title) { 61 | this.title = title; 62 | } 63 | 64 | public String getDescription() { 65 | return description; 66 | } 67 | 68 | public void setDescription(String description) { 69 | this.description = description; 70 | } 71 | 72 | public Date getPublishedDate() { 73 | return publishedDate; 74 | } 75 | 76 | public void setPublishedDate(Date publishedDate) { 77 | this.publishedDate = publishedDate; 78 | } 79 | 80 | public String getLink() { 81 | return link; 82 | } 83 | 84 | public void setLink(String link) { 85 | this.link = link; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.controller; 2 | 3 | import java.security.Principal; 4 | 5 | import javax.validation.Valid; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.validation.BindingResult; 11 | import org.springframework.web.bind.annotation.ModelAttribute; 12 | import org.springframework.web.bind.annotation.PathVariable; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | 16 | import cz.jiripinkas.jba.entity.Blog; 17 | import cz.jiripinkas.jba.service.BlogService; 18 | import cz.jiripinkas.jba.service.UserService; 19 | 20 | @Controller 21 | public class UserController { 22 | 23 | @Autowired 24 | private UserService userService; 25 | 26 | @Autowired 27 | private BlogService blogService; 28 | 29 | @ModelAttribute("blog") 30 | public Blog constructBlog() { 31 | return new Blog(); 32 | } 33 | 34 | @RequestMapping("/account") 35 | public String account(Model model, Principal principal) { 36 | String name = principal.getName(); 37 | model.addAttribute("user", userService.findOneWithBlogs(name)); 38 | return "account"; 39 | } 40 | 41 | @RequestMapping(value = "/account", method = RequestMethod.POST) 42 | public String doAddBlog(Model model, 43 | @Valid @ModelAttribute("blog") Blog blog, BindingResult result, 44 | Principal principal) { 45 | if (result.hasErrors()) { 46 | return account(model, principal); 47 | } 48 | String name = principal.getName(); 49 | blogService.save(blog, name); 50 | return "redirect:/account.html"; 51 | } 52 | 53 | @RequestMapping("/blog/remove/{id}") 54 | public String removeBlog(@PathVariable int id) { 55 | Blog blog = blogService.findOne(id); 56 | blogService.delete(blog); 57 | return "redirect:/account.html"; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/defs/general.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/service/BlogService.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.scheduling.annotation.Scheduled; 7 | import org.springframework.security.access.method.P; 8 | import org.springframework.security.access.prepost.PreAuthorize; 9 | import org.springframework.stereotype.Service; 10 | 11 | import cz.jiripinkas.jba.entity.Blog; 12 | import cz.jiripinkas.jba.entity.Item; 13 | import cz.jiripinkas.jba.entity.User; 14 | import cz.jiripinkas.jba.exception.RssException; 15 | import cz.jiripinkas.jba.repository.BlogRepository; 16 | import cz.jiripinkas.jba.repository.ItemRepository; 17 | import cz.jiripinkas.jba.repository.UserRepository; 18 | 19 | @Service 20 | public class BlogService { 21 | 22 | @Autowired 23 | private BlogRepository blogRepository; 24 | 25 | @Autowired 26 | private UserRepository userRepository; 27 | 28 | @Autowired 29 | private RssService rssService; 30 | 31 | @Autowired 32 | private ItemRepository itemRepository; 33 | 34 | public void saveItems(Blog blog) { 35 | try { 36 | List items = rssService.getItems(blog.getUrl()); 37 | for (Item item : items) { 38 | Item savedItem = itemRepository.findByBlogAndLink(blog, item.getLink()); 39 | if(savedItem == null) { 40 | item.setBlog(blog); 41 | itemRepository.save(item); 42 | } 43 | } 44 | } catch (RssException e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | // 1 hour = 60 seconds * 60 minutes * 1000 50 | @Scheduled(fixedDelay=3600000) 51 | public void reloadBlogs() { 52 | List blogs = blogRepository.findAll(); 53 | for (Blog blog : blogs) { 54 | saveItems(blog); 55 | } 56 | } 57 | 58 | public void save(Blog blog, String name) { 59 | User user = userRepository.findByName(name); 60 | blog.setUser(user); 61 | blogRepository.save(blog); 62 | saveItems(blog); 63 | } 64 | 65 | @PreAuthorize("#blog.user.name == authentication.name or hasRole('ROLE_ADMIN')") 66 | public void delete(@P("blog") Blog blog) { 67 | blogRepository.delete(blog); 68 | } 69 | 70 | public Blog findOne(int id) { 71 | return blogRepository.findOne(id); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/service/RssService.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.service; 2 | 3 | import java.io.File; 4 | import java.text.ParseException; 5 | import java.text.SimpleDateFormat; 6 | import java.util.ArrayList; 7 | import java.util.Date; 8 | import java.util.List; 9 | import java.util.Locale; 10 | 11 | import javax.xml.bind.JAXBContext; 12 | import javax.xml.bind.JAXBElement; 13 | import javax.xml.bind.JAXBException; 14 | import javax.xml.bind.Unmarshaller; 15 | import javax.xml.transform.Source; 16 | import javax.xml.transform.stream.StreamSource; 17 | 18 | import org.springframework.stereotype.Service; 19 | 20 | import cz.jiripinkas.jba.entity.Item; 21 | import cz.jiripinkas.jba.exception.RssException; 22 | import cz.jiripinkas.jba.rss.ObjectFactory; 23 | import cz.jiripinkas.jba.rss.TRss; 24 | import cz.jiripinkas.jba.rss.TRssChannel; 25 | import cz.jiripinkas.jba.rss.TRssItem; 26 | 27 | @Service 28 | public class RssService { 29 | 30 | public List getItems(File file) throws RssException { 31 | return getItems(new StreamSource(file)); 32 | } 33 | 34 | public List getItems(String url) throws RssException { 35 | return getItems(new StreamSource(url)); 36 | } 37 | 38 | private List getItems(Source source) throws RssException { 39 | ArrayList list = new ArrayList(); 40 | try { 41 | JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); 42 | Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); 43 | JAXBElement jaxbElement = unmarshaller.unmarshal(source, TRss.class); 44 | TRss rss = jaxbElement.getValue(); 45 | 46 | List channels = rss.getChannel(); 47 | for (TRssChannel channel : channels) { 48 | List items = channel.getItem(); 49 | for (TRssItem rssItem : items) { 50 | Item item = new Item(); 51 | item.setTitle(rssItem.getTitle()); 52 | item.setDescription(rssItem.getDescription()); 53 | item.setLink(rssItem.getLink()); 54 | Date pubDate = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH).parse(rssItem.getPubDate()); 55 | item.setPublishedDate(pubDate); 56 | list.add(item); 57 | } 58 | } 59 | } catch (JAXBException e) { 60 | throw new RssException(e); 61 | } catch (ParseException e) { 62 | throw new RssException(e); 63 | } 64 | return list; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/jsp/user-detail.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | <%@ include file="../layout/taglib.jsp"%> 5 | 6 |

7 | 8 |

9 | 10 | 20 | 21 | 22 | 27 | 28 | 29 |
30 | 31 |
32 |

33 |

34 | 35 | " class="btn btn-danger triggerRemove">remove blog 36 | 37 |

38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
TitleLink
55 |
56 |
57 |
58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | java-blog-aggregator 7 | 8 | index.html 9 | index.htm 10 | index.jsp 11 | default.html 12 | default.htm 13 | default.jsp 14 | 15 | 16 | 17 | dispatcher 18 | org.springframework.web.servlet.DispatcherServlet 19 | 1 20 | 21 | 22 | 23 | dispatcher 24 | *.html 25 | *.htm 26 | *.json 27 | *.xml 28 | 29 | 30 | 31 | org.springframework.web.context.ContextLoaderListener 32 | 33 | 34 | 35 | 36 | characterEncodingFilter 37 | org.springframework.web.filter.CharacterEncodingFilter 38 | 39 | encoding 40 | UTF-8 41 | 42 | 43 | forceEncoding 44 | true 45 | 46 | 47 | 48 | 49 | characterEncodingFilter 50 | /* 51 | 52 | 53 | 54 | 55 | springSecurityFilterChain 56 | org.springframework.web.filter.DelegatingFilterProxy 57 | 58 | 59 | 60 | springSecurityFilterChain 61 | /* 62 | 63 | 64 | 65 | defaultHtmlEscape 66 | true 67 | 68 | 69 | 70 | spring.profiles.default 71 | prod 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/service/UserService.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.transaction.Transactional; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.data.domain.PageRequest; 10 | import org.springframework.data.domain.Sort.Direction; 11 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 12 | import org.springframework.stereotype.Service; 13 | 14 | import cz.jiripinkas.jba.entity.Blog; 15 | import cz.jiripinkas.jba.entity.Item; 16 | import cz.jiripinkas.jba.entity.Role; 17 | import cz.jiripinkas.jba.entity.User; 18 | import cz.jiripinkas.jba.repository.BlogRepository; 19 | import cz.jiripinkas.jba.repository.ItemRepository; 20 | import cz.jiripinkas.jba.repository.RoleRepository; 21 | import cz.jiripinkas.jba.repository.UserRepository; 22 | 23 | @Service 24 | @Transactional 25 | public class UserService { 26 | 27 | @Autowired 28 | private UserRepository userRepository; 29 | 30 | @Autowired 31 | private RoleRepository roleRepository; 32 | 33 | @Autowired 34 | private BlogRepository blogRepository; 35 | 36 | @Autowired 37 | private ItemRepository itemRepository; 38 | 39 | public List findAll() { 40 | return userRepository.findAll(); 41 | } 42 | 43 | public User findOne(int id) { 44 | return userRepository.findOne(id); 45 | } 46 | 47 | @Transactional 48 | public User findOneWithBlogs(int id) { 49 | User user = findOne(id); 50 | List blogs = blogRepository.findByUser(user); 51 | for (Blog blog : blogs) { 52 | List items = itemRepository.findByBlog(blog, new PageRequest(0, 10, Direction.DESC, "publishedDate")); 53 | blog.setItems(items); 54 | } 55 | user.setBlogs(blogs); 56 | return user; 57 | } 58 | 59 | public void save(User user) { 60 | user.setEnabled(true); 61 | BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); 62 | user.setPassword(encoder.encode(user.getPassword())); 63 | 64 | List roles = new ArrayList(); 65 | roles.add(roleRepository.findByName("ROLE_USER")); 66 | user.setRoles(roles); 67 | 68 | userRepository.save(user); 69 | } 70 | 71 | public User findOneWithBlogs(String name) { 72 | User user = userRepository.findByName(name); 73 | return findOneWithBlogs(user.getId()); 74 | } 75 | 76 | public void delete(int id) { 77 | userRepository.delete(id); 78 | } 79 | 80 | public User findOne(String username) { 81 | return userRepository.findByName(username); 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/entity/User.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.entity; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.Id; 10 | import javax.persistence.JoinTable; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.OneToMany; 13 | import javax.persistence.Table; 14 | import javax.validation.constraints.Size; 15 | 16 | import org.hibernate.validator.constraints.Email; 17 | 18 | import cz.jiripinkas.jba.annotation.UniqueUsername; 19 | 20 | @Entity 21 | @Table(name = "app_user") 22 | public class User { 23 | 24 | @Id 25 | @GeneratedValue 26 | private Integer id; 27 | 28 | @Size(min = 3, message = "Name must be at least 3 characters!") 29 | @Column(unique = true) 30 | @UniqueUsername(message = "Such username already exists!") 31 | private String name; 32 | 33 | @Size(min = 1, message = "Invalid email address!") 34 | @Email(message = "Invalid email address!") 35 | private String email; 36 | 37 | @Size(min = 5, message = "Name must be at least 5 characters!") 38 | private String password; 39 | 40 | private boolean enabled; 41 | 42 | @ManyToMany 43 | @JoinTable 44 | private List roles; 45 | 46 | @OneToMany(mappedBy = "user", cascade = CascadeType.REMOVE) 47 | private List blogs; 48 | 49 | public boolean isEnabled() { 50 | return enabled; 51 | } 52 | 53 | public void setEnabled(boolean enabled) { 54 | this.enabled = enabled; 55 | } 56 | 57 | public List getBlogs() { 58 | return blogs; 59 | } 60 | 61 | public void setBlogs(List blogs) { 62 | this.blogs = blogs; 63 | } 64 | 65 | public List getRoles() { 66 | return roles; 67 | } 68 | 69 | public void setRoles(List roles) { 70 | this.roles = roles; 71 | } 72 | 73 | public Integer getId() { 74 | return id; 75 | } 76 | 77 | public void setId(Integer id) { 78 | this.id = id; 79 | } 80 | 81 | public String getName() { 82 | return name; 83 | } 84 | 85 | public void setName(String name) { 86 | this.name = name; 87 | } 88 | 89 | public String getEmail() { 90 | return email; 91 | } 92 | 93 | public void setEmail(String email) { 94 | this.email = email; 95 | } 96 | 97 | public String getPassword() { 98 | return password; 99 | } 100 | 101 | public void setPassword(String password) { 102 | this.password = password; 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TCategory.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlType; 15 | import javax.xml.bind.annotation.XmlValue; 16 | 17 | 18 | /** 19 | *

Java class for tCategory complex type. 20 | * 21 | *

The following schema fragment specifies the expected content contained within this class. 22 | * 23 | *

24 |  * <complexType name="tCategory">
25 |  *   <simpleContent>
26 |  *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
27 |  *       <attribute name="domain" type="{http://www.w3.org/2001/XMLSchema}string" />
28 |  *     </extension>
29 |  *   </simpleContent>
30 |  * </complexType>
31 |  * 
32 | * 33 | * 34 | */ 35 | @XmlAccessorType(XmlAccessType.FIELD) 36 | @XmlType(name = "tCategory", propOrder = { 37 | "value" 38 | }) 39 | public class TCategory { 40 | 41 | @XmlValue 42 | protected String value; 43 | @XmlAttribute(name = "domain") 44 | protected String domain; 45 | 46 | /** 47 | * Gets the value of the value property. 48 | * 49 | * @return 50 | * possible object is 51 | * {@link String } 52 | * 53 | */ 54 | public String getValue() { 55 | return value; 56 | } 57 | 58 | /** 59 | * Sets the value of the value property. 60 | * 61 | * @param value 62 | * allowed object is 63 | * {@link String } 64 | * 65 | */ 66 | public void setValue(String value) { 67 | this.value = value; 68 | } 69 | 70 | /** 71 | * Gets the value of the domain property. 72 | * 73 | * @return 74 | * possible object is 75 | * {@link String } 76 | * 77 | */ 78 | public String getDomain() { 79 | return domain; 80 | } 81 | 82 | /** 83 | * Sets the value of the domain property. 84 | * 85 | * @param value 86 | * allowed object is 87 | * {@link String } 88 | * 89 | */ 90 | public void setDomain(String value) { 91 | this.domain = value; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TSource.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlSchemaType; 15 | import javax.xml.bind.annotation.XmlType; 16 | import javax.xml.bind.annotation.XmlValue; 17 | 18 | 19 | /** 20 | *

Java class for tSource complex type. 21 | * 22 | *

The following schema fragment specifies the expected content contained within this class. 23 | * 24 | *

25 |  * <complexType name="tSource">
26 |  *   <simpleContent>
27 |  *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
28 |  *       <attribute name="url" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
29 |  *     </extension>
30 |  *   </simpleContent>
31 |  * </complexType>
32 |  * 
33 | * 34 | * 35 | */ 36 | @XmlAccessorType(XmlAccessType.FIELD) 37 | @XmlType(name = "tSource", propOrder = { 38 | "value" 39 | }) 40 | public class TSource { 41 | 42 | @XmlValue 43 | protected String value; 44 | @XmlAttribute(name = "url") 45 | @XmlSchemaType(name = "anyURI") 46 | protected String url; 47 | 48 | /** 49 | * Gets the value of the value property. 50 | * 51 | * @return 52 | * possible object is 53 | * {@link String } 54 | * 55 | */ 56 | public String getValue() { 57 | return value; 58 | } 59 | 60 | /** 61 | * Sets the value of the value property. 62 | * 63 | * @param value 64 | * allowed object is 65 | * {@link String } 66 | * 67 | */ 68 | public void setValue(String value) { 69 | this.value = value; 70 | } 71 | 72 | /** 73 | * Gets the value of the url property. 74 | * 75 | * @return 76 | * possible object is 77 | * {@link String } 78 | * 79 | */ 80 | public String getUrl() { 81 | return url; 82 | } 83 | 84 | /** 85 | * Sets the value of the url property. 86 | * 87 | * @param value 88 | * allowed object is 89 | * {@link String } 90 | * 91 | */ 92 | public void setUrl(String value) { 93 | this.url = value; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/service/InitDbService.java: -------------------------------------------------------------------------------- 1 | package cz.jiripinkas.jba.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import javax.annotation.PostConstruct; 8 | import javax.transaction.Transactional; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 12 | import org.springframework.stereotype.Service; 13 | 14 | import cz.jiripinkas.jba.entity.Blog; 15 | import cz.jiripinkas.jba.entity.Item; 16 | import cz.jiripinkas.jba.entity.Role; 17 | import cz.jiripinkas.jba.entity.User; 18 | import cz.jiripinkas.jba.repository.BlogRepository; 19 | import cz.jiripinkas.jba.repository.ItemRepository; 20 | import cz.jiripinkas.jba.repository.RoleRepository; 21 | import cz.jiripinkas.jba.repository.UserRepository; 22 | 23 | @Transactional 24 | @Service 25 | public class InitDbService { 26 | 27 | @Autowired 28 | private RoleRepository roleRepository; 29 | 30 | @Autowired 31 | private UserRepository userRepository; 32 | 33 | @Autowired 34 | private BlogRepository blogRepository; 35 | 36 | @Autowired 37 | private ItemRepository itemRepository; 38 | 39 | @PostConstruct 40 | public void init() { 41 | if (roleRepository.findByName("ROLE_ADMIN") == null) { 42 | Role roleUser = new Role(); 43 | roleUser.setName("ROLE_USER"); 44 | roleRepository.save(roleUser); 45 | 46 | Role roleAdmin = new Role(); 47 | roleAdmin.setName("ROLE_ADMIN"); 48 | roleRepository.save(roleAdmin); 49 | 50 | User userAdmin = new User(); 51 | userAdmin.setEnabled(true); 52 | userAdmin.setName("admin"); 53 | BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); 54 | userAdmin.setPassword(encoder.encode("admin")); 55 | List roles = new ArrayList(); 56 | roles.add(roleAdmin); 57 | roles.add(roleUser); 58 | userAdmin.setRoles(roles); 59 | userRepository.save(userAdmin); 60 | 61 | Blog blogJavavids = new Blog(); 62 | blogJavavids.setName("JavaVids"); 63 | blogJavavids 64 | .setUrl("http://feeds.feedburner.com/javavids?format=xml"); 65 | blogJavavids.setUser(userAdmin); 66 | blogRepository.save(blogJavavids); 67 | 68 | // Item item1 = new Item(); 69 | // item1.setBlog(blogJavavids); 70 | // item1.setTitle("first"); 71 | // item1.setLink("http://www.javavids.com"); 72 | // item1.setPublishedDate(new Date()); 73 | // itemRepository.save(item1); 74 | // 75 | // Item item2 = new Item(); 76 | // item2.setBlog(blogJavavids); 77 | // item2.setTitle("second"); 78 | // item2.setLink("http://www.javavids.com"); 79 | // item2.setPublishedDate(new Date()); 80 | // itemRepository.save(item2); 81 | } 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/jsp/user-register.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | <%@ include file="../layout/taglib.jsp" %> 5 | 6 | 7 | 8 | 9 |
Registration successfull!
10 |
11 | 12 |
13 | 14 |
15 | 16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 | 35 |
36 | 37 |
38 |
39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TGuid.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlType; 15 | import javax.xml.bind.annotation.XmlValue; 16 | 17 | 18 | /** 19 | *

Java class for tGuid complex type. 20 | * 21 | *

The following schema fragment specifies the expected content contained within this class. 22 | * 23 | *

24 |  * <complexType name="tGuid">
25 |  *   <simpleContent>
26 |  *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
27 |  *       <attribute name="isPermaLink" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
28 |  *     </extension>
29 |  *   </simpleContent>
30 |  * </complexType>
31 |  * 
32 | * 33 | * 34 | */ 35 | @XmlAccessorType(XmlAccessType.FIELD) 36 | @XmlType(name = "tGuid", propOrder = { 37 | "value" 38 | }) 39 | public class TGuid { 40 | 41 | @XmlValue 42 | protected String value; 43 | @XmlAttribute(name = "isPermaLink") 44 | protected Boolean isPermaLink; 45 | 46 | /** 47 | * Gets the value of the value property. 48 | * 49 | * @return 50 | * possible object is 51 | * {@link String } 52 | * 53 | */ 54 | public String getValue() { 55 | return value; 56 | } 57 | 58 | /** 59 | * Sets the value of the value property. 60 | * 61 | * @param value 62 | * allowed object is 63 | * {@link String } 64 | * 65 | */ 66 | public void setValue(String value) { 67 | this.value = value; 68 | } 69 | 70 | /** 71 | * Gets the value of the isPermaLink property. 72 | * 73 | * @return 74 | * possible object is 75 | * {@link Boolean } 76 | * 77 | */ 78 | public boolean isIsPermaLink() { 79 | if (isPermaLink == null) { 80 | return true; 81 | } else { 82 | return isPermaLink; 83 | } 84 | } 85 | 86 | /** 87 | * Sets the value of the isPermaLink property. 88 | * 89 | * @param value 90 | * allowed object is 91 | * {@link Boolean } 92 | * 93 | */ 94 | public void setIsPermaLink(Boolean value) { 95 | this.isPermaLink = value; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/layout/classic.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> 4 | 5 | 6 | 7 | 8 | <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> 9 | 10 | <%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %> 11 | 12 | 14 | 15 | 17 | 18 | 19 | 20 | 22 | 23 | 25 | 26 | 27 | <tiles:getAsString name="title" /> 28 | 29 | 30 | 31 | <%@ taglib uri="http://tiles.apache.org/tags-tiles-extras" prefix="tilesx" %> 32 | 33 | 34 | 35 |
36 | 37 | 38 | 67 | 68 | 69 | 70 | 71 |
72 |
73 |
74 | 75 |
76 | 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/ObjectFactory.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import javax.xml.bind.JAXBElement; 12 | import javax.xml.bind.annotation.XmlElementDecl; 13 | import javax.xml.bind.annotation.XmlRegistry; 14 | import javax.xml.namespace.QName; 15 | 16 | 17 | /** 18 | * This object contains factory methods for each 19 | * Java content interface and Java element interface 20 | * generated in the cz.jiripinkas.jba.rss package. 21 | *

An ObjectFactory allows you to programatically 22 | * construct new instances of the Java representation 23 | * for XML content. The Java representation of XML 24 | * content can consist of schema derived interfaces 25 | * and classes representing the binding of schema 26 | * type definitions, element declarations and model 27 | * groups. Factory methods for each of these are 28 | * provided in this class. 29 | * 30 | */ 31 | @XmlRegistry 32 | public class ObjectFactory { 33 | 34 | private final static QName _Rss_QNAME = new QName("", "rss"); 35 | 36 | /** 37 | * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: cz.jiripinkas.jba.rss 38 | * 39 | */ 40 | public ObjectFactory() { 41 | } 42 | 43 | /** 44 | * Create an instance of {@link TRss } 45 | * 46 | */ 47 | public TRss createTRss() { 48 | return new TRss(); 49 | } 50 | 51 | /** 52 | * Create an instance of {@link TRssChannel } 53 | * 54 | */ 55 | public TRssChannel createTRssChannel() { 56 | return new TRssChannel(); 57 | } 58 | 59 | /** 60 | * Create an instance of {@link TTextInput } 61 | * 62 | */ 63 | public TTextInput createTTextInput() { 64 | return new TTextInput(); 65 | } 66 | 67 | /** 68 | * Create an instance of {@link TCategory } 69 | * 70 | */ 71 | public TCategory createTCategory() { 72 | return new TCategory(); 73 | } 74 | 75 | /** 76 | * Create an instance of {@link TEnclosure } 77 | * 78 | */ 79 | public TEnclosure createTEnclosure() { 80 | return new TEnclosure(); 81 | } 82 | 83 | /** 84 | * Create an instance of {@link TImage } 85 | * 86 | */ 87 | public TImage createTImage() { 88 | return new TImage(); 89 | } 90 | 91 | /** 92 | * Create an instance of {@link TSource } 93 | * 94 | */ 95 | public TSource createTSource() { 96 | return new TSource(); 97 | } 98 | 99 | /** 100 | * Create an instance of {@link TCloud } 101 | * 102 | */ 103 | public TCloud createTCloud() { 104 | return new TCloud(); 105 | } 106 | 107 | /** 108 | * Create an instance of {@link TRssItem } 109 | * 110 | */ 111 | public TRssItem createTRssItem() { 112 | return new TRssItem(); 113 | } 114 | 115 | /** 116 | * Create an instance of {@link TGuid } 117 | * 118 | */ 119 | public TGuid createTGuid() { 120 | return new TGuid(); 121 | } 122 | 123 | /** 124 | * Create an instance of {@link JAXBElement }{@code <}{@link TRss }{@code >}} 125 | * 126 | */ 127 | @XmlElementDecl(namespace = "", name = "rss") 128 | public JAXBElement createRss(TRss value) { 129 | return new JAXBElement(_Rss_QNAME, TRss.class, null, value); 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TEnclosure.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import java.math.BigInteger; 12 | import javax.xml.bind.annotation.XmlAccessType; 13 | import javax.xml.bind.annotation.XmlAccessorType; 14 | import javax.xml.bind.annotation.XmlAttribute; 15 | import javax.xml.bind.annotation.XmlSchemaType; 16 | import javax.xml.bind.annotation.XmlType; 17 | import javax.xml.bind.annotation.XmlValue; 18 | 19 | 20 | /** 21 | *

Java class for tEnclosure complex type. 22 | * 23 | *

The following schema fragment specifies the expected content contained within this class. 24 | * 25 | *

 26 |  * <complexType name="tEnclosure">
 27 |  *   <simpleContent>
 28 |  *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
 29 |  *       <attribute name="url" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
 30 |  *       <attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
 31 |  *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 32 |  *     </extension>
 33 |  *   </simpleContent>
 34 |  * </complexType>
 35 |  * 
36 | * 37 | * 38 | */ 39 | @XmlAccessorType(XmlAccessType.FIELD) 40 | @XmlType(name = "tEnclosure", propOrder = { 41 | "value" 42 | }) 43 | public class TEnclosure { 44 | 45 | @XmlValue 46 | protected String value; 47 | @XmlAttribute(name = "url", required = true) 48 | @XmlSchemaType(name = "anyURI") 49 | protected String url; 50 | @XmlAttribute(name = "length", required = true) 51 | @XmlSchemaType(name = "nonNegativeInteger") 52 | protected BigInteger length; 53 | @XmlAttribute(name = "type", required = true) 54 | protected String type; 55 | 56 | /** 57 | * Gets the value of the value property. 58 | * 59 | * @return 60 | * possible object is 61 | * {@link String } 62 | * 63 | */ 64 | public String getValue() { 65 | return value; 66 | } 67 | 68 | /** 69 | * Sets the value of the value property. 70 | * 71 | * @param value 72 | * allowed object is 73 | * {@link String } 74 | * 75 | */ 76 | public void setValue(String value) { 77 | this.value = value; 78 | } 79 | 80 | /** 81 | * Gets the value of the url property. 82 | * 83 | * @return 84 | * possible object is 85 | * {@link String } 86 | * 87 | */ 88 | public String getUrl() { 89 | return url; 90 | } 91 | 92 | /** 93 | * Sets the value of the url property. 94 | * 95 | * @param value 96 | * allowed object is 97 | * {@link String } 98 | * 99 | */ 100 | public void setUrl(String value) { 101 | this.url = value; 102 | } 103 | 104 | /** 105 | * Gets the value of the length property. 106 | * 107 | * @return 108 | * possible object is 109 | * {@link BigInteger } 110 | * 111 | */ 112 | public BigInteger getLength() { 113 | return length; 114 | } 115 | 116 | /** 117 | * Sets the value of the length property. 118 | * 119 | * @param value 120 | * allowed object is 121 | * {@link BigInteger } 122 | * 123 | */ 124 | public void setLength(BigInteger value) { 125 | this.length = value; 126 | } 127 | 128 | /** 129 | * Gets the value of the type property. 130 | * 131 | * @return 132 | * possible object is 133 | * {@link String } 134 | * 135 | */ 136 | public String getType() { 137 | return type; 138 | } 139 | 140 | /** 141 | * Sets the value of the type property. 142 | * 143 | * @param value 144 | * allowed object is 145 | * {@link String } 146 | * 147 | */ 148 | public void setType(String value) { 149 | this.type = value; 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TTextInput.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlElement; 14 | import javax.xml.bind.annotation.XmlSchemaType; 15 | import javax.xml.bind.annotation.XmlType; 16 | 17 | 18 | /** 19 | * The purpose of this element is something of a mystery! You can use it to specify a search engine box. Or to allow a reader to provide feedback. Most aggregators ignore it. 20 | * 21 | *

Java class for tTextInput complex type. 22 | * 23 | *

The following schema fragment specifies the expected content contained within this class. 24 | * 25 | *

 26 |  * <complexType name="tTextInput">
 27 |  *   <complexContent>
 28 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 29 |  *       <sequence>
 30 |  *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
 31 |  *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
 32 |  *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
 33 |  *         <element name="link" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
 34 |  *       </sequence>
 35 |  *     </restriction>
 36 |  *   </complexContent>
 37 |  * </complexType>
 38 |  * 
39 | * 40 | * 41 | */ 42 | @XmlAccessorType(XmlAccessType.FIELD) 43 | @XmlType(name = "tTextInput", propOrder = { 44 | "title", 45 | "description", 46 | "name", 47 | "link" 48 | }) 49 | public class TTextInput { 50 | 51 | @XmlElement(required = true) 52 | protected String title; 53 | @XmlElement(required = true) 54 | protected String description; 55 | @XmlElement(required = true) 56 | protected String name; 57 | @XmlElement(required = true) 58 | @XmlSchemaType(name = "anyURI") 59 | protected String link; 60 | 61 | /** 62 | * Gets the value of the title property. 63 | * 64 | * @return 65 | * possible object is 66 | * {@link String } 67 | * 68 | */ 69 | public String getTitle() { 70 | return title; 71 | } 72 | 73 | /** 74 | * Sets the value of the title property. 75 | * 76 | * @param value 77 | * allowed object is 78 | * {@link String } 79 | * 80 | */ 81 | public void setTitle(String value) { 82 | this.title = value; 83 | } 84 | 85 | /** 86 | * Gets the value of the description property. 87 | * 88 | * @return 89 | * possible object is 90 | * {@link String } 91 | * 92 | */ 93 | public String getDescription() { 94 | return description; 95 | } 96 | 97 | /** 98 | * Sets the value of the description property. 99 | * 100 | * @param value 101 | * allowed object is 102 | * {@link String } 103 | * 104 | */ 105 | public void setDescription(String value) { 106 | this.description = value; 107 | } 108 | 109 | /** 110 | * Gets the value of the name property. 111 | * 112 | * @return 113 | * possible object is 114 | * {@link String } 115 | * 116 | */ 117 | public String getName() { 118 | return name; 119 | } 120 | 121 | /** 122 | * Sets the value of the name property. 123 | * 124 | * @param value 125 | * allowed object is 126 | * {@link String } 127 | * 128 | */ 129 | public void setName(String value) { 130 | this.name = value; 131 | } 132 | 133 | /** 134 | * Gets the value of the link property. 135 | * 136 | * @return 137 | * possible object is 138 | * {@link String } 139 | * 140 | */ 141 | public String getLink() { 142 | return link; 143 | } 144 | 145 | /** 146 | * Sets the value of the link property. 147 | * 148 | * @param value 149 | * allowed object is 150 | * {@link String } 151 | * 152 | */ 153 | public void setLink(String value) { 154 | this.link = value; 155 | } 156 | 157 | } 158 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/jsp/user-account.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | <%@ include file="../layout/taglib.jsp"%> 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 46 | 47 | 48 |

49 | 50 | 80 | 81 | 82 | 87 | 88 | 89 |
90 | 91 |
92 |

93 |

94 | 95 | " class="btn btn-danger triggerRemove">remove blog 96 | 97 |

98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 119 | 120 | 121 | 122 |
dateitem
111 | 112 | " target="_blank"> 113 | 114 | 115 | 116 |
117 | ${item.description} 118 |
123 |
124 |
125 |
126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TCloud.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import java.math.BigInteger; 12 | import javax.xml.bind.annotation.XmlAccessType; 13 | import javax.xml.bind.annotation.XmlAccessorType; 14 | import javax.xml.bind.annotation.XmlAttribute; 15 | import javax.xml.bind.annotation.XmlSchemaType; 16 | import javax.xml.bind.annotation.XmlType; 17 | 18 | 19 | /** 20 | * Specifies a web service that supports the rssCloud interface which can be implemented in HTTP-POST, XML-RPC or SOAP 1.1. 21 | * Its purpose is to allow processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds. 22 | * 23 | *

Java class for tCloud complex type. 24 | * 25 | *

The following schema fragment specifies the expected content contained within this class. 26 | * 27 | *

 28 |  * <complexType name="tCloud">
 29 |  *   <complexContent>
 30 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 31 |  *       <attribute name="domain" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 32 |  *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
 33 |  *       <attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 34 |  *       <attribute name="registerProcedure" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 35 |  *       <attribute name="protocol" use="required" type="{}tCloudProtocol" />
 36 |  *     </restriction>
 37 |  *   </complexContent>
 38 |  * </complexType>
 39 |  * 
40 | * 41 | * 42 | */ 43 | @XmlAccessorType(XmlAccessType.FIELD) 44 | @XmlType(name = "tCloud") 45 | public class TCloud { 46 | 47 | @XmlAttribute(name = "domain", required = true) 48 | protected String domain; 49 | @XmlAttribute(name = "port", required = true) 50 | @XmlSchemaType(name = "positiveInteger") 51 | protected BigInteger port; 52 | @XmlAttribute(name = "path", required = true) 53 | protected String path; 54 | @XmlAttribute(name = "registerProcedure", required = true) 55 | protected String registerProcedure; 56 | @XmlAttribute(name = "protocol", required = true) 57 | protected TCloudProtocol protocol; 58 | 59 | /** 60 | * Gets the value of the domain property. 61 | * 62 | * @return 63 | * possible object is 64 | * {@link String } 65 | * 66 | */ 67 | public String getDomain() { 68 | return domain; 69 | } 70 | 71 | /** 72 | * Sets the value of the domain property. 73 | * 74 | * @param value 75 | * allowed object is 76 | * {@link String } 77 | * 78 | */ 79 | public void setDomain(String value) { 80 | this.domain = value; 81 | } 82 | 83 | /** 84 | * Gets the value of the port property. 85 | * 86 | * @return 87 | * possible object is 88 | * {@link BigInteger } 89 | * 90 | */ 91 | public BigInteger getPort() { 92 | return port; 93 | } 94 | 95 | /** 96 | * Sets the value of the port property. 97 | * 98 | * @param value 99 | * allowed object is 100 | * {@link BigInteger } 101 | * 102 | */ 103 | public void setPort(BigInteger value) { 104 | this.port = value; 105 | } 106 | 107 | /** 108 | * Gets the value of the path property. 109 | * 110 | * @return 111 | * possible object is 112 | * {@link String } 113 | * 114 | */ 115 | public String getPath() { 116 | return path; 117 | } 118 | 119 | /** 120 | * Sets the value of the path property. 121 | * 122 | * @param value 123 | * allowed object is 124 | * {@link String } 125 | * 126 | */ 127 | public void setPath(String value) { 128 | this.path = value; 129 | } 130 | 131 | /** 132 | * Gets the value of the registerProcedure property. 133 | * 134 | * @return 135 | * possible object is 136 | * {@link String } 137 | * 138 | */ 139 | public String getRegisterProcedure() { 140 | return registerProcedure; 141 | } 142 | 143 | /** 144 | * Sets the value of the registerProcedure property. 145 | * 146 | * @param value 147 | * allowed object is 148 | * {@link String } 149 | * 150 | */ 151 | public void setRegisterProcedure(String value) { 152 | this.registerProcedure = value; 153 | } 154 | 155 | /** 156 | * Gets the value of the protocol property. 157 | * 158 | * @return 159 | * possible object is 160 | * {@link TCloudProtocol } 161 | * 162 | */ 163 | public TCloudProtocol getProtocol() { 164 | return protocol; 165 | } 166 | 167 | /** 168 | * Sets the value of the protocol property. 169 | * 170 | * @param value 171 | * allowed object is 172 | * {@link TCloudProtocol } 173 | * 174 | */ 175 | public void setProtocol(TCloudProtocol value) { 176 | this.protocol = value; 177 | } 178 | 179 | } 180 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TRss.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import java.math.BigDecimal; 12 | import java.util.ArrayList; 13 | import java.util.HashMap; 14 | import java.util.List; 15 | import java.util.Map; 16 | import javax.xml.bind.annotation.XmlAccessType; 17 | import javax.xml.bind.annotation.XmlAccessorType; 18 | import javax.xml.bind.annotation.XmlAnyAttribute; 19 | import javax.xml.bind.annotation.XmlAnyElement; 20 | import javax.xml.bind.annotation.XmlAttribute; 21 | import javax.xml.bind.annotation.XmlElement; 22 | import javax.xml.bind.annotation.XmlType; 23 | import javax.xml.namespace.QName; 24 | import org.w3c.dom.Element; 25 | 26 | 27 | /** 28 | *

Java class for tRss complex type. 29 | * 30 | *

The following schema fragment specifies the expected content contained within this class. 31 | * 32 | *

 33 |  * <complexType name="tRss">
 34 |  *   <complexContent>
 35 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 36 |  *       <sequence>
 37 |  *         <element name="channel" type="{}tRssChannel" maxOccurs="unbounded"/>
 38 |  *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
 39 |  *       </sequence>
 40 |  *       <attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}decimal" fixed="2.0" />
 41 |  *       <anyAttribute/>
 42 |  *     </restriction>
 43 |  *   </complexContent>
 44 |  * </complexType>
 45 |  * 
46 | * 47 | * 48 | */ 49 | @XmlAccessorType(XmlAccessType.FIELD) 50 | @XmlType(name = "tRss", propOrder = { 51 | "channel", 52 | "any" 53 | }) 54 | public class TRss { 55 | 56 | @XmlElement(required = true) 57 | protected List channel; 58 | @XmlAnyElement(lax = true) 59 | protected List any; 60 | @XmlAttribute(name = "version", required = true) 61 | protected BigDecimal version; 62 | @XmlAnyAttribute 63 | private Map otherAttributes = new HashMap(); 64 | 65 | /** 66 | * Gets the value of the channel property. 67 | * 68 | *

69 | * This accessor method returns a reference to the live list, 70 | * not a snapshot. Therefore any modification you make to the 71 | * returned list will be present inside the JAXB object. 72 | * This is why there is not a set method for the channel property. 73 | * 74 | *

75 | * For example, to add a new item, do as follows: 76 | *

 77 |      *    getChannel().add(newItem);
 78 |      * 
79 | * 80 | * 81 | *

82 | * Objects of the following type(s) are allowed in the list 83 | * {@link TRssChannel } 84 | * 85 | * 86 | */ 87 | public List getChannel() { 88 | if (channel == null) { 89 | channel = new ArrayList(); 90 | } 91 | return this.channel; 92 | } 93 | 94 | /** 95 | * Gets the value of the any property. 96 | * 97 | *

98 | * This accessor method returns a reference to the live list, 99 | * not a snapshot. Therefore any modification you make to the 100 | * returned list will be present inside the JAXB object. 101 | * This is why there is not a set method for the any property. 102 | * 103 | *

104 | * For example, to add a new item, do as follows: 105 | *

106 |      *    getAny().add(newItem);
107 |      * 
108 | * 109 | * 110 | *

111 | * Objects of the following type(s) are allowed in the list 112 | * {@link Element } 113 | * {@link Object } 114 | * 115 | * 116 | */ 117 | public List getAny() { 118 | if (any == null) { 119 | any = new ArrayList(); 120 | } 121 | return this.any; 122 | } 123 | 124 | /** 125 | * Gets the value of the version property. 126 | * 127 | * @return 128 | * possible object is 129 | * {@link BigDecimal } 130 | * 131 | */ 132 | public BigDecimal getVersion() { 133 | if (version == null) { 134 | return new BigDecimal("2.0"); 135 | } else { 136 | return version; 137 | } 138 | } 139 | 140 | /** 141 | * Sets the value of the version property. 142 | * 143 | * @param value 144 | * allowed object is 145 | * {@link BigDecimal } 146 | * 147 | */ 148 | public void setVersion(BigDecimal value) { 149 | this.version = value; 150 | } 151 | 152 | /** 153 | * Gets a map that contains attributes that aren't bound to any typed property on this class. 154 | * 155 | *

156 | * the map is keyed by the name of the attribute and 157 | * the value is the string value of the attribute. 158 | * 159 | * the map returned by this method is live, and you can add new attribute 160 | * by updating the map directly. Because of this design, there's no setter. 161 | * 162 | * 163 | * @return 164 | * always non-null 165 | */ 166 | public Map getOtherAttributes() { 167 | return otherAttributes; 168 | } 169 | 170 | } 171 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TImage.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlElement; 14 | import javax.xml.bind.annotation.XmlSchemaType; 15 | import javax.xml.bind.annotation.XmlType; 16 | 17 | 18 | /** 19 | *

Java class for tImage complex type. 20 | * 21 | *

The following schema fragment specifies the expected content contained within this class. 22 | * 23 | *

 24 |  * <complexType name="tImage">
 25 |  *   <complexContent>
 26 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 27 |  *       <sequence>
 28 |  *         <element name="url" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
 29 |  *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
 30 |  *         <element name="link" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
 31 |  *         <element name="width" type="{}tImageWidth" minOccurs="0"/>
 32 |  *         <element name="height" type="{}tImageHeight" minOccurs="0"/>
 33 |  *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 34 |  *       </sequence>
 35 |  *     </restriction>
 36 |  *   </complexContent>
 37 |  * </complexType>
 38 |  * 
39 | * 40 | * 41 | */ 42 | @XmlAccessorType(XmlAccessType.FIELD) 43 | @XmlType(name = "tImage", propOrder = { 44 | "url", 45 | "title", 46 | "link", 47 | "width", 48 | "height", 49 | "description" 50 | }) 51 | public class TImage { 52 | 53 | @XmlElement(required = true) 54 | @XmlSchemaType(name = "anyURI") 55 | protected String url; 56 | @XmlElement(required = true) 57 | protected String title; 58 | @XmlElement(required = true) 59 | @XmlSchemaType(name = "anyURI") 60 | protected String link; 61 | @XmlElement(defaultValue = "88") 62 | protected Integer width; 63 | @XmlElement(defaultValue = "31") 64 | protected Integer height; 65 | protected String description; 66 | 67 | /** 68 | * Gets the value of the url property. 69 | * 70 | * @return 71 | * possible object is 72 | * {@link String } 73 | * 74 | */ 75 | public String getUrl() { 76 | return url; 77 | } 78 | 79 | /** 80 | * Sets the value of the url property. 81 | * 82 | * @param value 83 | * allowed object is 84 | * {@link String } 85 | * 86 | */ 87 | public void setUrl(String value) { 88 | this.url = value; 89 | } 90 | 91 | /** 92 | * Gets the value of the title property. 93 | * 94 | * @return 95 | * possible object is 96 | * {@link String } 97 | * 98 | */ 99 | public String getTitle() { 100 | return title; 101 | } 102 | 103 | /** 104 | * Sets the value of the title property. 105 | * 106 | * @param value 107 | * allowed object is 108 | * {@link String } 109 | * 110 | */ 111 | public void setTitle(String value) { 112 | this.title = value; 113 | } 114 | 115 | /** 116 | * Gets the value of the link property. 117 | * 118 | * @return 119 | * possible object is 120 | * {@link String } 121 | * 122 | */ 123 | public String getLink() { 124 | return link; 125 | } 126 | 127 | /** 128 | * Sets the value of the link property. 129 | * 130 | * @param value 131 | * allowed object is 132 | * {@link String } 133 | * 134 | */ 135 | public void setLink(String value) { 136 | this.link = value; 137 | } 138 | 139 | /** 140 | * Gets the value of the width property. 141 | * 142 | * @return 143 | * possible object is 144 | * {@link Integer } 145 | * 146 | */ 147 | public Integer getWidth() { 148 | return width; 149 | } 150 | 151 | /** 152 | * Sets the value of the width property. 153 | * 154 | * @param value 155 | * allowed object is 156 | * {@link Integer } 157 | * 158 | */ 159 | public void setWidth(Integer value) { 160 | this.width = value; 161 | } 162 | 163 | /** 164 | * Gets the value of the height property. 165 | * 166 | * @return 167 | * possible object is 168 | * {@link Integer } 169 | * 170 | */ 171 | public Integer getHeight() { 172 | return height; 173 | } 174 | 175 | /** 176 | * Sets the value of the height property. 177 | * 178 | * @param value 179 | * allowed object is 180 | * {@link Integer } 181 | * 182 | */ 183 | public void setHeight(Integer value) { 184 | this.height = value; 185 | } 186 | 187 | /** 188 | * Gets the value of the description property. 189 | * 190 | * @return 191 | * possible object is 192 | * {@link String } 193 | * 194 | */ 195 | public String getDescription() { 196 | return description; 197 | } 198 | 199 | /** 200 | * Sets the value of the description property. 201 | * 202 | * @param value 203 | * allowed object is 204 | * {@link String } 205 | * 206 | */ 207 | public void setDescription(String value) { 208 | this.description = value; 209 | } 210 | 211 | } 212 | -------------------------------------------------------------------------------- /test-rss/javavids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JavaVids: Java video tutorials 5 | This free online video tutorial in English on YouTube is a collection of Java video tutorials. 6 | http://www.javavids.com/ 7 | Sun, 23 Mar 2014 08:01:34 +0000 8 | Sun, 23 Mar 2014 08:01:34 +0000 9 | 1800 10 | 11 | How to generate web.xml in Eclipse 12 | How to easily generate deployment descriptor (web.xml) in Eclipse for various Java EE versions? With examples for Java EE 7, Java EE 6 and Java EE 5<img src="http://feeds.feedburner.com/~r/javavids/~4/NzFxTrw7jtk" height="1" width="1"/> 13 | http://feedproxy.google.com/~r/javavids/~3/NzFxTrw7jtk/how-to-generate-web-xml-in-eclipse.html 14 | Sun, 23 Mar 2014 08:01:34 +0000 15 | http://www.javavids.com/video/how-to-generate-web-xml-in-eclipse.html 16 | 17 | Eclipse & external Maven installation integration 18 | How to integrate your external Maven installation with Eclipse?<img src="http://feeds.feedburner.com/~r/javavids/~4/QdlYiTAYmhU" height="1" width="1"/> 19 | http://feedproxy.google.com/~r/javavids/~3/QdlYiTAYmhU/eclipse-external-maven-installation-integration.html 20 | Sat, 22 Mar 2014 09:27:47 +0000 21 | http://www.javavids.com/video/eclipse-external-maven-installation-integration.html 22 | 23 | Open XML in pom.xml by default in Eclipse 24 | How to open plain XML in pom.xml by default in Eclipse? Tip for effective Maven usage.<img src="http://feeds.feedburner.com/~r/javavids/~4/r4GPX_wA38o" height="1" width="1"/> 25 | http://feedproxy.google.com/~r/javavids/~3/r4GPX_wA38o/open-xml-in-pomxml-by-default-in-eclipse.html 26 | Sat, 22 Mar 2014 09:00:06 +0000 27 | http://www.javavids.com/video/open-xml-in-pomxml-by-default-in-eclipse.html 28 | 29 | Eclipse Content Assist without Ctrl + Space 30 | Tired of pressing CTRL + SPACE to get Content Assist in Eclipse?<img src="http://feeds.feedburner.com/~r/javavids/~4/goY0owYDvME" height="1" width="1"/> 31 | http://feedproxy.google.com/~r/javavids/~3/goY0owYDvME/eclipse-content-assist-without-ctrl-space.html 32 | Fri, 21 Mar 2014 19:42:49 +0000 33 | http://www.javavids.com/video/eclipse-content-assist-without-ctrl-space.html 34 | 35 | Apache Tomcat & UTF-8 36 | Apache Tomcat out-of-the-box uses ISO-8859-1 (also called Latin 1). How to use UTF-8 in Apache Tomcat?<img src="http://feeds.feedburner.com/~r/javavids/~4/o-vY9YN1xtA" height="1" width="1"/> 37 | http://feedproxy.google.com/~r/javavids/~3/o-vY9YN1xtA/apache-tomcat-utf-8.html 38 | Fri, 21 Mar 2014 10:38:24 +0000 39 | http://www.javavids.com/video/apache-tomcat-utf-8.html 40 | 41 | Apache Tomcat Deploy web application 42 | How to deploy web application on Apache Tomcat using Context file? This is the most flexible and recommended way.<img src="http://feeds.feedburner.com/~r/javavids/~4/9fc1EVmfJgw" height="1" width="1"/> 43 | http://feedproxy.google.com/~r/javavids/~3/9fc1EVmfJgw/apache-tomcat-deploy-web-application.html 44 | Fri, 21 Mar 2014 08:42:03 +0000 45 | http://www.javavids.com/video/apache-tomcat-deploy-web-application.html 46 | 47 | Apache Tomcat Configuration 48 | How to split Apache Tomcat installation (catalina home) and configuration (catalina base)? Tomcat best practice.<img src="http://feeds.feedburner.com/~r/javavids/~4/-F59WSKNh8o" height="1" width="1"/> 49 | http://feedproxy.google.com/~r/javavids/~3/-F59WSKNh8o/apache-tomcat-configuration.html 50 | Thu, 20 Mar 2014 09:45:31 +0000 51 | http://www.javavids.com/video/apache-tomcat-configuration.html 52 | 53 | Apache Tomcat & NetBeans integration 54 | How to integrate your Apache Tomcat and NetBeans IDE?<img src="http://feeds.feedburner.com/~r/javavids/~4/_cECB5SjYk0" height="1" width="1"/> 55 | http://feedproxy.google.com/~r/javavids/~3/_cECB5SjYk0/apache-tomcat--netbeans-integration.html 56 | Wed, 19 Mar 2014 18:17:20 +0000 57 | http://www.javavids.com/video/apache-tomcat--netbeans-integration.html 58 | 59 | Apache Tomcat as a Windows service 60 | How to run Tomcat as a Windows service?<img src="http://feeds.feedburner.com/~r/javavids/~4/w-5wbpSJbxM" height="1" width="1"/> 61 | http://feedproxy.google.com/~r/javavids/~3/w-5wbpSJbxM/apache-tomcat-as-a-windows-service.html 62 | Wed, 19 Mar 2014 18:14:11 +0000 63 | http://www.javavids.com/video/apache-tomcat-as-a-windows-service.html 64 | 65 | Maven multi module project 66 | How to create a Multi module project?<img src="http://feeds.feedburner.com/~r/javavids/~4/fvrRuYBEldg" height="1" width="1"/> 67 | http://feedproxy.google.com/~r/javavids/~3/fvrRuYBEldg/maven-multi-module-project.html 68 | Fri, 31 Jan 2014 13:20:47 +0000 69 | http://www.javavids.com/video/maven-multi-module-project.html 70 | 71 | 72 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | cz.jiripinkas.jba 5 | java-blog-aggregator 6 | 0.0.1-SNAPSHOT 7 | war 8 | 9 | 10 | 11 | 4.0.2.RELEASE 12 | 3.0.3 13 | 3.2.3.RELEASE 14 | 15 | 16 | 17 | 18 | 19 | postgresql 20 | postgresql 21 | 9.1-901-1.jdbc4 22 | 23 | 24 | 25 | commons-dbcp 26 | commons-dbcp 27 | 1.4 28 | 29 | 30 | 31 | junit 32 | junit 33 | 4.11 34 | test 35 | 36 | 37 | 38 | org.hibernate 39 | hibernate-validator 40 | 5.1.0.Final 41 | 42 | 43 | 44 | org.springframework.security 45 | spring-security-taglibs 46 | ${spring.security.version} 47 | 48 | 49 | 50 | org.springframework.security 51 | spring-security-web 52 | ${spring.security.version} 53 | 54 | 55 | org.springframework.security 56 | spring-security-config 57 | ${spring.security.version} 58 | 59 | 60 | 61 | jstl 62 | jstl 63 | 1.2 64 | 65 | 66 | 67 | org.hsqldb 68 | hsqldb 69 | 2.3.2 70 | 71 | 72 | 73 | org.springframework.data 74 | spring-data-jpa 75 | 1.5.1.RELEASE 76 | 77 | 78 | 79 | org.hibernate 80 | hibernate-entitymanager 81 | 4.3.4.Final 82 | 83 | 84 | 85 | javax.servlet 86 | javax.servlet-api 87 | 3.0.1 88 | provided 89 | 90 | 91 | 92 | javax.servlet.jsp 93 | javax.servlet.jsp-api 94 | 2.2.1 95 | provided 96 | 97 | 98 | 99 | org.apache.tiles 100 | tiles-core 101 | ${apache.tiles} 102 | 103 | 104 | 105 | org.apache.tiles 106 | tiles-jsp 107 | ${apache.tiles} 108 | 109 | 110 | 111 | org.slf4j 112 | slf4j-log4j12 113 | 1.7.6 114 | 115 | 116 | 118 | 119 | org.springframework 120 | spring-core 121 | ${org.springframework.version} 122 | 123 | 124 | 126 | 127 | org.springframework 128 | spring-expression 129 | ${org.springframework.version} 130 | 131 | 132 | 134 | 135 | org.springframework 136 | spring-beans 137 | ${org.springframework.version} 138 | 139 | 140 | 142 | 143 | org.springframework 144 | spring-aop 145 | ${org.springframework.version} 146 | 147 | 148 | 151 | 152 | org.springframework 153 | spring-context 154 | ${org.springframework.version} 155 | 156 | 157 | 159 | 160 | org.springframework 161 | spring-context-support 162 | ${org.springframework.version} 163 | 164 | 165 | 168 | 169 | org.springframework 170 | spring-tx 171 | ${org.springframework.version} 172 | 173 | 174 | 176 | 177 | org.springframework 178 | spring-jdbc 179 | ${org.springframework.version} 180 | 181 | 182 | 185 | 186 | org.springframework 187 | spring-orm 188 | ${org.springframework.version} 189 | 190 | 191 | 194 | 195 | org.springframework 196 | spring-oxm 197 | ${org.springframework.version} 198 | 199 | 200 | 204 | 205 | org.springframework 206 | spring-web 207 | ${org.springframework.version} 208 | 209 | 210 | 213 | 214 | org.springframework 215 | spring-webmvc 216 | ${org.springframework.version} 217 | 218 | 219 | 222 | 223 | org.springframework 224 | spring-webmvc-portlet 225 | ${org.springframework.version} 226 | 227 | 228 | 231 | 232 | org.springframework 233 | spring-test 234 | ${org.springframework.version} 235 | test 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | org.eclipse.jetty 244 | jetty-maven-plugin 245 | 9.1.3.v20140225 246 | 247 | 248 | org.apache.tomcat.maven 249 | tomcat7-maven-plugin 250 | 2.2 251 | 252 | 253 | org.apache.maven.plugins 254 | maven-compiler-plugin 255 | 3.1 256 | 257 | 1.6 258 | 1.6 259 | 260 | 261 | 262 | 263 | 264 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TRssItem.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import java.util.ArrayList; 12 | import java.util.HashMap; 13 | import java.util.List; 14 | import java.util.Map; 15 | import javax.xml.bind.annotation.XmlAccessType; 16 | import javax.xml.bind.annotation.XmlAccessorType; 17 | import javax.xml.bind.annotation.XmlAnyAttribute; 18 | import javax.xml.bind.annotation.XmlAnyElement; 19 | import javax.xml.bind.annotation.XmlSchemaType; 20 | import javax.xml.bind.annotation.XmlType; 21 | import javax.xml.namespace.QName; 22 | import org.w3c.dom.Element; 23 | 24 | 25 | /** 26 | * An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed), and the link and title may be omitted. 27 | * 28 | *

Java class for tRssItem complex type. 29 | * 30 | *

The following schema fragment specifies the expected content contained within this class. 31 | * 32 | *

 33 |  * <complexType name="tRssItem">
 34 |  *   <complexContent>
 35 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 36 |  *       <sequence>
 37 |  *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 38 |  *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 39 |  *         <element name="link" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
 40 |  *         <element name="category" type="{}tCategory" minOccurs="0"/>
 41 |  *         <element name="comments" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
 42 |  *         <element name="enclosure" type="{}tEnclosure" minOccurs="0"/>
 43 |  *         <element name="guid" type="{}tGuid" minOccurs="0"/>
 44 |  *         <element name="pubDate" type="{}tRfc822FormatDate" minOccurs="0"/>
 45 |  *         <element name="source" type="{}tSource" minOccurs="0"/>
 46 |  *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
 47 |  *       </sequence>
 48 |  *       <anyAttribute/>
 49 |  *     </restriction>
 50 |  *   </complexContent>
 51 |  * </complexType>
 52 |  * 
53 | * 54 | * 55 | */ 56 | @XmlAccessorType(XmlAccessType.FIELD) 57 | @XmlType(name = "tRssItem", propOrder = { 58 | "title", 59 | "description", 60 | "link", 61 | "category", 62 | "comments", 63 | "enclosure", 64 | "guid", 65 | "pubDate", 66 | "source", 67 | "any" 68 | }) 69 | public class TRssItem { 70 | 71 | protected String title; 72 | protected String description; 73 | @XmlSchemaType(name = "anyURI") 74 | protected String link; 75 | protected TCategory category; 76 | @XmlSchemaType(name = "anyURI") 77 | protected String comments; 78 | protected TEnclosure enclosure; 79 | protected TGuid guid; 80 | protected String pubDate; 81 | protected TSource source; 82 | @XmlAnyElement(lax = true) 83 | protected List any; 84 | @XmlAnyAttribute 85 | private Map otherAttributes = new HashMap(); 86 | 87 | /** 88 | * Gets the value of the title property. 89 | * 90 | * @return 91 | * possible object is 92 | * {@link String } 93 | * 94 | */ 95 | public String getTitle() { 96 | return title; 97 | } 98 | 99 | /** 100 | * Sets the value of the title property. 101 | * 102 | * @param value 103 | * allowed object is 104 | * {@link String } 105 | * 106 | */ 107 | public void setTitle(String value) { 108 | this.title = value; 109 | } 110 | 111 | /** 112 | * Gets the value of the description property. 113 | * 114 | * @return 115 | * possible object is 116 | * {@link String } 117 | * 118 | */ 119 | public String getDescription() { 120 | return description; 121 | } 122 | 123 | /** 124 | * Sets the value of the description property. 125 | * 126 | * @param value 127 | * allowed object is 128 | * {@link String } 129 | * 130 | */ 131 | public void setDescription(String value) { 132 | this.description = value; 133 | } 134 | 135 | /** 136 | * Gets the value of the link property. 137 | * 138 | * @return 139 | * possible object is 140 | * {@link String } 141 | * 142 | */ 143 | public String getLink() { 144 | return link; 145 | } 146 | 147 | /** 148 | * Sets the value of the link property. 149 | * 150 | * @param value 151 | * allowed object is 152 | * {@link String } 153 | * 154 | */ 155 | public void setLink(String value) { 156 | this.link = value; 157 | } 158 | 159 | /** 160 | * Gets the value of the category property. 161 | * 162 | * @return 163 | * possible object is 164 | * {@link TCategory } 165 | * 166 | */ 167 | public TCategory getCategory() { 168 | return category; 169 | } 170 | 171 | /** 172 | * Sets the value of the category property. 173 | * 174 | * @param value 175 | * allowed object is 176 | * {@link TCategory } 177 | * 178 | */ 179 | public void setCategory(TCategory value) { 180 | this.category = value; 181 | } 182 | 183 | /** 184 | * Gets the value of the comments property. 185 | * 186 | * @return 187 | * possible object is 188 | * {@link String } 189 | * 190 | */ 191 | public String getComments() { 192 | return comments; 193 | } 194 | 195 | /** 196 | * Sets the value of the comments property. 197 | * 198 | * @param value 199 | * allowed object is 200 | * {@link String } 201 | * 202 | */ 203 | public void setComments(String value) { 204 | this.comments = value; 205 | } 206 | 207 | /** 208 | * Gets the value of the enclosure property. 209 | * 210 | * @return 211 | * possible object is 212 | * {@link TEnclosure } 213 | * 214 | */ 215 | public TEnclosure getEnclosure() { 216 | return enclosure; 217 | } 218 | 219 | /** 220 | * Sets the value of the enclosure property. 221 | * 222 | * @param value 223 | * allowed object is 224 | * {@link TEnclosure } 225 | * 226 | */ 227 | public void setEnclosure(TEnclosure value) { 228 | this.enclosure = value; 229 | } 230 | 231 | /** 232 | * Gets the value of the guid property. 233 | * 234 | * @return 235 | * possible object is 236 | * {@link TGuid } 237 | * 238 | */ 239 | public TGuid getGuid() { 240 | return guid; 241 | } 242 | 243 | /** 244 | * Sets the value of the guid property. 245 | * 246 | * @param value 247 | * allowed object is 248 | * {@link TGuid } 249 | * 250 | */ 251 | public void setGuid(TGuid value) { 252 | this.guid = value; 253 | } 254 | 255 | /** 256 | * Gets the value of the pubDate property. 257 | * 258 | * @return 259 | * possible object is 260 | * {@link String } 261 | * 262 | */ 263 | public String getPubDate() { 264 | return pubDate; 265 | } 266 | 267 | /** 268 | * Sets the value of the pubDate property. 269 | * 270 | * @param value 271 | * allowed object is 272 | * {@link String } 273 | * 274 | */ 275 | public void setPubDate(String value) { 276 | this.pubDate = value; 277 | } 278 | 279 | /** 280 | * Gets the value of the source property. 281 | * 282 | * @return 283 | * possible object is 284 | * {@link TSource } 285 | * 286 | */ 287 | public TSource getSource() { 288 | return source; 289 | } 290 | 291 | /** 292 | * Sets the value of the source property. 293 | * 294 | * @param value 295 | * allowed object is 296 | * {@link TSource } 297 | * 298 | */ 299 | public void setSource(TSource value) { 300 | this.source = value; 301 | } 302 | 303 | /** 304 | * Gets the value of the any property. 305 | * 306 | *

307 | * This accessor method returns a reference to the live list, 308 | * not a snapshot. Therefore any modification you make to the 309 | * returned list will be present inside the JAXB object. 310 | * This is why there is not a set method for the any property. 311 | * 312 | *

313 | * For example, to add a new item, do as follows: 314 | *

315 |      *    getAny().add(newItem);
316 |      * 
317 | * 318 | * 319 | *

320 | * Objects of the following type(s) are allowed in the list 321 | * {@link Element } 322 | * {@link Object } 323 | * 324 | * 325 | */ 326 | public List getAny() { 327 | if (any == null) { 328 | any = new ArrayList(); 329 | } 330 | return this.any; 331 | } 332 | 333 | /** 334 | * Gets a map that contains attributes that aren't bound to any typed property on this class. 335 | * 336 | *

337 | * the map is keyed by the name of the attribute and 338 | * the value is the string value of the attribute. 339 | * 340 | * the map returned by this method is live, and you can add new attribute 341 | * by updating the map directly. Because of this design, there's no setter. 342 | * 343 | * 344 | * @return 345 | * always non-null 346 | */ 347 | public Map getOtherAttributes() { 348 | return otherAttributes; 349 | } 350 | 351 | } 352 | -------------------------------------------------------------------------------- /rss.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | XML Schema for RSS v2.0 feed files. 5 | Revision: 2 6 | Date: 31-March-2003 7 | Based on the RSS 2.0 specification document at http://feeds.archive.org/validator/docs/rss2.html 8 | Author: Jorgen Thelin 9 | Feedback to: http://www.thearchitect.co.uk/weblog/archives/2003/03/000118.html 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed), and the link and title may be omitted. 23 | 24 | 25 | 26 | 27 | The title of the item. 28 | 29 | 30 | 31 | 32 | The item synopsis. 33 | 34 | 35 | 36 | 37 | The URL of the item. 38 | 39 | 40 | 41 | 42 | 43 | Includes the item in one or more categories. 44 | 45 | 46 | 47 | 48 | URL of a page for comments relating to the item. 49 | 50 | 51 | 52 | 53 | Describes a media object that is attached to the item. 54 | 55 | 56 | 57 | 58 | guid or permalink URL for this entry 59 | 60 | 61 | 62 | 63 | Indicates when the item was published. 64 | 65 | 66 | 67 | 68 | The RSS channel that the item came from. 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | The name of the channel. It's how people refer to your service. If you have an HTML website that contains the same information as your RSS file, the title of your channel should be the same as the title of your website. 80 | 81 | 82 | 83 | 84 | The URL to the HTML website corresponding to the channel. 85 | 86 | 87 | 88 | 89 | Phrase or sentence describing the channel. 90 | 91 | 92 | 93 | 94 | The language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element, as provided by Netscape, is here. You may also use values defined by the W3C. 95 | 96 | 97 | 98 | 99 | Copyright notice for content in the channel. 100 | 101 | 102 | 103 | 104 | 105 | 106 | The publication date for the content in the channel. All date-times in RSS conform to the Date and Time Specification of RFC 822, with the exception that the year may be expressed with two characters or four characters (four preferred). 107 | 108 | 109 | 110 | 111 | The last time the content of the channel changed. 112 | 113 | 114 | 115 | 116 | Specify one or more categories that the channel belongs to. 117 | 118 | 119 | 120 | 121 | A string indicating the program used to generate the channel. 122 | 123 | 124 | 125 | 126 | A URL that points to the documentation for the format used in the RSS file. It's probably a pointer to this page. It's for people who might stumble across an RSS file on a Web server 25 years from now and wonder what it is. 127 | 128 | 129 | 130 | 131 | Allows processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds. 132 | 133 | 134 | 135 | 136 | ttl stands for time to live. It's a number of minutes that indicates how long a channel can be cached before refreshing from the source. 137 | 138 | 139 | 140 | 141 | Specifies a GIF, JPEG or PNG image that can be displayed with the channel. 142 | 143 | 144 | 145 | 146 | Specifies a text input box that can be displayed with the channel. 147 | 148 | 149 | 150 | 151 | A hint for aggregators telling them which hours they can skip. 152 | 153 | 154 | 155 | 156 | A hint for aggregators telling them which days they can skip. 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | The URL of the image file. 176 | 177 | 178 | 179 | 180 | Describes the image, it's used in the ALT attribute of the HTML <img> tag when the channel is rendered in HTML. 181 | 182 | 183 | 184 | 185 | The URL of the site, when the channel is rendered, the image is a link to the site. (Note, in practice the image <title> and <link> should have the same value as the channel's <title> and <link>. 186 | 187 | 188 | 189 | 190 | The width of the image in pixels. 191 | 192 | 193 | 194 | 195 | The height of the image in pixels. 196 | 197 | 198 | 199 | 200 | Text that is included in the TITLE attribute of the link formed around the image in the HTML rendering. 201 | 202 | 203 | 204 | 205 | 206 | 207 | The height of the image in pixels. 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | The width of the image in pixels. 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | Specifies a web service that supports the rssCloud interface which can be implemented in HTTP-POST, XML-RPC or SOAP 1.1. 224 | Its purpose is to allow processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds. 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | The purpose of this element is something of a mystery! You can use it to specify a search engine box. Or to allow a reader to provide feedback. Most aggregators ignore it. 242 | 243 | 244 | 245 | 246 | The label of the Submit button in the text input area. 247 | 248 | 249 | 250 | 251 | Explains the text input area. 252 | 253 | 254 | 255 | 256 | The name of the text object in the text input area. 257 | 258 | 259 | 260 | 261 | The URL of the CGI script that processes text input requests. 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | A date-time displayed in RFC-822 format. 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | URL where the enclosure is located 286 | 287 | 288 | 289 | 290 | Size in bytes 291 | 292 | 293 | 294 | 295 | MIME media-type of the enclosure 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | -------------------------------------------------------------------------------- /src/main/java/cz/jiripinkas/jba/rss/TRssChannel.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2014.03.30 at 09:56:28 AM CEST 6 | // 7 | 8 | 9 | package cz.jiripinkas.jba.rss; 10 | 11 | import java.math.BigInteger; 12 | import java.util.ArrayList; 13 | import java.util.HashMap; 14 | import java.util.List; 15 | import java.util.Map; 16 | import javax.xml.bind.annotation.XmlAccessType; 17 | import javax.xml.bind.annotation.XmlAccessorType; 18 | import javax.xml.bind.annotation.XmlAnyAttribute; 19 | import javax.xml.bind.annotation.XmlAnyElement; 20 | import javax.xml.bind.annotation.XmlElement; 21 | import javax.xml.bind.annotation.XmlSchemaType; 22 | import javax.xml.bind.annotation.XmlType; 23 | import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; 24 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 25 | import javax.xml.namespace.QName; 26 | import org.w3c.dom.Element; 27 | 28 | 29 | /** 30 | *

Java class for tRssChannel complex type. 31 | * 32 | *

The following schema fragment specifies the expected content contained within this class. 33 | * 34 | *

 35 |  * <complexType name="tRssChannel">
 36 |  *   <complexContent>
 37 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 38 |  *       <sequence>
 39 |  *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
 40 |  *         <element name="link" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
 41 |  *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
 42 |  *         <element name="language" type="{http://www.w3.org/2001/XMLSchema}language" minOccurs="0"/>
 43 |  *         <element name="copyright" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 44 |  *         <element name="pubDate" type="{}tRfc822FormatDate" minOccurs="0"/>
 45 |  *         <element name="lastBuildDate" type="{}tRfc822FormatDate" minOccurs="0"/>
 46 |  *         <element name="category" type="{}tCategory" minOccurs="0"/>
 47 |  *         <element name="generator" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 48 |  *         <element name="docs" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
 49 |  *         <element name="cloud" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/>
 50 |  *         <element name="ttl" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" minOccurs="0"/>
 51 |  *         <element name="image" type="{}tImage" minOccurs="0"/>
 52 |  *         <element name="textInput" type="{}tTextInput" minOccurs="0"/>
 53 |  *         <element name="skipHours" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" minOccurs="0"/>
 54 |  *         <element name="skipDays" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" minOccurs="0"/>
 55 |  *         <element name="item" type="{}tRssItem" maxOccurs="unbounded"/>
 56 |  *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
 57 |  *       </sequence>
 58 |  *       <anyAttribute/>
 59 |  *     </restriction>
 60 |  *   </complexContent>
 61 |  * </complexType>
 62 |  * 
63 | * 64 | * 65 | */ 66 | @XmlAccessorType(XmlAccessType.FIELD) 67 | @XmlType(name = "tRssChannel", propOrder = { 68 | "title", 69 | "link", 70 | "description", 71 | "language", 72 | "copyright", 73 | "pubDate", 74 | "lastBuildDate", 75 | "category", 76 | "generator", 77 | "docs", 78 | "cloud", 79 | "ttl", 80 | "image", 81 | "textInput", 82 | "skipHours", 83 | "skipDays", 84 | "item", 85 | "any" 86 | }) 87 | public class TRssChannel { 88 | 89 | @XmlElement(required = true) 90 | protected String title; 91 | @XmlElement(required = true) 92 | @XmlSchemaType(name = "anyURI") 93 | protected String link; 94 | @XmlElement(required = true) 95 | protected String description; 96 | @XmlJavaTypeAdapter(CollapsedStringAdapter.class) 97 | @XmlSchemaType(name = "language") 98 | protected String language; 99 | protected String copyright; 100 | protected String pubDate; 101 | protected String lastBuildDate; 102 | protected TCategory category; 103 | protected String generator; 104 | @XmlSchemaType(name = "anyURI") 105 | protected String docs; 106 | protected Object cloud; 107 | @XmlSchemaType(name = "nonNegativeInteger") 108 | protected BigInteger ttl; 109 | protected TImage image; 110 | protected TTextInput textInput; 111 | @XmlSchemaType(name = "nonNegativeInteger") 112 | protected BigInteger skipHours; 113 | @XmlSchemaType(name = "nonNegativeInteger") 114 | protected BigInteger skipDays; 115 | @XmlElement(required = true) 116 | protected List item; 117 | @XmlAnyElement(lax = true) 118 | protected List any; 119 | @XmlAnyAttribute 120 | private Map otherAttributes = new HashMap(); 121 | 122 | /** 123 | * Gets the value of the title property. 124 | * 125 | * @return 126 | * possible object is 127 | * {@link String } 128 | * 129 | */ 130 | public String getTitle() { 131 | return title; 132 | } 133 | 134 | /** 135 | * Sets the value of the title property. 136 | * 137 | * @param value 138 | * allowed object is 139 | * {@link String } 140 | * 141 | */ 142 | public void setTitle(String value) { 143 | this.title = value; 144 | } 145 | 146 | /** 147 | * Gets the value of the link property. 148 | * 149 | * @return 150 | * possible object is 151 | * {@link String } 152 | * 153 | */ 154 | public String getLink() { 155 | return link; 156 | } 157 | 158 | /** 159 | * Sets the value of the link property. 160 | * 161 | * @param value 162 | * allowed object is 163 | * {@link String } 164 | * 165 | */ 166 | public void setLink(String value) { 167 | this.link = value; 168 | } 169 | 170 | /** 171 | * Gets the value of the description property. 172 | * 173 | * @return 174 | * possible object is 175 | * {@link String } 176 | * 177 | */ 178 | public String getDescription() { 179 | return description; 180 | } 181 | 182 | /** 183 | * Sets the value of the description property. 184 | * 185 | * @param value 186 | * allowed object is 187 | * {@link String } 188 | * 189 | */ 190 | public void setDescription(String value) { 191 | this.description = value; 192 | } 193 | 194 | /** 195 | * Gets the value of the language property. 196 | * 197 | * @return 198 | * possible object is 199 | * {@link String } 200 | * 201 | */ 202 | public String getLanguage() { 203 | return language; 204 | } 205 | 206 | /** 207 | * Sets the value of the language property. 208 | * 209 | * @param value 210 | * allowed object is 211 | * {@link String } 212 | * 213 | */ 214 | public void setLanguage(String value) { 215 | this.language = value; 216 | } 217 | 218 | /** 219 | * Gets the value of the copyright property. 220 | * 221 | * @return 222 | * possible object is 223 | * {@link String } 224 | * 225 | */ 226 | public String getCopyright() { 227 | return copyright; 228 | } 229 | 230 | /** 231 | * Sets the value of the copyright property. 232 | * 233 | * @param value 234 | * allowed object is 235 | * {@link String } 236 | * 237 | */ 238 | public void setCopyright(String value) { 239 | this.copyright = value; 240 | } 241 | 242 | /** 243 | * Gets the value of the pubDate property. 244 | * 245 | * @return 246 | * possible object is 247 | * {@link String } 248 | * 249 | */ 250 | public String getPubDate() { 251 | return pubDate; 252 | } 253 | 254 | /** 255 | * Sets the value of the pubDate property. 256 | * 257 | * @param value 258 | * allowed object is 259 | * {@link String } 260 | * 261 | */ 262 | public void setPubDate(String value) { 263 | this.pubDate = value; 264 | } 265 | 266 | /** 267 | * Gets the value of the lastBuildDate property. 268 | * 269 | * @return 270 | * possible object is 271 | * {@link String } 272 | * 273 | */ 274 | public String getLastBuildDate() { 275 | return lastBuildDate; 276 | } 277 | 278 | /** 279 | * Sets the value of the lastBuildDate property. 280 | * 281 | * @param value 282 | * allowed object is 283 | * {@link String } 284 | * 285 | */ 286 | public void setLastBuildDate(String value) { 287 | this.lastBuildDate = value; 288 | } 289 | 290 | /** 291 | * Gets the value of the category property. 292 | * 293 | * @return 294 | * possible object is 295 | * {@link TCategory } 296 | * 297 | */ 298 | public TCategory getCategory() { 299 | return category; 300 | } 301 | 302 | /** 303 | * Sets the value of the category property. 304 | * 305 | * @param value 306 | * allowed object is 307 | * {@link TCategory } 308 | * 309 | */ 310 | public void setCategory(TCategory value) { 311 | this.category = value; 312 | } 313 | 314 | /** 315 | * Gets the value of the generator property. 316 | * 317 | * @return 318 | * possible object is 319 | * {@link String } 320 | * 321 | */ 322 | public String getGenerator() { 323 | return generator; 324 | } 325 | 326 | /** 327 | * Sets the value of the generator property. 328 | * 329 | * @param value 330 | * allowed object is 331 | * {@link String } 332 | * 333 | */ 334 | public void setGenerator(String value) { 335 | this.generator = value; 336 | } 337 | 338 | /** 339 | * Gets the value of the docs property. 340 | * 341 | * @return 342 | * possible object is 343 | * {@link String } 344 | * 345 | */ 346 | public String getDocs() { 347 | return docs; 348 | } 349 | 350 | /** 351 | * Sets the value of the docs property. 352 | * 353 | * @param value 354 | * allowed object is 355 | * {@link String } 356 | * 357 | */ 358 | public void setDocs(String value) { 359 | this.docs = value; 360 | } 361 | 362 | /** 363 | * Gets the value of the cloud property. 364 | * 365 | * @return 366 | * possible object is 367 | * {@link Object } 368 | * 369 | */ 370 | public Object getCloud() { 371 | return cloud; 372 | } 373 | 374 | /** 375 | * Sets the value of the cloud property. 376 | * 377 | * @param value 378 | * allowed object is 379 | * {@link Object } 380 | * 381 | */ 382 | public void setCloud(Object value) { 383 | this.cloud = value; 384 | } 385 | 386 | /** 387 | * Gets the value of the ttl property. 388 | * 389 | * @return 390 | * possible object is 391 | * {@link BigInteger } 392 | * 393 | */ 394 | public BigInteger getTtl() { 395 | return ttl; 396 | } 397 | 398 | /** 399 | * Sets the value of the ttl property. 400 | * 401 | * @param value 402 | * allowed object is 403 | * {@link BigInteger } 404 | * 405 | */ 406 | public void setTtl(BigInteger value) { 407 | this.ttl = value; 408 | } 409 | 410 | /** 411 | * Gets the value of the image property. 412 | * 413 | * @return 414 | * possible object is 415 | * {@link TImage } 416 | * 417 | */ 418 | public TImage getImage() { 419 | return image; 420 | } 421 | 422 | /** 423 | * Sets the value of the image property. 424 | * 425 | * @param value 426 | * allowed object is 427 | * {@link TImage } 428 | * 429 | */ 430 | public void setImage(TImage value) { 431 | this.image = value; 432 | } 433 | 434 | /** 435 | * Gets the value of the textInput property. 436 | * 437 | * @return 438 | * possible object is 439 | * {@link TTextInput } 440 | * 441 | */ 442 | public TTextInput getTextInput() { 443 | return textInput; 444 | } 445 | 446 | /** 447 | * Sets the value of the textInput property. 448 | * 449 | * @param value 450 | * allowed object is 451 | * {@link TTextInput } 452 | * 453 | */ 454 | public void setTextInput(TTextInput value) { 455 | this.textInput = value; 456 | } 457 | 458 | /** 459 | * Gets the value of the skipHours property. 460 | * 461 | * @return 462 | * possible object is 463 | * {@link BigInteger } 464 | * 465 | */ 466 | public BigInteger getSkipHours() { 467 | return skipHours; 468 | } 469 | 470 | /** 471 | * Sets the value of the skipHours property. 472 | * 473 | * @param value 474 | * allowed object is 475 | * {@link BigInteger } 476 | * 477 | */ 478 | public void setSkipHours(BigInteger value) { 479 | this.skipHours = value; 480 | } 481 | 482 | /** 483 | * Gets the value of the skipDays property. 484 | * 485 | * @return 486 | * possible object is 487 | * {@link BigInteger } 488 | * 489 | */ 490 | public BigInteger getSkipDays() { 491 | return skipDays; 492 | } 493 | 494 | /** 495 | * Sets the value of the skipDays property. 496 | * 497 | * @param value 498 | * allowed object is 499 | * {@link BigInteger } 500 | * 501 | */ 502 | public void setSkipDays(BigInteger value) { 503 | this.skipDays = value; 504 | } 505 | 506 | /** 507 | * Gets the value of the item property. 508 | * 509 | *

510 | * This accessor method returns a reference to the live list, 511 | * not a snapshot. Therefore any modification you make to the 512 | * returned list will be present inside the JAXB object. 513 | * This is why there is not a set method for the item property. 514 | * 515 | *

516 | * For example, to add a new item, do as follows: 517 | *

518 |      *    getItem().add(newItem);
519 |      * 
520 | * 521 | * 522 | *

523 | * Objects of the following type(s) are allowed in the list 524 | * {@link TRssItem } 525 | * 526 | * 527 | */ 528 | public List getItem() { 529 | if (item == null) { 530 | item = new ArrayList(); 531 | } 532 | return this.item; 533 | } 534 | 535 | /** 536 | * Gets the value of the any property. 537 | * 538 | *

539 | * This accessor method returns a reference to the live list, 540 | * not a snapshot. Therefore any modification you make to the 541 | * returned list will be present inside the JAXB object. 542 | * This is why there is not a set method for the any property. 543 | * 544 | *

545 | * For example, to add a new item, do as follows: 546 | *

547 |      *    getAny().add(newItem);
548 |      * 
549 | * 550 | * 551 | *

552 | * Objects of the following type(s) are allowed in the list 553 | * {@link Element } 554 | * {@link Object } 555 | * 556 | * 557 | */ 558 | public List getAny() { 559 | if (any == null) { 560 | any = new ArrayList(); 561 | } 562 | return this.any; 563 | } 564 | 565 | /** 566 | * Gets a map that contains attributes that aren't bound to any typed property on this class. 567 | * 568 | *

569 | * the map is keyed by the name of the attribute and 570 | * the value is the string value of the attribute. 571 | * 572 | * the map returned by this method is live, and you can add new attribute 573 | * by updating the map directly. Because of this design, there's no setter. 574 | * 575 | * 576 | * @return 577 | * always non-null 578 | */ 579 | public Map getOtherAttributes() { 580 | return otherAttributes; 581 | } 582 | 583 | } 584 | --------------------------------------------------------------------------------