Examples of XhtmlControl


Examples of com.cosmo.ui.controls.XhtmlControl

            for (Entry<String, String> entry : authent.getParameters().entrySet())
            {
               lst.add(entry.getKey() + ": '''" + entry.getValue() + "'''");
            }
           
            XhtmlControl xAuthent = (XhtmlControl) pc.getControl("xAuthent");
            xAuthent.clear();
            xAuthent.appendHeadder(Icon.render(Icon.ICON_IMAGE_COG) + " Agent d'autenticaci�", 4).
                     appendParagraph("La seg�ent informaci� fa refer�ncia a l'agent d'autenticaci� configurat actualment:").
                     appendUnorderedList(lst, "alt");
         }
      }
      catch (Exception ex)
      {
         DynamicMessageControl xMsgAuthent = (DynamicMessageControl) pc.getControl("xMsgAuthent");
         xMsgAuthent.setMessage(ex.getMessage());
         xMsgAuthent.setType(MessageTypes.Error);
         xMsgAuthent.setVisible(true);
      }
     
      try
      {
         if (getWorkspace().isValidUserSession())
         {
            // Obtiene el agente de autenticaci�n
            Authorization autho = AuthorizationFactory.getInstance(getWorkspace());
           
            lst = new ArrayList<String>();
            lst.add("Classe: //" + autho.getClass().getName() + "//");
            for (Entry<String, String> entry : autho.getParameters().entrySet())
            {
               lst.add(entry.getKey() + ": '''" + entry.getValue() + "'''");
            }
           
            XhtmlControl xAutho = (XhtmlControl) pc.getControl("xAutho");
            xAutho.clear();
            xAutho.appendHeadder(Icon.render(Icon.ICON_IMAGE_COG) + " Agent d'autoritzaci�", 4).
                   appendParagraph("La seg�ent informaci� fa refer�ncia a l'agent d'autoritzaci� configurat actualment:").
                   appendUnorderedList(lst, "alt");
         }
      }
      catch (Exception ex)
View Full Code Here

