|
roller/src/org/roller/business UserManagerBase.java,1.6,1.7: msg#00051java.roller.cvs
Update of /cvsroot/roller/roller/src/org/roller/business In directory sc8-pr-cvs1:/tmp/cvs-serv22117/src/org/roller/business Modified Files: UserManagerBase.java Log Message: renamed mSupport to mStrategy Index: UserManagerBase.java =================================================================== RCS file: /cvsroot/roller/roller/src/org/roller/business/UserManagerBase.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UserManagerBase.java 3 Sep 2003 21:21:13 -0000 1.6 --- UserManagerBase.java 9 Sep 2003 11:42:14 -0000 1.7 *************** *** 42,46 **** LogFactory.getFactory().getInstance(UserManagerBase.class); ! protected PersistenceStrategy mSupport; protected Roller mRoller; --- 42,46 ---- LogFactory.getFactory().getInstance(UserManagerBase.class); ! protected PersistenceStrategy mStrategy; protected Roller mRoller; *************** *** 58,62 **** public WebsiteData retrieveWebsite(String id) throws RollerException { ! return (WebsiteData)mSupport.retrievePersistentObject(id,WebsiteData.class); } --- 58,62 ---- public WebsiteData retrieveWebsite(String id) throws RollerException { ! return (WebsiteData)mStrategy.retrievePersistentObject(id,WebsiteData.class); } *************** *** 66,75 **** public void storeWebsite(WebsiteData data) throws RollerException { ! mSupport.storePersistentObject(data); } public void removeWebsite(String id) throws RollerException { ! mSupport.removePersistentObject(id,WebsiteData.class); } --- 66,75 ---- public void storeWebsite(WebsiteData data) throws RollerException { ! mStrategy.storePersistentObject(data); } public void removeWebsite(String id) throws RollerException { ! mStrategy.removePersistentObject(id,WebsiteData.class); } *************** *** 96,100 **** //if (getUser(userName, false) == null) return null; ! List list = mSupport.query(query.toString(), args, types); return list.size()>0 ? (WebsiteData)list.get(0) : null; } --- 96,100 ---- //if (getUser(userName, false) == null) return null; ! List list = mStrategy.query(query.toString(), args, types); return list.size()>0 ? (WebsiteData)list.get(0) : null; } *************** *** 110,124 **** public UserData retrieveUser(String id) throws RollerException { ! return (UserData)mSupport.retrievePersistentObject(id,UserData.class); } public void storeUser(UserData data) throws RollerException { ! mSupport.storePersistentObject(data); } public void removeUser(String id) throws RollerException { ! mSupport.removePersistentObject(id,UserData.class); } --- 110,124 ---- public UserData retrieveUser(String id) throws RollerException { ! return (UserData)mStrategy.retrievePersistentObject(id,UserData.class); } public void storeUser(UserData data) throws RollerException { ! mStrategy.storePersistentObject(data); } public void removeUser(String id) throws RollerException { ! mStrategy.removePersistentObject(id,UserData.class); } *************** *** 146,150 **** } ! List list = mSupport.query(query.toString(), args, types); return list.size()>0 ? (UserData)list.get(0) : null; } --- 146,150 ---- } ! List list = mStrategy.query(query.toString(), args, types); return list.size()>0 ? (UserData)list.get(0) : null; } *************** *** 170,174 **** } ! List list = mSupport.query(query.toString(), args, types); return list.size()!=0 ? (UserData)list.get(0) : null; --- 170,174 ---- } ! List list = mStrategy.query(query.toString(), args, types); return list.size()!=0 ? (UserData)list.get(0) : null; *************** *** 195,199 **** } ! List v = mSupport.query(query.toString(), args, types); return (UserData[]) v.toArray(new UserData[v.size()]); } --- 195,199 ---- } ! List v = mStrategy.query(query.toString(), args, types); return (UserData[]) v.toArray(new UserData[v.size()]); } *************** *** 203,217 **** public RoleData retrieveRole(String id) throws RollerException { ! return (RoleData)mSupport.retrievePersistentObject(id,RoleData.class); } public void storeRole(RoleData data) throws RollerException { ! mSupport.storePersistentObject(data); } public void removeRole(String id) throws RollerException { ! mSupport.removePersistentObject(id,RoleData.class); } --- 203,217 ---- public RoleData retrieveRole(String id) throws RollerException { ! return (RoleData)mStrategy.retrievePersistentObject(id,RoleData.class); } public void storeRole(RoleData data) throws RollerException { ! mStrategy.storePersistentObject(data); } public void removeRole(String id) throws RollerException { ! mStrategy.removePersistentObject(id,RoleData.class); } *************** *** 224,228 **** Object[] args = { user.getId() }; Type[] types = { Hibernate.STRING }; ! List roles = mSupport.query(Queries.ROLES_BY_USER, args, types); return (RoleData[]) roles.toArray(new RoleData[roles.size()]); --- 224,228 ---- Object[] args = { user.getId() }; Type[] types = { Hibernate.STRING }; ! List roles = mStrategy.query(Queries.ROLES_BY_USER, args, types); return (RoleData[]) roles.toArray(new RoleData[roles.size()]); *************** *** 233,242 **** public PageData retrievePage(String id) throws RollerException { ! return (PageData)mSupport.retrievePersistentObject(id,PageData.class); } public void removePage(String id) throws RollerException { ! mSupport.removePersistentObject(id,PageData.class); } --- 233,242 ---- public PageData retrievePage(String id) throws RollerException { ! return (PageData)mStrategy.retrievePersistentObject(id,PageData.class); } public void removePage(String id) throws RollerException { ! mStrategy.removePersistentObject(id,PageData.class); } *************** *** 246,250 **** public void storePage(PageData data) throws RollerException { ! mSupport.storePersistentObject(data); } --- 246,250 ---- public void storePage(PageData data) throws RollerException { ! mStrategy.storePersistentObject(data); } *************** *** 263,267 **** Type[] types = { Hibernate.STRING,Hibernate.STRING,Hibernate.BOOLEAN }; ! List list = mSupport.query( Queries.PAGES_BY_USER + Queries.NAME_RESTRICTION + --- 263,267 ---- Type[] types = { Hibernate.STRING,Hibernate.STRING,Hibernate.BOOLEAN }; ! List list = mStrategy.query( Queries.PAGES_BY_USER + Queries.NAME_RESTRICTION + *************** *** 287,291 **** Type[] types = { Hibernate.STRING,Hibernate.STRING,Hibernate.BOOLEAN }; ! List list = mSupport.query( Queries.PAGES_BY_USER + Queries.LINK_RESTRICTION + --- 287,291 ---- Type[] types = { Hibernate.STRING,Hibernate.STRING,Hibernate.BOOLEAN }; ! List list = mStrategy.query( Queries.PAGES_BY_USER + Queries.LINK_RESTRICTION + *************** *** 307,311 **** Object[] args = {userName, Boolean.TRUE}; Type[] types = {Hibernate.STRING,Hibernate.BOOLEAN}; ! List list = mSupport.query( Queries.PAGES_BY_USER + Queries.WEBSITE_USER_ENABLED_RESTRICTION2 + --- 307,311 ---- Object[] args = {userName, Boolean.TRUE}; Type[] types = {Hibernate.STRING,Hibernate.BOOLEAN}; ! List list = mStrategy.query( Queries.PAGES_BY_USER + Queries.WEBSITE_USER_ENABLED_RESTRICTION2 + *************** *** 322,326 **** data.setLink(link); ! mSupport.storePersistentObject( data ); return link; --- 322,326 ---- data.setLink(link); ! mStrategy.storePersistentObject( data ); return link; *************** *** 346,354 **** // to roll back all of the objects associated with the new user. ! mSupport.storePersistentObject(ud); RoleData rd = new RoleData( null,ud.getUserName(),ud.getId(),"editor"); ! mSupport.storePersistentObject(rd); //WeblogManager wmgr = mRoller.getWeblogManager(); --- 346,354 ---- // to roll back all of the objects associated with the new user. ! mStrategy.storePersistentObject(ud); RoleData rd = new RoleData( null,ud.getUserName(),ud.getId(),"editor"); ! mStrategy.storePersistentObject(rd); //WeblogManager wmgr = mRoller.getWeblogManager(); *************** *** 369,373 **** "", // ignoreWords Boolean.FALSE); // allowComments ! mSupport.storePersistentObject(website); WeblogCategoryData generalCat = new WeblogCategoryData( --- 369,373 ---- "", // ignoreWords Boolean.FALSE); // allowComments ! mStrategy.storePersistentObject(website); WeblogCategoryData generalCat = new WeblogCategoryData( *************** *** 377,381 **** "General", // description null ); // image ! mSupport.storePersistentObject(generalCat); WeblogCategoryData javaCat = new WeblogCategoryData( --- 377,381 ---- "General", // description null ); // image ! mStrategy.storePersistentObject(generalCat); WeblogCategoryData javaCat = new WeblogCategoryData( *************** *** 385,389 **** "Java", // description null ); // image ! mSupport.storePersistentObject(javaCat); WeblogCategoryData musicCat = new WeblogCategoryData( --- 385,389 ---- "Java", // description null ); // image ! mStrategy.storePersistentObject(javaCat); WeblogCategoryData musicCat = new WeblogCategoryData( *************** *** 393,397 **** "Music", // description null ); // image ! mSupport.storePersistentObject(musicCat); website.setBloggerCategoryId(generalCat.getId()); --- 393,397 ---- "Music", // description null ); // image ! mStrategy.storePersistentObject(musicCat); website.setBloggerCategoryId(generalCat.getId()); *************** *** 402,420 **** FolderData topFolder = new FolderData(null,null, "top","top",website,null); ! mSupport.storePersistentObject(topFolder); FolderData blogroll = new FolderData(null,null, "Blogroll","Blogroll",website,topFolder.getId()); ! mSupport.storePersistentObject(blogroll); BookmarkData b1 = new BookmarkData(null, "Dave Johnson","","http://rollerweblogger.org/page/roller", zero,zero,blogroll,"",null); ! mSupport.storePersistentObject(b1); BookmarkData b2 = new BookmarkData(null, "Matt Raible","","http://raibledesigns.com", zero,zero,blogroll,"",null); ! mSupport.storePersistentObject(b2); BookmarkData b3 = new BookmarkData(null, --- 402,420 ---- FolderData topFolder = new FolderData(null,null, "top","top",website,null); ! mStrategy.storePersistentObject(topFolder); FolderData blogroll = new FolderData(null,null, "Blogroll","Blogroll",website,topFolder.getId()); ! mStrategy.storePersistentObject(blogroll); BookmarkData b1 = new BookmarkData(null, "Dave Johnson","","http://rollerweblogger.org/page/roller", zero,zero,blogroll,"",null); ! mStrategy.storePersistentObject(b1); BookmarkData b2 = new BookmarkData(null, "Matt Raible","","http://raibledesigns.com", zero,zero,blogroll,"",null); ! mStrategy.storePersistentObject(b2); BookmarkData b3 = new BookmarkData(null, *************** *** 422,441 **** "http://brainopolis.dnsalias.com/roller/page/lance/", zero,zero,blogroll,"",null); ! mSupport.storePersistentObject(b3); FolderData news = new FolderData(null,null, "News","News",website,topFolder.getId()); ! mSupport.storePersistentObject(news); BookmarkData b5 = new BookmarkData(null, "CNN","","http://www.cnn.com", zero,zero,news,"",null); ! mSupport.storePersistentObject(b5); BookmarkData b6 = new BookmarkData(null, "NY Times","","http://nytimes.com", zero,zero,news,"",null); ! mSupport.storePersistentObject(b6); --- 422,441 ---- "http://brainopolis.dnsalias.com/roller/page/lance/", zero,zero,blogroll,"",null); ! mStrategy.storePersistentObject(b3); FolderData news = new FolderData(null,null, "News","News",website,topFolder.getId()); ! mStrategy.storePersistentObject(news); BookmarkData b5 = new BookmarkData(null, "CNN","","http://www.cnn.com", zero,zero,news,"",null); ! mStrategy.storePersistentObject(b5); BookmarkData b6 = new BookmarkData(null, "NY Times","","http://nytimes.com", zero,zero,news,"",null); ! mStrategy.storePersistentObject(b6); *************** *** 458,462 **** new Date() // updateTime ); ! mSupport.storePersistentObject(pd); if ( pd.getName().equals("Weblog") ) --- 458,462 ---- new Date() // updateTime ); ! mStrategy.storePersistentObject(pd); if ( pd.getName().equals("Weblog") ) *************** *** 471,475 **** // Save website with blogger cat id, defauld page id and day id ! mSupport.storePersistentObject(website); // --- 471,475 ---- // Save website with blogger cat id, defauld page id and day id ! mStrategy.storePersistentObject(website); // *************** *** 488,492 **** Boolean.TRUE // publishEntry ); ! mSupport.storePersistentObject(post); } --- 488,492 ---- Boolean.TRUE // publishEntry ); ! mStrategy.storePersistentObject(post); } *************** *** 495,499 **** try { ! mSupport.rollback(); } catch ( Exception e ) --- 495,499 ---- try { ! mStrategy.rollback(); } catch ( Exception e ) *************** *** 540,544 **** for (i = 0; i < newsfeeds.length; i++) { ! mSupport.removePersistentObject( newsfeeds[i].getId(), --- 540,544 ---- for (i = 0; i < newsfeeds.length; i++) { ! mStrategy.removePersistentObject( newsfeeds[i].getId(), *************** *** 560,567 **** { CommentData comment = (CommentData)comments.get(x); ! mSupport.removePersistentObject( comment.getId(), CommentData.class ); } ! mSupport.removePersistentObject( entry.getId(), WeblogEntryData.class); --- 560,567 ---- { CommentData comment = (CommentData)comments.get(x); ! mStrategy.removePersistentObject( comment.getId(), CommentData.class ); } ! mStrategy.removePersistentObject( entry.getId(), WeblogEntryData.class); *************** *** 572,576 **** for (Iterator wbcItr = cats.iterator(); wbcItr.hasNext();) { WeblogCategoryData category = (WeblogCategoryData) wbcItr.next(); ! mSupport.removePersistentObject( category.getId(), WeblogCategoryData.class); --- 572,576 ---- for (Iterator wbcItr = cats.iterator(); wbcItr.hasNext();) { WeblogCategoryData category = (WeblogCategoryData) wbcItr.next(); ! mStrategy.removePersistentObject( category.getId(), WeblogCategoryData.class); *************** *** 582,591 **** for (i = 0; i < roles.length; i++) { ! mSupport.removePersistentObject( roles[i].getId(), RoleData.class); } ! mSupport.removePersistentObject( website.getId(), WebsiteData.class); ! mSupport.removePersistentObject( user.getId(), UserData.class); } } --- 582,591 ---- for (i = 0; i < roles.length; i++) { ! mStrategy.removePersistentObject( roles[i].getId(), RoleData.class); } ! mStrategy.removePersistentObject( website.getId(), WebsiteData.class); ! mStrategy.removePersistentObject( user.getId(), UserData.class); } } ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| News | FAQ | advertise |