use of com.twinsoft.convertigo.beans.core.MobileApplication in project convertigo by convertigo.
the class Ionic3Builder method updateSourceFiles.
private void updateSourceFiles() throws EngineException {
try {
MobileApplication mobileApplication = project.getMobileApplication();
if (mobileApplication != null) {
ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
if (application != null) {
String appTplVersion = application.requiredTplVersion();
if (compareVersions(tplVersion, appTplVersion) >= 0) {
for (PageComponent page : getEnabledPages(application)) {
writePageSourceFiles(page);
}
writeAppSourceFiles(application);
removeUselessPages(application);
Engine.logEngine.trace("(MobileBuilder) Application source files updated for ionic project '" + project.getName() + "'");
} else {
cleanDirectories();
throw new EngineException("Template project minimum " + appTplVersion + " is required for this project.\n" + "You can change template by configuring the 'Template project' property of your project's 'Application' object.\n" + "Then, be sure to update the project node modules packages (Application Right Click->Update packages and execute) \n");
}
}
}
} catch (EngineException e) {
throw e;
} catch (Exception e) {
throw new EngineException("Unable to update application source files for ionic project '" + project.getName() + "'", e);
}
}
use of com.twinsoft.convertigo.beans.core.MobileApplication in project convertigo by convertigo.
the class Ionic3Builder method addPage.
private void addPage(PageComponent page) throws EngineException {
MobileApplication mobileApplication = project.getMobileApplication();
if (mobileApplication != null) {
ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
if (application != null) {
writePageSourceFiles(page);
writeAppSourceFiles(application);
}
}
}
use of com.twinsoft.convertigo.beans.core.MobileApplication in project convertigo by convertigo.
the class Migration7_0_0 method migrate.
public static Element migrate(Document document, Element projectNode) throws EngineException {
try {
NodeList mobileDevicesNodeList = XMLUtils.findElements(projectNode, "/mobiledevice");
if (mobileDevicesNodeList != null) {
MobileApplication mobileApplication = new MobileApplication();
Element mobileApplicationElement = mobileApplication.toXml(document);
projectNode.appendChild(mobileApplicationElement);
Node[] mobileDeviceNodes = XMLUtils.toNodeArray(mobileDevicesNodeList);
boolean hasAndroid = false;
boolean hasIOs = false;
for (Node mobileDeviceNode : mobileDeviceNodes) {
Element mobileDevice = (Element) mobileDeviceNode;
String classname = mobileDevice.getAttribute("classname");
if (classname == null) {
// may never arrived
} else if (classname.equals("com.twinsoft.convertigo.beans.mobiledevices.Android")) {
hasAndroid = true;
} else if (classname.startsWith("com.twinsoft.convertigo.beans.mobiledevices.IP")) {
hasIOs = true;
}
projectNode.removeChild(mobileDevice);
}
if (hasAndroid) {
mobileApplicationElement.appendChild(new Android().toXml(document));
}
if (hasIOs) {
mobileApplicationElement.appendChild(new IOs().toXml(document));
}
if (hasAndroid && hasIOs) {
mobileApplicationElement.appendChild(new WindowsPhone8().toXml(document));
mobileApplicationElement.appendChild(new Windows().toXml(document));
}
String projectName = "" + XMLUtils.findPropertyValue(projectNode, "name");
File mobileFolder = new File(Engine.projectDir(projectName) + "/DisplayObjects/mobile");
if (mobileFolder.exists()) {
FileUtils.write(new File(mobileFolder, "mobile_project_migrated.txt"), "Your mobile project has been migrated.\n" + "Now, we make per platform configuration and resources.\n" + "You may customize your config.xml (the existing one will never used) and dispatch your existing specific resources per platform (see the 'platforms' folder).\n" + "You can delete this file after reading it.", "UTF-8");
}
}
} catch (Exception e) {
throw new EngineException("[Migration 7.0.0] Unable to migrate project", e);
}
return projectNode;
}
use of com.twinsoft.convertigo.beans.core.MobileApplication in project convertigo by convertigo.
the class NgxBuilder method pageDisabled.
@Override
public synchronized void pageDisabled(final IPageComponent pageComponent) throws EngineException {
PageComponent page = (PageComponent) pageComponent;
if (page != null && !page.isEnabled() && initDone) {
MobileApplication mobileApplication = project.getMobileApplication();
if (mobileApplication != null) {
ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
if (application != null) {
writePageSourceFiles(page);
writeAppSourceFiles(application);
moveFiles();
Engine.logEngine.trace("(MobileBuilder) Handled 'pageDisabled'");
}
}
}
}
use of com.twinsoft.convertigo.beans.core.MobileApplication in project convertigo by convertigo.
the class NgxBuilder method addPage.
private void addPage(PageComponent page) throws EngineException {
MobileApplication mobileApplication = project.getMobileApplication();
if (mobileApplication != null) {
ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
if (application != null) {
writePageSourceFiles(page);
writeAppSourceFiles(application);
}
}
}
Aggregations