Package com.opensymphony.module.propertyset

Examples of com.opensymphony.module.propertyset.PropertySet


      out.write("\r\n");

  UserManager um = UserManager.getInstance();
  User user = um.getUser(request.getParameter("name"));
  PropertySet ps = null;

  if (request.getParameter("propertyAdd") != null) {
    ps = user.getPropertySet();
        setPropertyValue(ps, request.getParameter("propertyKey"), Integer.parseInt(request.getParameter("propertyType")), request.getParameter("propertyValue"));
  }
  else if (request.getParameter("propertyDel") != null)
  {
    ps = user.getPropertySet();
    ps.remove(request.getParameter("propertyDel"));
  }
      out.write("\r\n\r\n");
      out.write("<h1>User: ");
      out.print( user.getName() );
      out.write("</h1>\r\n");
      out.write("<hr>\r\n\r\n");
      out.write("<h4>Details");
      out.write("</h4>\r\nName: ");
      out.print( user.getName() );
      out.write("<br>\r\nClass: ");
      out.print( user.getClass() );
      out.write("<br>\r\nFull Name: ");
      out.print( user.getFullName() );
      out.write("<br>\r\nEmail: ");
      out.print( user.getEmail() );
      out.write("<br>\r\n\r\n");
      out.write("<h4>Providers");
      out.write("</h4>\r\nCredentialsProvider: ");
      out.print( (user.getCredentialsProvider() != null ? user.getCredentialsProvider().getClass().toString() : "None") );
      out.write("<br>\r\nAccessProvider: ");
      out.print( (user.getAccessProvider() != null ? user.getAccessProvider().getClass().toString() : "None" ));
      out.write("<br>\r\nProfileProvider: ");
      out.print( (user.getProfileProvider() != null ? user.getProfileProvider().getClass().toString() : "None"));
      out.write("<br>\r\n\r\n");
      out.write("<h4>Groups");
      out.write("</h4>\r\n");

  Collection groups = user.getGroups();
      out.write("\r\n");
      out.print( groups.size() );
      out.write(" groups");
      out.write("<br>\r\n\r\n");
      out.write("<ol>\r\n");

  for (Iterator iterator = groups.iterator(); iterator.hasNext();)
  {
    String groupName = (String) iterator.next();
      out.write("\r\n\t\t");
      out.write("<li>");
      out.write("<a href=\"viewgroup.jsp?name=");
      out.print( URLEncoder.encode(groupName) );
      out.write("\">");
      out.print( groupName );
      out.write("</a>");
      out.write("</li>\r\n");

  }
      out.write("\r\n");
      out.write("</ol>\r\n");
      out.write("<a href=\"editusergroups.jsp?name=");
      out.print( URLEncoder.encode(user.getName()) );
      out.write("\">Add / Edit Groups");
      out.write("</a>\r\n\r\n");
      out.write("<h4>Properties");
      out.write("</h4>\r\n");

  ps = user.getPropertySet();

  Collection keys = ps.getKeys();
  for (Iterator iterator = keys.iterator(); iterator.hasNext();)
  {
    String key = (String) iterator.next();
      out.write("\r\n\t");
      out.print( key );
      out.write(" : ");
      out.print( getPropertyValue(ps, key) );
      out.write(" (");
      out.print( getTypeName(ps.getType(key)) );
      out.write(") [");
      out.write("<a href=\"viewuser.jsp?name=");
      out.print( URLEncoder.encode(user.getName()) );
      out.write("&propertyDel=");
      out.print( URLEncoder.encode(key) );
View Full Code Here


      out.write("\r\n");

  UserManager um = UserManager.getInstance();
  User user = um.getUser(request.getParameter("name"));
  PropertySet ps = null;

  if (request.getParameter("propertyAdd") != null) {
    ps = user.getPropertySet();
        setPropertyValue(ps, request.getParameter("propertyKey"), Integer.parseInt(request.getParameter("propertyType")), request.getParameter("propertyValue"));
  }
  else if (request.getParameter("propertyDel") != null)
  {
    ps = user.getPropertySet();
    ps.remove(request.getParameter("propertyDel"));
  }
      out.write("\r\n\r\n");
      out.write("<h1>User: ");
      out.print( user.getName() );
      out.write("</h1>\r\n");
      out.write("<hr>\r\n\r\n");
      out.write("<h4>Details");
      out.write("</h4>\r\nName: ");
      out.print( user.getName() );
      out.write("<br>\r\nClass: ");
      out.print( user.getClass() );
      out.write("<br>\r\nFull Name: ");
      out.print( user.getFullName() );
      out.write("<br>\r\nEmail: ");
      out.print( user.getEmail() );
      out.write("<br>\r\n\r\n");
      out.write("<h4>Providers");
      out.write("</h4>\r\nCredentialsProvider: ");
      out.print( (user.getCredentialsProvider() != null ? user.getCredentialsProvider().getClass().toString() : "None") );
      out.write("<br>\r\nAccessProvider: ");
      out.print( (user.getAccessProvider() != null ? user.getAccessProvider().getClass().toString() : "None" ));
      out.write("<br>\r\nProfileProvider: ");
      out.print( (user.getProfileProvider() != null ? user.getProfileProvider().getClass().toString() : "None"));
      out.write("<br>\r\n\r\n");
      out.write("<h4>Groups");
      out.write("</h4>\r\n");

  Collection groups = user.getGroups();
      out.write("\r\n");
      out.print( groups.size() );
      out.write(" groups");
      out.write("<br>\r\n\r\n");
      out.write("<ol>\r\n");

  for (Iterator iterator = groups.iterator(); iterator.hasNext();)
  {
    String groupName = (String) iterator.next();
      out.write("\r\n\t\t");
      out.write("<li>");
      out.write("<a href=\"viewgroup.jsp?name=");
      out.print( URLEncoder.encode(groupName) );
      out.write("\">");
      out.print( groupName );
      out.write("</a>");
      out.write("</li>\r\n");

  }
      out.write("\r\n");
      out.write("</ol>\r\n");
      out.write("<a href=\"editusergroups.jsp?name=");
      out.print( URLEncoder.encode(user.getName()) );
      out.write("\">Add / Edit Groups");
      out.write("</a>\r\n\r\n");
      out.write("<h4>Properties");
      out.write("</h4>\r\n");

  ps = user.getPropertySet();

  Collection keys = ps.getKeys();
  for (Iterator iterator = keys.iterator(); iterator.hasNext();)
  {
    String key = (String) iterator.next();
      out.write("\r\n\t");
      out.print( key );
      out.write(" : ");
      out.print( getPropertyValue(ps, key) );
      out.write(" (");
      out.print( getTypeName(ps.getType(key)) );
      out.write(") [");
      out.write("<a href=\"viewuser.jsp?name=");
      out.print( URLEncoder.encode(user.getName()) );
      out.write("&propertyDel=");
      out.print( URLEncoder.encode(key) );
View Full Code Here

      out.write("\r\n");

  UserManager um = UserManager.getInstance();
  Group group = um.getGroup(request.getParameter("name"));

  PropertySet ps = null;

  if (request.getParameter("propertyAdd") != null) {
    ps = group.getPropertySet();
        setPropertyValue(ps, request.getParameter("propertyKey"), Integer.parseInt(request.getParameter("propertyType")), request.getParameter("propertyValue"));
  }
  else if (request.getParameter("propertyDel") != null)
  {
    ps = group.getPropertySet();
    ps.remove(request.getParameter("propertyDel"));
  }
      out.write("\r\n\r\n");
      out.write("<h1>View Group : ");
      out.print( group.getName() );
      out.write("</h1>\r\n");
      out.write("<hr>\r\n\r\n");
      out.write("<h4>Details");
      out.write("</h4>\r\nName: ");
      out.print( group.getName() );
      out.write("<br>\r\nClass: ");
      out.print( group.getClass() );
      out.write("<br>\r\n\r\n");
      out.write("<h4>Providers");
      out.write("</h4>\r\nCredentialsProvider: ");
      out.print( (group.getCredentialsProvider() != null ? group.getCredentialsProvider().getClass().toString() : "None") );
      out.write("<br>\r\nAccessProvider: ");
      out.print( (group.getAccessProvider() != null ? group.getAccessProvider().getClass().toString() : "None" ));
      out.write("<br>\r\nProfileProvider: ");
      out.print( (group.getProfileProvider() != null ? group.getProfileProvider().getClass().toString() : "None"));
      out.write("<br>\r\n\r\n");
      out.write("<h4>Users");
      out.write("</h4>\r\n\r\n");

  Collection users = group.getUsers();
      out.write("\r\n");
      out.print( users.size() );
      out.write(" users");
      out.write("<br>\r\n\r\n");
      out.write("<ol>\r\n");

  for (Iterator iterator = users.iterator(); iterator.hasNext();)
  {
    String userName = (String) iterator.next();
      out.write("\r\n\t\t");
      out.write("<li>");
      out.write("<a href=\"viewuser.jsp?name=");
      out.print( URLEncoder.encode(userName) );
      out.write("\">");
      out.print( userName);
      out.write("</a>");
      out.write("</li>\r\n");

  }
      out.write("\r\n");
      out.write("</ol>\r\n\r\n");
      out.write("<h4>Properties");
      out.write("</h4>\r\n");

  ps = group.getPropertySet();
  if (ps != null)
  {
    Collection keys = ps.getKeys();
    for (Iterator iterator = keys.iterator(); iterator.hasNext();)
    {
      String key = (String) iterator.next();
      out.write("\r\n\t\t");
      out.print( key );
      out.write(" : ");
      out.print( getPropertyValue(ps, key) );
      out.write(" (");
      out.print( getTypeName(ps.getType(key)) );
      out.write(") [");
      out.write("<a href=\"viewgroup.jsp?name=");
      out.print( URLEncoder.encode(group.getName()) );
      out.write("&propertyDel=");
      out.print( URLEncoder.encode(key) );
View Full Code Here

      out.write("\r\n");

  UserManager um = UserManager.getInstance();
  Group group = um.getGroup(request.getParameter("name"));

  PropertySet ps = null;

  if (request.getParameter("propertyAdd") != null) {
    ps = group.getPropertySet();
        setPropertyValue(ps, request.getParameter("propertyKey"), Integer.parseInt(request.getParameter("propertyType")), request.getParameter("propertyValue"));
  }
  else if (request.getParameter("propertyDel") != null)
  {
    ps = group.getPropertySet();
    ps.remove(request.getParameter("propertyDel"));
  }
      out.write("\r\n\r\n");
      out.write("<h1>View Group : ");
      out.print( group.getName() );
      out.write("</h1>\r\n");
      out.write("<hr>\r\n\r\n");
      out.write("<h4>Details");
      out.write("</h4>\r\nName: ");
      out.print( group.getName() );
      out.write("<br>\r\nClass: ");
      out.print( group.getClass() );
      out.write("<br>\r\n\r\n");
      out.write("<h4>Providers");
      out.write("</h4>\r\nCredentialsProvider: ");
      out.print( (group.getCredentialsProvider() != null ? group.getCredentialsProvider().getClass().toString() : "None") );
      out.write("<br>\r\nAccessProvider: ");
      out.print( (group.getAccessProvider() != null ? group.getAccessProvider().getClass().toString() : "None" ));
      out.write("<br>\r\nProfileProvider: ");
      out.print( (group.getProfileProvider() != null ? group.getProfileProvider().getClass().toString() : "None"));
      out.write("<br>\r\n\r\n");
      out.write("<h4>Users");
      out.write("</h4>\r\n\r\n");

  Collection users = group.getUsers();
      out.write("\r\n");
      out.print( users.size() );
      out.write(" users");
      out.write("<br>\r\n\r\n");
      out.write("<ol>\r\n");

  for (Iterator iterator = users.iterator(); iterator.hasNext();)
  {
    String userName = (String) iterator.next();
      out.write("\r\n\t\t");
      out.write("<li>");
      out.write("<a href=\"viewuser.jsp?name=");
      out.print( URLEncoder.encode(userName) );
      out.write("\">");
      out.print( userName);
      out.write("</a>");
      out.write("</li>\r\n");

  }
      out.write("\r\n");
      out.write("</ol>\r\n\r\n");
      out.write("<h4>Properties");
      out.write("</h4>\r\n");

  ps = group.getPropertySet();
  if (ps != null)
  {
    Collection keys = ps.getKeys();
    for (Iterator iterator = keys.iterator(); iterator.hasNext();)
    {
      String key = (String) iterator.next();
      out.write("\r\n\t\t");
      out.print( key );
      out.write(" : ");
      out.print( getPropertyValue(ps, key) );
      out.write(" (");
      out.print( getTypeName(ps.getType(key)) );
      out.write(") [");
      out.write("<a href=\"viewgroup.jsp?name=");
      out.print( URLEncoder.encode(group.getName()) );
      out.write("&propertyDel=");
      out.print( URLEncoder.encode(key) );
View Full Code Here

  public void testGetPropertySet() throws Exception {
    bindMockInstanceIdToContext();

    final MockControl ctl = createMockWorkflowControl();
    final PropertySet ps = new MapPropertySet();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();

        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        ctl.setVoidCallable();
        workflow.getPropertySet(MOCK_INSTANCE_ID);
        ctl.setReturnValue(ps);
        ctl.replay();

        return workflow;
      }
    };

    setProperties(template);

    PropertySet result = template.getPropertySet();

    ctl.verify();

    assertEquals("PropertySets don't match", ps, result);
  }
View Full Code Here

  public void testPassesCondition() throws Exception {
    AcegiRoleCondition condition = new AcegiRoleCondition();

    Map transientVars = new HashMap();
    Map args = new HashMap();
    PropertySet ps = new MemoryPropertySet();

    args.put(AcegiRoleCondition.ROLE, "manager");
    assertTrue("Should be in manager role", condition.passesCondition(transientVars, args, ps));

    args.put(AcegiRoleCondition.ROLE, "vp");
View Full Code Here

    public boolean create(String name) {
        if (propertySetCache.propertySets.containsKey(name)) {
            return false;
        }

        PropertySet propertySet = PropertySetManager.getInstance("serializable", null);
        propertySetCache.propertySets.put(name, propertySet);

        return propertySetCache.store();
    }
View Full Code Here

      
      try
      {
          Map args = new HashMap();
        args.put("globalKey", "infoglue");
        PropertySet propertySet = PropertySetManager.getInstance("jdbc", args);
 
        String xml = getDataPropertyValue(propertySet, "serverNode_-1_shortcuts");
        logger.info("xml:" + xml);
       
      if(xml != null)
View Full Code Here

      return this.WYSIWYGProperties;
   
    //First we got the values from repository properties...
    Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      byte[] WYSIWYGConfigBytes = ps.getData("repository_" + this.getRepositoryId() + "_WYSIWYGConfig");
      if(WYSIWYGConfigBytes != null)
      {
        Properties properties = new Properties();
        properties.load(new ByteArrayInputStream(WYSIWYGConfigBytes));
        this.WYSIWYGProperties = properties;
View Full Code Here

  public String getInterceptorConfiguration(Integer interceptorId) throws Exception
  {
        Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);
     
      byte[] configurationBytes = ps.getData("interceptor_" + interceptorId + "_Configuration");
      if(configurationBytes != null)
      {
        String configuration = new String(configurationBytes, "utf-8");
        if(configuration != null && !configuration.equals(""))
      {
View Full Code Here

TOP

Related Classes of com.opensymphony.module.propertyset.PropertySet

Copyright © 2018 www.massapicom. 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.