PublicPersonalProfile: Konfiguration wird jetzt eingelesen
git-svn-id: https://svn.libreccm.org/ccm/trunk@1025 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
cd321662c6
commit
f32d96ce69
|
|
@ -309,8 +309,10 @@ public class ConfigRegistry {
|
||||||
|
|
||||||
private Properties getProperties(ClassLoader ldr, String resource) {
|
private Properties getProperties(ClassLoader ldr, String resource) {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
|
s_log.error(String.format(">>>Trying to get properties from '%s'...", resource));
|
||||||
InputStream is = ldr.getResourceAsStream(resource);
|
InputStream is = ldr.getResourceAsStream(resource);
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
|
s_log.error(">>>Create input stream successfully, resource exists...");
|
||||||
try {
|
try {
|
||||||
props.load(is);
|
props.load(is);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
@ -322,6 +324,8 @@ public class ConfigRegistry {
|
||||||
throw new UncheckedWrapperException(e);
|
throw new UncheckedWrapperException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
s_log.error(">>>Resource does not exist.");
|
||||||
}
|
}
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<registry>
|
<registry>
|
||||||
<!--
|
<config class="com.arsdigita.cms.contenttypes.SciPublicPersonalProfileConfig"
|
||||||
<config class="com.arsdigita.cms.contenttypes.SciPublicPersonalProfileConfig"
|
storage="ccm-sci-publicpersonalprofile/profile.properties"/>
|
||||||
storage="ccm-sci-publicpersonalprofile.properties"/>
|
|
||||||
-->
|
|
||||||
</registry>
|
</registry>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public class SciPublicPersonalProfileConfig extends AbstractConfig {
|
||||||
"com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.show_unfinished_parts",
|
"com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.show_unfinished_parts",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
Boolean.FALSE);
|
Boolean.FALSE);
|
||||||
personType = new StringParameter("com.arsdigita.cms.contenttypes.PublicPersonalProfile.person_class",
|
personType = new StringParameter("com.arsdigita.cms.contenttypes.PublicPersonalProfile.person_type",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
"com.arsdigita.cms.contenttypes.GenericPerson");
|
"com.arsdigita.cms.contenttypes.GenericPerson");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,4 @@ com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.show_unfinished_parts.fo
|
||||||
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.title = Class to restrict the selectable persons to.
|
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.title = Class to restrict the selectable persons to.
|
||||||
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.purpose = Class to restrict the selectable persons to.
|
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.purpose = Class to restrict the selectable persons to.
|
||||||
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.example = com.arsdigita.cms.contenttypes.GenericPerson
|
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.example = com.arsdigita.cms.contenttypes.GenericPerson
|
||||||
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.format = [String]
|
com.arsdigita.cms.contenttypes.SciPublicPersonalProfile.person_type.format = [string]
|
||||||
|
|
@ -20,7 +20,6 @@ import com.arsdigita.cms.ContentTypeCollection;
|
||||||
import com.arsdigita.cms.Folder;
|
import com.arsdigita.cms.Folder;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.contenttypes.SciMember;
|
|
||||||
import com.arsdigita.cms.contenttypes.SciPublicPersonalProfile;
|
import com.arsdigita.cms.contenttypes.SciPublicPersonalProfile;
|
||||||
import com.arsdigita.cms.contenttypes.SciPublicPersonalProfileConfig;
|
import com.arsdigita.cms.contenttypes.SciPublicPersonalProfileConfig;
|
||||||
import com.arsdigita.cms.ui.authoring.ApplyWorkflowFormSection;
|
import com.arsdigita.cms.ui.authoring.ApplyWorkflowFormSection;
|
||||||
|
|
@ -46,6 +45,10 @@ public class SciPublicPersonalProfileCreate extends PageCreate {
|
||||||
private static final SciPublicPersonalProfileConfig config =
|
private static final SciPublicPersonalProfileConfig config =
|
||||||
new SciPublicPersonalProfileConfig();
|
new SciPublicPersonalProfileConfig();
|
||||||
|
|
||||||
|
static {
|
||||||
|
config.load();
|
||||||
|
}
|
||||||
|
|
||||||
public SciPublicPersonalProfileCreate(final ItemSelectionModel itemModel,
|
public SciPublicPersonalProfileCreate(final ItemSelectionModel itemModel,
|
||||||
final CreationSelector parent) {
|
final CreationSelector parent) {
|
||||||
super(itemModel, parent);
|
super(itemModel, parent);
|
||||||
|
|
@ -71,10 +74,8 @@ public class SciPublicPersonalProfileCreate extends PageCreate {
|
||||||
SingleSelect ownerSelect = new SingleSelect(ownerModel);
|
SingleSelect ownerSelect = new SingleSelect(ownerModel);
|
||||||
ownerSelect.addValidationListener(new NotNullValidationListener());
|
ownerSelect.addValidationListener(new NotNullValidationListener());
|
||||||
|
|
||||||
//DataCollection persons = SessionManager.getSession().retrieve(
|
|
||||||
// SciMember.BASE_DATA_OBJECT_TYPE);
|
|
||||||
String personType = config.getPersonType();
|
String personType = config.getPersonType();
|
||||||
if ((personType == null) || (personType.isEmpty()) ) {
|
if ((personType == null) || (personType.isEmpty())) {
|
||||||
personType = "com.arsdigita.cms.contenttypes.GenericPerson";
|
personType = "com.arsdigita.cms.contenttypes.GenericPerson";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,7 +89,7 @@ public class SciPublicPersonalProfileCreate extends PageCreate {
|
||||||
persons.addFilter("profile is null");
|
persons.addFilter("profile is null");
|
||||||
while (persons.next()) {
|
while (persons.next()) {
|
||||||
GenericPerson person =
|
GenericPerson person =
|
||||||
(GenericPerson) DomainObjectFactory.newInstance(persons.
|
(GenericPerson) DomainObjectFactory.newInstance(persons.
|
||||||
getDataObject());
|
getDataObject());
|
||||||
ownerSelect.addOption(new Option(person.getID().toString(), person.
|
ownerSelect.addOption(new Option(person.getID().toString(), person.
|
||||||
getFullName()));
|
getFullName()));
|
||||||
|
|
@ -119,12 +120,12 @@ public class SciPublicPersonalProfileCreate extends PageCreate {
|
||||||
String id = (String) fse.getFormData().get(
|
String id = (String) fse.getFormData().get(
|
||||||
SciPublicPersonalProfile.OWNER);
|
SciPublicPersonalProfile.OWNER);
|
||||||
|
|
||||||
SciMember owner = new SciMember(new BigDecimal(id));
|
GenericPerson owner = new GenericPerson(new BigDecimal(id));
|
||||||
|
|
||||||
validateNameUniqueness(folder,
|
validateNameUniqueness(folder,
|
||||||
fse,
|
fse,
|
||||||
String.format("%s-profile",
|
String.format("%s-profile",
|
||||||
SciMember.urlSave(
|
GenericPerson.urlSave(
|
||||||
owner.getFullName())));
|
owner.getFullName())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,7 +143,7 @@ public class SciPublicPersonalProfileCreate extends PageCreate {
|
||||||
|
|
||||||
GenericPerson owner = new GenericPerson(new BigDecimal(id));
|
GenericPerson owner = new GenericPerson(new BigDecimal(id));
|
||||||
String name = String.format("%s-profile",
|
String name = String.format("%s-profile",
|
||||||
SciMember.urlSave(owner.getFullName()));
|
GenericPerson.urlSave(owner.getFullName()));
|
||||||
String title = String.format("%s (Profil)", owner.getFullName());
|
String title = String.format("%s (Profil)", owner.getFullName());
|
||||||
|
|
||||||
final ContentPage item = createContentPage(state);
|
final ContentPage item = createContentPage(state);
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,17 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
|
||||||
import com.arsdigita.bebop.form.CheckboxGroup;
|
|
||||||
import com.arsdigita.bebop.form.Option;
|
import com.arsdigita.bebop.form.Option;
|
||||||
import com.arsdigita.bebop.form.SingleSelect;
|
import com.arsdigita.bebop.form.SingleSelect;
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ContentType;
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.AuthorshipCollection;
|
|
||||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
|
||||||
import com.arsdigita.cms.contenttypes.Publication;
|
|
||||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue