Examples of Modification


Examples of ch.semafor.gendas.model.Modification

  public Object load(final Element element, final Long revision,
      final Object bean, final Class clazz) throws CoreException {
    if (revision == null) {
      return loadElement(element, null, bean, clazz); // NOPMD by wim on 9/20/10 3:51 PM
    }
    final Modification hist = element.getHistory(revision);
    if (hist == null) {
      throw new CoreException("No History with Revision #" + revision
          + " found");
    }
    return loadElement(element, hist.getTimestamp(), bean, clazz);
  }
View Full Code Here

Examples of com.dotmarketing.util.diff.html.modification.Modification

            getTextNode(start).setWhiteBefore(false);

        List<Modification> nextLastModified = new ArrayList<Modification>();

        for (int i = start; i < end; i++) {
            Modification mod = new Modification(ModificationType.ADDED);
            mod.setID(newID);
            if (lastModified.size() > 0) {
                mod.setPrevious(lastModified.get(0));
                if (lastModified.get(0).getNext() == null) {
                    for (Modification lastMod : lastModified) {
                        lastMod.setNext(mod);
                    }
                }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.Modification

                //Folders don't seem to always have a checked-in time, so
                //fake one.
                line = "0" + line;
            }
           
            Modification m = parseModificationDescription(line);
            mods.add(m);
        }
        return mods;
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.entry.Modification

                operation = ModificationOperation.ADD_ATTRIBUTE;
                break;

        }

        Modification modification = new DefaultModification(
            operation,
            ServerEntryUtils.toServerAttribute( modificationImpl.getAttribute(), attributeType ) );

        return modification;
View Full Code Here

Examples of org.apache.directory.api.ldap.model.entry.Modification

     * @return a instance of a ServerModification object
     */
    private static Modification toServerModification( Modification modification, AttributeType attributeType )
        throws LdapException
    {
        Modification serverModification = new DefaultModification(
            modification.getOperation(),
            new DefaultAttribute( attributeType, modification.getAttribute() ) );

        return serverModification;

View Full Code Here

Examples of org.apache.directory.api.ldap.model.entry.Modification

     * @param type the attributeType spec of the Attribute to extract
     * @return the extract Attribute or null if no such attribute exists
     */
    public static Attribute getAttribute( List<Modification> mods, AttributeType type )
    {
        Modification mod = getModificationItem( mods, type );

        if ( mod != null )
        {
            return mod.getAttribute();
        }

        return null;
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.entry.Modification

        Dn dn = new Dn( schemaManager, "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );

        Attribute attrib = new DefaultAttribute( SchemaConstants.OU_AT, OU_AT );
        attrib.add( "Engineering" );

        Modification add = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attrib );

        store.modify( dn, add );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.entry.Modification

        Attribute attrib = new DefaultAttribute( "sn", SN_AT );

        String attribVal = "Walker";
        attrib.add( attribVal );

        Modification add = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attrib );

        Entry lookedup = store.fetch( store.getEntryId( dn ), dn );

        store.modify( dn, add );
        assertTrue( lookedup.get( "sn" ).contains( attribVal ) );
View Full Code Here

Examples of org.apache.directory.api.ldap.model.entry.Modification

        Attribute attrib = new DefaultAttribute( SchemaConstants.SN_AT, SN_AT );

        String attribVal = "Johnny";
        attrib.add( attribVal );

        Modification add = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );

        Entry lookedup = store.fetch( store.getEntryId( dn ), dn );

        assertEquals( "WAlkeR", lookedup.get( "sn" ).get().getString() ); // before replacing

        lookedup = store.modify( dn, add );
        assertEquals( attribVal, lookedup.get( "sn" ).get().getString() );

        // testing the store.modify( dn, mod, entry ) API
        Modification replace = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SN_AT, "JWalker" );

        lookedup = store.modify( dn, replace );
        assertEquals( "JWalker", lookedup.get( "sn" ).get().getString() );
        assertEquals( 1, lookedup.get( "sn" ).size() );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.entry.Modification

    {
        Dn dn = new Dn( schemaManager, "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );

        Attribute attrib = new DefaultAttribute( SchemaConstants.SN_AT, SN_AT );

        Modification add = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );

        Entry lookedup = store.fetch( store.getEntryId( dn ), dn );

        assertNotNull( lookedup.get( "sn" ).get() );

        lookedup = store.modify( dn, add );
        assertNull( lookedup.get( "sn" ) );

        // add an entry for the sake of testing the remove operation
        add = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, SN_AT, "JWalker" );
        lookedup = store.modify( dn, add );
        assertNotNull( lookedup.get( "sn" ) );

        Modification remove = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, SN_AT );
        lookedup = store.modify( dn, remove );
        assertNull( lookedup.get( "sn" ) );
    }
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.