Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:petrbela/usergroup-portal
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrej-kvasnovsky committed Jul 28, 2011
2 parents 6068a37 + f0a77fb commit da94e79
Show file tree
Hide file tree
Showing 33 changed files with 898 additions and 64 deletions.
48 changes: 48 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoBlog.java
@@ -0,0 +1,48 @@
/**
* DaoBlog.java, 28.7.2011 15:54:38
*/
package ugportal.dao;

import ugportal.model.Blog;

import com.google.appengine.api.datastore.Email;

/**
* @author Tomas Vantuch
*/
public interface DaoBlog {
/**
* Returns {@link Blog} by it's id.
*
* @param id
* blog id
* @return fetched blog, or null
*/
Blog getByBlogId(Long blogId);

/**
* Returns {@link Blog} by it's email.
*
* @param blogEmail
* blog email
* @return fetched blog, or null
*/
Blog getByEmail(Email blogEmail);

/**
* saves or updates {@link Blog}
*
* @param blog
* blog to save or update
*/
void save(Blog blog);

/**
* deletes {@link Blog}
*
* @param blog
* blog to delete
*/
void delete(Blog blog);

}
52 changes: 52 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoBlogPost.java
@@ -0,0 +1,52 @@
/**
* DaoBlogPost.java, 28.7.2011 15:54:48
*/
package ugportal.dao;

import java.util.Date;

import ugportal.model.BlogPost;

/**
* @author Tomas Vantuch
*/
public interface DaoBlogPost {
/**
* Returns {@link BlogPost} by it's id.
*
* @param id
* blogPosts id
* @return fetched BlogPost, or null
*/
BlogPost getById(Long id);

/**
* Returns {@link BlogPost} by it's datas.
*
* @param datetime
* {@link BlogPost} dateTime
* @param title
* {@link BlogPost} title
* @param autor
* {@link BlogPost} autor
* @return fetched {@link BlogPost}, or null
*/
BlogPost getBySearchDatas(Date datetime, String title, String autor);

/**
* Saves or updates {@link BlogPost}
*
* @param blogPost
* blogpost to save or update
*/
void put(BlogPost blogPost);

/**
* Deletes {@link BlogPost}
*
* @param blogPost
* blogpost to delete
*/
void delete(BlogPost blogPost);

}
56 changes: 56 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoEvent.java
@@ -0,0 +1,56 @@
/**
* DaoEvent.java, 28.7.2011 15:54:54
*/
package ugportal.dao;

import java.util.Date;
import java.util.List;

import ugportal.model.Event;
import ugportal.model.EventType;
import ugportal.model.User;

/**
* @author Tomas
*/
public interface DaoEvent {
/**
* returns {@link Event} by it's id.
*
* @param id
* event's id
* @return fetched event or null.
*/
Event getById(Long id);

/**
* returns collection of {@link Event} by it's datas.
*
* @param eventType
* type of event
* @param date
* date of event
* @param autor
* autor of event
* @return fetched collection of event or null.
*/

List<Event> getByDatas(EventType eventType, Date date, User autor);

/**
* Saves or updates event
*
* @param event
* event to save or update
*/
void put(Event event);

/**
* Deletes event
*
* @param event
* event to delete.
*/
void delete(Event event);

}
37 changes: 37 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoEventType.java
@@ -0,0 +1,37 @@
/**
* DaoEventType.java, 28.7.2011 15:55:00
*/
package ugportal.dao;

import ugportal.model.EventType;

/**
* @author Tomas
*/
public interface DaoEventType {

/**
* Returns {@link EventType} by it's id.
*
* @param id
* eventype's id
* @return fetched eventtype or null.
*/
EventType getById(Long id);

/**
* Saves or update {@link EventType}
*
* @param eventType
* eventType to save or update.
*/
void put(EventType eventType);

/**
* Deletes {@link EventType}
*
* @param eventType
* eventType to delete.
*/
void delete(EventType eventType);
}
30 changes: 29 additions & 1 deletion usergroup-portal/src/main/java/ugportal/dao/DaoFactory.java
Expand Up @@ -13,13 +13,18 @@
*/
public abstract class DaoFactory {

private static DaoFactory daoFactory;

/**
* Returns instance of DAO factory.
*
* @return instance of DAO factory
*/
public static DaoFactory getInstance() {
return new DaoFactoryObjectify();
if (daoFactory == null) {
daoFactory = new DaoFactoryObjectify();
}
return daoFactory;
}

/**
Expand All @@ -30,4 +35,27 @@ public static DaoFactory getInstance() {
public abstract DaoUserGroup getDaoUserGroup();

public abstract DaoUser getDaoUser();

public abstract DaoBlog getDaoBlog();

public abstract DaoBlogPost getDaoBlogPost();

public abstract DaoEvent getDaoEvent();

public abstract DaoEventType getDaoEventType();

public abstract DaoInvitation getInvitation();

public abstract DaoInvitationState getDaoInvitationState();

public abstract DaoRank getDaoRank();

public abstract DaoRole getDaoRole();

public abstract DaoSetting getDaoSetting();

public abstract DaoSourceMaterial getDaoSourceMaterial();

public abstract DaoTweet getDaoTweet();

}
58 changes: 58 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoInvitation.java
@@ -0,0 +1,58 @@
/**
* DaoInvitation.java, 28.7.2011 15:55:05
*/
package ugportal.dao;

import java.util.List;

import ugportal.model.Invitation;
import ugportal.model.User;

/**
* @author Tomas
*/
public interface DaoInvitation {
/**
* Returns {@link Invitation} by it's id.
*
* @param id
* invitations id
* @return fetched invitaiton or null.
*/
Invitation getById(Long id);

/**
* Returns {@link Invitation} by invitated user
*
* @param user
* invited user by this invitation
* @return invitation or null
*/
Invitation getByInvitatedUser(User user);

/**
* Returns collection of {@link Invitation} by registered user
*
* @param user
* user, that sends invitations
* @return collection of invitations or null
*/
List<Invitation> getByRegisteredUser(User user);

/**
* Saves or updates {@link Invitation}
*
* @param invitation
* {@link Invitation} to save or update
*/
void put(Invitation invitation);

/**
* Deletes {@link Invitation}
*
* @param invitation
* {@link Invitation} to delete
*/
void delete(Invitation invitation);

}
@@ -0,0 +1,11 @@
/**
* DaoInvitationState.java, 28.7.2011 15:55:11
*/
package ugportal.dao;

/**
* @author Tomas
*/
public interface DaoInvitationState {

}
11 changes: 11 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoRank.java
@@ -0,0 +1,11 @@
/**
* DaoRank.java, 28.7.2011 15:55:16
*/
package ugportal.dao;

/**
* @author Tomas
*/
public interface DaoRank {

}
11 changes: 11 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoRole.java
@@ -0,0 +1,11 @@
/**
* DaoRole.java, 28.7.2011 15:55:21
*/
package ugportal.dao;

/**
* @author Tomas
*/
public interface DaoRole {

}
11 changes: 11 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoSetting.java
@@ -0,0 +1,11 @@
/**
* DaoSetting.java, 28.7.2011 15:55:27
*/
package ugportal.dao;

/**
* @author Tomas
*/
public interface DaoSetting {

}
11 changes: 11 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoSourceMaterial.java
@@ -0,0 +1,11 @@
/**
* DaoSourceMaterial.java, 28.7.2011 15:55:34
*/
package ugportal.dao;

/**
* @author Tomas
*/
public interface DaoSourceMaterial {

}
11 changes: 11 additions & 0 deletions usergroup-portal/src/main/java/ugportal/dao/DaoTweet.java
@@ -0,0 +1,11 @@
/**
* DaoTweet.java, 28.7.2011 15:55:39
*/
package ugportal.dao;

/**
* @author Tomas
*/
public interface DaoTweet {

}
4 changes: 2 additions & 2 deletions usergroup-portal/src/main/java/ugportal/dao/DaoUser.java
Expand Up @@ -52,12 +52,12 @@ public interface DaoUser {
public abstract List<User> getByEmail(final Email email);

/**
* to saving or updating users
* to saving or updating user
*
* @param user
* user to save or update
*/
public abstract void save(final User user);
public abstract void put(final User user);

/**
* to deleting users
Expand Down

0 comments on commit da94e79

Please sign in to comment.