Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. static GetSharePointMetadata(): SFInterfaces.ISharePointEntityMetadata {
  2.  
  3. const ConsoleLoggingLabel = "NewsTickerEntity";
  4.  
  5. const EmptyInstance = () => { return new NewsTickerItem() };
  6.  
  7. const SharePointListTitle = "VP News";
  8.  
  9. const colMappings: SFInterfaces.ISharePointListColumnMapping[] =
  10. AbstractViewPortItem.commonColumnMappings.concat([
  11. EntityHelper.GetIntegerMapping("ID", "SharePointID", EntityReadWriteAccess.READ_ONLY),
  12. EntityHelper.GetTextMapping("Title", "Title"),
  13. EntityHelper.GetTextMapping("Title", "News"),
  14. EntityHelper.GetTextMapping("VP_RedirectUrl", "RedirectUrl"),
  15. EntityHelper.GetDateTimeMapping("VP_EffectiveDate", "EffectiveDate"),
  16. EntityHelper.GetDateTimeMapping("VP_ExpirationDate", "ExpirationDate"),
  17. EntityHelper.GetIntegerMapping("VP_ItemDisplaySequence", "DisplaySequence")
  18. ]);
  19.  
  20. return <SFInterfaces.ISharePointEntityMetadata>{
  21. ConsoleLoggingLabel: ConsoleLoggingLabel,
  22.  
  23. SharePointListTitle: SharePointListTitle,
  24.  
  25. SharePointListColumnMappings: colMappings,
  26.  
  27. SharePointCamlResponseMapper: (camlItem) => {
  28. return EntityHelper.MapSharePointCamlToEntity(EmptyInstance(), camlItem, colMappings, ConsoleLoggingLabel);
  29. },
  30.  
  31. ValidateEntityFieldsMapping: () => {
  32. return EntityHelper.ValidateEntityFieldsMapping(EmptyInstance(), colMappings, ConsoleLoggingLabel);
  33. },
  34. ValidateCamlResponseMapping: (camlResponse: any) => {
  35. return EntityHelper.ValidateCamlResponseMapping(camlResponse, colMappings, ConsoleLoggingLabel);
  36. },
  37. ValidateEntityMappingIntegrity: () => {
  38. return EntityHelper.ValidateEntityMappingIntegrity(EmptyInstance(), colMappings, ConsoleLoggingLabel);
  39. }
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement