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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Create Datashape with Eclipse Extension

Sathishkumar_C
17-Peridot

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.

ACCEPTED SOLUTION

Accepted Solutions
vxavier
14-Alexandrite
(To:Sathishkumar_C)

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.

View solution in original post

6 REPLIES 6

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

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.

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");
		}
vxavier
14-Alexandrite
(To:supandey)

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

supandey
19-Tanzanite
(To:vxavier)

@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

vxavier
14-Alexandrite
(To:Sathishkumar_C)

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.

Announcements


Top Tags