本文整理汇总了C#中SobekCM.Resource_Object.SobekCM_Item.Save_Citation_Only_METS方法的典型用法代码示例。如果您正苦于以下问题:C# SobekCM_Item.Save_Citation_Only_METS方法的具体用法?C# SobekCM_Item.Save_Citation_Only_METS怎么用?C# SobekCM_Item.Save_Citation_Only_METS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SobekCM.Resource_Object.SobekCM_Item
的用法示例。
在下文中一共展示了SobekCM_Item.Save_Citation_Only_METS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: complete_item_submission
//.........这里部分代码省略.........
case 12:
Item_To_Complete.Behaviors.Serial_Info.Add_Hierarchy(2, asDateTime.Month, "December");
break;
}
Item_To_Complete.Behaviors.Serial_Info.Add_Hierarchy(3, asDateTime.Day, asDateTime.Day.ToString());
}
}
// Determine the in process directory for this
string user_in_process_directory = SobekCM_Library_Settings.In_Process_Submission_Location + "\\" + user.UserName.Replace(".", "").Replace("@", "") + "\\newitem";
if (user.UFID.Trim().Length > 0)
user_in_process_directory = SobekCM_Library_Settings.In_Process_Submission_Location + "\\" + user.UFID + "\\newitem";
// Ensure this directory exists
if (!Directory.Exists(user_in_process_directory))
Directory.CreateDirectory(user_in_process_directory);
// Now, delete all the files in the processing directory
string[] all_files = Directory.GetFiles(user_in_process_directory);
foreach (string thisFile in all_files)
{
File.Delete(thisFile);
}
// Save to the database
Item_To_Complete.Web.File_Root = Item_To_Complete.BibID.Substring(0, 2) + "\\" + Item_To_Complete.BibID.Substring(2, 2) + "\\" + Item_To_Complete.BibID.Substring(4, 2) + "\\" + Item_To_Complete.BibID.Substring(6, 2) + "\\" + Item_To_Complete.BibID.Substring(8, 2);
SobekCM_Database.Save_New_Digital_Resource(Item_To_Complete, false, false, user.UserName, String.Empty, -1);
// Assign the file root and assoc file path
Item_To_Complete.Web.AssocFilePath = Item_To_Complete.Web.File_Root + "\\" + Item_To_Complete.VID + "\\";
// Create the static html pages
string base_url = currentMode.Base_URL;
try
{
Static_Pages_Builder staticBuilder = new Static_Pages_Builder(SobekCM_Library_Settings.System_Base_URL, SobekCM_Library_Settings.Base_Data_Directory, Translator, codeManager, itemList, iconList, webSkin);
string filename = user_in_process_directory + "\\" + Item_To_Complete.BibID + "_" + Item_To_Complete.VID + ".html";
staticBuilder.Create_Item_Citation_HTML(Item_To_Complete, filename, String.Empty);
}
catch (Exception ee)
{
message = message + "<br /><span style=\"color: red\"><strong>" + ee.Message + "<br />" + ee.StackTrace.Replace("\n", "<br />") + "</strong></span>";
}
currentMode.Base_URL = base_url;
// Save the rest of the metadata
Item_To_Complete.Source_Directory = user_in_process_directory;
Item_To_Complete.Save_SobekCM_METS();
Item_To_Complete.Save_Citation_Only_METS();
// Add this to the cache
itemList.Add_SobekCM_Item(Item_To_Complete);
Database.SobekCM_Database.Add_Item_To_User_Folder(user.UserID, "Submitted Items", Item_To_Complete.BibID, Item_To_Complete.VID, 0, String.Empty, Tracer);
// Save Bib_Level METS?
//SobekCM.Resource_Object.Writers.OAI_Writer oaiWriter = new SobekCM.Resource_Object.Writers.OAI_Writer();
//oaiWriter.Save_OAI_File(bibPackage, resource_folder + "\\oai_dc.xml", bibPackage.Processing_Parameters.Collection_Primary.ToLower(), createDate);
// If there was no match, try to save to the tracking database
Database.SobekCM_Database.Tracking_Online_Submit_Complete(Item_To_Complete.Web.ItemID, user.Full_Name, String.Empty);
List<string> collectionnames = new List<string>();
MarcXML_File_ReaderWriter marcWriter = new MarcXML_File_ReaderWriter();
string Error_Message;
Dictionary<string, object> options = new Dictionary<string, object>();
options["MarcXML_File_ReaderWriter:Additional_Tags"] = Item_To_Complete.MARC_Sobek_Standard_Tags(collectionnames, true, SobekCM_Library_Settings.System_Name, SobekCM_Library_Settings.System_Abbreviation);
marcWriter.Write_Metadata(Item_To_Complete.Source_Directory + "\\marc.xml", Item_To_Complete, options, out Error_Message);
// Copy this to all the image servers
SobekCM_Library_Settings.Refresh(Database.SobekCM_Database.Get_Settings_Complete(Tracer));
string[] allFiles = Directory.GetFiles(user_in_process_directory);
// Copy all the files over to the server
string serverNetworkFolder = SobekCM_Library_Settings.Image_Server_Network + Item_To_Complete.Web.AssocFilePath;
// Create the folder
if (!Directory.Exists(serverNetworkFolder))
Directory.CreateDirectory(serverNetworkFolder);
foreach (string thisFile in allFiles)
{
string destination_file = serverNetworkFolder + "\\" + (new FileInfo(thisFile)).Name;
File.Copy(thisFile, destination_file, true);
}
// Add this to the cache
itemList.Add_SobekCM_Item(Item_To_Complete);
// Incrememnt the count of number of items submitted by this user
user.Items_Submitted_Count++;
// Delete any remaining items
all_files = Directory.GetFiles(user_in_process_directory);
foreach (string thisFile in all_files)
{
File.Delete(thisFile);
}
}
示例2: complete_item_submission
//.........这里部分代码省略.........
{
StreamWriter writer = new StreamWriter(userInProcessDirectory + "\\exception.txt", false);
writer.WriteLine( "ERROR CAUGHT WHILE SAVING NEW DIGITAL RESOURCE");
writer.WriteLine( DateTime.Now.ToString());
writer.WriteLine();
writer.WriteLine( ee.Message );
writer.WriteLine( ee.StackTrace );
writer.Flush();
writer.Close();
throw;
}
// Assign the file root and assoc file path
Item_To_Complete.Web.File_Root = Item_To_Complete.BibID.Substring(0, 2) + "\\" + Item_To_Complete.BibID.Substring(2, 2) + "\\" + Item_To_Complete.BibID.Substring(4, 2) + "\\" + Item_To_Complete.BibID.Substring(6, 2) + "\\" + Item_To_Complete.BibID.Substring(8, 2);
Item_To_Complete.Web.AssocFilePath = Item_To_Complete.Web.File_Root + "\\" + Item_To_Complete.VID + "\\";
// Create the static html pages
string base_url = currentMode.Base_URL;
try
{
Static_Pages_Builder staticBuilder = new Static_Pages_Builder(SobekCM_Library_Settings.System_Base_URL, SobekCM_Library_Settings.Base_Data_Directory, Translator, codeManager, itemList, iconList, webSkin);
string filename = userInProcessDirectory + "\\" + Item_To_Complete.BibID + "_" + Item_To_Complete.VID + ".html";
staticBuilder.Create_Item_Citation_HTML(Item_To_Complete, filename, String.Empty);
}
catch (Exception)
{
// An error here is not catastrophic
}
currentMode.Base_URL = base_url;
// Save the rest of the metadata
Item_To_Complete.Save_SobekCM_METS();
Item_To_Complete.Save_Citation_Only_METS();
// Add this to the cache
itemList.Add_SobekCM_Item(Item_To_Complete);
//// Link this item and user
//Database.SobekCM_Database.Add_User_Item_Link(user.UserID, item.Web.ItemID, 1, true);
//Database.SobekCM_Database.Add_User_BibID_Link(user.UserID, item.Behaviors.GroupID);
//Database.SobekCM_Database.Add_Item_To_User_Folder(user.UserID, "Submitted Items", item.BibID, item.VID, 0, String.Empty, Tracer);
// Save Bib_Level METS?
//SobekCM.Resource_Object.Writers.OAI_Writer oaiWriter = new SobekCM.Resource_Object.Writers.OAI_Writer();
//oaiWriter.Save_OAI_File(bibPackage, resource_folder + "\\oai_dc.xml", bibPackage.Processing_Parameters.Collection_Primary.ToLower(), createDate);
List<string> collectionnames = new List<string>();
//// Get the collection names
//if (item.Processing_Parameters.Collection_Primary.Length > 0)
//{
// DataRow[] primCode = Collection_Codes.Select("collectioncode = '" + item.Processing_Parameters.Collection_Primary + "'");
// if (primCode.Length > 0)
// {
// collectionnames.Add(primCode[0]["ShortName"].ToString());
// }
//}
//foreach (string altCollection in bibPackage.Processing_Parameters.Collections_Alternate)
//{
// DataRow[] altCode = Collection_Codes.Select("collectioncode = '" + altCollection + "'");
// if (altCode.Length > 0)
// {
// collectionnames.Add(altCode[0]["ShortName"].ToString());
// }
//}
// Save the marc xml file