1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.github.tonywasher.joceanus.moneywise.archive;
18
19 import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
20 import io.github.tonywasher.joceanus.oceanus.date.OceanusDate;
21 import io.github.tonywasher.joceanus.oceanus.profile.OceanusProfile;
22 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseBasicDataType;
23 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseBasicResource;
24 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseCash;
25 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseCash.MoneyWiseCashList;
26 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseCashInfo.MoneyWiseCashInfoList;
27 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseCategoryBase;
28 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDataSet;
29 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDeposit;
30 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDeposit.MoneyWiseDepositList;
31 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDepositInfo.MoneyWiseDepositInfoList;
32 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseLoan;
33 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseLoan.MoneyWiseLoanList;
34 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseLoanInfo.MoneyWiseLoanInfoList;
35 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePayee;
36 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePayee.MoneyWisePayeeList;
37 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePayeeInfo.MoneyWisePayeeInfoList;
38 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePortfolio;
39 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePortfolio.MoneyWisePortfolioList;
40 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePortfolioInfo.MoneyWisePortfolioInfoList;
41 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseSecurity;
42 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseSecurity.MoneyWiseSecurityList;
43 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseSecurityInfo.MoneyWiseSecurityInfoList;
44 import io.github.tonywasher.joceanus.moneywise.data.statics.MoneyWiseAccountInfoClass;
45 import io.github.tonywasher.joceanus.moneywise.data.statics.MoneyWiseCurrency;
46 import io.github.tonywasher.joceanus.moneywise.data.statics.MoneyWisePayeeClass;
47 import io.github.tonywasher.joceanus.moneywise.data.statics.MoneyWiseStaticDataType;
48 import io.github.tonywasher.joceanus.moneywise.exc.MoneyWiseIOException;
49 import io.github.tonywasher.joceanus.moneywise.exc.MoneyWiseLogicException;
50 import io.github.tonywasher.joceanus.prometheus.data.PrometheusDataResource;
51 import io.github.tonywasher.joceanus.prometheus.data.PrometheusDataValues;
52 import io.github.tonywasher.joceanus.prometheus.service.sheet.PrometheusSheetCell;
53 import io.github.tonywasher.joceanus.prometheus.service.sheet.PrometheusSheetRow;
54 import io.github.tonywasher.joceanus.prometheus.service.sheet.PrometheusSheetView;
55 import io.github.tonywasher.joceanus.prometheus.service.sheet.PrometheusSheetWorkBook;
56 import io.github.tonywasher.joceanus.tethys.api.thread.TethysUIThreadCancelException;
57 import io.github.tonywasher.joceanus.tethys.api.thread.TethysUIThreadStatusReport;
58
59
60
61
62
63
64 public final class MoneyWiseArchiveAccount {
65
66
67
68 private static final String SHEET_AREA = "AccountInfo";
69
70
71
72
73 private final TethysUIThreadStatusReport theReport;
74
75
76
77
78 private final PrometheusSheetWorkBook theWorkBook;
79
80
81
82
83 private final MoneyWiseDataSet theData;
84
85
86
87
88 private final MoneyWiseArchiveCache theCache;
89
90
91
92
93
94
95
96
97
98 MoneyWiseArchiveAccount(final TethysUIThreadStatusReport pReport,
99 final PrometheusSheetWorkBook pWorkBook,
100 final MoneyWiseDataSet pData,
101 final MoneyWiseArchiveCache pCache) {
102 theReport = pReport;
103 theWorkBook = pWorkBook;
104 theData = pData;
105 theCache = pCache;
106 }
107
108
109
110
111
112
113
114 void loadArchive(final OceanusProfile pStage) throws OceanusException {
115
116 try {
117
118 pStage.startTask("Accounts");
119 final PrometheusSheetView myView = theWorkBook.getRangeView(SHEET_AREA);
120
121
122 theReport.setNewStage(SHEET_AREA);
123
124
125 final int myTotal = myView.getRowCount();
126
127
128 theReport.setNumSteps(myTotal << 1);
129
130
131 for (int i = 0; i < myTotal; i++) {
132
133 final PrometheusSheetRow myRow = myView.getRowByIndex(i);
134
135
136 processPayee(myView, myRow);
137
138
139 theReport.setNextStep();
140 }
141
142
143 resolvePayeeLists();
144
145
146 for (int i = 0; i < myTotal; i++) {
147
148 final PrometheusSheetRow myRow = myView.getRowByIndex(i);
149
150
151 processAccount(myView, myRow);
152
153
154 theReport.setNextStep();
155 }
156
157
158 resolveAccountLists();
159
160
161 } catch (TethysUIThreadCancelException e) {
162 throw e;
163 } catch (OceanusException e) {
164 throw new MoneyWiseIOException("Failed to Load " + SHEET_AREA, e);
165 }
166 }
167
168
169
170
171
172
173
174
175 private void processPayee(final PrometheusSheetView pView,
176 final PrometheusSheetRow pRow) throws OceanusException {
177
178 int iAdjust = -1;
179 ++iAdjust;
180 ++iAdjust;
181
182
183 final String myClass = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
184
185
186 if (myClass.equals(MoneyWiseBasicDataType.PAYEE.toString())) {
187
188 processStdPayee(pView, pRow);
189
190
191 } else if (myClass.equals(MoneyWiseBasicDataType.CASH.toString())) {
192
193 processCashPayee(pView, pRow);
194 }
195 }
196
197
198
199
200
201
202
203
204 private void processAccount(final PrometheusSheetView pView,
205 final PrometheusSheetRow pRow) throws OceanusException {
206
207 int iAdjust = -1;
208 ++iAdjust;
209 ++iAdjust;
210
211
212 final String myClass = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
213
214
215 if (myClass.equals(MoneyWiseBasicDataType.DEPOSIT.toString())) {
216
217 processDeposit(pView, pRow);
218
219
220 } else if (myClass.equals(MoneyWiseBasicDataType.CASH.toString())) {
221
222 processCash(pView, pRow);
223
224
225 } else if (myClass.equals(MoneyWiseBasicDataType.LOAN.toString())) {
226
227 processLoan(pView, pRow);
228
229
230 } else if (myClass.equals(MoneyWiseBasicDataType.SECURITY.toString())) {
231
232 processSecurity(pView, pRow);
233
234
235 } else if (myClass.equals(MoneyWiseBasicDataType.PORTFOLIO.toString())) {
236
237 processPortfolio(pView, pRow);
238
239
240 } else if (!myClass.equals(MoneyWiseBasicDataType.PAYEE.toString())) {
241 throw new MoneyWiseLogicException("Unexpected Account Class " + myClass);
242 }
243 }
244
245
246
247
248
249
250 private void resolvePayeeLists() throws OceanusException {
251
252 final MoneyWisePayeeList myPayeeList = theData.getPayees();
253 final MoneyWisePayeeInfoList myPayeeInfoList = theData.getPayeeInfo();
254 myPayeeList.postProcessOnLoad();
255 myPayeeInfoList.postProcessOnLoad();
256 }
257
258
259
260
261
262
263 private void resolveAccountLists() throws OceanusException {
264
265 final MoneyWiseSecurityList mySecurityList = theData.getSecurities();
266 final MoneyWiseSecurityInfoList mySecInfoList = theData.getSecurityInfo();
267 mySecurityList.postProcessOnLoad();
268 mySecInfoList.postProcessOnLoad();
269
270
271 final MoneyWiseDepositList myDepositList = theData.getDeposits();
272 final MoneyWiseDepositInfoList myDepInfoList = theData.getDepositInfo();
273 myDepositList.postProcessOnLoad();
274 myDepInfoList.postProcessOnLoad();
275
276
277 final MoneyWiseCashList myCashList = theData.getCash();
278 final MoneyWiseCashInfoList myCashInfoList = theData.getCashInfo();
279 myCashList.postProcessOnLoad();
280 myCashInfoList.postProcessOnLoad();
281
282
283 final MoneyWiseLoanList myLoanList = theData.getLoans();
284 final MoneyWiseLoanInfoList myLoanInfoList = theData.getLoanInfo();
285 myLoanList.postProcessOnLoad();
286 myLoanInfoList.postProcessOnLoad();
287
288
289 final MoneyWisePortfolioList myPortfolioList = theData.getPortfolios();
290 final MoneyWisePortfolioInfoList myPortInfoList = theData.getPortfolioInfo();
291 myPortfolioList.postProcessOnLoad();
292 myPortInfoList.postProcessOnLoad();
293
294
295 theCache.resolveSecurityHoldings(theData);
296 }
297
298
299
300
301
302
303
304
305 private void processStdPayee(final PrometheusSheetView pView,
306 final PrometheusSheetRow pRow) throws OceanusException {
307
308 int iAdjust = -1;
309 final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
310 final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
311
312
313 ++iAdjust;
314
315
316 final PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
317 Boolean isClosed = Boolean.FALSE;
318 if (myCell != null) {
319 isClosed = myCell.getBoolean();
320 }
321
322
323 final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWisePayee.OBJECT_NAME);
324 myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myName);
325 myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, myType);
326 myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, isClosed);
327
328
329 final MoneyWisePayeeList myList = theData.getPayees();
330 final MoneyWisePayee myPayee = myList.addValuesItem(myValues);
331
332
333 theCache.declareAsset(myPayee);
334 }
335
336
337
338
339
340
341
342
343 private void processCashPayee(final PrometheusSheetView pView,
344 final PrometheusSheetRow pRow) throws OceanusException {
345
346 int iAdjust = -1;
347 final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
348
349
350 ++iAdjust;
351 ++iAdjust;
352
353
354 PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
355 Boolean isClosed = Boolean.FALSE;
356 if (myCell != null) {
357 isClosed = myCell.getBoolean();
358 }
359
360
361
362
363
364 ++iAdjust;
365 ++iAdjust;
366 ++iAdjust;
367 ++iAdjust;
368 ++iAdjust;
369 ++iAdjust;
370 ++iAdjust;
371 ++iAdjust;
372
373
374 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
375 if (myCell != null) {
376 final String myAutoPayee = myName + "Expense";
377
378
379 final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWisePayee.OBJECT_NAME);
380 myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myAutoPayee);
381 myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, MoneyWisePayeeClass.PAYEE.toString());
382 myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, isClosed);
383
384
385 final MoneyWisePayeeList myPayeeList = theData.getPayees();
386 myPayeeList.addValuesItem(myValues);
387 }
388 }
389
390
391
392
393
394
395
396
397 private void processCash(final PrometheusSheetView pView,
398 final PrometheusSheetRow pRow) throws OceanusException {
399
400 int iAdjust = -1;
401 final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
402 final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
403
404
405 ++iAdjust;
406
407
408 PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
409 Boolean isClosed = Boolean.FALSE;
410 if (myCell != null) {
411 isClosed = myCell.getBoolean();
412 }
413
414
415 ++iAdjust;
416 ++iAdjust;
417 ++iAdjust;
418 ++iAdjust;
419
420
421 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
422 String myBalance = null;
423 if (myCell != null) {
424 myBalance = myCell.getString();
425 }
426
427
428 ++iAdjust;
429 ++iAdjust;
430
431
432 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
433 MoneyWiseCurrency myCurrency = theData.getReportingCurrency();
434 if (myCell != null) {
435 final String myCurrName = myCell.getString();
436 myCurrency = theData.getAccountCurrencies().findItemByName(myCurrName);
437 }
438
439
440 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
441 String myAutoExpense = null;
442 String myAutoPayee = null;
443 if (myCell != null) {
444 myAutoExpense = myCell.getString();
445 myAutoPayee = myName + "Expense";
446 }
447
448
449 final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWiseCash.OBJECT_NAME);
450 myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myName);
451 myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, myType);
452 myValues.addValue(MoneyWiseStaticDataType.CURRENCY, myCurrency);
453 myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, isClosed);
454
455
456 final MoneyWiseCashList myList = theData.getCash();
457 final MoneyWiseCash myCash = myList.addValuesItem(myValues);
458
459
460 final MoneyWiseCashInfoList myInfoList = theData.getCashInfo();
461 myInfoList.addInfoItem(null, myCash, MoneyWiseAccountInfoClass.AUTOEXPENSE, myAutoExpense);
462 myInfoList.addInfoItem(null, myCash, MoneyWiseAccountInfoClass.AUTOPAYEE, myAutoPayee);
463 myInfoList.addInfoItem(null, myCash, MoneyWiseAccountInfoClass.OPENINGBALANCE, myBalance);
464
465
466 theCache.declareAsset(myCash);
467 }
468
469
470
471
472
473
474
475
476 private void processDeposit(final PrometheusSheetView pView,
477 final PrometheusSheetRow pRow) throws OceanusException {
478
479 int iAdjust = -1;
480 final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
481 final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
482
483
484 ++iAdjust;
485
486
487 PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
488 Boolean isClosed = Boolean.FALSE;
489 if (myCell != null) {
490 isClosed = myCell.getBoolean();
491 }
492
493
494 final String myParent = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
495
496
497 ++iAdjust;
498 ++iAdjust;
499
500
501 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
502 OceanusDate myMaturity = null;
503 if (myCell != null) {
504 myMaturity = myCell.getDate();
505 }
506
507
508 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
509 String myBalance = null;
510 if (myCell != null) {
511 myBalance = myCell.getString();
512 }
513
514
515 ++iAdjust;
516 ++iAdjust;
517
518
519 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
520 MoneyWiseCurrency myCurrency = theData.getReportingCurrency();
521 if (myCell != null) {
522 final String myCurrName = myCell.getString();
523 myCurrency = theData.getAccountCurrencies().findItemByName(myCurrName);
524 }
525
526
527 final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWiseDeposit.OBJECT_NAME);
528 myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myName);
529 myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, myType);
530 myValues.addValue(MoneyWiseStaticDataType.CURRENCY, myCurrency);
531 myValues.addValue(MoneyWiseBasicResource.ASSET_PARENT, myParent);
532 myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, isClosed);
533
534
535 final MoneyWiseDepositList myList = theData.getDeposits();
536 final MoneyWiseDeposit myDeposit = myList.addValuesItem(myValues);
537
538
539 final MoneyWiseDepositInfoList myInfoList = theData.getDepositInfo();
540 myInfoList.addInfoItem(null, myDeposit, MoneyWiseAccountInfoClass.MATURITY, myMaturity);
541 myInfoList.addInfoItem(null, myDeposit, MoneyWiseAccountInfoClass.OPENINGBALANCE, myBalance);
542
543
544 theCache.declareAsset(myDeposit);
545 }
546
547
548
549
550
551
552
553
554 private void processLoan(final PrometheusSheetView pView,
555 final PrometheusSheetRow pRow) throws OceanusException {
556
557 int iAdjust = -1;
558 final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
559 final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
560
561
562 ++iAdjust;
563
564
565 PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
566 Boolean isClosed = Boolean.FALSE;
567 if (myCell != null) {
568 isClosed = myCell.getBoolean();
569 }
570
571
572 final String myParent = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
573
574
575 ++iAdjust;
576 ++iAdjust;
577 ++iAdjust;
578 ++iAdjust;
579 ++iAdjust;
580 ++iAdjust;
581
582
583 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
584 MoneyWiseCurrency myCurrency = theData.getReportingCurrency();
585 if (myCell != null) {
586 final String myCurrName = myCell.getString();
587 myCurrency = theData.getAccountCurrencies().findItemByName(myCurrName);
588 }
589
590
591 final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWiseLoan.OBJECT_NAME);
592 myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myName);
593 myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, myType);
594 myValues.addValue(MoneyWiseStaticDataType.CURRENCY, myCurrency);
595 myValues.addValue(MoneyWiseBasicResource.ASSET_PARENT, myParent);
596 myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, isClosed);
597
598
599 final MoneyWiseLoanList myList = theData.getLoans();
600 final MoneyWiseLoan myLoan = myList.addValuesItem(myValues);
601
602
603 theCache.declareAsset(myLoan);
604 }
605
606
607
608
609
610
611
612
613 private void processPortfolio(final PrometheusSheetView pView,
614 final PrometheusSheetRow pRow) throws OceanusException {
615
616 int iAdjust = -1;
617 final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
618
619
620 final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
621
622
623 final int iIndex = myType.indexOf(MoneyWiseCategoryBase.STR_SEP);
624 if (iIndex == -1) {
625 throw new MoneyWiseLogicException("Unexpected Portfolio Class " + myType);
626 }
627
628
629 final String myPortType = myType.substring(iIndex + 1);
630
631
632 ++iAdjust;
633
634
635 PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
636 Boolean isClosed = Boolean.FALSE;
637 if (myCell != null) {
638 isClosed = myCell.getBoolean();
639 }
640
641
642 final String myParent = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
643
644
645 ++iAdjust;
646 ++iAdjust;
647 ++iAdjust;
648 ++iAdjust;
649 ++iAdjust;
650 ++iAdjust;
651
652
653 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
654 MoneyWiseCurrency myCurrency = theData.getReportingCurrency();
655 if (myCell != null) {
656 final String myCurrName = myCell.getString();
657 myCurrency = theData.getAccountCurrencies().findItemByName(myCurrName);
658 }
659
660
661 final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWisePortfolio.OBJECT_NAME);
662 myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myName);
663 myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, myPortType);
664 myValues.addValue(MoneyWiseBasicResource.ASSET_PARENT, myParent);
665 myValues.addValue(MoneyWiseStaticDataType.CURRENCY, myCurrency);
666 myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, isClosed);
667
668
669 final MoneyWisePortfolioList myList = theData.getPortfolios();
670 final MoneyWisePortfolio myPortfolio = myList.addValuesItem(myValues);
671
672
673 theCache.declareAsset(myPortfolio);
674 }
675
676
677
678
679
680
681
682
683 private void processSecurity(final PrometheusSheetView pView,
684 final PrometheusSheetRow pRow) throws OceanusException {
685
686 int iAdjust = -1;
687 final String myName = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
688 final String myType = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
689
690
691 final int iIndex = myType.indexOf(MoneyWiseCategoryBase.STR_SEP);
692 if (iIndex == -1) {
693 throw new MoneyWiseLogicException("Unexpected Security Class " + myType);
694 }
695
696
697 final String mySecType = myType.substring(iIndex + 1);
698
699
700 ++iAdjust;
701
702
703 PrometheusSheetCell myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
704 Boolean isClosed = Boolean.FALSE;
705 if (myCell != null) {
706 isClosed = myCell.getBoolean();
707 }
708
709
710 final MoneyWiseSecurityList myList = theData.getSecurities();
711
712
713 final String myParent = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
714
715
716 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
717 String myAlias = null;
718 if (myCell != null) {
719 myAlias = myCell.getString();
720 }
721
722
723 final String myPortfolio = pView.getRowCellByIndex(pRow, ++iAdjust).getString();
724
725
726 if (myAlias != null) {
727
728 theCache.declareAliasHolding(myName, myAlias, myPortfolio);
729
730
731 return;
732 }
733
734
735 ++iAdjust;
736 ++iAdjust;
737
738
739 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
740 String mySymbol = null;
741 if (myCell != null) {
742 mySymbol = myCell.getString();
743 }
744
745
746 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
747 String myRegion = null;
748 if (myCell != null) {
749 myRegion = myCell.getString();
750 }
751
752
753 myCell = pView.getRowCellByIndex(pRow, ++iAdjust);
754 MoneyWiseCurrency myCurrency = theData.getReportingCurrency();
755 if (myCell != null) {
756 final String myCurrName = myCell.getString();
757 myCurrency = theData.getAccountCurrencies().findItemByName(myCurrName);
758 }
759
760
761 final PrometheusDataValues myValues = new PrometheusDataValues(MoneyWiseSecurity.OBJECT_NAME);
762 myValues.addValue(PrometheusDataResource.DATAITEM_FIELD_NAME, myName);
763 myValues.addValue(MoneyWiseBasicResource.CATEGORY_NAME, mySecType);
764 myValues.addValue(MoneyWiseStaticDataType.CURRENCY, myCurrency);
765 myValues.addValue(MoneyWiseBasicResource.ASSET_PARENT, myParent);
766 myValues.addValue(MoneyWiseBasicResource.ASSET_CLOSED, isClosed);
767
768
769 final MoneyWiseSecurity mySecurity = myList.addValuesItem(myValues);
770
771
772 final MoneyWiseSecurityInfoList myInfoList = theData.getSecurityInfo();
773 myInfoList.addInfoItem(null, mySecurity, MoneyWiseAccountInfoClass.SYMBOL, mySymbol);
774 myInfoList.addInfoItem(null, mySecurity, MoneyWiseAccountInfoClass.REGION, myRegion);
775
776
777 theCache.declareSecurityHolding(mySecurity, myPortfolio);
778 }
779 }