Examples of NoteType


Examples of net.sourceforge.cardme.vcard.types.NoteType

    //NOTE
    {
      List<NoteType> it = vcard.getNotes();
      assertEquals(1, it.size());
     
      NoteType f = it.get(0);
      assertEquals("THIS SOFTWARE IS PROVIDED BY GEORGE EL-HADDAD ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GEORGE EL-HADDAD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", f.getNote());
    }
   
    //TEL
    {
      List<TelType> it = vcard.getTels();
      assertEquals(2, it.size());
     
      TelType f = it.get(0);
      assertEquals("(905) 555-1234", f.getTelephone());
      List<TelParamType> types = f.getParams();
      assertEquals(2, types.size());
      assertTrue(types.contains(TelParamType.WORK));
      assertTrue(types.contains(TelParamType.VOICE));

      f = it.get(1);
      assertEquals("(905) 666-1234", f.getTelephone());
      types = f.getParams();
      assertEquals(2, types.size());
      assertTrue(types.contains(TelParamType.HOME));
      assertTrue(types.contains(TelParamType.VOICE));
    }
   
    //ADR
    {
      List<AdrType> it = vcard.getAdrs();
      assertEquals(2, it.size());
     
      AdrType f = it.get(0);
      assertEquals("", f.getPostOfficeBox());
      assertEquals("", f.getExtendedAddress());
      assertEquals("Cresent moon drive", f.getStreetAddress());
      assertEquals("Albaney", f.getLocality());
      assertEquals("New York", f.getRegion());
      assertEquals("12345", f.getPostalCode());
      assertEquals("United States of America", f.getCountryName());
     
      List<AdrParamType> types = f.getParams();
      assertEquals(2, types.size());
      assertTrue(types.contains(AdrParamType.WORK));
      assertTrue(types.contains(AdrParamType.PREF));
     
      f = it.get(1);
      assertEquals("", f.getPostOfficeBox());
      assertEquals("", f.getExtendedAddress());
      assertEquals("Silicon Alley 5,", f.getStreetAddress());
      assertEquals("New York", f.getLocality());
      assertEquals("New York", f.getRegion());
      assertEquals("12345", f.getPostalCode());
      assertEquals("United States of America", f.getCountryName());
     
      types = f.getParams();
      assertEquals(1, types.size());
      assertTrue(types.contains(AdrParamType.HOME));
    }
   
    //LABEL
    {
      List<LabelType> it = vcard.getLables();
      assertEquals(2, it.size());
     
      LabelType f = it.get(0);
      assertEquals("Cresent moon drive\r\nAlbaney, New York  12345", f.getLabel());
     
      List<LabelParamType> types = f.getParams();
      assertEquals(2, types.size());
      assertTrue(types.contains(LabelParamType.WORK));
      assertTrue(types.contains(LabelParamType.PREF));
     
      f = it.get(1);
      assertEquals("Silicon Alley 5,\r\nNew York, New York  12345", f.getLabel());
      types = f.getParams();
      assertEquals(1, types.size());
      assertTrue(types.contains(LabelParamType.HOME));
    }
   
    //URL
    {
      List<UrlType> it = vcard.getUrls();
      assertEquals(1, it.size());
     
      UrlType f = it.get(0);
      assertEquals("http://www.ibm.com", f.getRawUrl());
     
      List<UrlParamType> types = f.getParams();
      assertEquals(1, types.size());
      assertTrue(types.contains(UrlParamType.WORK));
    }
   
    //ROLE
    {
      RoleType f = vcard.getRole();
      assertEquals("Counting Money", f.getRole());
    }
   
    //BDAY
    {
      BDayType f = vcard.getBDay();
      assertEquals(1980, f.getBirthday().get(Calendar.YEAR));
      assertEquals(Calendar.MARCH, f.getBirthday().get(Calendar.MONTH));
      assertEquals(22, f.getBirthday().get(Calendar.DAY_OF_MONTH));
    }
   
    //EMAIL
    {
      List<EmailType> it = vcard.getEmails();
      assertEquals(1, it.size());
     
      EmailType f = it.get(0);
      assertEquals("john.doe@ibm.cm", f.getEmail());
     
      List<EmailParamType> types = f.getParams();
      assertEquals(2, types.size());
      assertTrue(types.contains(EmailParamType.PREF));
      assertTrue(types.contains(EmailParamType.INTERNET));
    }

    //PHOTO
    {
      List<PhotoType> it = vcard.getPhotos();
      assertEquals(1, it.size());
     
      PhotoType f = it.get(0);
      assertEquals(EncodingType.BINARY, f.getEncodingType());
      assertEquals(ImageMediaType.JPEG, f.getImageMediaType());
      assertEquals(860, f.getPhoto().length);
    }
   
    //REV
    {
      RevType f = vcard.getRev();
      Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
      c.clear();
      c.set(Calendar.YEAR, 2012);
      c.set(Calendar.MONTH, Calendar.MARCH);
      c.set(Calendar.DAY_OF_MONTH, 5);
      c.set(Calendar.HOUR_OF_DAY, 13);
      c.set(Calendar.MINUTE, 19);
      c.set(Calendar.SECOND, 33);
      Calendar actual = f.getRevision();
      assertEquals(c.getTime(), actual.getTime());
    }
   
    //custom types
    {
      List<ExtendedType> it = vcard.getExtendedTypes();
      assertEquals(6, it.size());
     
      ExtendedType f = it.get(0);
      assertEquals("X-MS-OL-DEFAULT-POSTAL-ADDRESS", f.getExtendedName());
      assertEquals("2", f.getExtendedValue());
     
      f = it.get(1);
      assertEquals("X-MS-ANNIVERSARY", f.getExtendedName());
      assertEquals("20110113", f.getExtendedValue());
     
      f = it.get(2);
      assertEquals("X-MS-IMADDRESS", f.getExtendedName());
      assertEquals("johny5@aol.com", f.getExtendedValue());

      f = it.get(3);
      assertEquals("X-MS-OL-DESIGN", f.getExtendedName());
      assertEquals("<card xmlns=\"http://schemas.microsoft.com/office/outlook/12/electronicbusinesscards\" ver=\"1.0\" layout=\"left\" bgcolor=\"ffffff\"><img xmlns=\"\" align=\"tleft\" area=\"32\" use=\"photo\"/><fld xmlns=\"\" prop=\"name\" align=\"left\" dir=\"ltr\" style=\"b\" color=\"000000\" size=\"10\"/><fld xmlns=\"\" prop=\"org\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"/><fld xmlns=\"\" prop=\"title\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"/><fld xmlns=\"\" prop=\"dept\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"/><fld xmlns=\"\" prop=\"telwork\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"><label align=\"right\" color=\"626262\">Work</label></fld><fld xmlns=\"\" prop=\"telhome\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"><label align=\"right\" color=\"626262\">Home</label></fld><fld xmlns=\"\" prop=\"email\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"/><fld xmlns=\"\" prop=\"addrwork\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"/><fld xmlns=\"\" prop=\"addrhome\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"/><fld xmlns=\"\" prop=\"webwork\" align=\"left\" dir=\"ltr\" color=\"000000\" size=\"8\"/><fld xmlns=\"\" prop=\"blank\" size=\"8\"/><fld xmlns=\"\" prop=\"blank\" size=\"8\"/><fld xmlns=\"\" prop=\"blank\" size=\"8\"/><fld xmlns=\"\" prop=\"blank\" size=\"8\"/><fld xmlns=\"\" prop=\"blank\" size=\"8\"/><fld xmlns=\"\" prop=\"blank\" size=\"8\"/></card>", f.getExtendedValue());
      assertEquals(Charset.forName("UTF-8"), f.getCharset());
     
      f = it.get(4);
      assertEquals("X-MS-MANAGER", f.getExtendedName());
      assertEquals("Big Blue", f.getExtendedValue());
     
      f = it.get(5);
      assertEquals("X-MS-ASSISTANT", f.getExtendedName());
      assertEquals("Jenny", f.getExtendedValue());
    }
   
    VCardImpl vcard2 = (VCardImpl)vcard;
   
    if(vcard2.hasErrors()) {
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.NoteType

    //NOTE
    {
      List<NoteType> it = vcard.getNotes();
      assertEquals(1, it.size());
     
      NoteType f = it.get(0);
      assertEquals("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\nFavotire Color: Blue", f.getNote());
    }
   
    //URL
    {
      List<UrlType> it = vcard.getUrls();
      assertEquals(1, it.size());
     
      UrlType f = it.get(0);
      assertEquals("item4", f.getGroup());
      assertEquals("http://www.ibm.com", f.getRawUrl());
     
      List<UrlParamType> types = f.getParams();
      assertEquals(1, types.size());
      assertTrue(types.contains(UrlParamType.PREF));
    }
   
    //BDAY
    {
      BDayType f = vcard.getBDay();
      assertEquals(2012, f.getBirthday().get(Calendar.YEAR));
      assertEquals(Calendar.JUNE, f.getBirthday().get(Calendar.MONTH));
      assertEquals(6, f.getBirthday().get(Calendar.DAY_OF_MONTH));
      assertEquals(ISOFormat.ISO8601_DATE_EXTENDED, f.getISO8601Format());
    }
   
    //PHOTO
    {
      List<PhotoType> it = vcard.getPhotos();
      assertEquals(1, it.size());
     
      PhotoType f = it.get(0);
      assertEquals(EncodingType.BINARY, f.getEncodingType());
      assertEquals(null, f.getImageMediaType());
      assertEquals(18242, f.getPhoto().length);
    }
   
    //custom types
    {
      List<ExtendedType> it = vcard.getExtendedTypes();
      assertEquals(9, it.size());
     
      ExtendedType f = it.get(0);
      assertEquals("X-PHONETIC-FIRST-NAME", f.getExtendedName());
      assertEquals("Jon", f.getExtendedValue());
     
      f = it.get(1);
      assertEquals("X-PHONETIC-LAST-NAME", f.getExtendedName());
      assertEquals("Dow", f.getExtendedValue());
     
      f = it.get(2);
      assertEquals("item1", f.getGroup());
      assertEquals("X-ABLABEL", f.getExtendedName());
      assertEquals("AssistantPhone", f.getExtendedValue());

      f = it.get(3);
      assertEquals("item2", f.getGroup());
      assertEquals("X-ABADR", f.getExtendedName());
      assertEquals("Silicon Alley", f.getExtendedValue());
     
      f = it.get(4);
      assertEquals("item3", f.getGroup());
      assertEquals("X-ABADR", f.getExtendedName());
      assertEquals("Street 4, Building 6,\nFloor 8\nNew York\nUSA", f.getExtendedValue());
     
      f = it.get(5);
      assertEquals("item4", f.getGroup());
      assertEquals("X-ABLABEL", f.getExtendedName());
      assertEquals("_$!<HomePage>!$_", f.getExtendedValue());
     
      f = it.get(6);
      assertEquals("item5", f.getGroup());
      assertEquals("X-ABRELATEDNAMES", f.getExtendedName());
      assertEquals("Jenny", f.getExtendedValue());
     
      List<ExtendedParamType> xlist = f.getExtendedParams();
      assertEquals(1, xlist.size());
      assertEquals("TYPE", xlist.get(0).getTypeName());
      assertEquals("PREF", xlist.get(0).getTypeValue());
     
      f = it.get(7);
      assertEquals("item5", f.getGroup());
      assertEquals("X-ABLABEL", f.getExtendedName());
      assertEquals("Spouse", f.getExtendedValue());
     
      f = it.get(8);
      assertEquals("X-ABUID", f.getExtendedName());
      assertEquals("6B29A774-D124-4822-B8D0-2780EC117F60:ABPerson", f.getExtendedValue());
    }
   
    VCardImpl vcard2 = (VCardImpl)vcard;
   
    if(vcard2.hasErrors()) {
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

        }
    }

    @Override
    public NoteData retrieveNote(final Long noteId, final Long resourceId, final Integer noteTypeId) {
        final NoteType noteType = NoteType.fromInt(noteTypeId);
        try {
            final NoteMapper rm = new NoteMapper();
            String conditionSql = getResourceCondition(noteType);
            if (StringUtils.isNotBlank(conditionSql)) {
                conditionSql = " and " + conditionSql;
            }

            final String sql = rm.schema() + " where n.id = ? " + conditionSql + " order by n.created_date DESC";

            return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { noteId, resourceId });
        } catch (final EmptyResultDataAccessException e) {
            throw new NoteNotFoundException(noteId, resourceId, noteType.name().toLowerCase());
        }
    }
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

        }
    }

    @Override
    public Collection<NoteData> retrieveNotesByResource(final Long resourceId, final Integer noteTypeId) {
        final NoteType noteType = NoteType.fromInt(noteTypeId);
        final NoteMapper rm = new NoteMapper();
        final String conditionSql = getResourceCondition(noteType);

        final String sql = rm.schema() + " where " + conditionSql + " order by n.created_date DESC";
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String retrieveNotesByResource(@PathParam("resourceType") final String resourceType,
            @PathParam("resourceId") final Long resourceId, @Context final UriInfo uriInfo) {

        final NoteType noteType = NoteType.fromApiUrl(resourceType);

        if (noteType == null) { throw new NoteResourceNotSupportedException(resourceType); }

        this.context.authenticatedUser().validateHasReadPermission(getResourceDetails(noteType, resourceId).entityName());

        final Integer noteTypeId = noteType.getValue();

        final Collection<NoteData> notes = this.readPlatformService.retrieveNotesByResource(resourceId, noteTypeId);

        final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
        return this.toApiJsonSerializer.serialize(settings, notes, this.NOTE_DATA_PARAMETERS);
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String retrieveNote(@PathParam("resourceType") final String resourceType, @PathParam("resourceId") final Long resourceId,
            @PathParam("noteId") final Long noteId, @Context final UriInfo uriInfo) {

        final NoteType noteType = NoteType.fromApiUrl(resourceType);

        if (noteType == null) { throw new NoteResourceNotSupportedException(resourceType); }

        this.context.authenticatedUser().validateHasReadPermission(getResourceDetails(noteType, resourceId).entityName());

        final Integer noteTypeId = noteType.getValue();

        final NoteData note = this.readPlatformService.retrieveNote(noteId, resourceId, noteTypeId);

        final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
        return this.toApiJsonSerializer.serialize(settings, note, this.NOTE_DATA_PARAMETERS);
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String addNewNote(@PathParam("resourceType") final String resourceType, @PathParam("resourceId") final Long resourceId,
            final String apiRequestBodyAsJson) {

        final NoteType noteType = NoteType.fromApiUrl(resourceType);

        if (noteType == null) { throw new NoteResourceNotSupportedException(resourceType); }

        final CommandWrapper resourceDetails = getResourceDetails(noteType, resourceId);
        final CommandWrapper commandRequest = new CommandWrapperBuilder().createNote(resourceDetails, resourceType, resourceId)
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String updateNote(@PathParam("resourceType") final String resourceType, @PathParam("resourceId") final Long resourceId,
            @PathParam("noteId") final Long noteId, final String apiRequestBodyAsJson) {

        final NoteType noteType = NoteType.fromApiUrl(resourceType);

        if (noteType == null) { throw new NoteResourceNotSupportedException(resourceType); }

        final CommandWrapper resourceDetails = getResourceDetails(noteType, resourceId);
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String deleteNote(@PathParam("resourceType") final String resourceType, @PathParam("resourceId") final Long resourceId,
            @PathParam("noteId") final Long noteId) {

        final NoteType noteType = NoteType.fromApiUrl(resourceType);

        if (noteType == null) { throw new NoteResourceNotSupportedException(resourceType); }

        final CommandWrapper resourceDetails = getResourceDetails(noteType, resourceId);
View Full Code Here

Examples of org.mifosplatform.portfolio.note.domain.NoteType

    public CommandProcessingResult createNote(final JsonCommand command) {

        this.fromApiJsonDeserializer.validateNote(command.json());

        final String resourceUrl = getResourceUrlFromCommand(command); //command.getSupportedEntityType();
        final NoteType type = NoteType.fromApiUrl(resourceUrl);
        switch (type) {
            case CLIENT: {
                return createClientNote(command);
            }
            case GROUP: {
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.