Returns URL template name of the given type (by key).

@param refGroupName name of a group of templates from the config file.
@param key type of the template
@return template name
515292
public String getURLTemplateRef( String refGroupName, String key )
    {
        String ref = null;

        if ( _servletContext != null )
        {
            URLTemplatesFactory urlTemplatesFactory = URLTemplatesFactory.getURLTemplatesFactory( _servletContext );
            if ( urlTemplatesFactory != null )
            {
                ref = urlTemplatesFactory.getTemplateNameByRef( refGroupName, key );
            }
        }

        return ref;
    }
550738
protected String getCacheKey(String name, Groups groups) {
		if (groups == null) {
			return name;
		}
		StringBuilder tmp = new StringBuilder(64);
		tmp.append(name);
		for (String group : groups.groups()) {
			tmp.append('|');
			tmp.append(group);
		}
		return tmp.toString();
	}
58404
private Template getTemplate(String templateName) throws ParseException {
    try {
      return config.getTemplate(templateName, "UTF-8");
    } catch (ParseException e) {
      throw e;
    } catch (IOException e) {
      logger.error("Couldn't load template '{}',loader is {}", templateName,
          config.getTemplateLoader().getClass());
      throw Throwables.propagate(e);
    }
  }
1047330
public static String getReferencePropertyOriginalName(final String refPropertyName) {
        final int i = refPropertyName.lastIndexOf(REFERENCE_PROPERTY_SUFFIX);
        return i < 0 ? refPropertyName : refPropertyName.substring(0, i);
    }
868357
@Override
    public IEntityGroup find(String key) throws GroupsException {

        if (isTreeRefreshRequired()) {
            refreshTree();
        }

        log.debug("Invoking find() for key:  {}", key);

        // All of our groups (incl. ROOT_GROUP)
        // are indexed in the 'groups' map by key...
        return groupsTree.getGroups().get(key);
    }
1305668
@SuppressWarnings("ReferenceEquality")
  public boolean hasTemplateKey(TemplateType templateKey) {
    // Note: match by identity, not equality
    for (TemplateType entry : templateKeys) {
      if (entry == templateKey) {
        return true;
      }
    }
    return false;
  }
510368
public static String getClassName(String key) {
    int start = 0;
    if (key.startsWith("@") || key.startsWith("members/")) {
      start = key.lastIndexOf('/') + 1;
    }
    return (key.indexOf('<', start) == -1 && key.indexOf('[', start) == -1)
        ? key.substring(start)
        : null;
  }
80375
protected String getKey(final String ref, final String filename, final String extension) {
        return prefix + ref + "/" + filename + "." + extension;
    }
1136769
public function getTemplates($key)
    {
        /** @var EmailTemplateTranslation[] $templates */
        if ($templates = EmailTemplateTranslation::findAll([
            'template_id' => EmailTemplate::getIdByKey($key)
        ])) {
            return Template::buildTemplates($templates);
        }

        return null;
    }
831204
private String getFunctionTemplate(GroupCache gc, FunctionBandElement fbe, boolean previous) throws QueryException {
		
		StringBuilder templateKey = new StringBuilder();
		if (gc == null) {
			// function in Header
			templateKey.append("F_").
    		append(fbe.getFunction()).append("_").
    		append(fbe.getColumn());
			return templateKey.toString();
		}
		
		// function in group header
		String groupColumn = gc.getGroup().getColumn();
		Object groupValue;
		if (previous) {
			if (resultSetRow == 0) {
				groupValue = getResult().nextValue(groupColumn);
			} else {
				groupValue = previousRow[getResult().getColumnIndex(groupColumn)];
			}			
		} else {
			groupValue = getResult().nextValue(groupColumn);			
		}
		// keep the current value of the group
		groupTemplateKeys.put("G"+ gc.getGroup().getName(), "G"+ gc.getGroup().getName() +  "_" +  previousRow[getResult().getColumnIndex(groupColumn)]);
		    	
    	templateKey.append("G").append(gc.getGroup().getName()).append("_F_").
    		append(fbe.getFunction()).append("_").
    		append(fbe.getColumn()).append("_").
    		append(groupValue);    	    
    	
    	int group = Integer.parseInt(gc.getGroup().getName());
    	StringBuilder result = new StringBuilder();
    	for (int i=1; i<group; i++) {    		
    		result.append(groupTemplateKeys.get("G"+ i)).append("_");    		
    	}
    	result.append(templateKey.toString());
    	
    	return result.toString();
	}
