Skip to content

Commit

Permalink
Merge pull request #14 from ical4j/develop
Browse files Browse the repository at this point in the history
Prepare release
  • Loading branch information
benfortuna authored Jan 5, 2024
2 parents ec4c24b + 901b5fe commit 911584a
Show file tree
Hide file tree
Showing 102 changed files with 2,003 additions and 1,713 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
CHANGELOG_START_TAG=ical4j-template-0.1.0
CHANGELOG_END_TAG=HEAD

GRADLE_VERSION=7.6
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
env:
GPR_USERNAME: benfortuna
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ test:
build:
./gradlew build

changelog:
git log "$(CHANGELOG_START_TAG)...$(CHANGELOG_END_TAG)" \
--pretty=format:'* %s [View commit](http://github.com/ical4j/ical4j-template/commit/%H)' --reverse | grep -v Merge

currentVersion:
./gradlew -q currentVersion

markNextVersion:
./gradlew markNextVersion -Prelease.version=$(NEXT_VERSION)

install:
./gradlew publishToMavenLocal

verify:
./gradlew verify

Expand Down
116 changes: 97 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,115 @@
# iCal4j Templates

A decorator layer on iCalendar and vCard for common use-cases
iCalendar templates for common use-cases

## Overview

iCal4j Templates is designed to make the iCalendar and vCard specifications more accessible by providing a
discoverable API for common applications.
iCal4j Templates is designed to make the iCalendar specifications more accessible by providing a
discoverable API for common applications. For example, a simple meeting or task may not require the full
functionality provided by iCalendar, but you still need to understand it in order to
produce valid content.

For example, a simple meeting or task may not require the full functionality provided by the iCalendar specification,
but you still need to understand all of it in order to produce valid content.

This library aims to make it easier to construct valid iCalendar and vCard content without needing to read the
This library aims to make it easier to construct valid iCalendar content without needing to read the
specifications in full.

## Usage
Templates includes in this library are used to create or modify iCalendar objects.

### Domains

Template domains are simply a grouping of related templates that may be applied to a specific problem domain.
Currently, the supported domains include:

* Groupware - support for collaborative applications
* Project - Project management
* Agile - agile management processes
* Workflow - Work management
* Catalog - develop a service catalog
* Wiki - knowledge management


## Groupware

Support collaborative features such as calendar and task management, scheduling appointments
and meetings, as well as journaling and note-taking.

### Meeting

Meetings are scheduled with two or more participants, and may be created as follows:

```java
VEvent meeting = new Meeting().start(ZonedDateTime.of(...))
.required(URI.create("mailto:joe@example.com")).required(URI.create("mailto:sally@example.com"))
.optional(URI.create("mailto:fred@example.com"))
.chair(URI.create("mailto:vanessa@example.com")).apply();
```


## Project

TBD.

### Examples

## Agile

TBD.

#### Creating a Public Holiday

Public holidays are often anniversary-style events that can be created as follows:
## Workflow

```
VEvent christmasDay = new AnniversaryBuilder().title("Christmas Day").date(LocalDate.of(1970, Month.December, 25)).build();
```
Journal your workflows and deliverables as you work. Build a relational graph of people, teams, outputs
and dependencies.

The resulting iCalendar object would look like this:

```
BEGIN:VEVENT
END:VEVENT
```
## Catalog

Maintain a graph of customer and vendor relationships. Track offers and orders, and monitor customer satisfaction.


## Wiki

TBD.


<!--
## iCalendar and vCard Collections
In practice iCalendar and vCard formats are well-supported by server implementations of the CalDAV and
CardDAV specifications. This library is modeled around potential use-cases for CalDAV and CardDAV collections.
For example, a CalDAV server implementation could define the following default collections for VEvents:
/appointments # events without attendees - used by the organizer to block calendar time
/meetings # events with multiple participants
/reminders # transparent events used to provide deadline notifications, etc.
Similarly, the following collections could support different types of VToDo:
/actions # assignable tasks in response to events, journals, or other tasks
/engagements # temporary relationships between two parties
/issues # tracking for incidents, changes, risks, etc.
/orders # order pertaining to one or more offers from another party
/requests # service requests from one party to another
And the following collections for VJournal types:
/annotations # a note referencing an event, task or other journal type
/articles # a knowledge base article in response to an event or task
/invoices # invoice pertaining to an order
/metrics # measurement of qantitative metrics pertaining to events, tasks or journal types
/notes # independent notes
/offers # published offers used to build a product or service catalog
/records #
For a CardDAV server implementation the following default collections could apply:
/assets # inventory of items of value
/items # configuration items used to build a CMDB
/groups # collection of entities used to define teams, etc.
/orgs # relationships with other organizations
/places # physical locations
/products # product definitions including branding and logos
/services # service definitions including branding and logos
/subscriptions # entity groups notified when specific collections, events, tasks or journals are modified
/users # user profiles capturing contact information and availability
-->
32 changes: 22 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ description = '''
A collection of templates for popular calendar use-cases
'''

