Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copy/paste mistake to have the version of harvest in the documents #38

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 79 additions & 80 deletions src/main/java/gov/nasa/pds/registry/common/meta/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,90 +13,89 @@
*
* @author karpenko
*/
public class Metadata
{
public static final String FLD_ALTERNATE_IDS = "alternate_ids";
public static final String FLD_NODE_NAME = "ops:Harvest_Info/ops:node_name";
public static final String FLD_HARVEST_DATE_TIME = "ops:Harvest_Info/ops:harvest_date_time";
public static final String FLD_HARVEST_VERSION = "ops:Harvest_Info/ops:harvest_version";
public static final String FLD_ARCHIVE_STATUS = "ops:Tracking_Meta/ops:archive_status";


public String lid;
public String strVid; // Original VID from XML
public float vid; // Float for sorting (fining the latest version)
public String lidvid;

public String title;
public String prodClass; // Label's root element, e.g., "Product_Observational"

public FieldMapSet intRefs; // Internal references (preprocessed)
public FieldMapList fields; // Metadata fields

public Set<String> dataFiles; // File names from <File_Area...> tags


/**
* Constructor
*/
public Metadata()
{
intRefs = new FieldMapSet();
fields = new FieldMapList();
}


/**
* Set node name
* @param name node name
*/
public void setNodeName(String name)
{
fields.setValue(FLD_NODE_NAME, name);
}


/**
* Set harvest timestamp
* @param val timestamp
*/
public void setHarvestTimestamp(Instant val)
{
String strVal = DateTimeFormatter.ISO_INSTANT.format(val);
fields.setValue(FLD_HARVEST_DATE_TIME, strVal);
}
public class Metadata {
public static final String FLD_ALTERNATE_IDS = "alternate_ids";
public static final String FLD_NODE_NAME = "ops:Harvest_Info/ops:node_name";
public static final String FLD_HARVEST_DATE_TIME = "ops:Harvest_Info/ops:harvest_date_time";
public static final String FLD_HARVEST_VERSION = "ops:Harvest_Info/ops:harvest_version";
public static final String FLD_ARCHIVE_STATUS = "ops:Tracking_Meta/ops:archive_status";


/**
* Set harvest version
* @param val version
*/
public void setHarvestVersion(String val)
{
fields.setValue(FLD_HARVEST_DATE_TIME, val);
}
public String lid;
public String strVid; // Original VID from XML
public float vid; // Float for sorting (fining the latest version)
public String lidvid;

public String title;
public String prodClass; // Label's root element, e.g., "Product_Observational"

/**
* Set archive status
* @param status archive status
*/
public void setArchiveStatus(String status)
{
fields.setValue(FLD_ARCHIVE_STATUS, status);
}
public FieldMapSet intRefs; // Internal references (preprocessed)
public FieldMapList fields; // Metadata fields

/**
* terrible hack to set the harvest version from something that depends
* on this module.
*/
private static String harvest_version = "not set by harvest";
public static String getReportedHarvestVersion() {
return Metadata.harvest_version;
}
public static void reportHarvestVersion (String value) {
if (value != null) {
Metadata.harvest_version = value;
}
public Set<String> dataFiles; // File names from <File_Area...> tags


/**
* Constructor
*/
public Metadata() {
intRefs = new FieldMapSet();
fields = new FieldMapList();
}


/**
* Set node name
*
* @param name node name
*/
public void setNodeName(String name) {
fields.setValue(FLD_NODE_NAME, name);
}


/**
* Set harvest timestamp
*
* @param val timestamp
*/
public void setHarvestTimestamp(Instant val) {
String strVal = DateTimeFormatter.ISO_INSTANT.format(val);
fields.setValue(FLD_HARVEST_DATE_TIME, strVal);
}


/**
* Set harvest version
*
* @param val version
*/
public void setHarvestVersion(String val) {
fields.setValue(FLD_HARVEST_VERSION, val);
}


/**
* Set archive status
*
* @param status archive status
*/
public void setArchiveStatus(String status) {
fields.setValue(FLD_ARCHIVE_STATUS, status);
}

/**
* terrible hack to set the harvest version from something that depends on this module.
*/
private static String harvest_version = "not set by harvest";

public static String getReportedHarvestVersion() {
return Metadata.harvest_version;
}

public static void reportHarvestVersion(String value) {
if (value != null) {
Metadata.harvest_version = value;
}
}
}
Loading