Package com.adito.properties

Examples of com.adito.properties.DefaultPropertyProfile


        session.setAttribute(Constants.SELECTED_PROFILE, getPropertyProfile());
    }

    private static PropertyProfile getPropertyProfile() {
        Calendar instance = Calendar.getInstance();
        return new DefaultPropertyProfile(-1, -1, "", "", "", instance, instance);
    }
View Full Code Here


        setResourceService(new ResourceServiceAdapter<PropertyProfile>(PolicyConstants.PROFILE_RESOURCE_TYPE));
    }

    @Override
    protected PropertyProfile getDefaultResource(int selectedRealmId) {
        return new DefaultPropertyProfile(selectedRealmId, null, "resourceName", "resourceDescription");
    }
View Full Code Here

        // there are no additional properties
    }

    @Override
    protected PropertyProfile getDefaultResource(int selectedRealmId) {
        return new DefaultPropertyProfile(selectedRealmId, null, "resourceName", "resourceDescription");
    }
View Full Code Here

   
    @Override
    public PropertyProfile getEmptyResource() throws Exception {
        Calendar calendar = Calendar.getInstance();
        return new DefaultPropertyProfile(-1, -1, "", "", "", calendar, calendar);
    }
View Full Code Here

    }

    @Override
    public PropertyProfile getNormalResource() throws Exception {
        Calendar calendar = Calendar.getInstance();
        return new DefaultPropertyProfile(getDefaultRealm().getRealmID(), -1, null, "resourceName", "resourceDescription", calendar, calendar);
    }
View Full Code Here

    }

    @Override
    public PropertyProfile getNullResource() throws Exception {
        Calendar calendar = Calendar.getInstance();
        return new DefaultPropertyProfile(-1, -1, null, null, null, calendar, calendar);
    }
View Full Code Here

     * Test the creation of PropertyProfile with a no existing user, the PropertyProfile created is a general profile.
     * @throws Exception
     */
    @Test
    public void createProfileWithoutUser() throws Exception {
        DefaultPropertyProfile newProfile = new DefaultPropertyProfile(getDefaultRealm().getRealmID(), -1, "test3", "profile", "A profile", Calendar.getInstance(), Calendar.getInstance());
        assertEquals("There should not be any PropertyProfile", 0, propertyDatabase.getPropertyProfiles("test1", true, 1).size());
        PropertyProfile createdProfile = createResource(newProfile);
        assertEquals("There should be two PropertyProfile", 1, propertyDatabase.getPropertyProfiles("test3", true, 1).size());
        deleteResource(createdProfile);
        assertEquals("There should not be any PropertyProfile", 0, propertyDatabase.getPropertyProfiles("test1", true, 1).size());
View Full Code Here

            ps.execute();
        } finally {
            ps.releasePreparedStatement();
        }
        int id = db.getLastInsertId(ps, "insert.profile.lastInsertId");
        PropertyProfile profile = new DefaultPropertyProfile(realmID, id, username == null ? "" : username, shortName, description,
                        c, c);
        profile.setResourceName(shortName);
        profile.setResourceDescription(description);

        if (baseOn != -1) {
            for (PropertyDefinition def : PropertyClassManager.getInstance()
                            .getPropertyClass(ProfileProperties.NAME)
                            .getDefinitions()) {
View Full Code Here

        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(cd == null ? System.currentTimeMillis() : cd.getTime());
        Timestamp ad = rs.getTimestamp("date_amended");
        Calendar a = Calendar.getInstance();
        a.setTimeInMillis(ad == null ? System.currentTimeMillis() : ad.getTime());
        return new DefaultPropertyProfile(rs.getInt("realm_id"), rs.getInt("id"), username.equals("") ? null : username, rs
                        .getString("short_name"), rs.getString("description"), c, a);
    }
View Full Code Here

     */
    public Resource createResource(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        SessionInfo session = getSessionInfo(request);
        String principalName = session.isUserConsoleContext() ? session.getUser().getPrincipalName() : null;
        return new DefaultPropertyProfile(session.getRealmId(), principalName, "", "");
    }
View Full Code Here

TOP

Related Classes of com.adito.properties.DefaultPropertyProfile

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.