Open daniel-white opened 6 years ago
@daniel-white I haven't played with it much but System.IO.Packaging has the core properties, perhaps as a workaround you can use these: https://msdn.microsoft.com/en-us/library/system.io.packaging.packageproperties(v=vs.110).aspx?
and for implementer reference, the properties are defined in 29500-2 11.1 Core Properties Part. @daniel-white confirm that's what your looking for in the generated package.g.cs CoreFilePropertiesPart class? so this likely will be another enhancement to the schema gen code on the back end. (thanks for the suggestion!)
Yea. That has it. The productivity tool knows its a CoreFilePropertiesPart, but with a blob of xml.
For the community, 29500-2 can be downloaded here: http://standards.iso.org/ittf/PubliclyAvailableStandards/c061796_ISO_IEC_29500-2_2012.zip
Is this request to just expose a well defined set of properties? If so, we can do that without the schema generator updated. @daniel-white can you provide a C# example of what the properties should look like?
I'm guessing it should match the PackageProperties
. perhaps
CoreFilePropertiesPart part = ....
part.PackageProperties...
In order to decide whether to add it or not, we'll need the actual API surface area that should be considered for the discussion. Would you want to do that?
I'm thinking something like this based on the standard:
class CoreProperties
{
public string Category { get; set; } // category
public ContentStatusType ContentStatus { get; set; } // contentStatus
public DateTime CreatedAt {get; set;} //created
public string CreatedBy {get; set; } // creator
public string Summary {get; set; } // description
public List<Keyword> Keywords {get; set; } // keywords
public string Language {get; set; } // language
public string LastModifiedBy {get; set; } // lastModifiedBy
public DateTime? LastModifiedAt {get; set; } // modified
public DateTime? LastPrintedAt {get; set; } // lastPrinted
public int? Revision {get; set; } // revision
public int? Version {get; set; } // version
public string Subject {get; set; } // subject
public string Title {get; set; } // title
}
This is package level, right? So it would be something like:
public abstract class OpenXmlPackage
{
public CoreFilePropertiesPart CoreFilePropertiesPart { get; }
}
Are there any other places this would need to be accessible from?
Yea I think it is, thats where i found it. Not sure if its used elsewhere. I dont know the standard well enough.
A couple items on your API:
ICollection<Keyword>
instead of List<Keyword>
Keywords
property should probably only have a get
method and no set
DateTime
is used often throughout the SDK, but current practice recommends using DateTimeOffset
.Keyword
look like?ContentStatusType
look like?Yeah, I'm not well versed enough in the standard to know off the top of my head, either. @tomjebo @tarunchopra can you guys comment here?
class Keywords {
string Language { get; set; }
string Value { get; set; }
}
enum ContentStatusType
{
Draft,
Reviewed,
Final
}
Cool. Can you update the initial issue to have the APIs discussed here? We'll want someone who knows the spec a bit more than I do to sign off as well (@tomjebo @tarunchopra @ThomasBarnekow) but this looks good to me.
@daniel-white I cleaned up the API proposal a bit.
We may want to consider making Keyword
a struct.
Has this feature been added? It's been a year since the last discussion comment.
Stale issue message
Bump for refreshing the issue; has this been implemented anywhere yet?
Bruh. Why it was closed if it was almost done?
Not sure why it was closed - reopening so if anyone wants to continue with the design/implementation
@megapro17 - Please feel free to submit a PR with your proposed changes.
Description
DocumentFormat.OpenXml.Packaging.CoreFilePropertiesPart has no functional properties. I'd like to access at least the tags, description and title elements. There seems to be a well defined schema for it.
Information
Concept API surface