	public void execute() throws Throwable
	{
		OlioPerson loggedPerson = this.getUtility().getPerson(this.getSessionState().getLoggedPersonId());
		if (!this.getUtility().isRegisteredPerson(loggedPerson))
		{
			this.getLogger().severe("Login required for adding an event");
			this.setFailed(true);
			return;
		}
		StringBuilder response = null;
		response = this.getHttpTransport().fetchUrl(this.getGenerator().getAddEventURL());
		this.trace(this.getGenerator().getAddEventURL());
		if (!this.getGenerator().checkHttpResponse(response.toString()))
		{
			this.getLogger().severe("Problems in performing request to URL: " + this.getGenerator().getAddEventURL() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "). Server response: " + response);
			throw new IOException("Problems in performing request to URL: " + this.getGenerator().getAddEventURL() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + ")");
		}
		this.loadStatics(this.getGenerator().getAddEventStatics());
		this.trace(this.getGenerator().getAddEventStatics());
		String token = null;
		switch (this.getConfiguration().getIncarnation())
		{
			case OlioConfiguration.JAVA_INCARNATION:
				break;
			case OlioConfiguration.PHP_INCARNATION:
				break;
			case OlioConfiguration.RAILS_INCARNATION:
				token = this.parseAuthToken(response.toString());
				if ( token == null )
				{
					throw new Exception( "Authentication token could not be parsed" );
				}
				break;
		}
		OlioSocialEvent event = this.getUtility().newSocialEvent();
		event.submitterUserName = loggedPerson.userName;
		HttpPost reqPost = new HttpPost(this.getGenerator().getAddEventResultURL());
		MultipartEntity entity = new MultipartEntity();
		this.populateEntity(entity, event);
		switch (this.getConfiguration().getIncarnation())
		{
			case OlioConfiguration.JAVA_INCARNATION:
				break;
			case OlioConfiguration.PHP_INCARNATION:
				break;
			case OlioConfiguration.RAILS_INCARNATION:
				entity.addPart("authenticity_token", new StringBody(token));
				break;
		}
		reqPost.setEntity(entity);
		response = this.getHttpTransport().fetch(reqPost);
		this.trace(this.getGenerator().getAddEventResultURL());
		if (!this.getGenerator().checkHttpResponse(response.toString()))
		{
			this.getLogger().severe("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "). Server response: " + response);
			throw new IOException("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + ")");
		}
		int index = response.toString().toLowerCase().indexOf("success");
		if (index == -1)
		{
			this.getLogger().severe("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "): Could not find success message in result body. Server response: " + response);
			throw new IOException("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "): Could not find success message in result body");
		}
		this.getSessionState().setLastResponse(response.toString());
		this.setFailed(false);
	}

	public void execute() throws Throwable
	{
		OlioPerson loggedPerson = this.getUtility().getPerson(this.getSessionState().getLoggedPersonId());
		if (!this.getUtility().isRegisteredPerson(loggedPerson))
		{
			this.getLogger().severe("Login required for adding an event");
			this.setFailed(true);
			return;
		}
		StringBuilder response = null;
		response = this.getHttpTransport().fetchUrl(this.getGenerator().getAddEventURL());
		this.trace(this.getGenerator().getAddEventURL());
		if (!this.getGenerator().checkHttpResponse(response.toString()))
		{
			this.getLogger().severe("Problems in performing request to URL: " + this.getGenerator().getAddEventURL() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "). Server response: " + response);
			throw new IOException("Problems in performing request to URL: " + this.getGenerator().getAddEventURL() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + ")");
		}
		this.loadStatics(this.getGenerator().getAddEventStatics());
		this.trace(this.getGenerator().getAddEventStatics());
		String token = null;
		switch (this.getConfiguration().getIncarnation())
		{
			case OlioConfiguration.JAVA_INCARNATION:
				break;
			case OlioConfiguration.PHP_INCARNATION:
				break;
			case OlioConfiguration.RAILS_INCARNATION:
				token = this.parseAuthToken(response.toString());
				if ( token == null )
				{
					throw new Exception( "Authentication token could not be parsed" );
				}
				break;
		}
		OlioSocialEvent event = this.getUtility().newSocialEvent();
		event.submitterUserName = loggedPerson.userName;
		HttpPost reqPost = new HttpPost(this.getGenerator().getAddEventResultURL());
		MultipartEntity entity = new MultipartEntity();
		this.populateEntity(entity, event);
		switch (this.getConfiguration().getIncarnation())
		{
			case OlioConfiguration.JAVA_INCARNATION:
				break;
			case OlioConfiguration.PHP_INCARNATION:
				break;
			case OlioConfiguration.RAILS_INCARNATION:
				entity.addPart("authenticity_token", new StringBody(token));
				break;
		}
		reqPost.setEntity(entity);
		response = this.getHttpTransport().fetch(reqPost);
		this.trace(this.getGenerator().getAddEventResultURL());
		if (!this.getGenerator().checkHttpResponse(response.toString()))
		{
			this.getLogger().severe("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "). Server response: " + response);
			throw new IOException("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + ")");
		}
		switch (this.getConfiguration().getIncarnation())
		{
			case OlioConfiguration.JAVA_INCARNATION:
				break;
			case OlioConfiguration.PHP_INCARNATION:
				break;
			case OlioConfiguration.RAILS_INCARNATION:
				int index = response.toString().toLowerCase().indexOf("event was successfully created.");
				if (index == -1)
				{
					this.getLogger().severe("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "): Could not find success message in result body. Server response: " + response);
					throw new IOException("Problems in performing request to URL: " + reqPost.getURI() + " (HTTP status code: " + this.getHttpTransport().getStatusCode() + "): Could not find success message in result body");
				}
				break;
		}
		this.getSessionState().setLastResponse(response.toString());
		this.setFailed(false);
	}
