Reads ComboBox with Template information.<p>

@return string of chosen template path.
777165
private String getFieldTemplate() {

        if (m_fieldKeepTemplate.getValue().booleanValue()) {
            return ""; //No template property will be changed
        }
        Object value = m_simpleFieldTemplate.getValue();
        if (value != null) {
            return (String)value;
        }
        return "";
    }
1120770
private List getTemplates() {

        ArrayList ret = new ArrayList();
        TreeMap templates = null;

        try {
            templates = CmsNewResourceXmlPage.getTemplates(getJsp().getCmsObject(), null);

            // loop through all templates and build the entries
            Iterator i = templates.entrySet().iterator();
            while (i.hasNext()) {
                Map.Entry entry = (Map.Entry)i.next();
                String title = (String)entry.getKey();
                String path = (String)entry.getValue();

                ret.add(new CmsSelectWidgetOption(path, false, title));
            }
        } catch (CmsException e) {
            // not necessary
        }

        return ret;
    }
986447
private CmsComboWidget createTemplateSelect() {

        List<CmsSelectWidgetOption> options = new ArrayList<CmsSelectWidgetOption>();
        try {
            I_CmsResourceType templateType = OpenCms.getResourceManager().getResourceType(
                CmsResourceTypeJsp.getContainerPageTemplateTypeName());
            List<CmsResource> templates = getCms().readResources(
                "/system/",
                CmsResourceFilter.DEFAULT.addRequireType(templateType));
            for (CmsResource res : templates) {
                options.add(new CmsSelectWidgetOption(res.getRootPath()));
            }

        } catch (CmsException e) {
            LOG.error(e.getMessage(), e);
        }
        return new CmsComboWidget(options);
    }
69742
protected InputStream getTemplateAsStream(TestContext context) {
        Resource resource;
        if (templateResource != null) {
            resource = templateResource;
        } else {
            resource = FileUtils.getFileResource(template, context);
        }

        String templateYml;
        try {
            templateYml = context.replaceDynamicContentInString(FileUtils.readToString(resource));
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to read template resource", e);
        }
        return new ByteArrayInputStream(templateYml.getBytes());
    }
965807
public static ComboBox getOUComboBox(CmsObject cms, String baseOu, Log log, boolean includeWebOU) {

        ComboBox combo = null;
        try {
            IndexedContainer container = new IndexedContainer();
            container.addContainerProperty("desc", String.class, "");
            for (String ou : CmsOUHandler.getManagableOUs(cms)) {
                if (includeWebOU | !OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, ou).hasFlagWebuser()) {
                    Item item = container.addItem(ou);
                    if (ou == "") {
                        CmsOrganizationalUnit root = OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, "");
                        item.getItemProperty("desc").setValue(root.getDisplayName(A_CmsUI.get().getLocale()));
                    } else {
                        item.getItemProperty("desc").setValue(
                            OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, ou).getDisplayName(
                                A_CmsUI.get().getLocale()));
                    }
                }
            }
            combo = new ComboBox(null, container);
            combo.setTextInputAllowed(true);
            combo.setNullSelectionAllowed(false);
            combo.setWidth("379px");
            combo.setInputPrompt(
                Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_CLICK_TO_EDIT_0));
            combo.setItemCaptionPropertyId("desc");

            combo.setFilteringMode(FilteringMode.CONTAINS);

            combo.select(baseOu);

        } catch (CmsException e) {
            if (log != null) {
                log.error("Unable to read OU", e);
            }
        }
        return combo;
    }
144499
public List getTemplateConfigOptions() {

        List result = new ArrayList();
        result.add(new CmsSelectWidgetOption("", true, key(Messages.GUI_CHANGEELEMENTLOCALE_DIALOG_TEMPLATE_ALL_0)));

        TreeMap templates = null;
        try {
            // get all available templates
            templates = CmsNewResourceXmlPage.getTemplates(getCms(), null);
        } catch (CmsException e) {
            // can usually be ignored
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
        }
        if (templates != null) {
            // templates found, create option and value lists
            Iterator i = templates.entrySet().iterator();
            while (i.hasNext()) {
                Map.Entry entry = (Map.Entry)i.next();
                String key = (String)entry.getKey();
                String path = (String)entry.getValue();
                result.add(new CmsSelectWidgetOption(path, false, key));
            }
        }
        return result;
    }
1210968
public function getTemplatePath()
    {
        if ($templateData = $this->component->getData('_template')) {
            return $templateData;
        }

        return $this->variation->getConfiguration(
            'components',
            $this->component->getComponentType()->getName(),
            'path',
            $this->component->getComponentType()->getTemplatePath()
        );
    }
148191
public ImmutableList<String> getTemplateTypeNames() {
    if (info == null || info.templateTypeNames == null) {
      return ImmutableList.of();
    }
    return ImmutableList.copyOf(info.templateTypeNames);
  }
546883
public String buildSelectTemplates(String attributes) {

        List options = new ArrayList();
        List values = new ArrayList();
        TreeMap templates = null;
        int selectedIndex = -1;
        try {
            // get all available templates
            templates = CmsNewResourceXmlPage.getTemplates(getCms(), null);
        } catch (CmsException e) {
            // can usually be ignored
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
        }
        if (templates == null) {
            // no templates found, return empty String
            return "";
        } else {
            // templates found, create option and value lists
            CmsMessages messages = Messages.get().getBundle(getLocale());
            options.add(messages.key(Messages.GUI_PLEASE_SELECT_0));
            values.add("");
            options.add(messages.key(Messages.GUI_BUTTON_ALL_0));
            values.add(ALL);
            if (ALL.equals(getParamTemplate())) {
                selectedIndex = 1;
            }
            Iterator i = templates.entrySet().iterator();
            int counter = 2;
            while (i.hasNext()) {
                Map.Entry entry = (Map.Entry)i.next();
                String key = (String)entry.getKey();
                String path = (String)entry.getValue();
                if (path.equals(getParamTemplate())) {
                    selectedIndex = counter;
                }
                options.add(key);
                values.add(path);
                counter++;
            }
        }
        return buildSelect(attributes, options, values, selectedIndex, false);
    }
199876
function readTemplate() {
    return fs.readFileSync(path.resolve.apply(null, [__dirname, settings.paths.templates, ...arguments]), 'utf8');
}
302278
public Template getTemplate(String fileName) {
		if (fileName.charAt(0) != '/') {
			char[] arr = new char[fileName.length() + 1];
			fileName.getChars(0, fileName.length(), arr, 1);
			arr[0] = '/';
			fileName = new String(arr);
		}
		
		Template template = templateCache.get(fileName);
		if (template == null) {
			template = buildTemplateBySourceFactory(fileName);
			templateCache.put(fileName, template);
		} else if (devMode) {
			if (template.isModified()) {
				template = buildTemplateBySourceFactory(fileName);
				templateCache.put(fileName, template);
			}
		}
		return template;
	}
333217
public static String getTemplateMapperConfig(ServletRequest request) {

        String result = null;
        CmsTemplateContext templateContext = (CmsTemplateContext)request.getAttribute(
            CmsTemplateContextManager.ATTR_TEMPLATE_CONTEXT);
        if (templateContext != null) {
            I_CmsTemplateContextProvider provider = templateContext.getProvider();
            if (provider instanceof I_CmsTemplateMappingContextProvider) {
                result = ((I_CmsTemplateMappingContextProvider)provider).getMappingConfigurationPath(
                    templateContext.getKey());
            }
        }
        return result;
    }
588744
private NamedTemplate readTemplateWithName(CmsObject cms, String path) {

        try {
            CmsResource resource = cms.readResource(path, CmsResourceFilter.IGNORE_EXPIRATION);
            String name = getTemplateName(cms, resource);
            return new NamedTemplate(resource, name);
        } catch (Exception e) {
            return null;
        }
    }
384584
@Override
	public String getText()
	{
		if(this.target == null)
			return null;
		
			try
			{
				
				//Check if load of template needed
				if((this.template == null || this.template.length() == 0) && this.templateName != null)
				{
					try
					{
						this.template = Text.loadTemplate(templateName);
					}
					catch(Exception e)
					{
						throw new SetupException("Cannot load template:"+templateName,e);
					}
				}
				
				Map<Object,Object> faultMap = JavaBean.toMap(this.target);
				
				
				if(this.argumentTextDecorator != null)
				{
					this.argumentTextDecorator.setTarget(this.target.getArgument());
					
					faultMap.put(this.argumentKeyName, this.argumentTextDecorator.getText());
				}
				
				return Text.format(this.template, faultMap);
			}
			catch (FormatException e)
			{
				throw new FormatFaultException(this.template, e);
			}

		
	}
868775
public Template getParseTree() {
        getTemplateClass();
        if (findExecuteMethod() == null)
            throw new IllegalArgumentException("Cannot locate compiled template entry point.");
        reflectParameters();

        mTree = new Template(mCallerInfo, new Name(mCallerInfo, getName()),
            mParameters, mSubParam, null, null);
        mTree.setReturnType(new Type(mExecuteMethod.getReturnType(),
                                     mExecuteMethod.getGenericReturnType()));

        return mTree;
    }
798860
private JComboBox<String> createStatusComboBox() {
        JComboBox<String> comboBox = new JComboBox<>();
        comboBox.addItem(Constant.messages.getString("ascan.policy.table.quality.all"));
        View view = View.getSingleton();
        comboBox.addItem(view.getStatusUI(AddOn.Status.release).toString());
        comboBox.addItem(view.getStatusUI(AddOn.Status.beta).toString());
        comboBox.addItem(view.getStatusUI(AddOn.Status.alpha).toString());
        return comboBox;
    }
33058
public String getConfigurationPropertyPath() {

        if (m_params.containsKey(PARAM_CONFIGURATION)) {
            return m_params.get(PARAM_CONFIGURATION);
        } else {
            return OpenCms.getSystemInfo().getConfigFilePath(m_cms, "templatecontexts.json");
        }
    }