use of com.twinsoft.convertigo.beans.mobile.components.PageComponent in project convertigo by convertigo.
the class Ionic3Builder method pageDisabled.
@Override
public void pageDisabled(final IPageComponent pageComponent) throws EngineException {
PageComponent page = (PageComponent) pageComponent;
if (page != null && !page.isEnabled() && initDone) {
synchronized (page) {
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.mobile.components.PageComponent in project convertigo by convertigo.
the class Ionic3Builder method pageRemoved.
@Override
public void pageRemoved(final IPageComponent pageComponent) throws EngineException {
PageComponent page = (PageComponent) pageComponent;
if (page != null && page.isEnabled() && initDone) {
synchronized (page) {
MobileApplication mobileApplication = project.getMobileApplication();
if (mobileApplication != null) {
ApplicationComponent application = (ApplicationComponent) mobileApplication.getApplicationComponent();
if (application != null) {
writeAppSourceFiles(application);
deleteUselessDir(page.getName());
moveFiles();
Engine.logEngine.trace("(MobileBuilder) Handled 'pageRemoved'");
}
}
}
}
}
use of com.twinsoft.convertigo.beans.mobile.components.PageComponent in project convertigo by convertigo.
the class Ionic3Builder method writeAppServiceTs.
private void writeAppServiceTs(ApplicationComponent app) throws EngineException {
try {
if (app != null) {
Map<String, String> action_ts_imports = new HashMap<>();
Map<String, String> action_ts_functions = new HashMap<>();
// Menus contributors
for (Contributor contributor : app.getContributors()) {
action_ts_imports.putAll(contributor.getActionTsImports());
action_ts_functions.putAll(contributor.getActionTsFunctions());
}
// Pages contributors
List<PageComponent> pages = forceEnable ? app.getPageComponentList() : getEnabledPages(app);
for (PageComponent page : pages) {
synchronized (page) {
List<Contributor> contributors = page.getContributors();
for (Contributor contributor : contributors) {
action_ts_imports.putAll(contributor.getActionTsImports());
action_ts_functions.putAll(contributor.getActionTsFunctions());
}
}
}
String c8o_ActionTsImports = "";
for (String comp : action_ts_imports.keySet()) {
if (!getTplServiceActionTsImports().containsKey(comp)) {
if (comp.indexOf(" as ") == -1)
c8o_ActionTsImports += "import { " + comp + " } from '" + action_ts_imports.get(comp) + "';" + System.lineSeparator();
else
c8o_ActionTsImports += "import " + comp + " from '" + action_ts_imports.get(comp) + "';" + System.lineSeparator();
}
}
String c8o_ActionTsFunctions = System.lineSeparator();
for (String function : action_ts_functions.values()) {
c8o_ActionTsFunctions += function + System.lineSeparator();
}
File appServiceTpl = new File(ionicTplDir, "src/services/actionbeans.service.ts");
String mContent = FileUtils.readFileToString(appServiceTpl, "UTF-8");
mContent = mContent.replaceAll("/\\*\\=c8o_ActionTsImports\\*/", Matcher.quoteReplacement(c8o_ActionTsImports));
mContent = mContent.replaceAll("/\\*\\=c8o_ActionTsFunctions\\*/", Matcher.quoteReplacement(c8o_ActionTsFunctions));
File appServiceTsFile = new File(ionicWorkDir, "src/services/actionbeans.service.ts");
writeFile(appServiceTsFile, mContent, "UTF-8");
if (initDone) {
Engine.logEngine.trace("(MobileBuilder) Ionic service ts file generated for 'app'");
}
}
} catch (Exception e) {
throw new EngineException("Unable to write ionic app service ts file", e);
}
}
use of com.twinsoft.convertigo.beans.mobile.components.PageComponent in project convertigo by convertigo.
the class Ionic3Builder method pageStyleChanged.
@Override
public void pageStyleChanged(final IPageComponent pageComponent) throws EngineException {
PageComponent page = (PageComponent) pageComponent;
if (page != null && page.isEnabled() && initDone) {
synchronized (page) {
writePageStyle(page);
moveFiles();
Engine.logEngine.trace("(MobileBuilder) Handled 'pageStyleChanged'");
}
}
}
use of com.twinsoft.convertigo.beans.mobile.components.PageComponent in project convertigo by convertigo.
the class Ionic3Builder method pageTemplateChanged.
@Override
public void pageTemplateChanged(final IPageComponent pageComponent) throws EngineException {
PageComponent page = (PageComponent) pageComponent;
if (page != null && page.isEnabled() && initDone) {
synchronized (page) {
writePageTemplate(page);
moveFiles();
Engine.logEngine.trace("(MobileBuilder) Handled 'pageTemplateChanged'");
}
}
}
Aggregations