/**
* Loads the portfolio into the position master.
*/
@Override
protected void doRun() {
IntegrationToolContext context = getToolContext();
// Create portfolio writer
PortfolioWriter portfolioWriter = constructPortfolioWriter(
getCommandLine().getOptionValue(PORTFOLIO_NAME_OPT),
context.getPortfolioMaster(),
context.getPositionMaster(),
context.getSecurityMaster(),
getCommandLine().hasOption(WRITE_OPT),
getCommandLine().hasOption(OVERWRITE_OPT)
);
// Construct portfolio reader
PortfolioReader portfolioReader = constructPortfolioReader(
getCommandLine().getOptionValue(FILE_NAME_OPT),
context.getSecurityProvider()
);
// Create portfolio copier
ResolvingPortfolioCopier portfolioCopier = new ResolvingPortfolioCopier(
context.getHistoricalTimeSeriesMaster(),
context.getHistoricalTimeSeriesProvider(),
context.getBloombergReferenceDataProvider(),
getOptionValue(TIME_SERIES_DATAPROVIDER_OPT, "CMPL"),
getCommandLine().getOptionValues(TIME_SERIES_DATAFIELD_OPT) == null ?
new String[]{"PX_LAST"} : getCommandLine().getOptionValues(TIME_SERIES_DATAFIELD_OPT)
);