671758
private final int fetchNameForNoNamedGroup(int startCode, boolean ref) {
        int src = p;
        value = 0;
        int sign = 1;

        int endCode = nameEndCodePoint(startCode);
        int pnumHead = p;
        int nameEnd = stop;

        String err = null;
        if (!left()) {
            newValueException(EMPTY_GROUP_NAME);
        } else {
            fetch();
            if (c == endCode) newValueException(EMPTY_GROUP_NAME);

            if (enc.isDigit(c)) {
            } else if (c == '-') {
                sign = -1;
                pnumHead = p;
            } else {
                err = INVALID_CHAR_IN_GROUP_NAME;
            }
        }

        while(left()) {
            nameEnd = p;

            fetch();
            if (c == endCode || c == ')') break;
            if (!enc.isDigit(c)) err = INVALID_CHAR_IN_GROUP_NAME;
        }

        if (err == null && c != endCode) {
            err = INVALID_GROUP_NAME;
            nameEnd = stop;
        }

        if (err == null) {
            mark();
            p = pnumHead;
            int backNum = scanUnsignedNumber();
            restore();
            if (backNum < 0) {
                newValueException(TOO_BIG_NUMBER);
            } else if (backNum == 0){
                newValueException(INVALID_GROUP_NAME, src, nameEnd);
            }
            backNum *= sign;

            value = nameEnd;
            return backNum;
        } else {
            newValueException(err, src, nameEnd);
            return 0; // not reached
        }
    }
793557
public String remove(String group, Object key) {
		return this.groupedMap.remove(group, Convert.toStr(key));
	}
406180
public GroupForm getGroupForm(String key) {

        log.debug("Initializing group form for group key " + key);

        // find the current version of this group entity
        IEntityGroup group = GroupService.findGroup(key);

        // update the group form with the existing group's main information
        GroupForm form = new GroupForm();
        form.setKey(key);
        form.setName(group.getName());
        form.setDescription(group.getDescription());
        form.setCreatorId(group.getCreatorID());
        form.setType(groupListHelper.getEntityType(group).toString());

        // add child groups to our group form bean
        for (IGroupMember child : group.getChildren()) {
            JsonEntityBean childBean = groupListHelper.getEntity(child);
            form.addMember(childBean);
        }

        return form;
    }
1209873
public OvhTemplates templateName_GET(String templateName) throws IOException {
		String qPath = "/dedicated/installationTemplate/{templateName}";
		StringBuilder sb = path(qPath, templateName);
		String resp = execN(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhTemplates.class);
	}
1274972
private int fetchNameForNamedGroup(int startCode, boolean ref) {
        int src = p;
        value = 0;

        int isNum = 0;
        int sign = 1;

        int endCode = nameEndCodePoint(startCode);
        int pnumHead = p;
        int nameEnd = stop;

        String err = null;
        if (!left()) {
            newValueException(EMPTY_GROUP_NAME);
        } else {
            fetch();
            if (c == endCode) newValueException(EMPTY_GROUP_NAME);
            if (enc.isDigit(c)) {
                if (ref) {
                    isNum = 1;
                } else {
                    err = INVALID_GROUP_NAME;
                    // isNum = 0;
                }
            } else if (c == '-') {
                if (ref) {
                    isNum = 2;
                    sign = -1;
                    pnumHead = p;
                } else {
                    err = INVALID_GROUP_NAME;
                    // isNum = 0;
                }
            }
        }

        if (err == null) {
            while (left()) {
                nameEnd = p;
                fetch();
                if (c == endCode || c == ')') {
                    if (isNum == 2) {
                        err = INVALID_GROUP_NAME;
                        return fetchNameTeardown(src, endCode, nameEnd, err);
                    }
                    break;
                }

                if (isNum != 0) {
                    if (enc.isDigit(c)) {
                        isNum = 1;
                    } else {
                        if (!enc.isWord(c)) {
                            err = INVALID_CHAR_IN_GROUP_NAME;
                        } else {
                            err = INVALID_GROUP_NAME;
                        }
                        return fetchNameTeardown(src, endCode, nameEnd, err);
                    }
                }
            }

            if (c != endCode) {
                err = INVALID_GROUP_NAME;
                nameEnd = stop;
                return fetchNameErr(src, nameEnd, err);
            }

            int backNum = 0;
            if (isNum != 0) {
                mark();
                p = pnumHead;
                backNum = scanUnsignedNumber();
                restore();
                if (backNum < 0) {
                    newValueException(TOO_BIG_NUMBER);
                } else if (backNum == 0) {
                    newValueException(INVALID_GROUP_NAME, src, nameEnd);
                }
                backNum *= sign;
            }
            value = nameEnd;
            return backNum;
        } else {
            return fetchNameTeardown(src, endCode, nameEnd, err);
        }
    }
1147104
protected static function getTemplatesByKey($key)
    {
        $templates = [];
        $scheme = PhpSms::scheme();
        $config = PhpSms::config();
        foreach (array_keys($scheme) as $name) {
            if (isset($config[$name][$key])) {
                $templates[$name] = $config[$name][$key];
            }
        }

        return $templates;
    }
1057044
public function getSubGroupType($group_name, $ref_name = 'superior')
    {
        $types = $this->getSubs($ref_name);

        return $types->getType($group_name);
    }