Commit 78693b7b authored by Frank Bergmann's avatar Frank Bergmann

Initial import

parents
Pipeline #583 failed with stages
<?xml version="1.0"?>
<!-- Generated by the OpenACS Package Manager -->
<package key="ref-language" url="http://www.mayuli.com/acs-repository/apm/packages/ref-language" type="apm_service">
<package-name>Reference Data - Language</package-name>
<pretty-plural>Reference Data - Languages</pretty-plural>
<initial-install-p>f</initial-install-p>
<singleton-p>t</singleton-p>
<version name="0.1d" url="http://www.mayuli.com/acs-repository/download/apm/ref-language-0.1d.apm">
<database-support>
<database>oracle</database>
<database>postgresql</database>
</database-support>
<owner url="mailto:jon@jongriffin.com">Jon Griffin</owner>
<summary>ISO 639-1 language reference data for acs-reference.</summary>
<vendor url="http://www.mayuli.com">Mayuli Enterprises, LLC</vendor>
<description format="text/plain">This is the ISO 639-1 language reference data (with languages names in English).</description>
<provides url="ref-language" version="0.1d"/>
<requires url="acs-kernel" version="4.6.2"/>
<requires url="acs-reference" version="0.1d"/>
<files>
<file type="package_spec" path="ref-language.info"/>
<file type="data_model" db_type="oracle" path="sql/common/ref-language-data.sql"/>
<file type="data_model_create" db_type="oracle" path="sql/oracle/ref-language-create.sql"/>
<file type="data_model_drop" db_type="oracle" path="sql/oracle/ref-language-drop.sql"/>
<file type="data_model_create" db_type="postgresql" path="sql/postgresql/ref-language-create.sql"/>
<file type="data_model_drop" db_type="postgresql" path="sql/postgresql/ref-language-drop.sql"/>
</files>
<parameters>
<!-- No version parameters -->
</parameters>
</version>
</package>
aa,Afar
ab,Abkhazian
af,Afrikaans
am,Amharic
ar,Arabic
as,Assamese
ay,Aymara
az,Azerbaijani
ba,Bashkir
be,Byelorussian
bg,Bulgarian
bh,Bihari
bi,Bislama
bn,Bengali; Bangla
bo,Tibetan
br,Breton
ca,Catalan
co,Corsican
cs,Czech
cy,Welsh
da,Danish
de,German
dz,Bhutani
el,Greek
en,English
eo,Esperanto
es,Spanish
et,Estonian
eu,Basque
fa,Persian
fi,Finnish
fj,Fiji
fo,Faeroese
fr,French
fy,Frisian
ga,Irish
gd,Scots Gaelic
gl,Galician
gn,Guarani
gu,Gujarati
ha,Hausa
hi,Hindi
hr,Croatian
hu,Hungarian
hy,Armenian
ia,Interlingua
ie,Interlingue
ik,Inupiak
in,Indonesian
is,Icelandic
it,Italian
iw,Hebrew
ja,Japanese
ji,Yiddish
jw,Javanese
ka,Georgian
kk,Kazakh
kl,Greenlandic
km,Cambodian
kn,Kannada
ko,Korean
ks,Kashmiri
ku,Kurdish
ky,Kirghiz
la,Latin
ln,Lingala
lo,Laothian
lt,Lithuanian
lv,Latvian; Lettish
mg,Malagasy
mi,Maori
mk,Macedonian
ml,Malayalam
mn,Mongolian
mo,Moldavian
mr,Marathi
ms,Malay
mt,Maltese
my,Burmese
na,Nauru
ne,Nepali
nl,Dutch
no,Norwegian
oc,Occitan
om,(Afan) Oromo
or,Oriya
pa,Punjabi
pl,Polish
ps,Pashto; Pushto
pt,Portuguese
qu,Quechua
rm,Rhaeto-Romance
rn,Kirundia
ro,Romanian
ru,Russian
rw,Kinyarwanda
sa,Sanskrit
sd,Sindhi
sg,Sangro
sh,Serbo-Croatian
si,Singhalese
sk,Slovak
sl,Slovenian
sm,Samoan
sn,Shona
so,Somali
sq,Albanian
sr,Serbian
ss,Siswati
st,Sesotho
su,Sundanese
sv,Swedish
sw,Swahili
ta,Tamil
te,Telugu
tg,Tajik
th,Thai
ti,Tigrinya
tk,Turkmen
tl,Tagalog
tn,Setswana
to,Tonga
tr,Turkish
ts,Tsonga
tt,Tatar
tw,Twi
uk,Ukrainian
ur,Urdu
uz,Uzbek
vi,Vietnamese
vo,Volapuk
wo,Wolof
xh,Xhosa
yo,Yoruab
zh,Chinese
zu,Zulu
load data infile '[acs_root_dir]/packages/ref-language/sql/common/languages.dat'
into table language_codes
replace
fields terminated by "," optionally enclosed by "'"
(language_id,name)
-- packages/ref-language/sql/oracle/ref-language-create.sql
--
-- @author jon@jongriffin.com
-- @creation-date 2000-11-21
-- @cvs-id $Id$
--
-- ISO 639
create table language_codes (
language_id char(2)
constraint language_codes_language_id_pk
primary key,
name varchar(100)
constraint language_codes_name_uq
unique
constraint language_codes_name_nn
not null
);
comment on table language_codes is '
This is data from the ISO 639 standard on language codes.
';
comment on column language_codes.language_id is '
This is the ISO standard language code
';
comment on column language_codes.name is '
This is the English version of the language name.
I don''t want to get crazy here!
';
-- now register this table with the repository
declare
v_id integer;
begin
v_id := acs_reference.new(
table_name => upper('language_codes'),
source => 'ISO 639',
source_url => 'http://www.iso.ch',
effective_date => sysdate
);
commit;
end;
/
-- Drop the ACS Reference Language data
--
-- @author jon@jongriffin.com
-- @cvs-id $Id$
set serveroutput on
-- drop all associated tables and packages
-- I am not sure this is a good idea since we have no way to register
-- if any other packages are using this data.
-- This will probably fail if their is a child table using this.
-- I can probably make this cleaner also, but ... no time today
declare
cursor refsrc_cur is
select table_name,
package_name,
repository_id
from acs_reference_repositories
where upper(table_name) = 'LANGUAGE_CODES';
begin
for rec in refsrc_cur loop
dbms_output.put_line('Dropping ' || rec.table_name);
execute immediate 'drop table ' || rec.table_name;
if rec.package_name is not null then
execute immediate 'drop package ' || rec.package_name;
end if;
acs_reference.del(rec.repository_id);
end loop;
end;
/
show errors
\copy language_codes from '[acs_root_dir]/packages/ref-language/sql/common/languages.dat' using delimiters ',' with null as ''
-- packages/ref-language/sql/postgresql/language.sql
--
-- @author jon@jongriffin.com
-- @creation-date 2000-11-21
-- @cvs-id $Id$
--
-- ISO 639
create table language_codes (
language_id char(2)
constraint language_codes_language_id_pk
primary key,
name varchar(100)
constraint language_codes_name_uq
unique
constraint language_codes_name_nn
not null
);
comment on table language_codes is '
This is data from the ISO 639 standard on language codes.
';
comment on column language_codes.language_id is '
This is the ISO standard language code
';
comment on column language_codes.name is '
This is the English version of the language name.
I don''t want to get crazy here!
';
-- now register this table with the repository
select acs_reference__new(
'LANGUAGE_CODES',
null,
'ISO 639',
'http://www.iso.ch',
now()
);
-- Drop the ACS Reference Country data
--
-- @author jon@jongriffin.com
-- @cvs-id $Id$
-- drop all associated tables and packages
-- I am not sure this is a good idea since we have no way to register
-- if any other packages are using this data.
-- This will probably fail if their is a child table using this.
-- I can probably make this cleaner also, but ... no time today
create function inline_0() returns integer as '
declare
rec acs_reference_repositories%ROWTYPE;
begin
for rec in select * from acs_reference_repositories where upper(table_name) = ''LANGUAGE_CODES'' loop
execute ''drop table '' || rec.table_name;
perform acs_reference__delete(rec.repository_id);
end loop;
return 0;
end;' language 'plpgsql';
select inline_0();
drop function inline_0();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment