Skip to content

Create New Order Tool for CDF Files #444

Description

@R3tes

A new tool is needed to reorder content in CDF files based on predefined sorting criteria. At a minimum, this tool should support alphabetical (A–Z) and numeric sorting (lowest to highest), but additional options should be included too decided by the team. The user should be able to pick which property in the CDF file is used for sorting and whether the sorted file replaces the original or is saved separately. This feature makes it easier to analyze and compare different aspects of the file or verify that content aligns with desired ordering conventions.

Example tool run:

<codebase>
  <element name="ZetaUtility" type="class">
    <properties>
      <property name="Name" type="string" value="ZetaUtility"/>
      <property name="LOC" type="int" value="50"/>
    </properties>
  </element>
  <element name="AlphaHelper" type="class">
    <properties>
      <property name="Name" type="string" value="AlphaHelper"/>
      <property name="LOC" type="int" value="150"/>
    </properties>
  </element>
  <element name="GammaLogic" type="class">
    <properties>
      <property name="Name" type="string" value="GammaLogic"/>
      <property name="LOC" type="int" value="75"/>
    </properties>
  </element>
</codebase>
java -jar OrderCdfTool.jar \
     --input unsorted.xml \
     --property "Name" \
     --sort-type alphabetical \
     --output sortedByName.xml 
<codebase>
  <element name="AlphaHelper" type="class">
    <properties>
      <property name="Name" type="string" value="AlphaHelper"/>
      <property name="LOC" type="int" value="150"/>
    </properties>
  </element>
  <element name="GammaLogic" type="class">
    <properties>
      <property name="Name" type="string" value="GammaLogic"/>
      <property name="LOC" type="int" value="75"/>
    </properties>
  </element>
  <element name="ZetaUtility" type="class">
    <properties>
      <property name="Name" type="string" value="ZetaUtility"/>
      <property name="LOC" type="int" value="50"/>
    </properties>
  </element>
</codebase>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions