use of org.obeonetwork.dsl.manifest.MManifest in project InformationSystem by ObeoNetwork.
the class ExportProjectAsLibraryWizardModel method setSelectedModelingProject.
public void setSelectedModelingProject(ModelingProject selectedModelingProject) {
this.selectedModelingProject = selectedModelingProject;
// Initialize values for other fields
if (selectedModelingProject != null) {
Session session = selectedModelingProject.getSession();
List<MManifest> previousManifests = new ManifestServices().getExportedManifests(session);
String projectId = selectedModelingProject.getProject().getName();
if (!previousManifests.isEmpty()) {
projectId = previousManifests.get(previousManifests.size() - 1).getProjectId();
}
setProjectId(projectId);
setPreviousVersions(previousManifests);
}
}
use of org.obeonetwork.dsl.manifest.MManifest in project InformationSystem by ObeoNetwork.
the class ImportLibraryIntoProjectFileSelectionPage method extractInfoFromManifest.
private void extractInfoFromManifest(Manifest manifest) {
if (manifest != null) {
MManifest manifestModel = manifestServices.getModelFromMarManifest(manifest);
txtProjectId.setText(manifestModel.getProjectId());
txtVersion.setText(manifestModel.getVersion());
txtComment.setText(manifestModel.getComment());
if (manifestModel.getCreationDate() != null) {
txtCreationDate.setText(DATE_FORMAT.format(manifestModel.getCreationDate()));
}
wizard.getModel().getDependencies().addAll(manifestModel.getDependencies());
wizard.getModel().setValidMarFile(true);
} else {
txtProjectId.setText(null);
txtVersion.setText(null);
txtComment.setText(null);
txtCreationDate.setText(null);
wizard.getModel().getDependencies().clear();
wizard.getModel().getExistingDependenciesRows().clear();
wizard.getModel().setValidMarFile(false);
}
computeDependenciesTable();
}
use of org.obeonetwork.dsl.manifest.MManifest in project InformationSystem by ObeoNetwork.
the class ImportLibraryIntoProjectFileSelectionPage method computeDependenciesTable.
private void computeDependenciesTable() {
List<DependencyRow> rows = new ArrayList<>();
for (MManifest dependency : wizard.getModel().getDependencies()) {
DependencyRow row = new DependencyRow();
row.setId(dependency.getProjectId());
row.setVersion(dependency.getVersion());
String existingVersion = getExistingVersion(dependency.getProjectId());
if (existingVersion != null) {
row.setExistingVersion(existingVersion);
}
rows.add(row);
}
wizard.getModel().setExistingDependenciesRows(rows);
}
use of org.obeonetwork.dsl.manifest.MManifest in project InformationSystem by ObeoNetwork.
the class ProjectLibraryImporter method getProjectName.
private String getProjectName(final File marFile) {
String name = "";
Manifest manifest = null;
try {
manifest = manifestServices.getManifestFromArchive(marFile);
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
if (manifest != null) {
MManifest manifestModel = manifestServices.getModelFromMarManifest(manifest);
name = manifestModel.getProjectId() + "-" + manifestModel.getVersion();
}
return name;
}
use of org.obeonetwork.dsl.manifest.MManifest in project InformationSystem by ObeoNetwork.
the class ManifestServices method getNewManifest.
public MManifest getNewManifest(String id, String version, String comment) {
MManifest manifest = ManifestFactory.eINSTANCE.createMManifest();
manifest.setProjectId(id);
try {
manifest.setVersion(version);
} catch (BadVersionStringException e) {
return null;
}
if (comment == null) {
manifest.setComment("");
} else {
manifest.setComment(comment);
}
manifest.setCreationDate(new Date());
return manifest;
}
Aggregations