public String getViewId()

in jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/config/view/ExtractedViewConfigDefinitionEntry.java [236:293]


    public String getViewId()
    {
        StringBuilder viewId = new StringBuilder(this.basePath);
        if(this.pageName.equals(""))
        {
            String className = getNestedConfigAsPath();
            className = createPageName(className);
            viewId.append(className);
        }
        //nested classes with manually defined page name and shared basePath
        else if(!this.simpleClassNameToPathMapping.isEmpty())
        {
            String className = this.viewDefinitionClass.getName();

            //custom base-name for a config (overrides inherited base-path)
            if ("/".endsWith(this.basePath) && this.simpleClassNameToPathMapping.size() == 1)
            {
                className = "/" + this.simpleClassNameToPathMapping.get(this.viewDefinitionClass.getSimpleName()) + "/";
            }
            else
            {
                className = className.substring(className.lastIndexOf('.') + 1);
                className = convertToPathSyntax(className, this.simpleClassNameToPathMapping);
                className = createPageName(className);
                className = className.substring(0, className.lastIndexOf('/') + 1);
            }
            className += this.pageName;
            viewId.append(className);
        }
        //only a custom name for a nested config
        else if(!this.pageName.equals("") && this.viewDefinitionClass.getName().contains("$"))
        {
            String className = getNestedConfigAsPath();
            viewId.append(className.substring(0, className.lastIndexOf("/") + 1)).append(this.pageName);
        }
        else
        {
            viewId.append(this.pageName);
        }
        viewId.append(".");
        viewId.append(this.extension);
        String result = viewId.toString();

        if(result.startsWith("."))
        {
            if(result.startsWith("./"))
            {
                result = result.substring(1);
            }
            else
            {
                result = ROOT_PATH + result.substring(1);
            }
        }

        result = ensureValidViewIds(result);
        return result;
    }