talk@lists.collectionspace.org

WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org

View all threads

id generator pattern issue

JM
Jesse Martinez
Wed, Jun 1, 2016 2:38 AM

I'm coming across an issue where I can't increment a custom id generator.

This is the pattern I'm following EX1.2016, EX2.2016, etc.

And here is the SQL code from load_id_generators.sql

-- BM_EXHIBITION_NUMBER

INSERT INTO id_generators
(csid, displayname, description, priority, last_generated_id,
id_generator_state)
SELECT
'23595e33-423f-4653-b957-8d10a6ca05a5',
'BM Exhibition Number',
'Identifies BM exhibition activities, in which one
or more exhibition events occur at an institution.',
'9',
'',
'<org.collectionspace.services.id.SettableIDGenerator>
<parts>
<org.collectionspace.services.id.StringIDGeneratorPart>
<initialValue>EX</initialValue>
<currentValue>EX</currentValue>
</org.collectionspace.services.id.StringIDGeneratorPart>
<org.collectionspace.services.id.NumericIDGeneratorPart>
<maxLength>6</maxLength>
<initialValue>1</initialValue>
<currentValue>-1</currentValue>
</org.collectionspace.services.id.NumericIDGeneratorPart>
<org.collectionspace.services.id.StringIDGeneratorPart>
<initialValue>.</initialValue>
<currentValue>.</currentValue>
</org.collectionspace.services.id.StringIDGeneratorPart>
<org.collectionspace.services.id.YearIDGeneratorPart>
<currentValue></currentValue>
</org.collectionspace.services.id.YearIDGeneratorPart>
</parts>
</org.collectionspace.services.id.SettableIDGenerator>'
WHERE '23595e33-423f-4653-b957-8d10a6ca05a5' NOT IN
(
SELECT  csid
FROM    id_generators
);

My hunch is that since I have the incrementing part in the middle of the
string that it's failing to get matched? Has anyone come across this before?

I've had success creating other custom id generator patterns that follow
the PREFIX.YEAR.INT pattern.

Jesse

I'm coming across an issue where I can't increment a custom id generator. This is the pattern I'm following EX1.2016, EX2.2016, etc. And here is the SQL code from load_id_generators.sql -- BM_EXHIBITION_NUMBER > INSERT INTO id_generators > (csid, displayname, description, priority, last_generated_id, > id_generator_state) > SELECT > '23595e33-423f-4653-b957-8d10a6ca05a5', > 'BM Exhibition Number', > 'Identifies BM exhibition activities, in which one > or more exhibition events occur at an institution.', > '9', > '', > '<org.collectionspace.services.id.SettableIDGenerator> > <parts> > <org.collectionspace.services.id.StringIDGeneratorPart> > <initialValue>EX</initialValue> > <currentValue>EX</currentValue> > </org.collectionspace.services.id.StringIDGeneratorPart> > <org.collectionspace.services.id.NumericIDGeneratorPart> > <maxLength>6</maxLength> > <initialValue>1</initialValue> > <currentValue>-1</currentValue> > </org.collectionspace.services.id.NumericIDGeneratorPart> > <org.collectionspace.services.id.StringIDGeneratorPart> > <initialValue>.</initialValue> > <currentValue>.</currentValue> > </org.collectionspace.services.id.StringIDGeneratorPart> > <org.collectionspace.services.id.YearIDGeneratorPart> > <currentValue></currentValue> > </org.collectionspace.services.id.YearIDGeneratorPart> > </parts> > </org.collectionspace.services.id.SettableIDGenerator>' > WHERE '23595e33-423f-4653-b957-8d10a6ca05a5' NOT IN > ( > SELECT csid > FROM id_generators > ); My hunch is that since I have the incrementing part in the middle of the string that it's failing to get matched? Has anyone come across this before? I've had success creating other custom id generator patterns that follow the PREFIX.YEAR.INT pattern. Jesse
AR
Aron Roberts
Thu, Jun 2, 2016 5:02 AM

My hunch is that since I have the incrementing part in the middle of the

string that it's failing to get matched? Has anyone come across this before?

That sounds right; e.g.

https://issues.collectionspace.org/browse/CSPACE-1576

On Tue, May 31, 2016 at 7:38 PM, Jesse Martinez mjesse@gmail.com wrote:

I'm coming across an issue where I can't increment a custom id generator.

This is the pattern I'm following EX1.2016, EX2.2016, etc.

And here is the SQL code from load_id_generators.sql

-- BM_EXHIBITION_NUMBER

INSERT INTO id_generators
(csid, displayname, description, priority, last_generated_id,
id_generator_state)
SELECT
'23595e33-423f-4653-b957-8d10a6ca05a5',
'BM Exhibition Number',
'Identifies BM exhibition activities, in which one
or more exhibition events occur at an institution.',
'9',
'',
'<org.collectionspace.services.id.SettableIDGenerator>
<parts>
<org.collectionspace.services.id.StringIDGeneratorPart>
<initialValue>EX</initialValue>
<currentValue>EX</currentValue>
</org.collectionspace.services.id.StringIDGeneratorPart>
<org.collectionspace.services.id.NumericIDGeneratorPart>
<maxLength>6</maxLength>
<initialValue>1</initialValue>
<currentValue>-1</currentValue>
</org.collectionspace.services.id.NumericIDGeneratorPart>
<org.collectionspace.services.id.StringIDGeneratorPart>
<initialValue>.</initialValue>
<currentValue>.</currentValue>
</org.collectionspace.services.id.StringIDGeneratorPart>
<org.collectionspace.services.id.YearIDGeneratorPart>
<currentValue></currentValue>
</org.collectionspace.services.id.YearIDGeneratorPart>
</parts>
</org.collectionspace.services.id.SettableIDGenerator>'
WHERE '23595e33-423f-4653-b957-8d10a6ca05a5' NOT IN
(
SELECT  csid
FROM    id_generators
);

My hunch is that since I have the incrementing part in the middle of the
string that it's failing to get matched? Has anyone come across this before?

I've had success creating other custom id generator patterns that follow
the PREFIX.YEAR.INT pattern.

Jesse


Talk mailing list
Talk@lists.collectionspace.org

http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org

> My hunch is that since I have the incrementing part in the middle of the string that it's failing to get matched? Has anyone come across this before? That sounds right; e.g. https://issues.collectionspace.org/browse/CSPACE-1576 On Tue, May 31, 2016 at 7:38 PM, Jesse Martinez <mjesse@gmail.com> wrote: > I'm coming across an issue where I can't increment a custom id generator. > > This is the pattern I'm following EX1.2016, EX2.2016, etc. > > And here is the SQL code from load_id_generators.sql > > > -- BM_EXHIBITION_NUMBER >> INSERT INTO id_generators >> (csid, displayname, description, priority, last_generated_id, >> id_generator_state) >> SELECT >> '23595e33-423f-4653-b957-8d10a6ca05a5', >> 'BM Exhibition Number', >> 'Identifies BM exhibition activities, in which one >> or more exhibition events occur at an institution.', >> '9', >> '', >> '<org.collectionspace.services.id.SettableIDGenerator> >> <parts> >> <org.collectionspace.services.id.StringIDGeneratorPart> >> <initialValue>EX</initialValue> >> <currentValue>EX</currentValue> >> </org.collectionspace.services.id.StringIDGeneratorPart> >> <org.collectionspace.services.id.NumericIDGeneratorPart> >> <maxLength>6</maxLength> >> <initialValue>1</initialValue> >> <currentValue>-1</currentValue> >> </org.collectionspace.services.id.NumericIDGeneratorPart> >> <org.collectionspace.services.id.StringIDGeneratorPart> >> <initialValue>.</initialValue> >> <currentValue>.</currentValue> >> </org.collectionspace.services.id.StringIDGeneratorPart> >> <org.collectionspace.services.id.YearIDGeneratorPart> >> <currentValue></currentValue> >> </org.collectionspace.services.id.YearIDGeneratorPart> >> </parts> >> </org.collectionspace.services.id.SettableIDGenerator>' >> WHERE '23595e33-423f-4653-b957-8d10a6ca05a5' NOT IN >> ( >> SELECT csid >> FROM id_generators >> ); > > > > My hunch is that since I have the incrementing part in the middle of the > string that it's failing to get matched? Has anyone come across this before? > > I've had success creating other custom id generator patterns that follow > the PREFIX.YEAR.INT pattern. > > Jesse > > > _______________________________________________ > Talk mailing list > Talk@lists.collectionspace.org > > http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org > >