[Openproj-commitlog] openproj_core/src/com/projity/pm/task ProjectFactory.java, 1.27, 1.28 Project.
Open Source desktop project management
Brought to you by:
akheirol
From: Howard K. <ne...@us...> - 2009-01-08 01:17:22
|
Update of /cvsroot/openproj/openproj_core/src/com/projity/pm/task In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28633/src/com/projity/pm/task Modified Files: ProjectFactory.java Project.java Log Message: publish stuff Index: ProjectFactory.java =================================================================== RCS file: /cvsroot/openproj/openproj_core/src/com/projity/pm/task/ProjectFactory.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ProjectFactory.java 7 Jan 2009 00:43:53 -0000 1.27 +++ ProjectFactory.java 8 Jan 2009 01:17:09 -0000 1.28 @@ -390,6 +390,9 @@ session.schedule(job); try { if (opt.isSync()) job.waitResult(); + if (opt.isPublish()) { + session.publish(project); + } } catch (Exception e) {} } } @@ -584,6 +587,7 @@ portfolio.getObjectEventManager().fireDeleteEvent(this,p); Node node = portfolio.getNodeModel().search(p); portfolio.getNodeModel().remove(node,NodeModel.EVENT); + p.setLocked(false); } public void removeProject(final Project project, boolean allowCancel, boolean prompt,boolean calledFromSwing) { @@ -591,6 +595,7 @@ if (job != null) { // if not cancelled Session session=SessionFactory.getInstance().getSession(project.isLocal()); session.schedule(job); + project.setLocked(false); } } @@ -599,6 +604,7 @@ if (job!=null) { SessionFactory.getInstance().getSession(project.isLocal()).schedule(job); portfolio.handleExternalTasks(project,false, false); // external link handling + project.setLocked(false); } } @@ -646,10 +652,16 @@ } public boolean getLock(Project project) { Session session = SessionFactory.getInstance().getSession(false); - boolean lockSuccess = session.getLock(project); - if (lockSuccess) - project.setLocked(true); - return lockSuccess; + return session.getLock(project); + } + public boolean revert(Project project) { + Session session = SessionFactory.getInstance().getSession(false); + boolean ok = session.revert(project); + if (ok) + reload(project.getUniqueId()); + return ok; + } + public void reload(long projectId) { + Alert.warn("Code not present - reload project - doing nothing"); } - } \ No newline at end of file Index: Project.java =================================================================== RCS file: /cvsroot/openproj/openproj_core/src/com/projity/pm/task/Project.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- Project.java 7 Jan 2009 00:43:53 -0000 1.52 +++ Project.java 8 Jan 2009 01:17:09 -0000 1.53 @@ -52,6 +52,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; +import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.EventListener; @@ -2921,9 +2922,9 @@ // } transient String checkedOutUser; - transient long checkedOutDate; + transient Calendar checkedOutDate; transient String publishedUser; - transient long publishedDate; + transient Calendar publishedDate; public String getCheckedOutUser() { return checkedOutUser; } @@ -2932,11 +2933,11 @@ this.checkedOutUser = checkedOutUser; } - public long getCheckedOutDate() { + public Calendar getCheckedOutDate() { return checkedOutDate; } - public void setCheckedOutDate(long checkedOutDate) { + public void setCheckedOutDate(Calendar checkedOutDate) { this.checkedOutDate = checkedOutDate; } @@ -2948,16 +2949,15 @@ this.publishedUser = publishedUser; } - public long getPublishedDate() { + public Calendar getPublishedDate() { return publishedDate; } - public void setPublishedDate(long publishedDate) { + public void setPublishedDate(Calendar publishedDate) { this.publishedDate = publishedDate; } transient boolean locked = false; - transient boolean editable = true; public boolean isLocked() { return locked; } @@ -2966,15 +2966,8 @@ this.locked = locked; } - public boolean isEditable() { - return editable; - } - - public void setEditable(boolean editable) { - this.editable = editable; - } public String getPublishInfo() { - return "Locked=" + isLocked() + " published date = " + new Date(getPublishedDate()) + " by " + getPublishedUser() + " saved date " + new Date(getCheckedOutDate()) + " by " + getCheckedOutUser(); + return "Locked=" + isLocked() + " published date = " + getPublishedDate().getTime() + " by " + getPublishedUser() + " checked out date " + getCheckedOutDate().getTime() + " by " + getCheckedOutUser(); } } \ No newline at end of file |