-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b49aee6
commit c4ea97b
Showing
4 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.ical4j.template.workflow; | ||
|
||
import net.fortuna.ical4j.model.component.VToDo; | ||
import org.ical4j.template.AbstractTemplate; | ||
|
||
/** | ||
* Captures an approval step as part of a workflow. | ||
*/ | ||
public class Approval extends AbstractTemplate<VToDo> { | ||
|
||
public Approval() { | ||
super(VToDo.class); | ||
} | ||
|
||
public Approval(Class<VToDo> typeClass) { | ||
super(typeClass); | ||
} | ||
|
||
@Override | ||
public VToDo apply(VToDo vToDo) { | ||
return vToDo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.ical4j.template.workflow; | ||
|
||
import net.fortuna.ical4j.extensions.concept.RequestType; | ||
import net.fortuna.ical4j.model.component.VToDo; | ||
import org.ical4j.template.AbstractTemplate; | ||
|
||
public class Request extends AbstractTemplate<VToDo> { | ||
|
||
private RequestType requestType; | ||
|
||
public Request() { | ||
super(VToDo.class); | ||
} | ||
|
||
public Request(Class<VToDo> typeClass) { | ||
super(typeClass); | ||
} | ||
|
||
public Request type(String summary, RequestType requestType) { | ||
this.requestType = requestType; | ||
return this; | ||
} | ||
|
||
@Override | ||
public VToDo apply(VToDo vToDo) { | ||
vToDo.replace(requestType); | ||
return vToDo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.ical4j.template.workflow; | ||
|
||
import net.fortuna.ical4j.model.component.VAvailability; | ||
import org.ical4j.template.AbstractTemplate; | ||
|
||
public class Roster extends AbstractTemplate<VAvailability> { | ||
|
||
public Roster() { | ||
super(VAvailability.class); | ||
} | ||
|
||
public Roster(Class<VAvailability> typeClass) { | ||
super(typeClass); | ||
} | ||
|
||
@Override | ||
public VAvailability apply(VAvailability vAvailability) { | ||
return vAvailability; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.ical4j.template.workflow; | ||
|
||
import net.fortuna.ical4j.vcard.VCard; | ||
import net.fortuna.ical4j.vcard.property.Fn; | ||
import net.fortuna.ical4j.vcard.property.Member; | ||
import org.ical4j.template.AbstractTemplate; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* A workspace represents a collaborative space for one or more members. A member can be an individual or | ||
* a group. | ||
*/ | ||
public class Workspace extends AbstractTemplate<VCard> { | ||
|
||
private String title; | ||
|
||
private List<VCard> members = new ArrayList<>(); | ||
|
||
public Workspace() { | ||
super(VCard.class); | ||
} | ||
|
||
public Workspace(Class<VCard> typeClass) { | ||
super(typeClass); | ||
} | ||
|
||
public Workspace title(String title) { | ||
this.title = title; | ||
return this; | ||
} | ||
|
||
public Workspace member(VCard member) { | ||
members.add(member); | ||
return this; | ||
} | ||
|
||
@Override | ||
public VCard apply(VCard vCard) { | ||
vCard.replace(new Fn(title)); | ||
members.forEach(m -> vCard.add(new Member(m))); | ||
return vCard; | ||
} | ||
} |