Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CHOReVOLUTION
syncope
Commits
37ccef3a
Commit
37ccef3a
authored
Jan 24, 2018
by
Gianluca Filippone
Browse files
[CRV-323] added check for URL input fields
parent
b28c7a58
Changes
12
Hide whitespace changes
Inline
Side-by-side
ext/ee/client-console/src/main/java/org/apache/syncope/client/console/panels/AbstractEnactmentEngineModalPanel.java
View file @
37ccef3a
...
...
@@ -16,6 +16,8 @@
package
org.apache.syncope.client.console.panels
;
import
java.io.Serializable
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
org.apache.syncope.client.console.rest.EnactmentEngineRestClient
;
import
org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal
;
import
org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel
;
...
...
@@ -77,4 +79,8 @@ public abstract class AbstractEnactmentEngineModalPanel extends AbstractModalPan
form
.
add
(
urlInput
);
}
protected
void
checkURL
(
final
String
s
)
throws
MalformedURLException
{
URL
url
=
new
URL
(
s
);
}
}
ext/ee/client-console/src/main/java/org/apache/syncope/client/console/panels/AddEnactmentEngineModalPanel.java
View file @
37ccef3a
...
...
@@ -17,6 +17,7 @@ package org.apache.syncope.client.console.panels;
import
eu.chorevolution.idm.common.to.EnactmentEngineTO
;
import
java.io.Serializable
;
import
java.net.MalformedURLException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.syncope.client.console.SyncopeConsoleSession
;
import
org.apache.syncope.client.console.commons.Constants
;
...
...
@@ -39,6 +40,7 @@ public class AddEnactmentEngineModalPanel extends AbstractEnactmentEngineModalPa
@Override
public
void
onSubmit
(
final
AjaxRequestTarget
target
,
final
Form
<?>
form
)
{
try
{
checkURL
(
urlInput
.
getModelObject
());
EnactmentEngineTO
enactmentEngineTO
=
new
EnactmentEngineTO
();
enactmentEngineTO
.
setName
(
nameInput
.
getModelObject
());
enactmentEngineTO
.
setUsername
(
usernameInput
.
getModelObject
());
...
...
@@ -47,6 +49,8 @@ public class AddEnactmentEngineModalPanel extends AbstractEnactmentEngineModalPa
restClient
.
create
(
enactmentEngineTO
);
modal
.
close
(
target
);
SyncopeConsoleSession
.
get
().
info
(
getString
(
Constants
.
OPERATION_SUCCEEDED
));
}
catch
(
MalformedURLException
e
)
{
SyncopeConsoleSession
.
get
().
error
(
getString
(
"invalid_url"
));
}
catch
(
SyncopeClientException
e
)
{
LOG
.
error
(
"While creating new Enactment Engine"
,
e
);
SyncopeConsoleSession
.
get
().
error
(
StringUtils
.
isBlank
(
e
.
getMessage
())
...
...
ext/ee/client-console/src/main/java/org/apache/syncope/client/console/panels/EditEnactmentEngineModalPanel.java
View file @
37ccef3a
...
...
@@ -17,6 +17,7 @@ package org.apache.syncope.client.console.panels;
import
eu.chorevolution.idm.common.to.EnactmentEngineTO
;
import
java.io.Serializable
;
import
java.net.MalformedURLException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.syncope.client.console.SyncopeConsoleSession
;
import
org.apache.syncope.client.console.commons.Constants
;
...
...
@@ -55,6 +56,7 @@ public class EditEnactmentEngineModalPanel extends AbstractEnactmentEngineModalP
@Override
public
void
onSubmit
(
final
AjaxRequestTarget
target
,
final
Form
<?>
form
)
{
try
{
checkURL
(
urlInput
.
getModelObject
());
EnactmentEngineTO
enactmentEngineTO
=
new
EnactmentEngineTO
();
enactmentEngineTO
.
setKey
((
enactmentEngine
.
getKey
()));
enactmentEngineTO
.
setName
(
nameInput
.
getModelObject
());
...
...
@@ -64,6 +66,8 @@ public class EditEnactmentEngineModalPanel extends AbstractEnactmentEngineModalP
restClient
.
update
(
enactmentEngineTO
);
modal
.
close
(
target
);
SyncopeConsoleSession
.
get
().
info
(
getString
(
Constants
.
OPERATION_SUCCEEDED
));
}
catch
(
MalformedURLException
e
)
{
SyncopeConsoleSession
.
get
().
error
(
getString
(
"invalid_url"
));
}
catch
(
SyncopeClientException
e
)
{
LOG
.
error
(
"While creating new Enactment Engine"
,
e
);
SyncopeConsoleSession
.
get
().
error
(
StringUtils
.
isBlank
(
e
.
getMessage
())
...
...
ext/ee/client-console/src/main/resources/org/apache/syncope/client/console/pages/EnactmentEnginePage.properties
View file @
37ccef3a
...
...
@@ -14,3 +14,4 @@
# limitations under the License.
#
header_title
=
Enactment Engines
invalid_url
=
Inserted URL is not valid
ext/ee/client-console/src/main/resources/org/apache/syncope/client/console/pages/EnactmentEnginePage_it.properties
View file @
37ccef3a
...
...
@@ -14,3 +14,4 @@
# limitations under the License.
#
header_title
=
Enactment Engines
invalid_url
=
L'URL inserito non
\u
00e8 valido
ext/ee/client-console/src/main/resources/org/apache/syncope/client/console/pages/EnactmentEnginePage_pt_BR.properties
View file @
37ccef3a
...
...
@@ -14,3 +14,4 @@
# limitations under the License.
#
header_title
=
Enactment Engines
invalid_url
=
O URL inserido
\u
00e9 inv
\u
00e1lido
ext/synthesis-processor/client-console/src/main/java/org/apache/syncope/client/console/panels/AbstractSynthesisProcessorModalPanel.java
View file @
37ccef3a
...
...
@@ -16,6 +16,8 @@
package
org.apache.syncope.client.console.panels
;
import
java.io.Serializable
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal
;
import
org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel
;
import
org.apache.syncope.client.console.wicket.markup.html.form.EncryptedFieldPanel
;
...
...
@@ -73,4 +75,8 @@ public abstract class AbstractSynthesisProcessorModalPanel extends AbstractModal
form
.
add
(
urlInput
);
}
protected
void
checkURL
(
final
String
s
)
throws
MalformedURLException
{
URL
url
=
new
URL
(
s
);
}
}
ext/synthesis-processor/client-console/src/main/java/org/apache/syncope/client/console/panels/AddSynthesisProcessorModalPanel.java
View file @
37ccef3a
...
...
@@ -17,6 +17,7 @@ package org.apache.syncope.client.console.panels;
import
eu.chorevolution.idm.common.to.SynthesisProcessorTO
;
import
java.io.Serializable
;
import
java.net.MalformedURLException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.syncope.client.console.SyncopeConsoleSession
;
import
org.apache.syncope.client.console.commons.Constants
;
...
...
@@ -44,6 +45,7 @@ public class AddSynthesisProcessorModalPanel extends AbstractSynthesisProcessorM
@Override
public
void
onSubmit
(
final
AjaxRequestTarget
target
,
final
Form
<?>
form
)
{
try
{
checkURL
(
urlInput
.
getModelObject
());
SynthesisProcessorTO
synthesisProcessorTO
=
new
SynthesisProcessorTO
();
synthesisProcessorTO
.
setName
(
nameInput
.
getModelObject
());
synthesisProcessorTO
.
setBaseUrl
(
urlInput
.
getModelObject
());
...
...
@@ -52,6 +54,8 @@ public class AddSynthesisProcessorModalPanel extends AbstractSynthesisProcessorM
restClient
.
create
(
synthesisProcessorTO
);
modal
.
close
(
target
);
SyncopeConsoleSession
.
get
().
info
(
getString
(
Constants
.
OPERATION_SUCCEEDED
));
}
catch
(
MalformedURLException
e
)
{
SyncopeConsoleSession
.
get
().
error
(
getString
(
"invalid_url"
));
}
catch
(
SyncopeClientException
e
)
{
LOG
.
error
(
"While creating new Synthesis Processor"
,
e
);
SyncopeConsoleSession
.
get
().
error
(
StringUtils
.
isBlank
(
e
.
getMessage
())
...
...
ext/synthesis-processor/client-console/src/main/java/org/apache/syncope/client/console/panels/EditSynthesisProcessorModalPanel.java
View file @
37ccef3a
...
...
@@ -17,6 +17,7 @@ package org.apache.syncope.client.console.panels;
import
eu.chorevolution.idm.common.to.SynthesisProcessorTO
;
import
java.io.Serializable
;
import
java.net.MalformedURLException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.syncope.client.console.SyncopeConsoleSession
;
import
org.apache.syncope.client.console.commons.Constants
;
...
...
@@ -58,6 +59,7 @@ public class EditSynthesisProcessorModalPanel extends AbstractSynthesisProcessor
@Override
public
void
onSubmit
(
final
AjaxRequestTarget
target
,
final
Form
<?>
form
)
{
try
{
checkURL
(
urlInput
.
getModelObject
());
SynthesisProcessorTO
synthesisProcessorTO
=
new
SynthesisProcessorTO
();
synthesisProcessorTO
.
setKey
((
synthesisProcessor
.
getKey
()));
synthesisProcessorTO
.
setName
(
nameInput
.
getModelObject
());
...
...
@@ -67,6 +69,8 @@ public class EditSynthesisProcessorModalPanel extends AbstractSynthesisProcessor
restClient
.
update
(
synthesisProcessorTO
);
modal
.
close
(
target
);
SyncopeConsoleSession
.
get
().
info
(
getString
(
Constants
.
OPERATION_SUCCEEDED
));
}
catch
(
MalformedURLException
e
)
{
SyncopeConsoleSession
.
get
().
error
(
getString
(
"invalid_url"
));
}
catch
(
SyncopeClientException
e
)
{
LOG
.
error
(
"While updating Synthesis Processor"
,
e
);
SyncopeConsoleSession
.
get
().
error
(
StringUtils
.
isBlank
(
e
.
getMessage
())
...
...
ext/synthesis-processor/client-console/src/main/resources/org/apache/syncope/client/console/pages/SynthesisProcessorPage.properties
View file @
37ccef3a
...
...
@@ -14,3 +14,4 @@
# limitations under the License.
#
header_title
=
Synthesis Processors
invalid_url
=
Inserted URL is not valid
ext/synthesis-processor/client-console/src/main/resources/org/apache/syncope/client/console/pages/SynthesisProcessorPage_it.properties
View file @
37ccef3a
...
...
@@ -14,3 +14,4 @@
# limitations under the License.
#
header_title
=
Synthesis Processors
invalid_url
=
L'URL inserito non
\u
00e8 valido
ext/synthesis-processor/client-console/src/main/resources/org/apache/syncope/client/console/pages/SynthesisProcessorPage_pt_BR.properties
View file @
37ccef3a
...
...
@@ -14,3 +14,4 @@
# limitations under the License.
#
header_title
=
Synthesis Processors
invalid_url
=
O URL inserido
\u
00e9 inv
\u
00e1lido
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment