GithubHelp home page GithubHelp logo

afrozenpeach / csharp_marc Goto Github PK

View Code? Open in Web Editor NEW
57.0 16.0 16.0 6.3 MB

C# class libraries and full featured editor for MARC Records

Home Page: https://csharpmarc.net

License: Other

C# 79.43% mIRC Script 20.57%
csharp-marc marcxml-record marc-editor rda marc-records marc code4lib

csharp_marc's Introduction

Afrozenpeach

This project was generated with Angular CLI version 8.3.9.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

csharp_marc's People

Contributors

afrozenpeach avatar coldacid avatar sdanisch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csharp_marc's Issues

Develop way to export validation results

Hi!
I cannot export the validation results from the grid. I would like to export the results in a structured way that enables me to further analyze the validation results in other tools.

SystemEntryPointNotFoundException

Unfortunetly when I am trying to start this project i get SystemEntryPointNotFoundException everytime.
Using windows 10 Visual Studio 2022 17.6.4

There is question if I want reset db. After done this still error occurs.
error

Field length calculation gives wrong results for some UTF8 encoded data

For some MARC files with multi-byte characters in them, the import happens with errors and results in wrong field content

see 007-tit.mrc.txt, first record, Field 515

even though the data seems to be perfectly fine and can be imported/validated with other tools. The problem seems to occur in FileMARC.cs#L302, where the extra bytes for a field are calculated:

                    //Check if there are multi-byte characters in the string
                    System.Globalization.StringInfo stringInfo = new System.Globalization.StringInfo(tagData);
                    int extraBytes = fieldLength - stringInfo.LengthInTextElements;
                    int extraBytes2 = Encoding.UTF8.GetByteCount(tagData) - fieldLength;
                    int endOfFieldIndex = tagData.IndexOf(END_OF_FIELD);

                    if (tagData.Length - 1 != endOfFieldIndex)
                    {
                        int differenceLength = tagData.Length - 1 - endOfFieldIndex;

                        if (differenceLength != extraBytes && differenceLength != extraBytes2)
                        {
                            fieldLength -= differenceLength;
                            totalExtraBytesRead += differenceLength;
                            tagData = raw.Substring(fieldStart, endOfFieldIndex + 1);
                        }
                        else
                        {
                            if (extraBytes > 0)
                            {
                                fieldLength -= extraBytes;
                                totalExtraBytesRead += extraBytes;
                                tagData = raw.Substring(fieldStart, fieldLength);
                            }
                            else if (extraBytes2 > 0)
                            {
                                fieldLength -= extraBytes2;
                                totalExtraBytesRead += extraBytes2;
                                tagData = raw.Substring(fieldStart, fieldLength);
                            }
                        }
                    }

It seems as if extraBytes2 has the correct value to be used, but extraBytes is used instead. Unfortunately i dont really understand, what is supposed to happen in this part of the code. For our internal import, changing the logic to use the larger value between extraBytes and extraBytes2 seems to work and leads to the field in question being read correctly:

                    //Check if there are multi-byte characters in the string
                    System.Globalization.StringInfo stringInfo = new System.Globalization.StringInfo(tagData);
                    int extraBytes =  fieldLength - stringInfo.LengthInTextElements;                    
                    int extraBytes2 = Encoding.UTF8.GetByteCount(tagData) - fieldLength;
                    extraBytes = extraBytes >= extraBytes2 ? extraBytes : extraBytes2;
                    int endOfFieldIndex = tagData.IndexOf(END_OF_FIELD);

                    if (tagData.Length - 1 != endOfFieldIndex)
                    {
                        int differenceLength = tagData.Length - 1 - endOfFieldIndex;

                        if (differenceLength != extraBytes)
                        {
                            fieldLength -= differenceLength;
                            totalExtraBytesRead += differenceLength;
                            tagData = raw.Substring(fieldStart, endOfFieldIndex + 1);
                        }
                        else
                        {
                            if (extraBytes > 0)
                            {
                                fieldLength -= extraBytes;
                                totalExtraBytesRead += extraBytes;
                                tagData = raw.Substring(fieldStart, fieldLength);
                            }                           
                        }
                    }

As im not quite sure what is supposed to happen here, i was hesitant to provide a pull request, but will of course do so if that is a feasible solution. If you see what is wrong with that approach and know how it should be handled instead, im more then willing to implement that solution and provide a matching pull request.

Feature Request: Display Data for Multiple Tags

Would be nice if you could select multiple tags on the bottom left panel (using CTRL or SHIFT),
select-multiple-tags

And have them display together in the bottom center, taking up some of the empty space there.
empty-space

note: (might require adding an extra column for tag in the middle).

Getting warnings when importing records.

So, my catalogers use a program called MarcEdit to edit their records. I use your API because it allows me to edit bib records, create holding records, and then load them to the database in batch. Today, I noticed that your API gave me a warning where I believed there should not have been one given. So, I did some digging. I used NotePad++ to see if the leader first five bytes matched NotePad++ length of the file. It matched. See Notepad++.png. I then used MarcEdit to see if it would give a warning. It did not. See MarcEdit.png. I figured I was doing something wrong while reading the file in, so I downloaded your CSharp_MARC application. I imported the record into there and got the same warning. It appears that the leader length and the way your API counts the length of some special characters are not equal. It leads to the indicators being left out in the field that follows. See CSharpmarc.png.

Test Record: G108April2022CRDPRECORDS_test - Copy - Copy.mrc.txt
PrettyPrint of Test Record: G108April2022CRDPRECORDS_test - Copy - Copy.mrk.txt

Notepad++
CSharpMarc
MarcEdit
G108April2022CRDPRECORDS_test - Copy - Copy.mrc.txt
G108April2022CRDPRECORDS_test - Copy - Copy.mrk.txt

Critical Fail

I was putting in my first record. Attempted to put in 035 of the record below. I got an error so I tried to skip to 040 by renaming 035 to 040 and got another or the same error not sure.

Now each time I open the app I get Unhanded Exception. If I ignore the app is just frozen. The only other option is to quit. I broke you app in my first 10 minutes. I guessing I need to delete or edit the database to reset. Can you please help.

The Record below comes from https://calgary.bibliocommons.com/item/show/642846095?active_tab=bib_info
-> Full Record -> Mark display
I would love to have a way to import or paste such records into CSharp_MARC.

000 $aam a0n a
001 $acpl01015429
003 $aDLC
005 $a20100805103101.0
008 $a100805s2010 nyua b 001 0 eng d
020 $a9781583333938 (pbk.)
035 $a(OCoLC)462901951
040 $aDLC$cDLC
042 $apcc
082 00 $a616.6/5$222
099 $a616. 65 SCA 2010
100 1 $aScardino, Peter T.
245 10 $aDr. Peter Scardino's prostate book :$bthe complete guide to overcoming prostate cancer, prostatitis, and BPH /$cPeter T. Scardino and Judith Kelman.
246 10 $aProstate book
250 $a2nd ed.
260 $aNew York :$bAvery,$c2010.
300 $axxvi, 565 p. :$bill.
504 $aIncludes bibliographical references and index.
596 $a6 15
650 0 $aProstate$vPopular works.
700 1 $aKelman, Judith.


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at CSharp_MARC_Editor.MainForm.LoadPreview(Int32 recordID, Boolean recordsTableReload)
at CSharp_MARC_Editor.MainForm.LoadFields(Int32 recordID)
at CSharp_MARC_Editor.MainForm.loadingBackgroundWorker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2633.0 built by: NET471REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

CSharp_MARC Editor
Assembly Version: 2018.2.20.0
Win32 Version: 2018.02.20.0
CodeBase: file:///C:/Users/bigby/AppData/Local/Apps/2.0/AZL5JT02.8R7/E1ZX6RRO.VW4/csha..tion_9e24aae7a729629d_07e2.0002_5501cb4bd75a0916/CSharp_MARC%20Editor.exe

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2633.0 built by: NET471REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2612.0 built by: NET471REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2633.0 built by: NET471REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll

System.Data.DataSetExtensions
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll

System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

System.Data.SQLite
Assembly Version: 1.0.107.0
Win32 Version: 1.0.107.0
CodeBase: file:///C:/Users/bigby/AppData/Local/Apps/2.0/AZL5JT02.8R7/E1ZX6RRO.VW4/csha..tion_9e24aae7a729629d_07e2.0002_5501cb4bd75a0916/System.Data.SQLite.DLL

System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll

CSharp_MARC
Assembly Version: 2018.2.20.0
Win32 Version: 2018.02.20.0
CodeBase: file:///C:/Users/bigby/AppData/Local/Apps/2.0/AZL5JT02.8R7/E1ZX6RRO.VW4/csha..tion_9e24aae7a729629d_07e2.0002_5501cb4bd75a0916/CSharp_MARC.DLL

System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Change class library to netstandard & publish nuget

This class library seems very useful for automating updating & identifying wrong MARC records.

It would be super useful if the library part was published as a Nuget that targets netstandard so that it can also be used from .NET 6.

Is that possible? Or are there any hard dependencies on .NET Framework 4.7 that aren't available in netstandard?

Error trying to clean and build CSharp_MARC

I get the error below when I try to clean and building the CSharp_MARC library project.

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS7027	Error signing output with public key from file 'CSharp_MARC.snk' -- File not found.	CSharp_MARC	C:\Users\theUser\Source\Repos\CSharp_MARC\CSharp_MARC\CSC	1	Active

Unhandled Exception after clicking arrows on right

Clicking on the up or down arrow on the right causes an unhandled 'Index Out of Range'
error.

Error occurs regardless of which record id or tag (first, middle, last) is selected, or
if more than one record is selected

Running on 64-bit Windows 7 Enteprise.

text:

Unhandled exception has occurred in your application. If you click Continue, the application 
  ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index.

screenshots:

exception-text-index

error-fullscreen

full details:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at System.Windows.Forms.DataGridViewRowCollection.SharedRow(Int32 rowIndex)
   at System.Windows.Forms.DataGridViewRowCollection.get_Item(Int32 index)
   at CSharp_MARC_Editor.MainForm.subfieldUpButton_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1076.0 built by: NETFXREL3STAGE
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
CSharp_MARC Editor
    Assembly Version: 2016.6.12.1
    Win32 Version: 2016.06.12.1
    CodeBase: file:///C:/Users/akswcs1/Downloads/CSharp.MARC.Editor/CSharp_MARC%20Editor.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1055.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1075.0 built by: NETFXREL3STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1068.2 built by: NETFXREL3STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1055.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.