*
* @param project
* @return
*/
public static FScript getRepository(IProject project){
FScript repos = null;
try {
repos = (FScript)project.getSessionProperty(new QualifiedName(ToolProjectSupport.PROJECT_QUALIFIED_NAME, ToolProjectSupport.REPOS_OBJECT));
if (repos == null){
/*
* create a ToolRepository based on the project properties
* and store it as a session property
*/
String forteRoot = project.getPersistentProperty(ToolProjectSupport.forteRootQualifiedName);
String repository = project.getPersistentProperty(ToolProjectSupport.reposQualifiedName);
String workspace = project.getPersistentProperty(ToolProjectSupport.workspaceQualifiedName);
String workspacePassword = project.getPersistentProperty(ToolProjectSupport.worspacePasswordQualifiedName);
String logFlags = project.getPersistentProperty(ToolProjectSupport.loggerQualifiedName);
repos = new FScript(forteRoot, repository, workspace, workspacePassword, logFlags, true);
project.setSessionProperty(new QualifiedName(ToolProjectSupport.PROJECT_QUALIFIED_NAME, ToolProjectSupport.REPOS_OBJECT), repos);
}
} catch (CoreException e) {
ToolPlugin.showError("Error getting repository", e);