Class DouiService

    • Field Detail

      • EVENT_REST_CALL

        public static final java.lang.String EVENT_REST_CALL
        Key for rest call event.
        Since:
        14.2.0
        See Also:
        Constant Field Values
    • Constructor Detail

      • DouiService

        public DouiService()
    • Method Detail

      • restLumGetDataPost

        @Path("/lumgetdata/{restInterfaceName}")
        @POST
        @Produces({"application/json","application/xml"})
        public final javax.ws.rs.core.Response restLumGetDataPost​(@PathParam("restShortName")
                                                                  java.lang.String restShortName,
                                                                  @PathParam("restInterfaceName")
                                                                  java.lang.String restInterfaceName,
                                                                  @Context
                                                                  javax.servlet.http.HttpServletRequest servletRequest)
        Sub-resource to treats request on POST HTTP method. This sub-resource is responsible for load a REST interface and return the information as JSON or XML format.
        Parameters:
        restShortName - instance of service target that the information will be loaded.
        restInterfaceName - name of the rest interface that will be loaded, optionally including an extension (.json or .xml) used to choose the response format.
        servletRequest - request object that contains all information that was sent by user.
        Returns:
        returns the information loaded from rest interface as JSON or XML format.
        Since:
        6.1.0
      • getReturnType

        protected IDouiRestInterfaceRequest.ResponseType getReturnType​(java.lang.String restInterfaceName)
        Returns the type of the REST result.
        Parameters:
        restInterfaceName - interface rest name that contains the return type.
        Returns:
        MediaType.APPLICATION_XML if the rest interface name ends with ".xml". Otherwise return MediaType.APPLICATION_JSON.
        Since:
        6.1.0
      • restLumGetDataGet

        @Path("/lumgetdata/{restInterfaceName}")
        @GET
        @Produces({"application/json","application/xml"})
        public final javax.ws.rs.core.Response restLumGetDataGet​(@PathParam("restShortName")
                                                                 java.lang.String restShortName,
                                                                 @PathParam("restInterfaceName")
                                                                 java.lang.String restInterfaceName,
                                                                 @Context
                                                                 javax.servlet.http.HttpServletRequest servletRequest)
        Sub-resource to treats request on GET HTTP method. This sub-resource is responsible for load a REST interface and return the information as JSON or XML format.
        Parameters:
        restShortName - instance of service target that the information will be loaded.
        restInterfaceName - name of the rest interface that will be loaded, optionally including an extension (.json or .xml) used to choose the response format.
        servletRequest - request object that contains all information that was sent by user.
        Returns:
        returns the information loaded from rest interface as JSON or XML format.
        Since:
        6.1.0
      • restDoProcessAction

        @Path("/lumPA/{interfaceSimpleId: [a-zA-Z][\\w]*}.json")
        @POST
        public final javax.ws.rs.core.Response restDoProcessAction​(@PathParam("interfaceSimpleId")
                                                                   java.lang.String interfaceSimpleId,
                                                                   @PathParam("restShortName")
                                                                   java.lang.String restShortName,
                                                                   @QueryParam("lumActionId")
                                                                   java.lang.String lumActionId,
                                                                   @Context
                                                                   javax.ws.rs.core.UriInfo uriInfo,
                                                                   @Context
                                                                   javax.servlet.http.HttpServletRequest request)
        Process action call API.
        This method is intended to be used typically, but not limited to, from the browser, for those who want to execute a given process action.
        Before call this API, user must already have performed any required authentication.
        The default implementation will return:
        • 307 redirect to the URL that will perform the process action.
        • Bad request (400) if there's something wrong with the request.
        • Forbidden (403) if user has no permission to perform the given request.
        • Internal server error (500) if something went wrong during the processing.

        To override the default behavior, override the method restCallProcessAction(String, String, String, UriInfo).
        Parameters:
        interfaceSimpleId - The target interface simple identifier. It is the part after the last '.' character of interface identifier.
        restShortName - The target service instance's rest short name.
        lumActionId - the target process action identifier.
        uriInfo - the URI information about the request.
        request - the request.
        Returns:
        the Response to be sent to the client.
        Since:
        10.4.0
      • restDoProcessActionWithActionId

        @Path("/lumPA/{interfaceSimpleId: [a-zA-Z][\\w]*}/{lumActionId: [a-zA-Z][\\w]*}.json")
        @POST
        public final javax.ws.rs.core.Response restDoProcessActionWithActionId​(@PathParam("interfaceSimpleId")
                                                                               java.lang.String interfaceSimpleId,
                                                                               @PathParam("restShortName")
                                                                               java.lang.String restShortName,
                                                                               @PathParam("lumActionId")
                                                                               java.lang.String lumActionId,
                                                                               @Context
                                                                               javax.ws.rs.core.UriInfo uriInfo,
                                                                               @Context
                                                                               javax.servlet.http.HttpServletRequest request)
        Process action call API.
        This method is intended to be used typically, but not limited to, from the browser, for those who want to execute a given process action.
        Before call this API, user must already have performed any required authentication.
        The default implementation will return:
        • 307 redirect to the URL that will perform the process action.
        • Bad request (400) if there's something wrong with the request.
        • Forbidden (403) if user has no permission to perform the given request.
        • Internal server error (500) if something went wrong during the processing.

        To override the default behavior, override the method restCallProcessAction(String, String, String, UriInfo).
        Parameters:
        interfaceSimpleId - The target interface simple identifier. It is the part after the last '.' character of interface identifier.
        restShortName - The target service instance's rest short name.
        lumActionId - the target process action identifier.
        uriInfo - the URI information about the request.
        request - the request.
        Returns:
        the Response to be sent to the client.
        Since:
        10.4.0
      • restCallProcessAction

        protected javax.ws.rs.core.Response restCallProcessAction​(java.lang.String interfaceSimpleId,
                                                                  java.lang.String restShortName,
                                                                  java.lang.String lumActionId,
                                                                  javax.ws.rs.core.UriInfo uriInfo)
        Process action call API.
        This method is intended to be used typically, but not limited to, from the browser, for those who want to execute a given process action.
        Before call this API, user must already have performed any required authentication.
        The default implementation will return:
        • 307 redirect to the URL that will perform the process action.
        • Bad request (400) if there's something wrong with the request.
        • Forbidden (403) if user has no permission to perform the given request.
        • Internal server error (500) if something went wrong during the processing.

        In the default implementation, this method is called by both restDoProcessAction(String, String, String, UriInfo, HttpServletRequest) and restDoProcessActionWithActionId(String, String, String, UriInfo, HttpServletRequest).
        Parameters:
        interfaceSimpleId - The target interface simple identifier. It is the part after the last '.' character of interface identifier.
        restShortName - The target service instance's rest short name.
        lumActionId - the target process action identifier.
        uriInfo - the URI information about the request.
        Returns:
        the Response to be sent to the client.
        Since:
        10.4.0
      • restGetProcessActionRestHelp

        @Path("/lumPA/{interfaceSimpleId: [a-zA-Z][\\w]*}/help")
        @GET
        public javax.ws.rs.core.Response restGetProcessActionRestHelp​(@PathParam("interfaceSimpleId")
                                                                      java.lang.String interfaceSimpleId,
                                                                      @PathParam("restShortName")
                                                                      java.lang.String restShortName,
                                                                      @Context
                                                                      javax.servlet.http.HttpServletRequest req,
                                                                      @Context
                                                                      javax.servlet.http.HttpServletResponse resp)
                                                               throws java.lang.Exception
        Returns the help for the process action call of the given service interface in the given service instance (given in form of rest short name).
        In the default implementation, this method will find all data controls of the requested interface and will write as an HTML response the parameters described by IDataControl.getRequestHelpDefinition(). The default implementation will return:
        • An HTML (response code 200) with the parameters.
        • Bad request (400) if there's something wrong with the request.
        • Forbidden (403) if user has no permission to perform the given request.
        • Internal server error (500) if something went wrong during the processing.
        Parameters:
        interfaceSimpleId - The target interface simple identifier. It is the part after the last '.' character of interface identifier.
        restShortName - The target service instance's rest short name.
        req - The Servlet request.
        resp - The Servlet response.
        Returns:
        the response code.
        Throws:
        java.lang.Exception
        Since:
        10.4.0
      • usesImageService

        @Deprecated
        public boolean usesImageService​(ITransaction transaction)
                                 throws PortalException
        Deprecated.
        Description copied from interface: IDouiService
        Indicates if this service uses an image service (as repository, for example).
        Specified by:
        usesImageService in interface IDouiService
        Parameters:
        transaction - the transaction for persistence access.
        Returns:
        true if this service uses a image service, false otherwise.
        Throws:
        PortalException
      • usesMediaRepository

        public boolean usesMediaRepository​(ITransaction transaction)
                                    throws PortalException
        Description copied from interface: IDouiService
        Indicates if this service may use a media repository.
        Specified by:
        usesMediaRepository in interface IDouiService
        Parameters:
        transaction - the transaction for persistence access.
        Returns:
        true if this service may use a media service, false otherwise.
        Throws:
        PortalException
      • usesDocumentService

        public boolean usesDocumentService​(ITransaction transaction)
                                    throws PortalException
        Description copied from interface: IDouiService
        Indicates if this service uses a document service (as repository, for example).
        Specified by:
        usesDocumentService in interface IDouiService
        Parameters:
        transaction - the transaction for persistence access.
        Returns:
        true if this service uses a document service, false otherwise.
        Throws:
        PortalException
      • usesWidgetRepository

        public boolean usesWidgetRepository​(ITransaction transaction)
                                     throws PortalException
        Description copied from interface: IDouiService
        Indicates if this service uses a widget repository.
        Specified by:
        usesWidgetRepository in interface IDouiService
        Parameters:
        transaction - the transaction for persistence access.
        Returns:
        true if this service uses a widget repository, false otherwise.
        Throws:
        PortalException
      • hasHtmlField

        public boolean hasHtmlField​(ITransaction transaction)
                             throws PortalException
        Description copied from interface: IDouiService
        Indicates if this service has an html field.
        Specified by:
        hasHtmlField in interface IDouiService
        Parameters:
        transaction - the transaction for persistence access.
        Returns:
        true if this service has an html field, false otherwise.
        Throws:
        PortalException
      • setDataTypeAttributes

        protected void setDataTypeAttributes​(org.w3c.dom.Node douiDefinitionNode,
                                             ITransaction transaction)
                                      throws PortalException
        Replace number data type for integer data type, for backward compatibility.
        Parameters:
        douiDefinitionNode - the doui definition to adjust.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.0.4
      • setPositionAttributes

        protected void setPositionAttributes​(org.w3c.dom.Node douiDefinitionNode,
                                             ITransaction transaction)
                                      throws PortalException
        Sets default attribute values for position field.
        Parameters:
        douiDefinitionNode - the douidefinition xml node.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        10.3.0