'Build the zone string in the required format.
:param cfgs:  cfgs map
:param active_cfg: Active cfg string
:param zones: zones map
:param alias: alias map
:param qlps: qlps map
:param ifas: ifas map
:param activate: True will activate config.
:returns: zonestring in the required format
:raises BrocadeZoningHttpException:'

def form_zone_string(self, cfgs, active_cfg, zones, alias, qlps, ifas, activate):

    try:
        zoneString = zone_constant.ZONE_STRING_PREFIX
        saveonly = ('false' if (activate is True) else 'true')
        for cfg in sorted(cfgs.keys()):
            zoneString += ((((zone_constant.CFG_DELIM + cfg) + '    ') + cfgs.get(cfg)) + '    ')
        for zone in sorted(zones.keys()):
            zoneString += ((((zone_constant.ZONE_DELIM + zone) + '    ') + zones.get(zone)) + '    ')
        for al in sorted(alias.keys()):
            zoneString += ((((zone_constant.ALIAS_DELIM + al) + '    ') + alias.get(al)) + '    ')
        for qlp in sorted(qlps.keys()):
            zoneString += ((((zone_constant.QLP_DELIM + qlp) + '    ') + qlps.get(qlp)) + '    ')
        for ifa in sorted(ifas.keys()):
            zoneString += ((((zone_constant.IFA_DELIM + ifa) + '    ') + ifas.get(ifa)) + '    ')
        if ((active_cfg != '') and activate):
            zoneString += ((zone_constant.ACTIVE_CFG_DELIM + active_cfg) + '    null    ')
        zoneString += (zone_constant.ZONE_END_DELIM + saveonly)
    except Exception as e:
        msg = (_('Exception    while    forming    the    zone    string:    %s.') % six.text_type(e))
        LOG.error(msg)
        raise exception.BrocadeZoningHttpException(reason=msg)
    return encodeutils.safe_encode(zoneString)
