cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Create Datashape with Eclipse Extension

SOLVED
Highlighted
Aquamarine

Create Datashape with Eclipse Extension

Hi All,

I have created an infotable in eclipse extension and try to plot as a chart. I can able to see the data on grid by checking "ShowAllColoumns". But i can,t able to plot as chart.

How can i create a datashape with in eclipse and import into thingworx?

 

Thanks & Regards,

Sathishkumar C.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Create Datashape with Eclipse Extension

I saw in a widget here, and maybe you can try create a folder inside your zip file with the entities. Following the architecture:

 

- MyExtension.zip

  • Entities
    • DataShapes
      • You data shape.xml
  • ui
  • metadata.xml

That is the example of the xml file that defines the data shape that I found:

 

<?xml version="1.0" encoding="UTF-8"?>
<Entities
 build="b140"
 majorVersion="8"
 minorVersion="2"
 modelPersistenceProviderPackage="PostgresPersistenceProviderPackage"
 revision="1"
 schemaVersion="1020"
 universal="">
    <DataShapes>
        <DataShape
         baseDataShape=""
         description=""
         documentationContent=""
         homeMashup=""
         lastModifiedDate="2018-03-20T14:54:13.211+02:00"
         name="GanttChartData"
         projectName=""
         tags="Applications:GanttChart;Applications:Testing">
            <avatar></avatar>
            <DesignTimePermissions>
                <Create></Create>
                <Read></Read>
                <Update></Update>
                <Delete></Delete>
                <Metadata></Metadata>
            </DesignTimePermissions>
            <RunTimePermissions></RunTimePermissions>
            <VisibilityPermissions>
                <Visibility></Visibility>
            </VisibilityPermissions>
            <ConfigurationTables></ConfigurationTables>
            <FieldDefinitions>
                <FieldDefinition
                 baseType="NUMBER"
                 description=""
                 name="duration"
                 ordinal="8"></FieldDefinition>
                <FieldDefinition
                 baseType="DATETIME"
                 description=""
                 name="end"
                 ordinal="4"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="id"
                 ordinal="1"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="name"
                 ordinal="2"></FieldDefinition>
                <FieldDefinition
                 baseType="NUMBER"
                 description=""
                 name="percentage"
                 ordinal="5"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="relationships"
                 ordinal="7"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="resource"
                 ordinal="6"></FieldDefinition>
                <FieldDefinition
                 baseType="DATETIME"
                 description=""
                 name="start"
                 ordinal="3"></FieldDefinition>
            </FieldDefinitions>
        </DataShape>
    </DataShapes>
</Entities>

Hope it works and help.

6 REPLIES 6

Re: Create Datashape with Eclipse Extension

Hi @Sathishkumar_C not sure if you have already tried, is this not working when you create Configuration Table? This creates the datashape fields

11-07-2018 16-54-45.jpg

 

11-07-2018 16-55-15.jpg

Re: Create Datashape with Eclipse Extension

Thanks for your reply.
I don't know how it will work. Anyway I will try this.
Also I have defined datashape as xml in meta.xml file. It was working fine.

Thanks.

Re: Create Datashape with Eclipse Extension

I don't know if this will help, how can I create a thing that is a data shape on eclipse?

Re: Create Datashape with Eclipse Extension

Hi @Sathishkumar_C configuration table option which i mentioned would be if you have like a configuration section in your entity.

 

If you are just looking to create a data shape you can invoke the EntityServices function CreateDataShape()

 

InfoTable myIF = new InfoTable();
FieldDefinition Field1 = new FieldDefinition("Field1", BaseTypes.INTEGER);
EntityServices es = new EntityServices();

String name = "CustomDataShape";
		String description = "Created from Extension";
		TagCollection myTag = null;
		myIF.addField(Field1);

		try {
			es.CreateDataShape(name, description, myTag, myIF);
			_logger.info("Successfully created datashape" + es.getName());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			_logger.error("Failed to create DS");
		}

Re: Create Datashape with Eclipse Extension

@vxavier may be put it as part of a service in extension and then you can invoke this service on the platform to automatically create that DS entity

Re: Create Datashape with Eclipse Extension

I saw in a widget here, and maybe you can try create a folder inside your zip file with the entities. Following the architecture:

 

- MyExtension.zip

  • Entities
    • DataShapes
      • You data shape.xml
  • ui
  • metadata.xml

That is the example of the xml file that defines the data shape that I found:

 

<?xml version="1.0" encoding="UTF-8"?>
<Entities
 build="b140"
 majorVersion="8"
 minorVersion="2"
 modelPersistenceProviderPackage="PostgresPersistenceProviderPackage"
 revision="1"
 schemaVersion="1020"
 universal="">
    <DataShapes>
        <DataShape
         baseDataShape=""
         description=""
         documentationContent=""
         homeMashup=""
         lastModifiedDate="2018-03-20T14:54:13.211+02:00"
         name="GanttChartData"
         projectName=""
         tags="Applications:GanttChart;Applications:Testing">
            <avatar></avatar>
            <DesignTimePermissions>
                <Create></Create>
                <Read></Read>
                <Update></Update>
                <Delete></Delete>
                <Metadata></Metadata>
            </DesignTimePermissions>
            <RunTimePermissions></RunTimePermissions>
            <VisibilityPermissions>
                <Visibility></Visibility>
            </VisibilityPermissions>
            <ConfigurationTables></ConfigurationTables>
            <FieldDefinitions>
                <FieldDefinition
                 baseType="NUMBER"
                 description=""
                 name="duration"
                 ordinal="8"></FieldDefinition>
                <FieldDefinition
                 baseType="DATETIME"
                 description=""
                 name="end"
                 ordinal="4"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="id"
                 ordinal="1"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="name"
                 ordinal="2"></FieldDefinition>
                <FieldDefinition
                 baseType="NUMBER"
                 description=""
                 name="percentage"
                 ordinal="5"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="relationships"
                 ordinal="7"></FieldDefinition>
                <FieldDefinition
                 baseType="STRING"
                 description=""
                 name="resource"
                 ordinal="6"></FieldDefinition>
                <FieldDefinition
                 baseType="DATETIME"
                 description=""
                 name="start"
                 ordinal="3"></FieldDefinition>
            </FieldDefinitions>
        </DataShape>
    </DataShapes>
</Entities>

Hope it works and help.