本文整理汇总了Java中org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties类的典型用法代码示例。如果您正苦于以下问题:Java ResponseProperties类的具体用法?Java ResponseProperties怎么用?Java ResponseProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResponseProperties类属于org.ofbiz.workeffort.workeffort.ICalWorker包,在下文中一共展示了ResponseProperties类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: storeWorkEffort
import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; //导入依赖的package包/类
protected static ResponseProperties storeWorkEffort(Component component, Map<String, Object> context) throws GenericEntityException, GenericServiceException {
PropertyList propertyList = component.getProperties();
String workEffortId = fromXProperty(propertyList, workEffortIdXPropName);
Delegator delegator = (Delegator) context.get("delegator");
GenericValue workEffort = EntityQuery.use(delegator).from("WorkEffort").where("workEffortId", workEffortId).queryOne();
if (workEffort == null) {
return ICalWorker.createNotFoundResponse(null);
}
if (!hasPermission(workEffortId, "UPDATE", context)) {
return null;
}
Map<String, Object> serviceMap = FastMap.newInstance();
serviceMap.put("workEffortId", workEffortId);
setWorkEffortServiceMap(component, serviceMap);
invokeService("updateWorkEffort", serviceMap, context);
return storePartyAssignments(workEffortId, component, context);
}
示例2: storeWorkEffort
import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; //导入依赖的package包/类
protected static ResponseProperties storeWorkEffort(Component component, Map<String, Object> context) throws GenericEntityException, GenericServiceException {
PropertyList propertyList = component.getProperties();
String workEffortId = fromXProperty(propertyList, workEffortIdXPropName);
Delegator delegator = (Delegator) context.get("delegator");
GenericValue workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false);
if (workEffort == null) {
return ICalWorker.createNotFoundResponse(null);
}
if (!hasPermission(workEffortId, "UPDATE", context)) {
return null;
}
Map<String, Object> serviceMap = FastMap.newInstance();
serviceMap.put("workEffortId", workEffortId);
setWorkEffortServiceMap(component, serviceMap);
invokeService("updateWorkEffort", serviceMap, context);
return storePartyAssignments(workEffortId, component, context);
}
示例3: createWorkEffort
import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; //导入依赖的package包/类
protected static ResponseProperties createWorkEffort(Component component, Map<String, Object> context) {
Map<String, Object> serviceMap = FastMap.newInstance();
setWorkEffortServiceMap(component, serviceMap);
serviceMap.put("workEffortTypeId", "VTODO".equals(component.getName()) ? "TASK" : "EVENT");
serviceMap.put("currentStatusId", "VTODO".equals(component.getName()) ? "CAL_NEEDS_ACTION" : "CAL_TENTATIVE");
serviceMap.put("partyId", ((GenericValue) context.get("userLogin")).get("partyId"));
serviceMap.put("roleTypeId", "CAL_OWNER");
serviceMap.put("statusId", "PRTYASGN_ASSIGNED");
Map<String, Object> serviceResult = invokeService("createWorkEffortAndPartyAssign", serviceMap, context);
if (ServiceUtil.isError(serviceResult)) {
return ICalWorker.createPartialContentResponse(ServiceUtil.getErrorMessage(serviceResult));
}
String workEffortId = (String) serviceResult.get("workEffortId");
if (workEffortId != null) {
replaceProperty(component.getProperties(), toXProperty(workEffortIdXPropName, workEffortId));
serviceMap.clear();
serviceMap.put("workEffortIdFrom", context.get("workEffortId"));
serviceMap.put("workEffortIdTo", workEffortId);
serviceMap.put("workEffortAssocTypeId", "WORK_EFF_DEPENDENCY");
serviceMap.put("fromDate", new Timestamp(System.currentTimeMillis()));
serviceResult = invokeService("createWorkEffortAssoc", serviceMap, context);
if (ServiceUtil.isError(serviceResult)) {
return ICalWorker.createPartialContentResponse(ServiceUtil.getErrorMessage(serviceResult));
}
storePartyAssignments(workEffortId, component, context);
}
return null;
}
示例4: getICalendar
import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; //导入依赖的package包/类
/** Returns a calendar derived from a Work Effort calendar publish point.
* @param workEffortId ID of a work effort with <code>workEffortTypeId</code> equal to
* <code>PUBLISH_PROPS</code>.
* @param context The conversion context
* @return An iCalendar as a <code>String</code>, or <code>null</code>
* if <code>workEffortId</code> is invalid.
* @throws GenericEntityException
*/
public static ResponseProperties getICalendar(String workEffortId, Map<String, Object> context) throws GenericEntityException {
Delegator delegator = (Delegator) context.get("delegator");
GenericValue publishProperties = EntityQuery.use(delegator).from("WorkEffort").where("workEffortId", workEffortId).queryOne();
if (!isCalendarPublished(publishProperties)) {
Debug.logInfo("WorkEffort calendar is not published: " + workEffortId, module);
return ICalWorker.createNotFoundResponse(null);
}
if (!"WES_PUBLIC".equals(publishProperties.get("scopeEnumId"))) {
if (context.get("userLogin") == null) {
return ICalWorker.createNotAuthorizedResponse(null);
}
if (!hasPermission(workEffortId, "VIEW", context)) {
return ICalWorker.createForbiddenResponse(null);
}
}
Calendar calendar = makeCalendar(publishProperties, context);
ComponentList components = calendar.getComponents();
List<GenericValue> workEfforts = getRelatedWorkEfforts(publishProperties, context);
if (workEfforts != null) {
for (GenericValue workEffort : workEfforts) {
ResponseProperties responseProps = toCalendarComponent(components, workEffort, context);
if (responseProps != null) {
return responseProps;
}
}
}
if (Debug.verboseOn()) {
try {
calendar.validate(true);
Debug.logVerbose("iCalendar passes validation", module);
} catch (ValidationException e) {
Debug.logVerbose("iCalendar fails validation: " + e, module);
}
}
return ICalWorker.createOkResponse(calendar.toString());
}
示例5: getICalendar
import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; //导入依赖的package包/类
/** Returns a calendar derived from a Work Effort calendar publish point.
* @param workEffortId ID of a work effort with <code>workEffortTypeId</code> equal to
* <code>PUBLISH_PROPS</code>.
* @param context The conversion context
* @return An iCalendar as a <code>String</code>, or <code>null</code>
* if <code>workEffortId</code> is invalid.
* @throws GenericEntityException
*/
public static ResponseProperties getICalendar(String workEffortId, Map<String, Object> context) throws GenericEntityException {
Delegator delegator = (Delegator) context.get("delegator");
GenericValue publishProperties = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false);
if (!isCalendarPublished(publishProperties)) {
Debug.logInfo("WorkEffort calendar is not published: " + workEffortId, module);
return ICalWorker.createNotFoundResponse(null);
}
if (!"WES_PUBLIC".equals(publishProperties.get("scopeEnumId"))) {
if (context.get("userLogin") == null) {
return ICalWorker.createNotAuthorizedResponse(null);
}
if (!hasPermission(workEffortId, "VIEW", context)) {
return ICalWorker.createForbiddenResponse(null);
}
}
Calendar calendar = makeCalendar(publishProperties, context);
ComponentList components = calendar.getComponents();
List<GenericValue> workEfforts = getRelatedWorkEfforts(publishProperties, context);
if (workEfforts != null) {
for (GenericValue workEffort : workEfforts) {
ResponseProperties responseProps = toCalendarComponent(components, workEffort, context);
if (responseProps != null) {
return responseProps;
}
}
}
if (Debug.verboseOn()) {
try {
calendar.validate(true);
Debug.logVerbose("iCalendar passes validation", module);
} catch (ValidationException e) {
Debug.logVerbose("iCalendar fails validation: " + e, module);
}
}
return ICalWorker.createOkResponse(calendar.toString());
}
示例6: storePartyAssignments
import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; //导入依赖的package包/类
protected static ResponseProperties storePartyAssignments(String workEffortId, Component component, Map<String, Object> context) {
ResponseProperties responseProps = null;
Map<String, Object> serviceMap = FastMap.newInstance();
List<Property> partyList = FastList.newInstance();
partyList.addAll(UtilGenerics.checkList(component.getProperties("ATTENDEE"), Property.class));
partyList.addAll(UtilGenerics.checkList(component.getProperties("CONTACT"), Property.class));
partyList.addAll(UtilGenerics.checkList(component.getProperties("ORGANIZER"), Property.class));
for (Property property : partyList) {
String partyId = fromXParameter(property.getParameters(), partyIdXParamName);
if (partyId == null) {
serviceMap.clear();
String address = property.getValue();
if (address.toUpperCase().startsWith("MAILTO:")) {
address = address.substring(7);
}
serviceMap.put("address", address);
Map<String, Object> result = invokeService("findPartyFromEmailAddress", serviceMap, context);
partyId = (String) result.get("partyId");
if (partyId == null) {
continue;
}
replaceParameter(property.getParameters(), toXParameter(partyIdXParamName, partyId));
}
serviceMap.clear();
serviceMap.put("workEffortId", workEffortId);
serviceMap.put("partyId", partyId);
serviceMap.put("roleTypeId", fromRoleMap.get(property.getName()));
Delegator delegator = (Delegator) context.get("delegator");
List<GenericValue> assignments = null;
try {
assignments = EntityQuery.use(delegator).from("WorkEffortPartyAssignment").where(serviceMap).filterByDate().queryList();
if (assignments.size() == 0) {
serviceMap.put("statusId", "PRTYASGN_OFFERED");
serviceMap.put("fromDate", new Timestamp(System.currentTimeMillis()));
invokeService("assignPartyToWorkEffort", serviceMap, context);
}
} catch (GenericEntityException e) {
responseProps = ICalWorker.createPartialContentResponse(e.getMessage());
break;
}
}
return responseProps;
}
示例7: storePartyAssignments
import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; //导入依赖的package包/类
protected static ResponseProperties storePartyAssignments(String workEffortId, Component component, Map<String, Object> context) {
ResponseProperties responseProps = null;
Map<String, Object> serviceMap = FastMap.newInstance();
List<Property> partyList = FastList.newInstance();
partyList.addAll(UtilGenerics.checkList(component.getProperties("ATTENDEE"), Property.class));
partyList.addAll(UtilGenerics.checkList(component.getProperties("CONTACT"), Property.class));
partyList.addAll(UtilGenerics.checkList(component.getProperties("ORGANIZER"), Property.class));
for (Property property : partyList) {
String partyId = fromXParameter(property.getParameters(), partyIdXParamName);
if (partyId == null) {
serviceMap.clear();
String address = property.getValue();
if (address.toUpperCase().startsWith("MAILTO:")) {
address = address.substring(7);
}
serviceMap.put("address", address);
Map<String, Object> result = invokeService("findPartyFromEmailAddress", serviceMap, context);
partyId = (String) result.get("partyId");
if (partyId == null) {
continue;
}
replaceParameter(property.getParameters(), toXParameter(partyIdXParamName, partyId));
}
serviceMap.clear();
serviceMap.put("workEffortId", workEffortId);
serviceMap.put("partyId", partyId);
serviceMap.put("roleTypeId", fromRoleMap.get(property.getName()));
Delegator delegator = (Delegator) context.get("delegator");
List<GenericValue> assignments = null;
try {
assignments = EntityUtil.filterByDate(delegator.findByAnd("WorkEffortPartyAssignment", serviceMap, null, false));
if (assignments.size() == 0) {
serviceMap.put("statusId", "PRTYASGN_OFFERED");
serviceMap.put("fromDate", new Timestamp(System.currentTimeMillis()));
invokeService("assignPartyToWorkEffort", serviceMap, context);
}
} catch (GenericEntityException e) {
responseProps = ICalWorker.createPartialContentResponse(e.getMessage());
break;
}
}
return responseProps;
}