Diverser Kleinkram (Formatierungen, Rechtschreibfehler in JavaDoc etc.)
git-svn-id: https://svn.libreccm.org/ccm/trunk@2259 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ee7ce1ed26
commit
c5cb863d9e
|
|
@ -54,7 +54,7 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
* </dl>
|
||||
*
|
||||
* Each entry has at least a {@code <value>} element as child. The {@code <value>} element contains the value of the
|
||||
* enum entry. Optionally there can also be can descriptions element containing a description of the entry.
|
||||
* enum entry. Optionally there can also be can description element containing a description of the entry.
|
||||
*
|
||||
* @author Jens Pelzetter <jens@jp-digital.de>
|
||||
* @version $Id$
|
||||
|
|
|
|||
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.london.util.cmd;
|
||||
|
||||
import com.arsdigita.cms.RelationAttribute;
|
||||
import com.arsdigita.cms.RelationAttributeCollection;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter <jens@jp-digital.de>
|
||||
*/
|
||||
public class RelationAttributeCliTool extends Program {
|
||||
|
||||
public RelationAttributeCliTool() {
|
||||
super("RelationAttributeCliTool", "1.0.0", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doRun(final CommandLine cmdLine) {
|
||||
|
||||
final String[] args = cmdLine.getArgs();
|
||||
|
||||
if (args.length == 0) {
|
||||
printUsage();
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
final String command = args[0];
|
||||
|
||||
System.out.printf("command is %s", command);
|
||||
|
||||
if ("list".equals(command)) {
|
||||
list(args);
|
||||
} else if ("add".equals(command)) {
|
||||
add(args);
|
||||
} else if ("alter".equals(command)) {
|
||||
alter(args);
|
||||
} else if ("remove".equals(command)) {
|
||||
remove(args);
|
||||
} else if ("help".equals(command)) {
|
||||
printUsage();
|
||||
System.exit(0);
|
||||
} else {
|
||||
printUsage();
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
|
||||
// new Transaction() {
|
||||
// @Override
|
||||
// protected void doRun() {
|
||||
// final RelationAttribute attr = new RelationAttribute();
|
||||
// attr.setAttribute("test");
|
||||
// attr.setKey("test");
|
||||
// attr.setLanguage("de");
|
||||
// attr.setName("test");
|
||||
// }
|
||||
//
|
||||
// }.run();
|
||||
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
new RelationAttributeCliTool().run(args);
|
||||
}
|
||||
|
||||
private void list(final String[] args) {
|
||||
|
||||
final RelationAttributeCollection enums;
|
||||
if (args.length >= 2) {
|
||||
enums = new RelationAttributeCollection(args[1]);
|
||||
System.out.print("\n");
|
||||
System.out.printf("All values of enum '%s':\n\n", args[1]);
|
||||
} else {
|
||||
enums = new RelationAttributeCollection();
|
||||
|
||||
System.out.print("\n");
|
||||
System.out.print("All available enums and values:\n\n");
|
||||
}
|
||||
|
||||
System.out.print("Enum Key Lang Value Description\n");
|
||||
|
||||
while (enums.next()) {
|
||||
printEnumValue(enums.getRelationAttribute());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void printEnumValue(final RelationAttribute value) {
|
||||
System.out.printf("%s %s %s %s %s\n",
|
||||
value.getAttribute(),
|
||||
value.getKey(),
|
||||
value.getLanguage(),
|
||||
value.getName(),
|
||||
value.getDescription());
|
||||
}
|
||||
|
||||
private void add(final String[] args) {
|
||||
if (args.length < 5) {
|
||||
printUsage();
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
final String enumname = args[1];
|
||||
final String key = args[2];
|
||||
final String lang = args[3];
|
||||
final String value = args[4];
|
||||
|
||||
new Transaction() {
|
||||
@Override
|
||||
protected void doRun() {
|
||||
final RelationAttribute enumvalue = new RelationAttribute();
|
||||
enumvalue.setAttribute(enumname);
|
||||
enumvalue.setKey(key);
|
||||
enumvalue.setLanguage(lang);
|
||||
enumvalue.setName(value);
|
||||
if (args.length >= 6) {
|
||||
enumvalue.setDescription(args[5]);
|
||||
}
|
||||
|
||||
enumvalue.save();
|
||||
}
|
||||
|
||||
}.run();
|
||||
|
||||
System.out.printf("Added %s %s %s %s\n", enumname, key, lang, value);
|
||||
}
|
||||
|
||||
private void alter(final String[] args) {
|
||||
|
||||
}
|
||||
|
||||
private void remove(final String[] args) {
|
||||
}
|
||||
|
||||
private void printUsage() {
|
||||
System.err.println("Usage ReleationAttributeCliTool command parameters");
|
||||
System.err.println("Available commands:");
|
||||
System.err.println("\tlist");
|
||||
System.err.println("\tadd");
|
||||
System.err.println("\talter");
|
||||
System.err.println("\tremove");
|
||||
|
||||
System.err.println(" ");
|
||||
|
||||
System.err.println("list\t Shows all avaiable enums and there values.");
|
||||
System.err.println("list $enum\t Shows all avaiable values for the enum $enum.");
|
||||
System.err.println(
|
||||
"add $enum $key $lang $value [$desc]\t Adds a value $value for the specified key $key and specficied language $lang to to enum $enum. If given the description is also set.");
|
||||
System.err.println(
|
||||
"alter $enum $key $lang $value [$desc]\t Alters a value $value for the specified key $key and specficied language $lang to to enum $enum. If given the description is also set.");
|
||||
System.err.println("remove $enum\t Removes the provided enum completly.");
|
||||
System.err.println("remove $enum $key\t Removes the all values for the provided key from the given enum.");
|
||||
System.err.println(
|
||||
"remove $enum $key $values\t Removes the value identified by $key and $lang from the given enum.");
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xrd:adapters
|
||||
xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
||||
|
||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contentassets.LibrarySignatures">
|
||||
|
||||
</xrd:adapter>
|
||||
</xrd:context>
|
||||
|
||||
</xrd:adapters>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<!--Nothing yet-->
|
||||
</registry>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<load>
|
||||
<requires>
|
||||
<table name="inits"/>
|
||||
<table name="acs_objects"/>
|
||||
<table name="cms_items"/>
|
||||
<table name="ct_publications"/>
|
||||
|
||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.PublicationInitializer"/>
|
||||
</requires>
|
||||
|
||||
<provides>
|
||||
<table name="ca_publications_librarysignatures"/>
|
||||
<initializer class="com.arsdigita.cms.contentassets.LibrarySignaturesInitializer"/>
|
||||
</provides>
|
||||
|
||||
<scripts>
|
||||
<schema directory="ccm-sci-publications-librarysignatures"/>
|
||||
<data class="com.arsdigita.cms.contentassets.LibrarySignaturesLoader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
|
|
@ -0,0 +1 @@
|
|||
com/arsdigita/cms/contentassets/SciPublicationsLibrarySignatures.pdl
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,18 @@
|
|||
# To change this template, choose Tools | Templates
|
||||
# and open the template in the editor.
|
||||
|
||||
com.arsdigita.cms.contentassets.librarysignatures.label=Library signatures
|
||||
com.arsdigita.cms.contentassets.LibrarySignaturesResources=Library signatures of the publication
|
||||
scipublications.librarysignatures.none=No library signatures yet
|
||||
scipublications.librarysignatures.columns.library=Library
|
||||
scipublications.librarysignatures.columns.signature=Signature
|
||||
scipublications.librarysignatures.columns.library_link=Link
|
||||
scipublications.librarysignatures.columns.edit=Edit
|
||||
scipublications.librarysignatures.columns.delete=Delete
|
||||
scipublications.librarysignatures.edit=Edit
|
||||
scipublications.librarysignatures.delete=Delete
|
||||
scipublications.librarysignatures.add=Add library signature
|
||||
scipublications.librarysignatures.form.library=Library
|
||||
scipublications.librarysignatures.form.signature=Signature
|
||||
scipublications.librarysignatures.form.link=Link to the library catalog
|
||||
scipublications.librarysignatures.delete.confirm=Are you sure to delete this signature
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# To change this template, choose Tools | Templates
|
||||
# and open the template in the editor.
|
||||
|
||||
com.arsdigita.cms.contentassets.librarysignatures.label=Bibliothekssignaturen
|
||||
com.arsdigita.cms.contentassets.LibrarySignaturesResources=Bibliothekssignaturen der Publikation
|
||||
scipublications.librarysignatures.none=Noch keine Bibliothekssignaturen vorhanden
|
||||
scipublications.librarysignatures.columns.library=Bibliothek
|
||||
scipublications.librarysignatures.columns.signature=Signatur
|
||||
scipublications.librarysignatures.columns.library_link=Link
|
||||
scipublications.librarysignatures.columns.edit=Bearbeiten
|
||||
scipublications.librarysignatures.columns.delete=L\u00f6schen
|
||||
scipublications.librarysignatures.edit=Bearbeiten
|
||||
scipublications.librarysignatures.delete=L\u00f6schen
|
||||
scipublications.librarysignatures.add=Bibliothekssignatur hinzuf\u00fcgen
|
||||
scipublications.librarysignatures.form.library=Bibliothek
|
||||
scipublications.librarysignatures.form.signature=Signatur
|
||||
scipublications.librarysignatures.form.link=Link zum Bibliothekskatalog
|
||||
scipublications.librarysignatures.delete.confirm=Sind Sie sicher, dass Sie diese Bibliothekssignatur entfernen wollen?
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
ddl-timestamp
|
||||
|
|
@ -0,0 +1 @@
|
|||
@ ddl/oracle-se/table-ca_publications_librarysignatures-auto.sql
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
alter table ca_publications_librarysignatures add
|
||||
constraint ca_pub_librarys_pub_id_f_be8sv foreign key (publication_id)
|
||||
references ct_publications(publication_id);
|
||||
alter table ca_publications_librarysignatures add
|
||||
constraint ca_pub_librarys_sig_id_f_gk1cu foreign key (signature_id)
|
||||
references acs_objects(object_id);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
alter table ca_publications_librarysignatures
|
||||
drop constraint ca_pub_librarys_pub_id_f_be8sv;
|
||||
alter table ca_publications_librarysignatures
|
||||
drop constraint ca_pub_librarys_sig_id_f_gk1cu;
|
||||
|
|
@ -0,0 +1 @@
|
|||
drop table ca_publications_librarysignatures;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
create table ca_publications_librarysignatures (
|
||||
signature_id INTEGER not null
|
||||
constraint ca_pub_librarys_sig_id_p_7qh_1
|
||||
primary key,
|
||||
-- referential constraint for signature_id deferred due to circular dependencies
|
||||
library VARCHAR(512) not null,
|
||||
signature VARCHAR(512) not null,
|
||||
librarylink VARCHAR(2048),
|
||||
publication_id INTEGER not null
|
||||
-- referential constraint for publication_id deferred due to circular dependencies
|
||||
);
|
||||
|
|
@ -0,0 +1 @@
|
|||
\i ddl/postgres/table-ca_publications_librarysignatures-auto.sql
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
alter table ca_publications_librarysignatures add
|
||||
constraint ca_pub_librarys_pub_id_f_be8sv foreign key (publication_id)
|
||||
references ct_publications(publication_id);
|
||||
alter table ca_publications_librarysignatures add
|
||||
constraint ca_pub_librarys_sig_id_f_gk1cu foreign key (signature_id)
|
||||
references acs_objects(object_id);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
alter table ca_publications_librarysignatures
|
||||
drop constraint ca_pub_librarys_pub_id_f_be8sv RESTRICT;
|
||||
alter table ca_publications_librarysignatures
|
||||
drop constraint ca_pub_librarys_sig_id_f_gk1cu RESTRICT;
|
||||
|
|
@ -0,0 +1 @@
|
|||
drop table ca_publications_librarysignatures;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
create table ca_publications_librarysignatures (
|
||||
signature_id INTEGER not null
|
||||
constraint ca_pub_librarys_sig_id_p_7qh_1
|
||||
primary key,
|
||||
-- referential constraint for signature_id deferred due to circular dependencies
|
||||
library VARCHAR(512) not null,
|
||||
signature VARCHAR(512) not null,
|
||||
librarylink VARCHAR(2048),
|
||||
publication_id INTEGER not null
|
||||
-- referential constraint for publication_id deferred due to circular dependencies
|
||||
);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
@@ ddl/oracle-se/create.sql
|
||||
@@ ddl/oracle-se/deferred.sql
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
begin;
|
||||
\i ddl/postgres/create.sql
|
||||
\i ddl/postgres/deferred.sql
|
||||
commit;
|
||||
|
|
@ -39,5 +39,4 @@ association {
|
|||
|
||||
component LibrarySignature[0..n] librarysignatures = join ct_publications.publication_id
|
||||
to ca_publications_librarysignatures.publication_id;
|
||||
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
||||
|
||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contentassets.Note">
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contentassets.LibrarySignatures">
|
||||
|
||||
</xrd:adapter>
|
||||
</xrd:context>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
//Nothing yet
|
||||
<!--Nothing yet-->
|
||||
</registry>
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
</requires>
|
||||
|
||||
<provides>
|
||||
<table name="ca_sci_publications_librarysignatures"/>
|
||||
<table name="ca_publications_librarysignatures"/>
|
||||
<initializer class="com.arsdigita.cms.contentassets.LibrarySignaturesInitializer"/>
|
||||
</provides>
|
||||
|
||||
|
|
|
|||
|
|
@ -33,14 +33,12 @@ import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
|||
* @version $Id$
|
||||
*/
|
||||
public class LibrarySignaturesStep extends SimpleEditStep {
|
||||
|
||||
|
||||
|
||||
protected static final String EDIT = "edit";
|
||||
protected static final String SIGNATURE_PARAM = "library_signature";
|
||||
|
||||
private static final String FORM_KEY = "LibrarySignaturesAdd";
|
||||
|
||||
private final ItemSelectionModel itemModel;
|
||||
|
||||
private final BigDecimalParameter signatureParam;
|
||||
final LibrarySignaturesAddForm addForm;
|
||||
|
||||
|
|
@ -52,9 +50,7 @@ public class LibrarySignaturesStep extends SimpleEditStep {
|
|||
final AuthoringKitWizard parent,
|
||||
final String prefix ) {
|
||||
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
this.itemModel = itemModel;
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
signatureParam = new BigDecimalParameter(SIGNATURE_PARAM);
|
||||
final ACSObjectSelectionModel signatureModel = new ACSObjectSelectionModel(signatureParam);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public class LibrarySignaturesTable extends Table {
|
|||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
4,
|
||||
LibrarySignaturesGlobalizationUtil.globalize("scipublications.librarysignatures.columns.edit"),
|
||||
LibrarySignaturesGlobalizationUtil.globalize("scipublications.librarysignatures.columns.delete"),
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new ModelBuilder(itemModel));
|
||||
|
|
@ -143,16 +143,6 @@ public class LibrarySignaturesTable extends Table {
|
|||
|
||||
@Override
|
||||
public boolean nextRow() {
|
||||
// boolean ret;
|
||||
//
|
||||
// if ((librarySignatures != null) && librarySignatures.next()) {
|
||||
// ret = true;
|
||||
// } else {
|
||||
// ret = false;
|
||||
// }
|
||||
//
|
||||
// return ret;
|
||||
|
||||
return (librarySignatures != null) && librarySignatures.next();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue