use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.
the class InitMsnPage method getMsnList.
private List getMsnList() {
if (this.msns == null || this.msns.size() == 0) {
this.msns = new ArrayList();
this.removeMsns = new ArrayList();
String msnList = this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + "list");
if (msnList.trim().length() > 0) {
StringTokenizer st = new StringTokenizer(msnList, ",");
while (st.hasMoreTokens()) {
String number = st.nextToken().trim();
if (number.length() > 0) {
IMsn msn = this.getRuntime().getCallFactory().createMsn(this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_msn"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_label"));
this.msns.add(msn);
}
}
}
}
return this.msns;
}
use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.
the class InitMsnPage method openMsnWizard.
private void openMsnWizard(String msn, String additional) {
Display display = DisplayManager.getDefaultDisplay();
Shell shell = new Shell(display);
// Create the dialog
IMsn oldMsn = this.getRuntime().getCallFactory().createMsn(msn, additional);
WizardDialog.setDefaultImage(SWTImageManager.getInstance(this.getRuntime()).get(IJAMConst.IMAGE_KEY_PIM_ICON));
MsnWizard msnW = new MsnWizard(oldMsn);
WizardDialog dlg = new WizardDialog(shell, msnW);
dlg.open();
if (dlg.getReturnCode() == WizardDialog.OK) {
IMsn result = msnW.getResult();
this.msns.remove(oldMsn);
this.msns.add(result);
}
tv.setInput(this.msns);
this.resizeTable(tv.getTable());
}
use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.
the class OldDatFileCallImporter method parseMsn.
private IMsn parseMsn(String msn) {
IMsn parsedMSN = PIMRuntime.getInstance().getCallFactory().createMsn("", "");
if (msn.indexOf("(") > 0) {
String _msn = msn.substring(0, msn.indexOf("(") - 1);
_msn = _msn.trim();
String _msnAdd = msn.substring(msn.indexOf("(") + 1, msn.lastIndexOf(")"));
parsedMSN.setMSN(_msn);
parsedMSN.setAdditional(_msnAdd);
} else {
msn = msn.trim();
parsedMSN.setMSN(msn);
parsedMSN.setAdditional(PIMRuntime.getInstance().getMsnManager().getMsnLabel(msn));
}
return parsedMSN;
}
use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.
the class MailNotification method getDataList.
private List getDataList() {
if (this.dataList == null || this.dataList.size() == 0) {
this.dataList = new ArrayList();
this.removableData = new ArrayList();
String msnList = this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + "list");
if (msnList.trim().length() > 0) {
StringTokenizer st = new StringTokenizer(msnList, ",");
while (st.hasMoreTokens()) {
String number = st.nextToken().trim();
if (number.length() > 0) {
IMsn msn = this.getRuntime().getMsnManager().createMsn(number);
MailDataObject mdo = new MailDataObject(msn, this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailto"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailfrom"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mimetype"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_encoding"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailsubject"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailcontent"), this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + number + "_mailtemplate"));
if (!this.dataList.contains(mdo))
this.dataList.add(mdo);
}
}
}
}
return this.dataList;
}
use of de.janrufmonitor.framework.IMsn in project janrufmonitor by tbrandt77.
the class MailNotification method sendTestMail.
public void sendTestMail() {
ICaller caller = getRuntime().getCallerFactory().createCaller(getRuntime().getCallerFactory().createName("Max", "Mustermann"), getRuntime().getCallerFactory().createPhonenumber("49", "30", "1234567890"));
IMsn msn = getRuntime().getMsnManager().createMsn("12345");
ICip cip = getRuntime().getCipManager().createCip("999");
ICall call = getRuntime().getCallFactory().createCall(caller, msn, cip);
if (this.m_configuration == null) {
PropagationFactory.getInstance().fire(new de.janrufmonitor.exception.Message(de.janrufmonitor.exception.Message.ERROR, NAMESPACE, "notstarted", new String[] {}, new Exception()), "Tray");
return;
}
if (this.m_task == null) {
this.m_task = new MailTask();
this.m_logger.info("Created new MailTask instance");
}
PropagationFactory.getInstance().fire(new de.janrufmonitor.exception.Message(de.janrufmonitor.exception.Message.INFO, NAMESPACE, "testmail", new String[] {}, new Exception()), "Tray");
this.m_task.setConfiguration(this.m_configuration);
this.m_task.addMail(call);
this.m_task.run();
}
Aggregations