Page 1 of 1

New views in Essential Cloud

Posted: 18 Jul 2017, 01:37
by tmacfarlane
I have referenced https://www.enterprise-architecture.org ... ew-reports for insight on how to create a new view in Essential Cloud, however I continue to have issues. Can you share the base template code for creating a new view?

My code was:

xmlns:xalan="http://xml.apache.org/xslt"
xmlns:fo-"http://www.w3.org/1999/XSL/Format">
<head>Essential Cloud Custom report Test</head>
<body>
<!-- ADD THE PAGE HEADING -->
<xsl:call-template name="Heading"></xsl:call-template>
<!--ADD THE VISITED PAGES SECTION-->
<xsl:call-template name="Page_History">
<xsl:with-param name="breadcrumbs">
<xsl:value-of select="$pageHistory"/></xsl:with-param>
</xsl:call-template>
<!--page body starts here-->
<xsl:apply-templates select="$currentNode" mode="Page_Body">
<!--PAGE BODY ENDS HERE-->
<xsl:call-template name="Footer"></xsl:call-template>
</body>
</html>

Thanks.

Re: New views in Essential Cloud

Posted: 18 Jul 2017, 08:45
by JohnM
Basic page template is attached. It is a skeleton template for your xsl and it sets you up to start at the root node of the xml.

Re: New views in Essential Cloud

Posted: 20 Feb 2018, 16:57
by TMC
I have had reasonable success reviewing the library of open source views / reports - they work identically on the cloud version, and there are lots of examples from which to find relevant snippets.
Tudor

Re: New views in Essential Cloud

Posted: 20 Jul 2018, 14:43
by KarenM
If I want to use one of the existing views/ reports as a basis for a user view. What is the easiest way for an Essential Cloud user to get the xsl file for an existing report?
Do I have to install the open source standalone version of essential? OR can I download just the viewer xsl library?

thanks

Re: New views in Essential Cloud

Posted: 23 Jul 2018, 13:12
by JohnM
Hi Karen,

You can find them here https://github.com/enterprise-architect ... ial_viewer

Regards

John

Re: New views in Essential Cloud

Posted: 14 Aug 2018, 14:59
by neil.walsh
Just a quick note to say we've moved this project to a new account on GitHub. It's now at

https://github.com/essentialproject/essential_viewer

Apologies for any inconvenience

Neil

Re: New views in Essential Cloud

Posted: 04 Oct 2018, 13:42
by KarenM
Thanks Neil - very helpful

Re: New views in Essential Cloud

Posted: 15 Jan 2024, 08:50
by ellenab
Hello,

Could you please indicate the URL with the tutorial for creating/updating Essential views?

Thank you,
Elena B

Re: New views in Essential Cloud

Posted: 17 Jan 2024, 10:34
by JohnM
Hi Elena,

There is an overview here: https://enterprise-architecture.org/uni ... w-reports/

However, if you have Javascript/HTML skills then let us know and we can create a query to provide a JSON structure you can use, which may be easier for you.

Regards

John

Re: New views in Essential Cloud

Posted: 19 Jan 2024, 08:31
by ellenab
Hello,

Thank you for your input. I would like to explore both options if possible.

Elena B

Re: New views in Essential Cloud

Posted: 02 Jul 2024, 17:47
by JohnM
The JSON format is really up to you. We suggest you work out what you want to show and then structure the JSON to support that.

Here's a template with a console.log of data from one of the Data Set APIs and combines that data with some data from a template. You'll see the promise for the Data Set API is in the $('document').ready(function () { ...})
basic_template_api.xsl.zip
In summary:

If you want to create some JSON to merge into the file loaded then you can create a JSON structure as a template. To do this:

At the top add your variable(s) e.g.

Code: Select all

<xsl:variable name="appsData" select="$utilitiesAllDataSetAPIs[own_slot_value[slot_reference = 'name']/value = 'Core API: Application List']"></xsl:variable>
so create a variable, e.g.

Code: Select all

var myAppJSON=[<xsl:apply-templates select="$myApplicationJSON" mode="appJSON"/>];
create a template, e.g.

Code: Select all

<xsl:template match="node()" mode="appJSON">
		{
		 "id": "<xsl:value-of select="current()/name"/>",
		 "name":"<xsl:call-template name="RenderMultiLangInstanceName">
			<xsl:with-param name="theSubjectInstance" select="current()"/>
			<xsl:with-param name="isRenderAsJSString" select="true()"/>
		</xsl:call-template>",
		"yourSlot1":"",
		"yourSlot2":""
		}<xsl:if test="position()!=last()">,</xsl:if>
</xsl:template>
The myAppJSON variable will hold your JSON. In the code, we use Javascript to merge the JSON from the API with the JSON we have created (using ID)

Hope that helps