Examples of com.cosmo.ui.controls.XhtmlControl

         list = new ArrayList<String>();
         list.add("Login: " + getUserSession().getCurrentUser().getLogin());
         list.add("Mail: " + getUserSession().getCurrentUser().getMail());
         list.add("Nom: " + getUserSession().getCurrentUser().getName());

         XhtmlControl xUser = (XhtmlControl) pc.getControl("xUser");
         xUser.clear();
         xUser.appendHeadder(Icon.render(Icon.ICON_IMAGE_USER) + " usuari autenticat", 4).
               appendParagraph("A continuaci� es mostren les dades de l'usuari autenticat actualment.").
               appendUnorderedList(list, "alt");
        
         // Muestra los roles del usuario
         XhtmlControl xhtmlRoles = (XhtmlControl) pc.getControl("content-roles");
         xhtmlRoles.clear();
         xhtmlRoles.appendHeadder(Icon.render(Icon.ICON_IMAGE_GROUP) + " Rols d'usuari", 4).
                    appendParagraph("La seg�ent llista cont� els rols que t� l'usuari:");
         if (!getUserSession().getRoles().isEmpty())
         {
            xhtmlRoles.appendUnorderedList(getUserSession().getRoles(), "alt");
         }
         else
         {
            DynamicMessageControl msgRoles = (DynamicMessageControl) pc.getControl("msg-roles");
            msgRoles.setMessage("L'usuari " + XhtmlControl.formatBold(getUserSession().getCurrentUser().getLogin()) + " no t� cap rol associat.");
            msgRoles.setVisible(true);
         }
        
         // Muestra los roles efectivos del usuario
         try
         {
            // Se instancia s�lo para disponer de la lista completa de roles
            PostgreSqlAuthorizationImpl auth = (PostgreSqlAuthorizationImpl) AuthorizationFactory.getInstance(getWorkspace());
           
            // Se recorre la lista completa de actividades y se comprueba si el usuario dispone o no de permiso sobre cada una de ellas
            ArrayList<String> lst = new ArrayList<String>();
            for (Role role : auth.getRoles())
            {
               // Comprueba si el usuario dispone de permisos para la actividad
               lst.add((getUserSession().isInRole(role.getId()) ? Icon.render(Icon.ICON_IMAGE_OK_SIGN, Icon.ICON_SIZE_SMALL, Icon.ICON_COLOR_GREEN) : Icon.render(Icon.ICON_IMAGE_REMOVE_SIGN, Icon.ICON_SIZE_SMALL, Icon.ICON_COLOR_RED)) + " " +
                        role.getId() + " (" + role.getDescription() + ")");
            }
           
            XhtmlControl xRolList = (XhtmlControl) pc.getControl("xRolList");
            xRolList.clear();
            xRolList.appendHeadder(Icon.render(Icon.ICON_IMAGE_CHECK) + " Rols efectius d'usuari", 4).
                     appendParagraph("La seg�ent llista mostra els rols efectius de l'usuari. S'agafa la llista complerta de rols i un per un es comprova per l'usuari a trav�s la API de seguretat.").
                     appendUnorderedList(lst, "alt");
         }
         catch (AuthorizationException ex)
         {
            DynamicMessageControl xRolMsg = (DynamicMessageControl) pc.getControl("xRolMsg");
            xRolMsg.setMessage(ex.getMessage());
            xRolMsg.setVisible(true);
         }
        
         // Muestra los permisos del usuario
         XhtmlControl xhtmlAct = (XhtmlControl) pc.getControl("content-act");
         xhtmlAct.clear();
         xhtmlAct.appendHeadder(Icon.render(Icon.ICON_IMAGE_SHARE) + " Permisos de l'usuari", 4).
                  appendParagraph("La seg�ent llista cont� les activitats sobre les que l'usuari t� permisos especificats:");
         if (!getUserSession().getPermissions().isEmpty())
         {
            xhtmlAct.appendUnorderedList(getUserSession().getPermissions(), "alt");
         }
         else
         {
            DynamicMessageControl msgAct = (DynamicMessageControl) pc.getControl("msg-act");
            msgAct.setVisible(true);
           
            if (!getUserSession().isSuperUser())
            {
               msgAct.setMessage("L'usuari " + XhtmlControl.formatBold(getUserSession().getCurrentUser().getLogin()) + " no t� perm�s d'execuci� per cap activitat.");
            }
            else
            {
               msgAct.setMessage("L'usuari " + XhtmlControl.formatBold(getUserSession().getCurrentUser().getLogin()) + " t� perm�s d'execuci� per totes les activitats (SuperUser).");
            }
         }
        
         // Muestra los permisos efectivos del usuario
         try
         {
            // Se instancia s�lo para disponer de la lista completa de permisos
            PostgreSqlAuthorizationImpl auth = (PostgreSqlAuthorizationImpl) AuthorizationFactory.getInstance(getWorkspace());
           
            // Se recorre la lista completa de actividades y se comprueba si el usuario dispone o no de permiso sobre cada una de ellas
            ArrayList<String> lst = new ArrayList<String>();
            for (Activity activity : auth.getActivities())
            {
               // Comprueba si el usuario dispone de permisos para la actividad
               lst.add((getUserSession().isActivityAllowed(activity.getId()) ? Icon.render(Icon.ICON_IMAGE_OK_SIGN, Icon.ICON_SIZE_SMALL, Icon.ICON_COLOR_GREEN) : Icon.render(Icon.ICON_IMAGE_REMOVE_SIGN, Icon.ICON_SIZE_SMALL, Icon.ICON_COLOR_RED)) + " " +
                        activity.getId() + " (" + activity.getDescription() + ")");
            }
           
            XhtmlControl xhtmlActLst = (XhtmlControl) pc.getControl("act-list");
            xhtmlActLst.clear();
            xhtmlActLst.appendHeadder(Icon.render(Icon.ICON_IMAGE_CHECK) + " Permisos efectius d'usuari", 4).
                        appendParagraph("La seg�ent llista mostra els permisos efectius de l'usuari. S'agafa la llista complerta d'activitats i una per una es comprova per l'usuari a trav�s la API de seguretat.").
                        appendUnorderedList(lst, "alt");
         }
         catch (AuthorizationException ex)
         {
View Full Code Here

Examples of com.cosmo.ui.controls.XhtmlControl

      HeaderControl header = new HeaderControl(getWorkspace());
      header.setTitle("XHTML Control");
      header.setDescription("Exemple d'�s del control " + XhtmlControl.formatBold("XhtmlControl") + " per generar contingut est�tic");
      pc.addContent(header, ContentColumns.MAIN);
     
      XhtmlControl xhtml = new XhtmlControl(getWorkspace());
      xhtml.append("<h3>Headings</h3>");
      xhtml.append("<h1>Heading 1</h1>");
      xhtml.append("<h2>Heading 2</h2>");
      xhtml.append("<h3>Heading 3</h3>");
      xhtml.append("<h4>Heading 4</h4>");
      xhtml.append("<h5>Heading 5</h5>");
      xhtml.append("<h6>Heading 6</h6>");
      xhtml.append("<hr />");
     
      xhtml.append("<h3>Paragraphs</h3>");
      xhtml.append("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tincidunt ornare nisl non cursus. Proin fermentum interdum pulvinar. Morbi sed odio quis dui ornare dignissim vel vel nulla. Proin augue ligula, convallis at lobortis mattis, laoreet in mauris. Praesent posuere hendrerit dolor vel pellentesque. Fusce sollicitudin volutpat elit ut venenatis. Vivamus ultrices neque nec dui pellentesque a ornare enim vehicula. Sed sit amet eros turpis, ac viverra arcu. Cras ullamcorper volutpat faucibus. Integer mi odio, bibendum vel malesuada porttitor, aliquam quis lectus. Integer a nibh at velit congue ornare eu quis erat. Pellentesque odio justo, tempus eu eleifend vel, sollicitudin et lacus. Fusce consectetur massa id ipsum ornare vestibulum. Donec lacinia nibh vel libero rhoncus imperdiet.</p>");
      xhtml.append("<hr />");
     
      xhtml.append("<h3>Blockquote</h3>");
      xhtml.append("<blockquote>");
      xhtml.append("<p>lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio");
      xhtml.append("<span>Someone Important</span></p>");
      xhtml.append("</blockquote>");
      xhtml.append("<blockquote class=\"small\">");
      xhtml.append("<p>lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio");
      xhtml.append("<span>Someone Important</span></p>");
      xhtml.append("</blockquote>");
      xhtml.append("<hr />");
     
      xhtml.append("<h3>Inline Styles</h3>");
      xhtml.append("<p><strong>Strong</strong></p>");
      xhtml.append("<p><em>Emphasis</em></p>");
      xhtml.append("<p><a href=\"\">Inline Link</a></p>");
      xhtml.append("<p><strike>Strike</strike></p>");
      xhtml.append("<p>Inline " + Icon.render(Icon.ICON_IMAGE_HOME, Icon.ICON_SIZE_DEFAULT) + " Icons</p>");
      xhtml.append("<p><code>&lt;h1&gt;Sample Code&lt;/h1&gt;</code></p>");
      xhtml.append("<hr />");

      xhtml.append("<h3>Lists</h3>");
      xhtml.append("<ul>");
      xhtml.append("<li>tation ullamcorper suscipit lobortis</li>");
      xhtml.append("<li>Nam liber tempor cum soluta nobis</li>");
      xhtml.append("<li>imperdiet doming id quod mazim</li>");
      xhtml.append("<li>suscipit lobortis nisl ut aliquip ex</li>");
      xhtml.append("</ul>");
      xhtml.append("<ol>");
      xhtml.append("<li>tation ullamcorper suscipit lobortis</li>");
      xhtml.append("<li>Nam liber tempor cum soluta nobis</li>");
      xhtml.append("<li>imperdiet doming id quod mazim</li>");
      xhtml.append("<li>suscipit lobortis nisl ut aliquip ex</li>");
      xhtml.append("</ol>");
      xhtml.append("<ul class=\"checks\">");
      xhtml.append("<li>tation ullamcorper suscipit lobortis</li>");
      xhtml.append("<li>Nam liber tempor cum soluta nobis</li>");
      xhtml.append("<li>imperdiet doming id quod mazim</li>");
      xhtml.append("<li>suscipit lobortis nisl ut aliquip ex</li>");
      xhtml.append("</ul>");
     
      pc.addContent(xhtml, ContentColumns.MAIN);
     
      return pc;
   }
View Full Code Here

Examples of com.cosmo.ui.controls.XhtmlControl

      HeaderControl header = new HeaderControl(getWorkspace());
      header.setTitle("ORM Form Control");
      header.setDescription("Exemple de formulari que fa us de CORM (Cormo ORM).");
      pc.addContent(header, ContentColumns.MAIN);

      XhtmlControl xhtml = new XhtmlControl(getWorkspace());
      xhtml.append("Per consultar el contingut de les dades que s'introdueixen en aquest formulari, consultar l'exemple de Grid Control.");
      pc.addContent(xhtml, ContentColumns.MAIN);

      DynamicMessageControl message = new DynamicMessageControl(getWorkspace(), ID_MSG);
      pc.addContent(message, ContentColumns.MAIN);
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.