mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/mp/MissionProgramMgrImpl.java
private void addTemplates(final GetTemplatesResponseData message, final int systemId)
    {
        //replace or add template collection for the given system id
        final Set<MissionProgramTemplate> templates = new HashSet<MissionProgramTemplate>();
        for (MissionProgramTemplateGen.MissionProgramTemplate protoTemplate : message.getTemplateList())
        {
            final MissionProgramTemplate template;
            try 
            {
                template = (MissionProgramTemplate) m_Converter.convertToJaxb(protoTemplate);
            } 
            catch (final ObjectConverterException exception) 
            {
                m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_WARN, "Syncing Templates Warning", 
                    String.format("A template from controller 0x%08x wasn't able to be processed.", systemId), 
                        exception);
                continue;
            }
            
            templates.add(template);
            
            //load the template to the local store
            try
            {
                m_TemplateProgramManager.loadMissionTemplate(template);
            }
            catch (final PersistenceFailedException exception)
            {
                m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_WARN, "Syncing Templates Info", 
                    String.format("A template from controller 0x%08x wasn't able to be stored locally.", systemId), 
                        exception);
            }
        }
        //add to the list of templates for the specified system
        m_RemoteTemplates.put(systemId, templates);
    }
/**
     * Add a template to the lookup.
     * @param message
     *     the message that contains the mission program templates to add
     * @param systemId
     *     the ID of the system from which the template originated from
     */
Add a template to the lookup.
@param message
the message that contains the mission program templates to add
@param systemId
the ID of the system from which the template originated from
Add a template to the lookup . @param message the message that contains the mission program templates to add @param systemId the ID of the system from which the template originated from
private void addTemplates(final GetTemplatesResponseData message, final int systemId)
    {
        final Set<MissionProgramTemplate> templates = new HashSet<MissionProgramTemplate>();
        for (MissionProgramTemplateGen.MissionProgramTemplate protoTemplate : message.getTemplateList())
        {
            final MissionProgramTemplate template;
            try 
            {
                template = (MissionProgramTemplate) m_Converter.convertToJaxb(protoTemplate);
            } 
            catch (final ObjectConverterException exception) 
            {
                m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_WARN, "Syncing Templates Warning", 
                    String.format("A template from controller 0x%08x wasn't able to be processed.", systemId), 
                        exception);
                continue;
            }
            templates.add(template);
            try
            {
                m_TemplateProgramManager.loadMissionTemplate(template);
            }
            catch (final PersistenceFailedException exception)
            {
                m_GrowlMessageUtil.createLocalFacesMessage(FacesMessage.SEVERITY_WARN, "Syncing Templates Info", 
                    String.format("A template from controller 0x%08x wasn't able to be stored locally.", systemId), 
                        exception);
            }
        }
        m_RemoteTemplates.put(systemId, templates);
    }
private void addTemplates ( final GetTemplatesResponseData message , final int systemId ) { final Set < MissionProgramTemplate > templates = new HashSet < MissionProgramTemplate > ( ) ; for ( MissionProgramTemplateGen . MissionProgramTemplate protoTemplate : message . getTemplateList ( ) ) { final MissionProgramTemplate template ; try { template = ( MissionProgramTemplate ) m_Converter . convertToJaxb ( protoTemplate ) ; } catch ( final ObjectConverterException exception ) { m_GrowlMessageUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_WARN , "Syncing Templates Warning" , String . format ( "A template from controller 0x%08x wasn't able to be processed." , systemId ) , exception ) ; continue ; } templates . add ( template ) ; try { m_TemplateProgramManager . loadMissionTemplate ( template ) ; } catch ( final PersistenceFailedException exception ) { m_GrowlMessageUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_WARN , "Syncing Templates Info" , String . format ( "A template from controller 0x%08x wasn't able to be stored locally." , systemId ) , exception ) ; } } m_RemoteTemplates . put ( systemId , templates ) ; }
Add a template to the lookup.
Add a template to the lookup .
//replace or add template collection for the given system id //load the template to the local store //add to the list of templates for the specified system