mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/mp/MissionImport.java
public void handleImportMission(final FileUploadEvent event) throws IOException
    {   
        final UploadedFile missionFile = event.getFile();
        try
        {
            m_TemplateProgramManager.loadFromStream(missionFile.getInputstream(), false);
            
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_INFO,
                    "Mission template successfully imported!",
                    missionFile.getFileName() + " was successfully imported.");
        }
        catch (final IllegalArgumentException exception)
        {
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, "Mission template already exists!", 
                    String.format("%s. The name of the template will need to be changed before it can be imported.", 
                    exception.getMessage()), exception);
            
        }
        catch (final UnmarshalException | IllegalStateException exception)
        {
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, "Invalid XML file!", "The XML file "
                    + "was unable to be converted to a mission template. Be sure that the mission template follows"
                    + " the schema for mission templates.", exception);
        }
        catch (final PersistenceFailedException exception)
        {
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR,
                    "Mission template was unable to be " 
                    + "stored!", "The mission template being imported was unable to be saved in the local data store.", 
                    exception);
        }
    }
/**
     * Method called to handle importing an XML mission file to the {@link TemplateProgramManager}.
     * 
     * @param event 
     *        event that is thrown with each file being uploaded
     * @throws IOException
     *         If the file being imported is unable to read from.
     */
Method called to handle importing an XML mission file to the  TemplateProgramManager.

@param event
event that is thrown with each file being uploaded
@throws IOException
If the file being imported is unable to read from.
Method called to handle importing an XML mission file to the TemplateProgramManager . @param event event that is thrown with each file being uploaded @throws IOException If the file being imported is unable to read from .
public void handleImportMission(final FileUploadEvent event) throws IOException
    {   
        final UploadedFile missionFile = event.getFile();
        try
        {
            m_TemplateProgramManager.loadFromStream(missionFile.getInputstream(), false);
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_INFO,
                    "Mission template successfully imported!",
                    missionFile.getFileName() + " was successfully imported.");
        }
        catch (final IllegalArgumentException exception)
        {
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, "Mission template already exists!", 
                    String.format("%s. The name of the template will need to be changed before it can be imported.", 
                    exception.getMessage()), exception);
        }
        catch (final UnmarshalException | IllegalStateException exception)
        {
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, "Invalid XML file!", "The XML file "
                    + "was unable to be converted to a mission template. Be sure that the mission template follows"
                    + " the schema for mission templates.", exception);
        }
        catch (final PersistenceFailedException exception)
        {
            m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR,
                    "Mission template was unable to be " 
                    + "stored!", "The mission template being imported was unable to be saved in the local data store.", 
                    exception);
        }
    }
public void handleImportMission ( final FileUploadEvent event ) throws IOException { final UploadedFile missionFile = event . getFile ( ) ; try { m_TemplateProgramManager . loadFromStream ( missionFile . getInputstream ( ) , false ) ; m_GrowlMessageUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_INFO , "Mission template successfully imported!" , missionFile . getFileName ( ) + " was successfully imported." ) ; } catch ( final IllegalArgumentException exception ) { m_GrowlMessageUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , "Mission template already exists!" , String . format ( "%s. The name of the template will need to be changed before it can be imported." , exception . getMessage ( ) ) , exception ) ; } catch ( final UnmarshalException | IllegalStateException exception ) { m_GrowlMessageUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , "Invalid XML file!" , "The XML file " + "was unable to be converted to a mission template. Be sure that the mission template follows" + " the schema for mission templates." , exception ) ; } catch ( final PersistenceFailedException exception ) { m_GrowlMessageUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , "Mission template was unable to be " + "stored!" , "The mission template being imported was unable to be saved in the local data store." , exception ) ; } }
Method called to handle importing an XML mission file to the {@link TemplateProgramManager}.
Method called to handle importing an XML mission file to the { @link TemplateProgramManager } .