Skip to content

Commit

Permalink
Merge pull request #37 from openworm/development
Browse files Browse the repository at this point in the history
Release 0.3.4
  • Loading branch information
tarelli authored Feb 14, 2017
2 parents a59681a + 1b14ad8 commit fd7d5f7
Show file tree
Hide file tree
Showing 331 changed files with 163,366 additions and 320 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/.settings/
.classpath
/.DS_Store
/target/
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.geppetto</groupId>
<artifactId>persistence</artifactId>
<name>Geppetto Persistence Bundle</name>
<version>0.3.3</version>
<version>0.3.4</version>
<packaging>bundle</packaging>
<properties>
<spring.version>3.1.3.RELEASE</spring.version>
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/org/geppetto/persistence/GeppettoDataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@

import java.io.Reader;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.lang.SerializationUtils;
Expand Down Expand Up @@ -263,6 +266,8 @@ public IUser newUser(String name, String password, boolean persistent, IUserGrou
{
User user = new User(name, password, name, new ArrayList<GeppettoProject>(), group);

user.addLoginTimeStamp(new Date());

if(persistent)
{
dbManager.storeEntity(user);
Expand Down Expand Up @@ -496,4 +501,11 @@ public IUserGroup newUserGroup(String name, List<UserPrivileges> privileges, lon
return new UserGroup(name, privileges, spaceAllowance, timeAllowance);
}

@Override
public void makeGeppettoProjectPublic(long projectId,boolean isPublic) throws GeppettoExecutionException {

GeppettoProject project = this.getGeppettoProjectById(projectId);
project.setPublic(isPublic);
dbManager.storeEntity(project);
}
}
5 changes: 4 additions & 1 deletion src/main/java/org/geppetto/persistence/db/DBManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

package org.geppetto.persistence.db;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -43,6 +46,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.datanucleus.store.query.QueryResult;
import org.geppetto.core.data.model.IDataEntity;
import org.geppetto.core.data.model.IUser;
import org.geppetto.persistence.db.model.GeppettoProject;
Expand Down Expand Up @@ -304,5 +308,4 @@ public User findUserByLogin(String login)
finishRequest();
}
}

}
23 changes: 23 additions & 0 deletions src/main/java/org/geppetto/persistence/db/model/Experiment.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public class Experiment implements Serializable, IExperiment
private Date creationDate;

private Date lastModified;

private Date lastRan;

private ExperimentStatus status;

Expand All @@ -88,6 +90,8 @@ public class Experiment implements Serializable, IExperiment

private String script;

private boolean isPublic = false;

public Experiment(List<AspectConfiguration> aspectConfigurations, String name, String description, Date creationDate, Date lastModified, ExperimentStatus status,
List<SimulationResult> simulationResults, Date startDate, Date endDate, IGeppettoProject project)
{
Expand Down Expand Up @@ -263,4 +267,23 @@ public void setScript(String script)
this.script = script;
}


@Override
public void updateStartDate() {
this.startDate = new Date();
}

@Override
public void updateEndDate() {
this.startDate = new Date();
}

@Override
public boolean isPublic() {
return this.isPublic;
}

public void setIsPublic(boolean mode){
this.isPublic = mode;
}
}
Loading

0 comments on commit fd7d5f7

Please sign in to comment.