Skip to content
Permalink
Browse files

#1157 Reworked configuration of "Enable suggestion for Organizations"

-> Add additional radio button "Separate list of organizations"
-> The organisations-list is only visible if the "Separate list of
organizations" button is selected
- Add new values for the "Enable suggestion for Organizations" radio
buttons
- The "AUTOSUGGEST_ORGAS" property is set to "none" as default value
- Reworked person.xhtml according to the changes in AdminConfig.xhtml
  • Loading branch information...
helkv committed Oct 9, 2019
1 parent 6dd56ed commit bc8cc2912a8febf827b8497e0535536ff665b3c2
@@ -133,6 +133,7 @@
public static final String DEFAULT_CONE_AUTHORS = "http://pubman.mpdl.mpg.de/cone/persons/query?format=json&n=10&m=full&q=";
public static final String DEFAULT_MAX_NUMBER_CITATION_AUTHORS = "5";
public static final String DEFAULT_DISPLAY_COOKIE_NOTICE = "true";
public static final String DEFAULT_AUTOSUGGEST_ORGAS = "none";

// Specific collection metadata (= ContainerAdditionalInfo), which have a additional handling (validation, placeholder, ...):
public static final String COLLECTION_METADATA_GEO_COORDINATES_LABEL = "Geo-coordinates";
@@ -232,6 +233,7 @@ private void initPropertiesWithDefaultValue() {
initPropertyWithDefaultValue(CONFIGURATION.MAX_NUMBER_CITATION_AUTHORS, DEFAULT_MAX_NUMBER_CITATION_AUTHORS);
initPropertyWithDefaultValue(CONFIGURATION.DEFAULT_LICENSE, ImejiLicenses.CC_BY.name());
initPropertyWithDefaultValue(CONFIGURATION.DISPLAY_COOKIE_NOTICE, DEFAULT_DISPLAY_COOKIE_NOTICE);
initPropertyWithDefaultValue(CONFIGURATION.AUTOSUGGEST_ORGAS, DEFAULT_AUTOSUGGEST_ORGAS);
}

/**
@@ -76,7 +76,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
} else if (datasource != null && !datasource.isEmpty()) {
if ("imeji_persons".equals(datasource)) {
responseString = autoCompleteForInternalUsers(suggest);
} else if ("imeji_orgs".equals(datasource)) {
} else if ("imeji_internal_organizations".equals(datasource)) {
responseString = autoCompleteForInternalOrganisations(suggest);
} else {
final GetMethod getMethod = new GetMethod(datasource + URLEncoder.encode(suggest.toString(), "UTF-8"));
@@ -507,8 +507,6 @@ embed = Einbetten

en = Englisch

enable_autosuggest_by_organizations_list = Vorschl\u00E4ge f\u00FCr Organisationen anschalten mittels einer Organisationsliste

enable_autosuggest_for_organizations = Vorschl\u00E4ge f\u00FCr Organisation anschalten

enable_autosuggest_for_users = Vorschl\u00E4ge f\u00FCr Nutzer anschalten
@@ -808,6 +806,10 @@ link_to_images = Link zu den Inhalten

list = Liste

list_of_organizations = Eigene Organisationsliste

list_of_organizations_for_suggestion = Eigene Organisationsliste f\u00FCr Vorschl\u00E4ge

locked = Gesperrt

login = Anmelden
@@ -507,8 +507,6 @@ embed = Embed

en = English

enable_autosuggest_by_organizations_list = Enable suggestion for Organizations by a list of Organizations

enable_autosuggest_for_organizations = Enable suggestion for Organizations

enable_autosuggest_for_users = Enable suggestion for Users
@@ -812,6 +810,10 @@ link_to_images = Link to items

list = List

list_of_organizations = Separate list of organizations

list_of_organizations_for_suggestion = Separate list of Organizations for suggestion

locked = Locked

login = Login
@@ -289,8 +289,6 @@ embed = Embed

en = Ingl\u00E9s

enable_autosuggest_by_organizations_list = Enable suggestion for Organizations by a list of Organizations

english = Ingles

error = Error
@@ -467,6 +465,10 @@ link = Link

link_to_images = Ligar a im\u00E1genes

list_of_organizations = Separate list of organizations

list_of_organizations_for_suggestion = Separate list of Organizations for suggestion

login = Ingresar

login_statistics = Estad\u00EDsticas de ingresos
@@ -327,8 +327,6 @@ embed = \u57CB\u3081\u8FBC\u307F

en = \u82F1\u8A9E

enable_autosuggest_by_organizations_list = Enable suggestion for Organizations by a list of Organizations

enable_autosuggest_for_organizations = \u7D44\u7E54\u540D\u306E\u30AA\u30FC\u30C8\u30B5\u30B8\u30A7\u30B9\u30C8\u3092\u6709\u52B9\u306B\u3059\u308B

enable_autosuggest_for_users = \u30E6\u30FC\u30B6\u540D\u306E\u30AA\u30FC\u30C8\u30B5\u30B8\u30A7\u30B9\u30C8\u3092\u6709\u52B9\u306B\u3059\u308B
@@ -543,6 +541,10 @@ link = \u30EA\u30F3\u30AF

link_to_images = \u753B\u50CF\u306B\u30EA\u30F3\u30AF\u3059\u308B

list_of_organizations = Separate list of organizations

list_of_organizations_for_suggestion = Separate list of Organizations for suggestion

login = \u30ED\u30B0\u30A4\u30F3

login_statistics = \u30ED\u30B0\u30A4\u30F3\u56DE\u6570
@@ -97,8 +97,6 @@ cookie_notice_link_text = Erfahren Sie mehr.

delete_wait = L\u00F6schen, bitte warten!

disabled_by_organizations_list = deaktiviert wenn eine Organisationsliste definiert ist

edit_user_email_forbidden = Nur der Administrator darf die E-mail \u00E4ndern

editor_append = \u00DCberall einen neuen Wert hinzuf\u00FCgen
@@ -97,8 +97,6 @@ cookie_notice_link_text = Learn more

delete_wait = Deleting, please wait!

disabled_by_organizations_list = disabled if a list of Organizations is defined

edit_user_email_forbidden = Only the administrator can change your e-mail

editor_append = Add a new value to all
@@ -39,8 +39,6 @@ cookie_notice_link_text = Learn more

delete_wait = ¡Borrando! Por favor, espere.

disabled_by_organizations_list = disabled if a list of Organizations is defined

editor_append = Agregar un nuevo valor a todo

editor_basic = Agregar solo cuando el valor este vacio
@@ -51,8 +51,6 @@ cookie_notice_link_text = Learn more

delete_wait = \u524A\u9664\u4E2D\u3067\u3059\u3002\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044\uFF01

disabled_by_organizations_list = disabled if a list of Organizations is defined

edit_user_email_forbidden = \u7BA1\u7406\u8005\u3060\u3051\u304C\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5909\u66F4\u3067\u304D\u307E\u3059\u3002

editor_append = \u65B0\u3057\u3044\u5024\u3092\u5168\u3066\u306B\u8FFD\u52A0\u3059\u308B
@@ -13,23 +13,27 @@
<ui:param name="backlinkTitle1" value="Admin"/>

<ui:define name="additonalFooterScripts">
<script type="text/javascript">
$('.imj_clearInput').click(function(evt){
var datatarget, parent, target;
if ($(this).data('target')) {
datatarget = $(this).data('target');
parent = datatarget.split(" ")[0];
target = datatarget.replace((parent + " "), "");
if (parent) {
if (target) {
$(this).parents(parent).find(target).val('');
} else {
$(this).parents(parent).val('');
<h:panelGroup id="clearInputScript" layout="block">
<script type="text/javascript">
$('.imj_clearInput').click(function(evt){
var datatarget, parent, target;
if ($(this).data('target')) {
datatarget = $(this).data('target');
parent = datatarget.split(" ")[0];
target = datatarget.replace((parent + " "), "");
if (parent) {
if (target) {
$(this).parents(parent).find(target).val('');
} else {
$(this).parents(parent).val('');
}
}
}
}
});
});
</script>
</h:panelGroup>
<script type="text/javascript">
$('.imj_administrationTiledList .imj_adminPanel .imj_content').css({"display":"none"});
$('.imj_administrationTiledList .imj_adminPanel .imj_config_headline').click(function(evt){
@@ -797,34 +801,38 @@
<div class="imj_admindataSet">
<div class="imj_admindataLabel">
<h:outputText
value="#{lbl.enable_autosuggest_for_organizations} (#{msg.disabled_by_organizations_list})" />
value="#{lbl.enable_autosuggest_for_organizations}" />
<span class="imj_noDisplay">: </span>
</div>
<div class="imj_admindataValue">
<div class="imj_admindataValueEntry">
<h:selectOneRadio disabled="#{not empty Configuration.organizationSuggestions}"
value="#{Configuration.autosuggestForOrganizations}">
<f:selectItem itemLabel="#{lbl.none}" itemValue="" />
<h:selectOneRadio value="#{Configuration.autosuggestForOrganizations}">
<f:selectItem itemLabel="#{lbl.none}"
itemValue="none" />
<f:selectItem itemLabel="#{lbl.imeji_organizations}"
itemValue="imeji_orgs" />
itemValue="imeji_internal_organizations" />
<f:selectItem itemLabel="#{lbl.list_of_organizations}"
itemValue="organizations_list" />
<f:ajax render="configForm:listOfOrganizationsSet clearInputScript"/>
</h:selectOneRadio>
</div>
</div>
</div>
<div class="imj_admindataSet">
<h:panelGroup class="#{Configuration.autosuggestForOrganizations != 'organizations_list' ? 'imj_noDisplay' : 'imj_admindataSet'}"
id="listOfOrganizationsSet" layout="block">
<div class="imj_admindataLabel">
<h:outputText value="#{lbl.enable_autosuggest_by_organizations_list} (#{msg.one_value_per_line})" />
<h:outputText value="#{lbl.list_of_organizations_for_suggestion} (#{msg.one_value_per_line})"/>
<span class="imj_noDisplay">: </span>
</div>
<div class="imj_admindataValue">
<h:inputTextarea value="#{Configuration.organizationSuggestions}"
<h:inputTextarea id="organizationsList" value="#{Configuration.organizationSuggestions}"
styleClass="imj_admindataEdit" rows="10"/>
</div>
<a href="javascript: void(0);"
data-target=".imj_admindataSet .imj_admindataValue textarea"
class="imj_clearInput fa fa-times">
</a>
</div>
</h:panelGroup>
</div>
</div>

@@ -61,7 +61,7 @@
});
</script>
</ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.orgsSource}">
<ui:fragment rendered="#{cc.attrs.orgsSource == 'imeji_internal_organizations'}">
<script>
var orgaSource;
function setOrgaSource(src) {
@@ -144,23 +144,17 @@
<ui:repeat var="org" value="#{cc.attrs.person.organizations}"
varStatus="index">
<div>
<h:inputText id="inputOrgaURI"
styleClass="input_hidden_orga_uri imj_noDisplay"
value="#{PersonBean.orgaURI}"
valueChangeListener="#{PersonBean.orgaListener}"
onfocus="setOrgaSource('#{cc.attrs.orgsSource}');"
rendered="#{cc.attrs.orgsSource != ''}" />
<h:inputText id="inputOrgaURI1"
styleClass="input_hidden_orga_uri imj_noDisplay"
value="#{PersonBean.orgaURI}"
valueChangeListener="#{PersonBean.orgaListener}"
rendered="#{cc.attrs.orgsSource == ''}" />

<h:commandButton id="changeOrgaButton"
styleClass="button_change_button imj_noDisplay"
action="#{PersonBean.changeOrga(cc.attrs.bean, cc.attrs.position, index.index)}">
<f:ajax render="#{containerId}" execute="#{containerId}" />
</h:commandButton>
<h:panelGroup rendered="#{cc.attrs.orgsSource == 'imeji_internal_organizations'}">
<h:inputText id="inputOrgaURI"
styleClass="input_hidden_orga_uri imj_noDisplay"
value="#{PersonBean.orgaURI}"
valueChangeListener="#{PersonBean.orgaListener}"/>
<h:commandButton id="changeOrgaButton"
styleClass="button_change_button imj_noDisplay"
action="#{PersonBean.changeOrga(cc.attrs.bean, cc.attrs.position, index.index)}">
<f:ajax render="#{containerId}" execute="#{containerId}" />
</h:commandButton>
</h:panelGroup>

<div class="imj_metadataSet">
<div class="imj_metadataLabel">
@@ -172,18 +166,18 @@
<h:inputText id="inputOrgaName"
styleClass="imj_admindataEdit"
value="#{org.name}"
rendered="#{cc.attrs.orgsSource == '' and Configuration.organizationSuggestions == ''}" />
rendered="#{cc.attrs.orgsSource == 'none' || cc.attrs.orgsSource == ''}" />
<h:inputText id="inputOrgaNameWithSuggest"
styleClass="imj_admindataEdit autocomplete_org"
value="#{org.name}"
onfocus="setOrgaSource('#{cc.attrs.orgsSource}');"
rendered="#{cc.attrs.orgsSource != '' and Configuration.organizationSuggestions == ''}" />
rendered="#{cc.attrs.orgsSource == 'imeji_internal_organizations'}" />
<h:inputText id="comboboxOrgaNameWithSuggest" title="#{lbl.select_from_list_or_free_text}"
styleClass="imj_comboBox"
value="#{org.name}"
html5:data-source='#{UtilBean.toJavascriptArray(Configuration.organizationSuggestionsAsList)}'
html5:placeholder="#{lbl.select_from_list_or_free_text}"
rendered="#{Configuration.organizationSuggestions != ''}" />
rendered="#{cc.attrs.orgsSource == 'organizations_list'}" />
</div>
<span class="imj_inlineButtonGroup">
<h:commandLink

0 comments on commit bc8cc29

Please sign in to comment.
You can’t perform that action at this time.