[gatein-issues] [JBoss JIRA] (GTNPORTAL-3509) [Application Registry] Missing validator when importing applications

H. Trang Vu (JIRA) issues at jboss.org
Mon Jun 9 04:06:15 EDT 2014


     [ https://issues.jboss.org/browse/GTNPORTAL-3509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

H. Trang Vu updated GTNPORTAL-3509:
-----------------------------------

    Attachment: SiteRedirectsAndImportExportAdminPortlet-TooLongAppName-DisplayName.png


When importing automatically all applications, it only replaces slashes by underscores in Application Name and Display Name in [ApplicationRegistryServiceImpl.java|https://github.com/gatein/gatein-portal/blob/3.7.1.Final/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java#L382-L385]
{code:title=ApplicationRegistryServiceImpl.java}
            // Need to sanitize portlet and application names in case they contain characters that would
            // cause an improper Application name
            portletApplicationName = portletApplicationName.replace('/', '_');
            portletName = portletName.replace('/', '_');
{code}

While adding an application to a category on UI, it must pass the rule of length limit and character validation. For example, in [UIApplicationForm.java|https://github.com/gatein/gatein-portal/blob/3.7.1.Final/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java#L58-L61]
{code:title=UIApplicationForm.java}
    public UIApplicationForm() throws Exception {
        addUIFormInput(new UIFormStringInput("applicationName", "applicationName", null).addValidator(MandatoryValidator.class)
                .addValidator(StringLengthValidator.class, 3, 30).addValidator(NameValidator.class));
        addUIFormInput(new UIFormStringInput("displayName", "displayName", null).addValidator(StringLengthValidator.class, 3,
                30).addValidator(NotHTMLTagValidator.class));
        addUIFormInput(new UIFormTextAreaInput("description", "description", null).addValidator(NullFieldValidator.class)
                .addValidator(NotHTMLTagValidator.class));
    }
{code}

> [Application Registry] Missing validator when importing applications
> --------------------------------------------------------------------
>
>                 Key: GTNPORTAL-3509
>                 URL: https://issues.jboss.org/browse/GTNPORTAL-3509
>             Project: GateIn Portal
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.5.10.Final, 3.7.1.Final, 3.8.2.Final
>            Reporter: H. Trang Vu
>            Priority: Minor
>         Attachments: SiteRedirectsAndImportExportAdminPortlet-TooLongAppName-DisplayName.png
>
>
> When applications are added by configuration or by importing automatically all applications, there isn't any check of application name while its value is read-only after the creation. These validators (length and pattern) however existent when adding or editing an application. As a consequence, some imported applications cannot be changed (Display Name, Description, Access Permission).
> Steps to reproduce:
> # Login as root
> # Go to Application Registry
> # Click *Site Redirects and Import/Export* (the last item of *Administration* category).
> # Change nothing. Click Save. Warning message appears as follows.
> {noformat}
> The length of the text in field "Application Name" must be between "3" and "30" characters.
> The length of the text in field "Display Name" must be between "3" and "30" characters.
> {noformat}
> * It is feasible to reduce "Display Name" but not "Application Name" at run time.



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the gatein-issues mailing list