Last active
May 3, 2017 17:05
-
-
Save silvae86/5838df542637d5059106c82c92728806 to your computer and use it in GitHub Desktop.
Install DSpace 6.x on Ubuntu 16.04 with custom metadata importing template via CSV (BTE configuration)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> | |
<!-- **************************************************************************************************** --> | |
<!-- BTE Batch import Service --> | |
<!-- **************************************************************************************************** --> | |
<bean id="org.dspace.app.itemimport.BTEBatchImportService" class="org.dspace.app.itemimport.BTEBatchImportService"> | |
<property name="dataLoaders"> | |
<map> | |
<!-- Specify here any data loaders that you want to have access to in the command line batch import. | |
Key is the name that you need to specify in the "-i" option in the command line script when "-b" | |
option is used (which means BTE Batch import) --> | |
<entry key="pubmedXML" value-ref="pubmedFileDataLoader" /> | |
<entry key="crossrefXML" value-ref="crossRefFileDataLoader" /> | |
<entry key="arxivXML" value-ref="arXivFileDataLoader" /> | |
<entry key="ciniiXML" value-ref="ciniiFileDataLoader" /> | |
<entry key="bibtex" value-ref="bibTeXDataLoader" /> | |
<entry key="ris" value-ref="risDataLoader" /> | |
<entry key="endnote" value-ref="endnoteDataLoader" /> | |
<entry key="csv" value-ref="csvDataLoader" /> | |
<entry key="tsv" value-ref="tsvDataLoader" /> | |
<entry key="oai" value-ref="oaipmhDataLoader" /> | |
</map> | |
</property> | |
<!-- The map that will be used to map internal BTE keys to DSpace metadata fields --> | |
<property name="outputMap" ref="outputMap" /> | |
<property name="transformationEngine" ref="batchImportTransformationEngine" /> | |
</bean> | |
<!-- **************************************************************************************************** --> | |
<!-- BTE Batch import Transformation Engine --> | |
<!-- **************************************************************************************************** --> | |
<bean id="batchImportTransformationEngine" class="gr.ekt.bte.core.TransformationEngine"> | |
<property name="workflow" ref="batchImportLinearWorkflow" /> | |
</bean> | |
<!-- Specify here any filters or modifiers to run before the output --> | |
<bean id="batchImportLinearWorkflow" class="gr.ekt.bte.core.LinearWorkflow"> | |
<property name="process"> | |
<list> | |
<!-- Add here filters and modifiers --> | |
</list> | |
</property> | |
</bean> | |
<!-- **************************************************************************************************** --> | |
<!-- Submission Lookup Service --> | |
<!-- **************************************************************************************************** --> | |
<bean class="org.dspace.submit.lookup.SubmissionLookupService" | |
name="org.dspace.submit.lookup.SubmissionLookupService"> | |
<property name="phase1TransformationEngine" ref="phase1TransformationEngine" /> | |
<property name="phase2TransformationEngine" ref="phase2TransformationEngine" /> | |
<!-- Uncomment the following property if you want specific fields to appear in the detail presentation | |
of a publication. Default values are the ones shown below --> | |
<!-- | |
<property name="detailFields"> | |
<list> | |
<value>title</value> | |
<value>authors</value> | |
<value>editors</value> | |
<value>translators</value> | |
<value>chairs</value> | |
<value>issued</value> | |
<value>abstract</value> | |
<value>doi</value> | |
<value>journal</value> | |
<value>volume</value> | |
<value>issue</value> | |
<value>publisher</value> | |
<value>jissn</value> | |
<value>jeissn</value> | |
<value>pisbn</value> | |
<value>eisbn</value> | |
<value>arxivCategory</value> | |
<value>keywords</value> | |
<value>mesh</value> | |
<value>language</value> | |
<value>subtype</value> | |
<value>translators</value> | |
</list> | |
</property> | |
--> | |
</bean> | |
<!-- **************************************************************************************************** --> | |
<!-- Submission Lookup Transformation Engine (phase 1) --> | |
<!-- **************************************************************************************************** --> | |
<bean name="phase1TransformationEngine" class="gr.ekt.bte.core.TransformationEngine"> | |
<property name="dataLoader" ref="multipleDataLoader"/> | |
<property name="workflow" ref="phase1LinearWorkflow"/> | |
<property name="outputGenerator" ref="org.dspace.submit.lookup.SubmissionLookupOutputGenerator"/> | |
</bean> | |
<bean name="multipleDataLoader" class="org.dspace.submit.lookup.MultipleSubmissionLookupDataLoader"> | |
<property name="dataloadersMap"> | |
<map> | |
<!-- Specify here any data loaders you want to include in the submission lookup process. | |
Dataloaders must either extend the "NetworkSubmissionLookupDataLoader" abstract class | |
or conform to "FileDataLoader" interface of BTE --> | |
<entry key="pubmed" value-ref="pubmedOnlineDataLoader"/> | |
<entry key="crossref" value-ref="crossRefOnlineDataLoader"/> | |
<entry key="arxiv" value-ref="arXivOnlineDataLoader"/> | |
<entry key="cinii" value-ref="ciniiOnlineDataLoader"/> | |
<entry key="pubmedXML" value-ref="pubmedFileDataLoader"/> | |
<entry key="crossRefXML" value-ref="crossRefFileDataLoader"/> | |
<entry key="arXivXML" value-ref="arXivFileDataLoader"/> | |
<entry key="ciniiXML" value-ref="ciniiFileDataLoader"/> | |
<entry key="bibtex" value-ref="bibTeXDataLoader"/> | |
<entry key="ris" value-ref="risDataLoader"/> | |
<entry key="endnote" value-ref="endnoteDataLoader"/> | |
<entry key="csv" value-ref="csvDataLoader"/> | |
<entry key="tsv" value-ref="tsvDataLoader"/> | |
</map> | |
</property> | |
</bean> | |
<bean name="org.dspace.submit.lookup.SubmissionLookupOutputGenerator" class="org.dspace.submit.lookup.SubmissionLookupOutputGenerator"/> | |
<!-- Specify here any filters or modifiers to run before the output --> | |
<bean name="phase1LinearWorkflow" class="gr.ekt.bte.core.LinearWorkflow"> | |
<property name="process"> | |
<list> | |
<ref bean="mapConverter_arxivSubject"/> | |
<ref bean="mapConverter_pubstatusPubmed"/> | |
<ref bean="removeLastDot"/> | |
</list> | |
</property> | |
</bean> | |
<!-- Converts an input value to an output one --> | |
<bean name="mapConverter_arxivSubject" class="org.dspace.submit.lookup.MapConverterModifier" init-method="init"> | |
<constructor-arg value="mapConverter_arxivSubject Modifier"/> | |
<property name="converterNameFile" value="mapConverter-arxivSubject.properties"/> | |
<property name="configurationService" ref="org.dspace.services.ConfigurationService"/> | |
<property name="fieldKeys"> | |
<list> | |
<!-- Specify the internal BTE keys that this modifier needs to be applied for --> | |
<value>arxivCategory</value> | |
</list> | |
</property> | |
</bean> | |
<!-- Converts an input value to an output one --> | |
<bean name="mapConverter_pubstatusPubmed" class="org.dspace.submit.lookup.MapConverterModifier" init-method="init"> | |
<constructor-arg value="mapConverter_pubstatusPubmed Modifier"/> | |
<property name="converterNameFile" value="mapConverter-pubstatusPubmed.properties"/> | |
<property name="configurationService" ref="org.dspace.services.ConfigurationService"/> | |
<property name="defaultValue" value="Subjected to Journal"/> | |
<property name="fieldKeys"> | |
<list> | |
<!-- Specify the internal BTE keys that this modifier needs to be applied for --> | |
<value>publicationStatus</value> | |
</list> | |
</property> | |
</bean> | |
<!-- Remove the last dot in the specified field keys --> | |
<bean name="removeLastDot" class="org.dspace.submit.lookup.RemoveLastDotModifier"> | |
<constructor-arg value="removeLastDot Modifier"/> | |
<property name="fieldKeys"> | |
<list> | |
<value>title</value> | |
</list> | |
</property> | |
</bean> | |
<!-- **************************************************************************************************** --> | |
<!-- Submission Lookup Transformation Engine (phase 2) --> | |
<!-- **************************************************************************************************** --> | |
<bean name="phase2TransformationEngine" class="gr.ekt.bte.core.TransformationEngine"> | |
<property name="dataLoader" ref="submissionItemDataLoader"/> | |
<property name="workflow" ref="phase2linearWorkflow"/> | |
<property name="outputGenerator" ref="org.dspace.submit.lookup.DSpaceWorkspaceItemOutputGenerator"/> | |
</bean> | |
<bean name="submissionItemDataLoader" class="org.dspace.submit.lookup.SubmissionItemDataLoader"/> | |
<!-- Specify here any filters or modifiers to run before the output --> | |
<bean name="phase2linearWorkflow" class="gr.ekt.bte.core.LinearWorkflow"> | |
<property name="process"> | |
<list> | |
<ref bean="fieldMergeModifier"/> | |
<ref bean="valueConcatenationModifier"/> | |
<ref bean="languageCodeModifier"/> | |
</list> | |
</property> | |
</bean> | |
<bean name="fieldMergeModifier" class="org.dspace.submit.lookup.FieldMergeModifier"> | |
<property name="mergeFieldMap"> | |
<map> | |
<entry key="allauthors"> | |
<list> | |
<value>authors</value> | |
</list> | |
</entry> | |
<entry key="allkeywords"> | |
<list> | |
<value>keywords</value> | |
<value>mesh</value> | |
</list> | |
</entry> | |
</map> | |
</property> | |
</bean> | |
<bean name="valueConcatenationModifier" class="org.dspace.submit.lookup.ValueConcatenationModifier"> | |
<property name="field" value="allkeywords"/> | |
<property name="separator" value=";" /> | |
<property name="whitespaceAfter" value="true" /> | |
</bean> | |
<bean name="languageCodeModifier" class="org.dspace.submit.lookup.LanguageCodeModifier"/> | |
<bean name="org.dspace.submit.lookup.DSpaceWorkspaceItemOutputGenerator" class="org.dspace.submit.lookup.DSpaceWorkspaceItemOutputGenerator"> | |
<property name="outputMap" ref="outputMap"/> | |
<property name="extraMetadataToKeep"> | |
<list> | |
<value>dc.import.contributorauthor</value> | |
<value>dc.import.contributoreditor</value> | |
<value>dc.import.contributortranslator</value> | |
<!-- <value>dc.description.scopusurl</value> | |
<value>dc.description.scopuscitationcount</value> | |
<value>dc.description.scopuscitationurl</value>--> | |
</list> | |
</property> | |
</bean> | |
<!-- **************************************************************************************************** --> | |
<!-- DataLoader beans --> | |
<!-- **************************************************************************************************** --> | |
<!-- Each dataloader needs a mapping that defines how the input maps to | |
records. Internally every record organizes the data as key-list of values | |
pairs, and in order to be able to recall the values the keys should have | |
distinct names. Each data format has a way to address individual data, and | |
this is the key of the map. The value is the label that the record internally | |
associates with the specific data and is used in the output mapping as well. --> | |
<!-- The key of the map is just the BibTeX label (e.g. author, date, pages | |
etc). The value the label that the record internally associates with the | |
specific data. --> | |
<bean id="bibTeXDataLoader" class="gr.ekt.bteio.loaders.BibTeXDataLoader"> | |
<property name="fieldMap"> | |
<map> | |
<entry key="title" value="title" /> | |
<entry key="author" value="authors" /> | |
<entry key="journal" value="journal" /> | |
<entry key="year" value="issued" /> | |
<entry key="ISSN" value="jissn" /> | |
</map> | |
</property> | |
</bean> | |
<!-- Each entry in a CSV is a row, and each column represents the same data | |
in each entry. For example the first column might record the item title, | |
the second the authors etc. The key of the field map is this number. Note | |
that the first column is number 0. The CSV data loader has the following extra parameters | |
that configure its behaviour: - skipLines: a number that instructs the reader | |
to ignore the first lines in the input file. Default value: 0 - separator: | |
a character that signifies how the values are separated. Default value ',' | |
-quoteChar: individual values could include the separator character. For | |
example if the separator is ',' and there is an abstract, there is a high | |
probability that it will contain commas. If the value is quoted using the | |
quoteChar then separator characters inside it will be ignored. Default value | |
'"'. -valueSeparator: There are cases where a value is the concatenation | |
of multiple values. For instance a list of authors. In this case the CSVDataLoader | |
can split the CSV value into its individual values, if they are separated | |
with valueSeparator. This can be a full java regular expression. Default | |
value: null (the csv value is not used by default). --> | |
<bean id="csvDataLoader" class="gr.ekt.bteio.loaders.CSVDataLoader"> | |
<property name="fieldMap"> | |
<map> | |
<entry key="0" value="jissn" /> | |
<entry key="1" value="pisbn" /> | |
<entry key="2" value="citation" /> | |
<entry key="3" value="otheridentifiers" /> | |
<entry key="4" value="journal" /> | |
<entry key="5" value="title" /> | |
<entry key="6" value="issued" /> | |
<entry key="7" value="language" /> | |
<entry key="8" value="subtype" /> | |
<entry key="9" value="authors" /> | |
<entry key="10" value="editors" /> | |
<entry key="11" value="illustrators" /> | |
<entry key="12" value="translators" /> | |
<entry key="13" value="chairs" /> | |
<entry key="14" value="abstract" /> | |
<entry key="15" value="allkeywords" /> | |
<entry key="16" value="arxivCategory" /> | |
<entry key="17" value="doi" /> | |
<entry key="18" value="publisher" /> | |
<entry key="19" value="url" /> | |
<entry key="20" value="volume" /> | |
<entry key="21" value="issue" /> | |
<entry key="22" value="eisbn" /> | |
<entry key="23" value="editionnumber" /> | |
<entry key="24" value="seriestitle" /> | |
<entry key="25" value="volumetitle" /> | |
<entry key="26" value="titleAlternative" /> | |
<entry key="27" value="isversionof" /> | |
<entry key="28" value="provenance" /> | |
<entry key="29" value="spatial" /> | |
<entry key="30" value="temporal" /> | |
<entry key="31" value="tableofcontents" /> | |
<entry key="32" value="rightsholder" /> | |
<entry key="33" value="rightsuri" /> | |
<entry key="34" value="source" /> | |
<entry key="35" value="classification" /> | |
<entry key="36" value="dcc" /> | |
<entry key="37" value="lcc" /> | |
<entry key="38" value="lcsh" /> | |
<entry key="39" value="mesh" /> | |
</map> | |
</property> | |
<property name="skipLines" value="1" /> | |
</bean> | |
<!-- A TSV file is exactly the same as a CSV one, with the difference that | |
the separator is a tab instead of a comma. See the comments in the previous | |
section. --> | |
<bean id="tsvDataLoader" class="gr.ekt.bteio.loaders.CSVDataLoader"> | |
<property name="fieldMap"> | |
<map> | |
<entry key="0" value="jissn" /> | |
<entry key="1" value="pisbn" /> | |
<entry key="2" value="citation" /> | |
<entry key="3" value="otheridentifiers" /> | |
<entry key="4" value="journal" /> | |
<entry key="5" value="title" /> | |
<entry key="6" value="issued" /> | |
<entry key="7" value="language" /> | |
<entry key="8" value="subtype" /> | |
<entry key="9" value="authors" /> | |
<entry key="10" value="editors" /> | |
<entry key="11" value="illustrators" /> | |
<entry key="12" value="translators" /> | |
<entry key="13" value="chairs" /> | |
<entry key="14" value="abstract" /> | |
<entry key="15" value="allkeywords" /> | |
<entry key="16" value="arxivCategory" /> | |
<entry key="17" value="doi" /> | |
<entry key="18" value="publisher" /> | |
<entry key="19" value="url" /> | |
<entry key="20" value="volume" /> | |
<entry key="21" value="issue" /> | |
<entry key="22" value="eisbn" /> | |
<entry key="23" value="editionnumber" /> | |
<entry key="24" value="seriestitle" /> | |
<entry key="25" value="volumetitle" /> | |
<entry key="26" value="titleAlternative" /> | |
<entry key="27" value="isversionof" /> | |
<entry key="28" value="provenance" /> | |
<entry key="29" value="spatial" /> | |
<entry key="30" value="temporal" /> | |
<entry key="31" value="tableofcontents" /> | |
<entry key="32" value="rightsholder" /> | |
<entry key="33" value="rightsuri" /> | |
<entry key="34" value="source" /> | |
<entry key="35" value="classification" /> | |
<entry key="36" value="dcc" /> | |
<entry key="37" value="lcc" /> | |
<entry key="38" value="lcsh" /> | |
<entry key="39" value="mesh" /> | |
</map> | |
</property> | |
<!-- This makes the CSV data loader able to load TSV data --> | |
<property name="separator" value="\u0009" /> | |
<property name="skipLines" value="1" /> | |
</bean> | |
<!-- The keys in the RIS data loader map have to be the RIS tags that | |
need to be loaded. --> | |
<bean id="risDataLoader" class="gr.ekt.bteio.loaders.RISDataLoader"> | |
<property name="fieldMap"> | |
<map> | |
<entry key="T1" value="title" /> | |
<entry key="AU" value="authors" /> | |
<entry key="SO" value="journal" /> | |
<entry key="PY" value="issued" /> | |
<entry key="SN" value="jissn" /> | |
<entry key="PT" value="subtype" /> | |
<entry key="AB" value="abstract" /> | |
</map> | |
</property> | |
</bean> | |
<bean id="endnoteDataLoader" class="gr.ekt.bteio.loaders.EndnoteDataLoader"> | |
<property name="fieldMap"> | |
<map> | |
<entry key="TI" value="title" /> | |
<entry key="AU" value="authors" /> | |
<entry key="AB" value="abstract" /> | |
<entry key="PY" value="issued" /> | |
<entry key="SO" value="journal" /> | |
</map> | |
</property> | |
</bean> | |
<!-- OAI Data Loader --> | |
<bean id="oaipmhDataLoader" class="gr.ekt.bteio.loaders.OAIPMHDataLoader"> | |
<property name="fieldMap"> | |
<map> | |
<entry key="title" value="title" /> | |
<entry key="creator" value="authors" /> | |
<entry key="description" value="abstract" /> | |
<entry key="date" value="issued" /> | |
<entry key="type" value="subtype" /> | |
</map> | |
</property> | |
<property name="prefix" value="oai_dc" /> | |
<property name="serverAddress" | |
value="http://ebooks.serrelib.gr/serrelib-oai/request" /> | |
</bean> | |
<!-- PubMed --> | |
<bean id="pubmedOnlineDataLoader" class="org.dspace.submit.lookup.PubmedOnlineDataLoader"> | |
<property name="searchProvider" value="false" /> | |
<property name="fieldMap" ref="pubmedInputMap" /> | |
</bean> | |
<bean id="pubmedFileDataLoader" class="org.dspace.submit.lookup.PubmedFileDataLoader"> | |
<property name="fieldMap" ref="pubmedInputMap" /> | |
</bean> | |
<bean name="pubmedInputMap" class="java.util.HashMap" scope="prototype"> | |
<constructor-arg> | |
<map key-type="java.lang.String" value-type="java.lang.String"> | |
<entry key="pubmedID" value="pubmedID" /> | |
<entry key="doi" value="doi" /> | |
<entry key="printISSN" value="jissn" /> | |
<entry key="electronicISSN" value="jeissn" /> | |
<entry key="journalTitle" value="journal" /> | |
<entry key="articleTitle" value="title" /> | |
<entry key="pubDate" value="issued" /> | |
<entry key="journalVolume" value="volume" /> | |
<entry key="journalIssue" value="issue" /> | |
<entry key="language" value="language" /> | |
<entry key="publicationType" value="subtype" /> | |
<entry key="primaryKeyword" value="keywords" /> | |
<entry key="secondaryKeyword" value="keywords" /> | |
<entry key="primaryMeshHeading" value="mesh" /> | |
<entry key="secondaryMeshHeading" value="mesh" /> | |
<entry key="startPage" value="firstpage" /> | |
<entry key="endPage" value="lastpage" /> | |
<entry key="abstractText" value="abstract" /> | |
<entry key="publicationStatus" value="publicationStatus" /> | |
<entry key="author" value="authors" /> | |
<!-- Not used --> | |
<!-- | |
<entry key="pubblicationModel" value="" /> | |
--> | |
</map> | |
</constructor-arg> | |
</bean> | |
<!-- Arxiv Data Loaders --> | |
<bean id="arXivOnlineDataLoader" class="org.dspace.submit.lookup.ArXivOnlineDataLoader"> | |
<property name="searchProvider" value="false" /> | |
<property name="fieldMap" ref="arxivInputMap" /> | |
</bean> | |
<bean id="arXivFileDataLoader" class="org.dspace.submit.lookup.ArXivFileDataLoader"> | |
<property name="fieldMap" ref="arxivInputMap" /> | |
</bean> | |
<bean name="arxivInputMap" class="java.util.HashMap" scope="prototype"> | |
<constructor-arg> | |
<map key-type="java.lang.String" value-type="java.lang.String"> | |
<entry key="journalRef" value="journal" /> | |
<entry key="doi" value="doi" /> | |
<entry key="author" value="authors" /> | |
<entry key="authorWithAffiliation" value="authorsWithAffiliation" /> | |
<entry key="comment" value="note" /> | |
<entry key="published" value="issued" /> | |
<entry key="articleTitle" value="title" /> | |
<entry key="summary" value="abstract" /> | |
<entry key="id" value="url" /> | |
<entry key="pdfUrl" value="fulltextUrl" /> | |
<entry key="primaryCategory" value="arxivCategory" /> | |
<entry key="category" value="arxivCategory" /> | |
</map> | |
</constructor-arg> | |
</bean> | |
<!-- CrossRef Data Loaders --> | |
<bean id="crossRefOnlineDataLoader" class="org.dspace.submit.lookup.CrossRefOnlineDataLoader"> | |
<property name="searchProvider" value="false" /> | |
<!-- For CrossRef service you need to obtain an API Key from CrossRef. Once you get it, add it | |
to the following configuration value | |
--> | |
<property name="apiKey" value="" /> | |
<!-- Uncomment the following line if you want to define the max results returned by the | |
CrossRef free text (by author, title, date) search. Default value is 10 | |
--> | |
<!-- <property name="maxResults" value="10" /> --> | |
<property name="fieldMap" ref="crossrefInputMap" /> | |
</bean> | |
<bean id="crossRefFileDataLoader" class="org.dspace.submit.lookup.CrossRefFileDataLoader"> | |
<property name="fieldMap" ref="crossrefInputMap" /> | |
</bean> | |
<bean name="crossrefInputMap" class="java.util.HashMap" scope="prototype"> | |
<constructor-arg> | |
<map key-type="java.lang.String" value-type="java.lang.String"> | |
<entry key="journalTitle" value="journal" /> | |
<entry key="doi" value="doi" /> | |
<entry key="authors" value="authors" /> | |
<entry key="printISSN" value="jissn" /> | |
<entry key="electronicISSN" value="jeissn" /> | |
<entry key="year" value="issued" /> | |
<entry key="articleTitle" value="title" /> | |
<entry key="volume" value="volume" /> | |
<entry key="issue" value="issue" /> | |
<entry key="firstPage" value="firstpage" /> | |
<entry key="lastPage" value="lastpage" /> | |
<entry key="printISBN" value="pisbn" /> | |
<entry key="electronicISBN" value="eisbn" /> | |
<entry key="editionNumber" value="editionnumber" /> | |
<entry key="seriesTitle" value="seriestitle" /> | |
<entry key="volumeTitle" value="volumetitle" /> | |
<entry key="editors" value="editors" /> | |
<entry key="translators" value="translators" /> | |
<entry key="chairs" value="chairs" /> | |
<entry key="doyType" value="subtype" /> | |
<!-- Not used --> | |
<!-- | |
<entry key="publicationType" value="" /> | |
--> | |
</map> | |
</constructor-arg> | |
</bean> | |
<!-- CiNii --> | |
<bean id="ciniiOnlineDataLoader" class="org.dspace.submit.lookup.CiNiiOnlineDataLoader"> | |
<property name="searchProvider" value="false" /> | |
<!-- For CiNii service you need to obtain an Application ID from NII. | |
Once you get it, add it to the following configuration value. | |
For details, see http://ci.nii.ac.jp/info/en/api/developer.html | |
--> | |
<property name="appId" value="" /> | |
<!-- Uncomment the following line if you want to define the max results | |
returned by the CiNii free text (by author, title, date) search. | |
Default value is 10 | |
--> | |
<!-- <property name="maxResults" value="10" /> --> | |
<property name="fieldMap" ref="ciniiInputMap" /> | |
</bean> | |
<bean id="ciniiFileDataLoader" class="org.dspace.submit.lookup.CiNiiFileDataLoader"> | |
<property name="fieldMap" ref="ciniiInputMap" /> | |
</bean> | |
<bean name="ciniiInputMap" class="java.util.HashMap" scope="prototype"> | |
<constructor-arg> | |
<map key-type="java.lang.String" value-type="java.lang.String"> | |
<entry key="naid" value="naid" /> | |
<entry key="ncid" value="ncid" /> | |
<entry key="issn" value="jissn" /> | |
<entry key="journal" value="journal" /> | |
<entry key="title" value="title" /> | |
<entry key="issued" value="issued" /> | |
<entry key="volume" value="volume" /> | |
<entry key="issue" value="issue" /> | |
<entry key="spage" value="firstpage" /> | |
<entry key="epage" value="lastpage" /> | |
<entry key="language" value="language" /> | |
<entry key="description" value="abstract" /> | |
<entry key="subjects" value="keywords" /> | |
<entry key="authors" value="authors" /> | |
<entry key="publisher" value="publisher" /> | |
</map> | |
</constructor-arg> | |
</bean> | |
<!-- **************************************************************************************************** --> | |
<!-- Output Mapping --> | |
<!-- **************************************************************************************************** --> | |
<!-- The output generator needs a configuration on how to map internal records | |
to DSpace metadata fields. The following map specifies this relationship. | |
The value needs to be the label that the record internally associates with | |
the specific data and it is specified in the data loader beans. The key is | |
in the format of <schema>.<element>[.<qualifier>] and specified the dspace | |
metadata field that the value will map to. --> | |
<bean name="outputMap" class="java.util.HashMap" scope="prototype"> | |
<constructor-arg> | |
<map key-type="java.lang.String" value-type="java.lang.String"> | |
<entry value="jissn" key="dc.identifier.issn" /> | |
<entry value="pisbn" key="dc.identifier.isbn" /> | |
<entry value="citation" key="dc.identifier.citation" /> | |
<entry value="otheridentifiers" key="dc.identifier.other" /> | |
<entry value="journal" key="dc.source" /> | |
<entry value="title" key="dc.title" /> | |
<entry value="issued" key="dc.date.issued" /> | |
<entry value="language" key="dc.language.iso" /> | |
<entry value="subtype" key="dc.type" /> | |
<entry value="authors" key="dc.contributor.author" /> | |
<entry value="editors" key="dc.contributor.editor" /> | |
<entry value="illustrators" key="dc.contributor.illustrator" /> | |
<entry value="translators" key="dc.contributor.other" /> | |
<entry value="chairs" key="dc.contributor.other" /> | |
<entry value="abstract" key="dc.description.abstract" /> | |
<entry value="allkeywords" key="dc.subject" /> | |
<entry value="arxivCategory" key="dc.subject" /> | |
<entry value="doi" key="dc.identifier" /> | |
<entry value="publisher" key="dc.publisher" /> | |
<!-- Not used - new metadata fields need to be declared for them in DSpace registry --> | |
<entry value="url" key="dc.relation.uri" /> | |
<entry value="volume" key="dc.relation.ispartof" /> | |
<entry value="issue" key="dc.relation.ispartof" /> | |
<entry value="eisbn" key="dc.identifier.isbn" /> | |
<entry value="editionnumber" key="dc.relation.ispartof" /> | |
<entry value="seriestitle" key="dc.relation.ispartofseries" /> | |
<entry value="volumetitle" key="dc.relation.ispartof" /> | |
<entry value="titleAlternative" key="dc.title.alternative" /> | |
<!-- Not used - new metadata fields need to be declared for them in DSpace registry 2 --> | |
<entry value="isversionof" key="dc.relation.isversionof" /> | |
<entry value="provenance" key="dc.description.provenance" /> | |
<entry value="spatial" key="dc.coverage.spatial" /> | |
<entry value="temporal" key="dc.coverage.temporal" /> | |
<entry value="tableofcontents" key="dc.description.tableofcontents" /> | |
<entry value="rightsholder" key="dc.rights.holder" /> | |
<entry value="rightsuri" key="dc.rights.uri" /> | |
<entry value="source" key="dc.source" /> | |
<entry value="classification" key="dc.subject.classification" /> | |
<!-- Other IDs --> | |
<entry value="dcc" key="dc.subject.ddc" /> | |
<entry value="lcc" key="dc.subject.lcc" /> | |
<entry value="lcsh" key="dc.subject.lcsh" /> | |
<entry value="mesh" key="dc.subject.mesh" /> | |
</map> | |
</constructor-arg> | |
</bean> | |
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo su dspace | |
/dspace/dspace/bin/dspace create-administrator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#install dependencies | |
sudo apt-get -qq -y install openjdk-8-jdk tasksel ant maven htop lynx wget | |
sudo apt-get install mutt | |
sudo tasksel #select PostgreSQL server and Tomcat Server. Confirm. | |
sudo apt-get install mutt #optional, for mailing files as attachments. | |
#edit tomcat heap space | |
sudo vim /usr/share/tomcat8/bin/setenv.sh | |
#paste the contents of the setenv.sh file in this gist and save | |
sudo service tomcat8 restart | |
#editing database properties | |
sudo su postgres | |
createuser -U postgres -d -A -P dspace | |
vim /etc/postgresql/9.5/main/pg_hba.conf | |
#add at the end: | |
#local all dspace md5 | |
exit | |
#create dspace user and dspace directory | |
sudo useradd -m dspace | |
sudo passwd dspace #enter password | |
sudo mkdir /dspace | |
sudo chown dspace /dspace | |
#create the database for dspace | |
sudo -u dspace createdb -U dspace -E UNICODE dspace | |
#install pgcrypto | |
sudo su postgres | |
psql dspace | |
CREATE EXTENSION pgcrypto; | |
#Type \q and then press ENTER to quit psql. | |
#clone dspace | |
sudo su dspace | |
cd /home/dspace | |
git clone https://github.com/DSpace/DSpace | |
cd DSpace | |
git checkout dspace-6.0 | |
#configure things for compiling dspace | |
cd /home/dspace/DSpace | |
#set build properties | |
cd /home/dspace/DSpace/dspace/config | |
cp local.cfg.EXAMPLE local.cfg | |
vim local.cfg | |
#paste the contents of attached file in this gist | |
#configure csv import | |
vim /home/dspace/DSpace/dspace/config/spring/api/bte.xml | |
#replace the <bean id="csvDataLoader" section with the contents of the bte.xml in this gist | |
exit | |
#upload any custom logos to | |
#/home/dspace/DSpace/dspace-jspui/src/main/webapp/image | |
#/home/dspace/DSpace/dspace/target/dspace-installer/webapps/xmlui/themes/Mirage/images | |
# you can also edit the header jsp file to change the path to the logo | |
#vim /dspace/webapps/jspui/layout/header-default.jsp | |
sudo su | |
#set the modification date to the current date on the server because of any time offset problems | |
touch -a /var/lib/tomcat8/webapps/jspui/image/*logo* && | |
cd /home/dspace/DSpace && | |
mvn package && | |
cd /home/dspace/DSpace/dspace/target/dspace-installer && | |
ant fresh_install && | |
#copy app to installation directory | |
cp -R /home/dspace/DSpace/dspace /dspace && | |
#install compiled apps in tomcat8 | |
#sudo cp $(find /home/dspace/DSpace | grep \.war$ | xargs echo) /var/lib/tomcat8/webapps; | |
cd /var/lib/tomcat8/webapps && | |
rm -rf jspui/ oai/ rdf/ rest/ solr/ sword/ swordv2/ xmlui/ && | |
cp -R /dspace/dspace/webapps/jspui /dspace/dspace/webapps/solr /dspace/dspace/webapps/rest /var/lib/tomcat8/webapps && | |
touch -a /home/dspace/DSpace/dspace-jspui/src/main/webapp/image/*logo* && | |
#give ownership of installation to tomcat user | |
sudo chown -R tomcat8 /dspace && | |
#restart tomcat; | |
service tomcat8 restart && | |
echo "OK"; | |
#create admin user | |
chmod +x /dspace/dspace/bin/dspace | |
su dspace | |
/dspace/dspace/bin/dspace create-administrator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#enable admin user for tomcat gui | |
sudo vim /etc/tomcat8/tomcat-users.xml | |
#The file must be like this | |
#<tomcat-users> | |
#<!-- | |
# <role rolename="tomcat"/> | |
# <role rolename="role1"/> | |
# <user username="tomcat" password="tomcat" roles="tomcat"/> | |
# <user username="both" password="tomcat" roles="tomcat,role1"/> | |
# <user username="role1" password="tomcat" roles="role1"/> | |
#--> | |
# <role rolename="manager-gui"/> | |
# <user username="admin" password="admin" roles="manager-gui"/> | |
# | |
#</tomcat-users> | |
#deploy dspace app (JSPUI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo su | |
chmod -R ugo+w /dspace/dspace/imports | |
cd /dspace/dspace/bin | |
chmod +x ./dspace | |
./dspace import -s /home/dspace/Registos\ Bibliografia\ Lyman\ Sargent\ -\ Metadata\ \(1\).csv -i csv -m /home/dspace/map -b -e lolada@gmail.com -c "123456789/4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo wget https://github.com/DSpace/DSpace/blob/dspace-5.5/dspace/config/spring/api/bte.xml#L321 /dspace/bte.xml | |
sudo wget https://github.com/DSpace/DSpace/blob/dspace-5.5/dspace/config/spring/api/bte.xml#L321 /dspace/bte.xml | |
sudo ./dspace import -b -e dspace_user_email@gmail.com -c 123456789/2 -s /home/dspace/dspace_import.ris -m /dspace/bte_ris.xml -i ris |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EXAMPLE "local.cfg" for DSpace. | |
# | |
# Any configurations added to this file will automatically OVERRIDE configurations | |
# of the same name in any of the DSpace *.cfg files. This includes overriding | |
# settings in any of these files: | |
# * [dspace]/config/dspace.cfg | |
# * Or any configuration file that is included in 'dspace.cfg' | |
# (See "include = [filepath]" settings near the end of dspace.cfg. | |
# By default, it includes all [dspace]/config/modules/*.cfg files) | |
# | |
# By default, this EXAMPLE file includes a number of commonly overridden configurations. | |
# * ADD configurations by simply copying them into this file from any existing *.cfg file. | |
# * REMOVE configurations by simply commenting them out or deleting them below. | |
# | |
# Any commented out settings in this file are simply ignored. A configuration | |
# will only override another configuration if it has the EXACT SAME key/name. | |
# For example, including "dspace.dir" in this local.cfg will override the | |
# default value of "dspace.dir" in the dspace.cfg file. | |
# Similarly, including "oai.solr.url" in this local.cfg will override the | |
# default value of "oai.solr.url" in the modules/oai.cfg file. | |
# | |
########################## | |
# SERVER CONFIGURATION # | |
########################## | |
# DSpace installation directory. | |
# This is the location where you want to install DSpace. | |
# Windows note: Please remember to use forward slashes for all paths (e.g. C:/dspace) | |
dspace.dir=/dspace/dspace | |
# DSpace host name - should match base URL. Do not include port number | |
dspace.hostname = localhost | |
# DSpace base host URL. Include port number etc. | |
dspace.baseUrl = http://localhost:8080 | |
# The user interface you will be using for DSpace. Common usage is either xmlui or jspui | |
dspace.ui = jspui | |
# Full link your end users will use to access DSpace. In most cases, this will be the baseurl followed by | |
# the context path to the UI you are using. | |
# | |
# Alternatively, you can use a url redirect or deploy the web application under the servlet container root. | |
# In this case, make sure to remove the /${dspace.ui} from the dspace.url property. | |
#dspace.url = ${dspace.baseUrl}/${dspace.ui} | |
# Name of the site | |
dspace.name = Example DSpace | |
# Default language for metadata values | |
#default.language = en_US | |
# Solr server/webapp. | |
# DSpace uses Solr for all search/browse capability (and for usage statistics by default). | |
# The included 'solr' webapp MUST be deployed to Tomcat for DSpace to function. | |
# Usually it will be available via port 8080 and the 'solr' context path. But, | |
# But, you may need to modify this if you are running DSpace on a custom port, etc. | |
solr.server = http://localhost:8080/solr | |
########################## | |
# DATABASE CONFIGURATION # | |
########################## | |
# DSpace only supports two database types: PostgreSQL or Oracle | |
# URL for connecting to database | |
# * Postgres template: jdbc:postgresql://localhost:5432/dspace | |
# * Oracle template: jdbc:oracle:thin:@//localhost:1521/xe | |
db.url = jdbc:postgresql://localhost:5432/dspace | |
# JDBC Driver | |
# * For Postgres: org.postgresql.Driver | |
# * For Oracle: oracle.jdbc.OracleDriver | |
db.driver = org.postgresql.Driver | |
# Database Dialect (for Hibernate) | |
# * For Postgres: org.dspace.storage.rdbms.hibernate.postgres.DSpacePostgreSQL82Dialect | |
# * For Oracle: org.hibernate.dialect.Oracle10gDialect | |
db.dialect = org.dspace.storage.rdbms.hibernate.postgres.DSpacePostgreSQL82Dialect | |
# Database username and password | |
db.username = dspace | |
db.password = dspace | |
# Database Schema name | |
# * For Postgres, this is often "public" (default schema) | |
# * For Oracle, schema is equivalent to the username of your database account, | |
# so this may be set to ${db.username} in most scenarios. | |
db.schema = public | |
## Connection pool parameters | |
# Maximum number of DB connections in pool (default = 30) | |
#db.maxconnections = 30 | |
# Maximum time to wait before giving up if all connections in pool are busy (milliseconds) | |
# (default = 5000ms or 5 seconds) | |
#db.maxwait = 5000 | |
# Maximum number of idle connections in pool (-1 = unlimited) | |
# (default = -1, unlimited) | |
#db.maxidle = -1 | |
####################### | |
# EMAIL CONFIGURATION # | |
####################### | |
# SMTP mail server (allows DSpace to send email notifications) | |
#mail.server = smtp.example.com | |
# SMTP mail server authentication username and password (if required) | |
#mail.server.username = myusername | |
#mail.server.password = mypassword | |
# SMTP mail server alternate port (defaults to 25) | |
#mail.server.port = 25 | |
# From address for mail | |
# All mail from the DSpace site will use this 'from' address | |
#mail.from.address = dspace-noreply@myu.edu | |
# When feedback is submitted via the Feedback form, it is sent to this address | |
# Currently limited to one recipient! | |
#feedback.recipient = dspace-help@myu.edu | |
# General site administration (Webmaster) e-mail | |
#mail.admin = dspace-help@myu.edu | |
# Recipient for server errors and alerts (defaults to mail.admin) | |
#alert.recipient = ${mail.admin} | |
# Recipient for new user registration emails (defaults to unspecified) | |
#registration.notify = | |
######################## | |
# HANDLE CONFIGURATION # | |
######################## | |
# | |
# Canonical Handle URL prefix | |
# | |
# Items in DSpace receive a unique URL, stored in dc.identifier.uri | |
# after it is generated during the submission process. | |
# | |
# If you register with CNRI's handle service at http://www.handle.net/, | |
# these links can be generated as permalinks using http://hdl.handle.net/ | |
# as canonical prefix. Please make sure to change handle.canonical.prefix | |
# after registering with handle.net by uncommenting one of the following | |
# lines, depending if you prefer to use http or https: | |
# handle.canonical.prefix = http://hdl.handle.net/ | |
# handle.canonical.prefix = https://hdl.handle.net/ | |
# | |
# Note that this will not alter dc.identifer.uri metadata for existing | |
# items (only for subsequent submissions), but it will alter the URL | |
# in JSPUI's 'identifier' message on item record pages for existing items. | |
# CNRI Handle prefix | |
# (Defaults to a dummy/fake prefix of 123456789) | |
#handle.prefix = 123456789 | |
####################### | |
# PROXY CONFIGURATION # | |
####################### | |
# uncomment and specify both properties if proxy server required | |
# proxy server for external http requests - use regular hostname without port number | |
#http.proxy.host = | |
# port number of proxy server | |
#http.proxy.port = | |
########################## | |
# AUTHENTICATION METHODS # | |
########################## | |
# EXAMPLE OVERRIDE: | |
# Override the default authentication method(s) defined in authentication.cfg | |
# by defining your own custom ordered list in this local.cfg. | |
# | |
# By default, all of these methods are commented out and DSpace will use the | |
# settings from authentication.cfg. But you may uncomment whichever plugins you | |
# need in order to change the default settings (or reorder them below). | |
# | |
# You may also copy default settings from the corresponding authentication-*.cfg | |
# configuration file and override them in this local.cfg. | |
# IP-based authentication/authorization. See authentication-ip.cfg for default configuration. | |
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.IPAuthentication | |
# LDAP authentication/authorization. See authentication-ldap.cfg for default configuration. | |
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.LDAPAuthentication | |
# Shibboleth authentication/authorization. See authentication-shibboleth.cfg for default configuration. | |
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.ShibAuthentication | |
# X.509 certificate authentication. See authentication-x509.cfg for default configuration. | |
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.X509Authentication | |
# Authentication by Password (encrypted in DSpace's database). See authentication-password.cfg for default configuration. | |
# Enabled by default in authentication.cfg | |
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.PasswordAuthentication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#misc stuff | |
#re-create database | |
sudo -u dspace dropdb dspace | |
sudo -u dspace createdb -U dspace -E UNICODE dspace | |
sudo -u dspace psql dspace | |
#alter the password for the dspace user | |
ALTER USER "dspace" WITH PASSWORD 'dspace'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonemedium "C:\Users\joaor\VirtualBox VMs\DSpaceVagrant_default_1493144378220_4048\ubuntu-xenial-16.04-cloudimg.vmdk" "C:\Users\joaor\VirtualBox VMs\DSpaceVagrant_default_1493144378220_4048\ubuntu-xenial-16.04-cloudimg.vdi" --format vdi | |
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifymedium "C:\Users\joaor\VirtualBox VMs\DSpaceVagrant_default_1493144378220_4048\ubuntu-xenial-16.04-cloudimg.vdi" --resize 51200 | |
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonemedium "C:\Users\joaor\VirtualBox VMs\DSpaceVagrant_default_1493144378220_4048\ubuntu-xenial-16.04-cloudimg.vdi" "C:\Users\joaor\VirtualBox VMs\DSpaceVagrant_default_1493144378220_4048\ubuntu-xenial-16.04-cloudimg.vdmk" --format vmdk | |
cd ~/VirtualBox VMs/<vm_name> #change this | |
VBoxManage clonehd ubuntu-xenial-16.04-cloudimg.vmdk ubuntu-xenial-16.04-cloudimg.vdi --format vdi | |
VBoxManage modifyhd ubuntu-xenial-16.04-cloudimg.vdi --resize 51200 #for 50GB HD | |
mv ubuntu-xenial-16.04-cloudimg.vmdk ubuntu-xenial-16.04-cloudimg.vmdk.bak | |
VBoxManage clonehd ubuntu-xenial-16.04-cloudimg.vdi ubuntu-xenial-16.04-cloudimg.vmdk --format vmdk | |
VBoxManage internalcommands sethduuid ubuntu-xenial-16.04-cloudimg.vmdk | |
#replace the given uuid in the storage section of the .vbox file | |
#<MediaRegistry> | |
# <HardDisks> | |
# <HardDisk uuid="{0079b17b-b6fa-43a4-88ae-2a731b58b210}" location="ubuntu-xenial-16.04-cloudimg-configdrive.vmdk" format="VMDK" type="Normal"/> | |
# <HardDisk uuid="{a74087d2-8e96-4ef8-bb34-36775d89dcf3}" location="ubuntu-xenial-16.04-cloudimg.vmdk" format="VMDK" type="Normal"/> | |
# </HardDisks> | |
#</MediaRegistry> | |
#Remove the vmdk hard drive in the VBox UI and reattach it again. | |
#Boot up! | |
rm -rf ubuntu-xenial-16.04-cloudimg.vmdk.bak #AFTER you check the clone was SUCCESSFUL!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export JAVA_OPTS="$JAVA_OPTS -Xms512M -Xmx512M" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#TAIL LOG | |
cd /var/log/tomcat8 | |
tail -f catalina.2017-04-26.log #name may be different (date) | |
tail -f localhost.2017-05-03.log #name may be different (date) FOR INTERNAL SERVER ERRORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jissn | pisbn | citation | otheridentifiers | journal | title | issued | language | subtype | authors | editors | illustrators | translators | chairs | abstract | allkeywords | arxivCategory | doi | publisher | url | volume | issue | eisbn | editionnumber | seriestitle | volumetitle | titleAlternative | isversionof | provenance | spatial | temporal | tableofcontents | rightsholder | rightsuri | source | classification | dcc | lcc | lcsh | mesh | id | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jissn | pisbn | citation | otheridentifiers | journal | title | 11-11-1111 | language | subtype | authors | editors | illustrators | translators | chairs | abstract | allkeywords | arxivCategory | doi | publisher | url | volume | issue | eisbn | editionnumber | seriestitle | volumetitle | titleAlternative | isversionof | provenance | spatial | 11-11-1111 | tableofcontents | rightsholder | rightsuri | source | classification | dcc | lcc | lcsh | mesh | + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
#install plugin to keep all the VBox Guest Additions updated. | |
required_plugins = %w(vagrant-share vagrant-vbguest) | |
plugins_to_install = required_plugins.select { |plugin| not Vagrant.has_plugin? plugin } | |
if not plugins_to_install.empty? | |
puts "Installing plugins: #{plugins_to_install.join(' ')}" | |
if system "vagrant plugin install #{plugins_to_install.join(' ')}" | |
exec "vagrant #{ARGV.join(' ')}" | |
else | |
abort "Installation of one or more plugins has failed. Aborting." | |
end | |
end | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at | |
# https://docs.vagrantup.com. | |
# Every Vagrant development environment requires a box. You can search for | |
# boxes at https://atlas.hashicorp.com/search. | |
config.vm.box = "ubuntu/xenial64" | |
# Disable automatic box update checking. If you disable this, then | |
# boxes will only be checked for updates when the user runs | |
# `vagrant box outdated`. This is not recommended. | |
# config.vm.box_check_update = false | |
# Create a forwarded port mapping which allows access to a specific port | |
# within the machine from a port on the host machine. In the example below, | |
# accessing "localhost:8080" will access port 80 on the guest machine. | |
# config.vm.network "forwarded_port", guest: 80, host: 8080 | |
# Create a private network, which allows host-only access to the machine | |
# using a specific IP. | |
config.vm.network "private_network", ip: "192.168.33.10" | |
# Create a public network, which generally matched to bridged network. | |
# Bridged networks make the machine appear as another physical device on | |
# your network. | |
# config.vm.network "public_network" | |
# Share an additional folder to the guest VM. The first argument is | |
# the path on the host to the actual folder. The second argument is | |
# the path on the guest to mount the folder. And the optional third | |
# argument is a set of non-required options. | |
# config.vm.synced_folder "../data", "/vagrant_data" | |
# Provider-specific configuration so you can fine-tune various | |
# backing providers for Vagrant. These expose provider-specific options. | |
# Example for VirtualBox: | |
# | |
config.vm.provider "virtualbox" do |vb| | |
# Display the VirtualBox GUI when booting the machine | |
#vb.gui = true | |
# | |
# Customize the amount of memory on the VM: | |
vb.memory = "2048" | |
vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ] | |
vb.customize [ "modifyvm", :id, "--uartmode1", "file", "console.log" ] | |
end | |
# | |
# View the documentation for the provider you are using for more | |
# information on available options. | |
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies | |
# such as FTP and Heroku are also available. See the documentation at | |
# https://docs.vagrantup.com/v2/push/atlas.html for more information. | |
# config.push.define "atlas" do |push| | |
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" | |
# end | |
# Enable provisioning with a shell script. Additional provisioners such as | |
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the | |
# documentation for more information about their specific syntax and use. | |
# config.vm.provision "shell", inline: <<-SHELL | |
# apt-get update | |
# apt-get install -y apache2 | |
# SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment