Code Monkey home page Code Monkey logo

ical4j-extensions's Introduction

Build Status

Extensions

iCal4j Extensions is a Java library that provides support for widely used non-standard iCalendar objects (i.e. properties and parameters). These model extensions are implemented via the custom object registry support in iCal4j.

Usage

To add support for extensions you may register the required factories with your CalendarBuilder instance:

    CalendarParser parser = CalendarParserFactory.getInstance().createParser();
    
    PropertyFactoryRegistry propertyFactoryRegistry = new PropertyFactoryRegistry();
    propertyFactoryRegistry.register(WrTimezone.PROPERTY_NAME, WrTimezone.FACTORY);
    propertyFactoryRegistry.register(WrCalName.PROPERTY_NAME, WrCalName.FACTORY);
    
    ParameterFactoryRegistry parameterFactoryRegistry = new ParameterFactoryRegistry();
    
    TimeZoneRegistry tzRegistry = TimeZoneRegistryFactory.getInstance().createRegistry();
    
    builder = new CalendarBuilder(parser, propertyFactoryRegistry, parameterFactoryRegistry, tzRegistry);

Minimum requirements

iCal4j Extensions requires a minimum of Java 5 due to the use of features introduced in this version.

References:

ical4j-extensions's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lonardo 1placenz

ical4j-extensions's Issues

ImmutableCalendarServerAccess initialization calling setValue

Hi,

I was checking out the code and I see in CalendarServerAccess.java,

When we're initializing ImmutableCalendarServerAccess,
it calls

public CalendarServerAccess(ParameterList aList, String value) {
        super(PROPERTY_NAME, aList, new Factory());
        setValue(value);
    }

which eventually calls the setValue method defined in ImmutableCalendarServerAccess:

    private static final class ImmutableCalendarServerAccess extends CalendarServerAccess {
        private static final long serialVersionUID = -2054338254L;

        private ImmutableCalendarServerAccess(String value) {
            super(new ParameterList(true), value);
        }

        public void setValue(String aValue) {
            throw new UnsupportedOperationException("Cannot modify constant instances");
        }
    }

I'm wondering if I'm using this library wrong or is this a real issue.
because I see in similar class like ical4j Method.java, the ImmutableMethod will call the super constructor which will use this.value = value and not invoking the setValue method.

I know that those code were there for quite a long time, so I'm wondering if I'm using this library in a wrong way.

Thanks. Looking forward to your reply.

I'm using ical4j-extension 1.0.3 and ical4j 2.2.0

Support multiple plugin mechanisms

Current plugin implementation uses ServiceLoader and doesn't support Android and OSGi environments.

Use the extensions library to support multiple injection models to support different environments.

  • ServiceLoader, refactor current implementation to load from extensions library
  • OSGi
  • Spring
  • guice

SUBCALENDAR-ID

I want to use a calendar published in Confluence, but this fails on the property SUBCALENDAR-ID

net.fortuna.ical4j.data.ParserException: Error at line 177:Illegal property [SUBCALENDAR-ID]
Caused by: java.lang.IllegalArgumentException: Illegal property [SUBCALENDAR-ID]

cfr. ics-file in attachement
calendar.txt

Wrong CalendarValidatorFactory being used?

We are using iCal4J 2.0.0 with iCal4J extensions 1.0.0 (all the latest). When constructing a new Calendar object, the AbstractCalendarValidatorFactory is setting its static CalendarValidatorFactory instance to a DefaultCalendarValidatorFactory instead of the expected ExtensionsCalendarValidatorFactory, which happens to be second in the Iterator returned by ServiceLoader. Is this a bug or is there something that should be done to get the classes to load in the proper order so that the ExtensionsCalendarValidatorFactory is used? As it stands right now, we are required to use the Calendar constructor that takes the Validator in order to explicitly set the ExtensionsCalendarValidator as the validator to use. Otherwise, any Calendars that use extensions will fail validation.

FWIW, we were using iCal4J 1.0.6 and iCal4J extensions 0.9.2 previously and didn't need to do anything special to handle the extensions validation (though I see the validation framework was handled completely differently on those older versions).

Thanks for providing a great open source library!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.