use of com.twinsoft.convertigo.beans.references.ProjectSchemaReference in project convertigo by convertigo.
the class ReferenceTreeObject method treeObjectPropertyChanged.
@Override
public void treeObjectPropertyChanged(TreeObjectEvent treeObjectEvent) {
super.treeObjectPropertyChanged(treeObjectEvent);
TreeObject treeObject = (TreeObject) treeObjectEvent.getSource();
if (treeObject instanceof DatabaseObjectTreeObject) {
DatabaseObject databaseObject = (DatabaseObject) treeObject.getObject();
String propertyName = treeObjectEvent.propertyName;
propertyName = ((propertyName == null) ? "" : propertyName);
// If a bean name has changed
if (propertyName.equals("name")) {
handlesBeanNameChanged(treeObjectEvent);
} else {
// If a referenced project has changed, clear current project schema
if (getObject() instanceof ProjectSchemaReference) {
ProjectSchemaReference reference = (ProjectSchemaReference) getObject();
if (databaseObject.getProject().getName().equals(reference.getParser().getProjectName())) {
Engine.theApp.schemaManager.clearCache(reference.getProject().getName());
}
}
}
}
}
use of com.twinsoft.convertigo.beans.references.ProjectSchemaReference in project convertigo by convertigo.
the class ProjectSchemaWizardPage method dialogChanged.
private void dialogChanged() {
if (projectName == null) {
updateStatus("Please select a project");
return;
}
try {
DatabaseObject dbo = ((ObjectExplorerWizardPage) getWizard().getPage("ObjectExplorerWizardPage")).getCreatedBean();
if (dbo != null) {
if (dbo instanceof ProjectSchemaReference) {
projectName = ProjectUrlParser.getUrl(projectName);
((ProjectSchemaReference) dbo).setProjectName(projectName);
}
}
} catch (NullPointerException e) {
updateStatus("New Bean has not been instantiated");
return;
}
updateStatus(null);
}
use of com.twinsoft.convertigo.beans.references.ProjectSchemaReference in project convertigo by convertigo.
the class Migration7_0_0 method addReferenceToMap.
private static void addReferenceToMap(Map<String, Reference> referenceMap, String namespaceURI, String location) throws EngineException {
if (!referenceMap.containsKey(namespaceURI)) {
// c8o project reference
if (location.startsWith("../")) {
String targetProjectName = location.substring(3, location.indexOf("/", 3));
ProjectSchemaReference reference = new ProjectSchemaReference();
reference.setProjectName(targetProjectName);
reference.setName(targetProjectName + "_reference");
referenceMap.put(namespaceURI, reference);
} else // other reference
{
ImportXsdSchemaReference reference = new ImportXsdSchemaReference();
reference.setName(StringUtils.normalize(location));
reference.setFilepath(".//xsd/" + location);
referenceMap.put(namespaceURI, reference);
}
}
}
use of com.twinsoft.convertigo.beans.references.ProjectSchemaReference in project convertigo by convertigo.
the class CLI method generateMobileBuilder.
public void generateMobileBuilder(Project project, String mode) throws Exception {
MobileBuilder mb = project.getMobileBuilder();
MobileBuilderBuildMode bm = MobileBuilderBuildMode.production;
try {
bm = MobileBuilderBuildMode.valueOf(mode);
} catch (Exception e) {
}
mb.setAppBuildMode(bm);
List<Project> projects = new ArrayList<>();
projects.add(project);
int i = 0;
do {
for (Reference ref : projects.get(i).getReferenceList()) {
if (ref instanceof ProjectSchemaReference) {
ProjectSchemaReference pref = (ProjectSchemaReference) ref;
Project p = Engine.theApp.referencedProjectManager.importProject(pref.getParser());
if (p == null) {
Engine.logConvertigo.warn("Failed to import project reference: " + pref.getProjectName() + " (ignored)");
} else if (!projects.contains(p)) {
projects.add(p);
}
}
}
} while (++i < projects.size());
Collections.reverse(projects);
for (Project p : projects) {
MobileBuilder.initBuilder(p, true);
}
Collections.reverse(projects);
for (Project p : projects) {
MobileBuilder.releaseBuilder(p, true);
}
}
use of com.twinsoft.convertigo.beans.references.ProjectSchemaReference in project convertigo by convertigo.
the class SchemaManager method getProjectReferences.
protected static void getProjectReferences(List<String> refs, String projectName) {
if (refs == null)
return;
try {
Project p = Engine.theApp.databaseObjectsManager.getOriginalProjectByName(projectName);
if (p != null) {
if (!refs.contains(projectName)) {
refs.add(projectName);
for (Reference ref : p.getReferenceList()) {
if (ref instanceof ProjectSchemaReference) {
ProjectSchemaReference psr = (ProjectSchemaReference) ref;
getProjectReferences(refs, psr.getParser().getProjectName());
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations