Parse the template descriptor to extract template URL
@param viewName
@return	URL of the template
171061
static protected String extractTemplateUrl(String viewName){
		int i1 = -1;
		int i2 = -1;
		int i3 = -1;
		int i4 = -1;
		i1 = viewName.indexOf(LEFT_BRACKET);
		if (i1 != -1){
			i2 = viewName.indexOf(LEFT_BRACKET, i1+1);
		}
		i4 = viewName.lastIndexOf(RIGHT_BRACKET);
		if (i4 != -1){
			i3 = viewName.lastIndexOf(RIGHT_BRACKET, i4-1);
		}
		
		if ((i1 == -1 || i4 == -1)		// no starting or ending 
				|| (i2*i3 < 0) 			// not matching
				|| (i2 > i3)){			// not matching
			return viewName;		// no valid template descriptor
		}
		
		//////// the format is guaranteed to be valid after this point
		
		String url = null;
		
		if (i2 != -1){
			url = viewName.substring(i1+1, i2);		// prefix{url{...}}postfix
		}else{
			url = viewName.substring(i1+1, i4);		// prefix{url}postfix
		}

		if (i1 > 0){
			String prefix = viewName.substring(0, i1);
			url = prefix + url;
		}
		if (i4 < viewName.length() - 1){
			String postfix = viewName.substring(i4 + 1);
			url = url + postfix;
		}
		
		return url;
	}
997886
public static dnsview get(nitro_service service, String viewname) throws Exception{
		dnsview obj = new dnsview();
		obj.set_viewname(viewname);
		dnsview response = (dnsview) obj.get_resource(service);
		return response;
	}
986190
@Override
    public String getTemplateURI(String controllerName, String templateName) {
        TupleStringKey key = new TupleStringKey(controllerName, templateName);
        String uri = templateURICache.get(key);
        if (uri == null) {
            uri = super.getTemplateURI(controllerName, templateName);
            String prevuri=templateURICache.putIfAbsent(key, uri);
            if (prevuri != null) {
                return prevuri;
            }
        }
        return uri;
    }
1333628
function view(template, options = {}) {

	if(!template) {
		throw new Exception('Please pass a template!');
	}

	return Class => {

		let renderedFlag = !(options.renderedFlag === false);

		initCoreMap(storage, Class);
		initViewMap(storage, Class);

		let map = storage.get(Class);

		/**
		 * Its required when we use @style multiple times!
		 * Only once registration!
		 */
		if(map.get('@view').get('callbacksDefined')){
			return;
		}

		map.get('@callbacks').get('created').push((domNode, createVars = {}) => {

			// get and merge dom view var attributes
			let domViewAttributes = extractDomProperties(
				domNode, /^@view\.bind\.(\S+)$/i, true
			);

			// get the restof regular attributes
			let regularDomAttributes = extractDomProperties(domNode);

			let viewBinds = {};
			let entries = map.get('@view').get('bind');
			entries.forEach(([key, value]) => viewBinds[key] = value);

			let viewVars = Object.assign({},
				viewBinds,
				domViewAttributes,
				createVars,
				regularDomAttributes
			);

			// initialize view
			let $view = new View({
				prerenderer: HandlebarsRuntime.template,
				rootNode: domNode,
				vars: viewVars,
				template: template,
			});

			view.helper.registerSetGet(
				domNode,
				Object.assign({}, viewBinds, domViewAttributes)
			);

			// render view
			$view.render(null, {
				renderedFlag: renderedFlag,
			});

			domNode.$view = $view;
		});

		map.get('@callbacks').get('attached').push(domNode => {

			if(domNode.$view.initialized()){
				return;
			}

			/**
			 * Using the same instance is 30% faster in
			 * (Chrome, Opera) and no difference in Firefox
			 * @see: https://jsperf.com/new-class-vs-singleton
			 */
			domNode.$view.reinit({
				rootNode: domNode,
				prerenderer: HandlebarsRuntime.template,
			});
		});

		map.get('@callbacks').get('detached').push(domNode => {
			domNode.$view.destroy();
		});

		map.get('@view').set('callbacksDefined', true);
	}
}
1101748
private ThymeLeafTemplateImplementation getTemplateByURL(URL url) {
        Collection<ThymeLeafTemplateImplementation> list = registrations.keySet();
        for (ThymeLeafTemplateImplementation template : list) {
            if (template.getURL().sameFile(url)) {
                return template;
            }
        }
        return null;
    }
38713
private void parseTemplate() {
    /*
     * query string and path literals have different reserved characters and different encoding
     * requirements. to ensure compliance with RFC 6570, we'll need to encode query literals
     * differently from path literals. let's look at the template to see if it contains a query
     * string and if so, keep track of where it starts.
     */
    Matcher queryStringMatcher = QUERY_STRING_PATTERN.matcher(this.template);
    if (queryStringMatcher.find()) {
      /*
       * the template contains a query string, split the template into two parts, the path and query
       */
      String path = this.template.substring(0, queryStringMatcher.start());
      String query = this.template.substring(queryStringMatcher.end() - 1);
      this.parseFragment(path, false);
      this.parseFragment(query, true);
    } else {
      /* parse the entire template */
      this.parseFragment(this.template, false);
    }
  }
105748
def findViewType(self, viewTypeName):
        
        for viewType in self._viewTypes:
            if ( viewType.viewTypeName() == viewTypeName ):
                return viewType
        return None
243822
private String normalize(final String viewName) {
		String normalized = viewName;

		if (normalized.startsWith("/")) {
			normalized = normalized.substring(0);
		}

		if (normalized.endsWith("/")) {
			normalized = normalized.substring(0, normalized.length() - 1);
		}

		return normalized.replaceAll("/", ".");
	}
105312
function getProcessedUrl(data, resourceName) {
                    // get the raw URL out of the resource name and check if it is valid
                    var rawUrl = checkUrl(data[config.linksKey][resourceName][config.linksHrefKey], resourceName,
                        config.linksHrefKey);

                    // extract the template parameters of the raw URL
                    return extractUrl(rawUrl, data[config.linksKey][resourceName].templated);
                }
405644
public function viewUrl($viewName, array $parameters = array())
    {
        $path = sprintf("?view=%s", $viewName);

        return $this->absoluteUrl($path, $parameters);
    }
717724
@NonNull
  public static CreateMaterializedViewStart createMaterializedView(@NonNull String viewName) {
    return createMaterializedView(CqlIdentifier.fromCql(viewName));
  }
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;
	}
956249
public static Template parse(String input) {
        return new Template(input, Tag.getTags(), Filter.getFilters());
    }
60306
@Override
	public void putViewName(String url, String viewName) {
		viewNameMappingInfoStorage.put(url, viewName);
	}
605875
public Response getTemplate(String id) throws RequestException, LocalOperationException {
        Request request = new Request(this);
        return new Response(request.get("/templates/" + id));
    }
1019761
private function getViewUrl(View $view)
    {
        if (!method_exists($view, 'getUrl')) {
            return $this->generateUrl('victoire_business_template_show', ['id' => $view->getId()]);
        }

        /** @var ViewReference $viewReference */
        $viewReference = $this->container->get('victoire_view_reference.repository')
            ->getOneReferenceByParameters(['viewId' => $view->getId()]);

        $view->setReference($viewReference);

        return $this->generateUrl('victoire_core_page_show', ['url' => $viewReference->getUrl()]);
    }
525676
public static dnsview_binding get(nitro_service service, String viewname) throws Exception{
		dnsview_binding obj = new dnsview_binding();
		obj.set_viewname(viewname);
		dnsview_binding response = (dnsview_binding) obj.get_resource(service);
		return response;
	}