Auto generated number in Dspace

28 views
Skip to first unread message

Amit Gupta

unread,
Jun 24, 2019, 9:02:00 AM6/24/19
to DSpace Technical Support
Hi All,

For one of our clients we have created the item type - Conference Proceedings, as per the custom fields defined by the client.

The client is seeking a self-generated sequence number for a custom field called 'control number', with the following format: MyRepository/current date/CP/01

Example values for this will be as follows:
MyRepository/23-Jun-2019/CP/01
MyRepository/24-Jun-2019/CP/01
MyRepository/24-Jun-2019/CP/02

Is this possible in DSpace?


Regards,
Amit

Michael Plate

unread,
Jun 24, 2019, 10:08:12 AM6/24/19
to dspac...@googlegroups.com
Hi Amit,

Am 24.06.19 um 11:04 schrieb Amit Gupta:
[…]

AFAIK not out-of-the-box.
Generally spoken, you can use a modified template in the XMLUI and fetch
a number from a service in the background.
Or use Javascript in the web site (security !).

But you need a service (program) to generate the numbers and to keep
track of them (database, e.g.).

CU

Michael


Amit Gupta

unread,
Jun 24, 2019, 10:22:14 AM6/24/19
to Michael Plate, dspac...@googlegroups.com
Thanks Michael.

--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/f1d83c2e-abd3-3dfa-9749-ce97d7cb56b7%40bibliothek.uni-kassel.de.

Amit Gupta

unread,
Jun 24, 2019, 10:46:51 AM6/24/19
to Michael Plate, dspac...@googlegroups.com
Hi Michael,

Can you please help in which page I need to call database.

Amit Gupta

unread,
Jun 24, 2019, 11:35:19 AM6/24/19
to Michael Plate, dspac...@googlegroups.com
Thanks for your reply.

I am using jspui theme.

On Mon, 24 Jun, 2019, 9:01 PM Michael Plate, <pl...@bibliothek.uni-kassel.de> wrote:
Hi Amit,

Am 24.06.19 um 16:46 schrieb Amit Gupta:

> Hi Michael,
>
> Can you please help in which page I need to call database.
[…]

this depends  - first, you need to use XMLUI e.g., second, you need to
develop a REST-service which accesses a database (you need your own
tables, DSpace alone will not be sufficient).

This needs a developer, so.
If you want to use that field during submit, you need a template to
replace DSpace's code by your own code like so:

  <xsl:template
match="//dri:field[@id='aspect.submission.StepTransformer.field.dc_yourfield']">
<br/>
  <input type="text">
         <xsl:attribute name="readonly">readonly</xsl:attribute>
         <xsl:attribute
name="id">aspect_submission_StepTransformer_field_dc_yourfield</xsl:attribute>
         <xsl:attribute name="name">dc_identifier</xsl:attribute>
         <xsl:choose>
         <xsl:when test="not(.//dri:value)">
                 <xsl:attribute name="value">
                         <xsl:apply-templates
select="document('THE_URL_TO_YOUR_SERVICE')"/>
                 </xsl:attribute>
         </xsl:when>
         <xsl:otherwise>
                 <xsl:attribute name="value"><xsl:value-of
select=".//dri:value"/></xsl:attribute>
         </xsl:otherwise>
         </xsl:choose>
  </input>
  <br/>
  </xsl:template>

This mus be placed in a file below your theme, e.g.
*/xmlui/Mirage2/xsl/core/ (make your own dir for your company).

Depending on your needs, the code for the service can be several hundred
lines.
Be sure to know what you do !


CU

Michael


Reply all
Reply to author
Forward
0 new messages