//sourceCompatibility = 11
//targetCompatibility = 11
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
mavenLocal()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
Expand All @@ -42,14 +43,14 @@ java {
dependencies {
api "org.mnode.ical4j:ical4j:$ical4jVersion",
"org.mnode.ical4j:ical4j-vcard:$ical4jVcardVersion",
"org.ical4j:ical4j-serializer:$ical4jSerializerVersion"
"org.mnode.ical4j:ical4j-extensions:$ical4jExtensionsVersion"

implementation "com.j2html:j2html:$j2htmlVersion"
// implementation "com.j2html:j2html:$j2htmlVersion"

testImplementation "org.codehaus.groovy:groovy-all:$groovyVersion"

// spock
testImplementation platform("org.spockframework:spock-bom:2.0-M4-groovy-3.0"),
testImplementation platform("org.spockframework:spock-bom:$spockVersion"),
"org.spockframework:spock-core"

// logging
Expand Down Expand Up @@ -79,7 +80,7 @@ javadoc {

scmVersion {
tag {
prefix = 'ical4j-templates-'
prefix = 'ical4j-template-'
}
versionCreator 'versionWithBranch'
branchVersionCreator = ['master': 'simple']
Expand All @@ -89,7 +90,7 @@ version = scmVersion.version
jar {
manifest {
attributes (
'Implementation-Title': 'iCal4j Templates',
'Implementation-Title': 'iCal4j Template',
'Implementation-Version': version,
'Implementation-Vendor': 'Ben Fortuna'
)
Expand All @@ -110,9 +111,9 @@ publishing {
asNode().appendNode('url', 'http://ical4j.github.io')

def scmNode = asNode().appendNode('scm')
scmNode.appendNode('url', 'https://github.com/ical4j/ical4j-templates')
scmNode.appendNode('connection', 'scm:git@github.com:ical4j/ical4j-templates.git')
scmNode.appendNode('developerConnection', 'scm:git@github.com:ical4j/ical4j-templates.git')
scmNode.appendNode('url', 'https://github.com/ical4j/ical4j-template')
scmNode.appendNode('connection', 'scm:git@github.com:ical4j/ical4j-template.git')
scmNode.appendNode('developerConnection', 'scm:git@github.com:ical4j/ical4j-template.git')

def licenseNode = asNode().appendNode('licenses').appendNode('license')
licenseNode.appendNode('name', 'iCal4j - License')
Expand All @@ -125,6 +126,17 @@ publishing {
}
}
}

repositories {
maven {
name = "OSSRH"
url = version.endsWith('SNAPSHOT') ? "https://s01.oss.sonatype.org/content/repositories/snapshots/" : "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}

signing {
Expand Down
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
ical4jVersion = 4.0.0-beta9
ical4jVcardVersion = 2.0.0-alpha8
ical4jSerializerVersion = 0.2.1
ical4jVersion = 4.0.0-rc3
ical4jVcardVersion = 2.0.0-beta1
ical4jExtensionsVersion = 2.0.0-rc2

groovyVersion=3.0.12
bndVersion = 6.1.0
slf4jVersion = 2.0.7
log4jVersion = 2.20.0
j2htmlVersion = 1.5.0

spockVersion = 2.4-M1-groovy-3.0
43 changes: 0 additions & 43 deletions src/main/java/org/ical4j/template/AbstractCalendarTemplate.java

This file was deleted.

34 changes: 34 additions & 0 deletions src/main/java/org/ical4j/template/AbstractTemplate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.ical4j.template;

import java.lang.reflect.InvocationTargetException;
import java.util.function.UnaryOperator;

/**
* Base class for templates with the added ability to construct new object instances.
*
* @param <T>
*/
public abstract class AbstractTemplate<T> implements UnaryOperator<T> {

private final Class<? extends T> typeClass;

private T prototype;

public AbstractTemplate(Class<? extends T> typeClass) {
this.typeClass = typeClass;
}

public T getPrototype() {
return prototype;
}

public void setPrototype(T prototype) {
this.prototype = prototype;
}

public T apply() throws NoSuchMethodException, InvocationTargetException, InstantiationException,
IllegalAccessException {

return apply(typeClass.getDeclaredConstructor().newInstance());
}
}
28 changes: 0 additions & 28 deletions src/main/java/org/ical4j/template/AbstractVCardTemplate.java

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/org/ical4j/template/FluentCalendarTemplate.java

This file was deleted.

Loading

0 comments on commit 911584a

Please sign in to comment.