Fix lines that *only* have whitespace.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@759252 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2009-03-27 17:01:18 +00:00
parent 2b8ba92349
commit 448944da70
8 changed files with 104 additions and 104 deletions
@@ -63,21 +63,21 @@ import org.ofbiz.service.ServiceUtil;
import org.ofbiz.service.mail.MimeMessageWrapper;
public class CommunicationEventServices {
public static final String module = CommunicationEventServices.class.getName();
public static final String resource = "PartyErrorUiLabels";
public static Map<String, Object> sendCommEventAsEmail(DispatchContext ctx, Map<String, ? extends Object> context) {
GenericDelegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
GenericValue userLogin = (GenericValue) context.get("userLogin");
Locale locale = (Locale) context.get("locale");
String communicationEventId = (String) context.get("communicationEventId");
Map<String, Object> result = ServiceUtil.returnSuccess();
List<Object> errorMessages = FastList.newInstance(); // used to keep a list of all error messages returned from sending emails to contact list
try {
// find the communication event and make sure that it is actually an email
GenericValue communicationEvent = delegator.findByPrimaryKey("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId));
@@ -106,7 +106,7 @@ public class CommunicationEventServices {
if (UtilValidate.isEmpty(communicationEvent.getString("content"))) {
communicationEvent.put("content", " ");
}
// prepare the email
Map<String, Object> sendMailParams = FastMap.newInstance();
sendMailParams.put("sendFrom", communicationEvent.getRelatedOne("FromContactMech").getString("infoString"));
@@ -114,7 +114,7 @@ public class CommunicationEventServices {
sendMailParams.put("body", communicationEvent.getString("content"));
sendMailParams.put("contentType", communicationEvent.getString("contentMimeTypeId"));
sendMailParams.put("userLogin", userLogin);
// if there is no contact list, then send look for a contactMechIdTo and partyId
if ((UtilValidate.isEmpty(communicationEvent.getString("contactListId")))) {
// send to address
@@ -134,7 +134,7 @@ public class CommunicationEventServices {
sendMailParams.put("communicationEventId", communicationEventId);
sendMailParams.put("sendTo", sendTo);
sendMailParams.put("partyId", communicationEvent.getString("partyIdTo")); // who it's going to
// send it
Map<String, Object> tmpResult = dispatcher.runSync("sendMail", sendMailParams);
if (ServiceUtil.isError(tmpResult)) {
@@ -176,14 +176,14 @@ public class CommunicationEventServices {
} catch (GenericServiceException esx) {
ServiceUtil.returnError(esx.getMessage());
}
// If there were errors, then the result of this service should be error with the full list of messages
if (errorMessages.size() > 0) {
result = ServiceUtil.returnError(errorMessages);
}
return result;
}
public static Map<String, Object> sendEmailToContactList(DispatchContext ctx, Map<String, ? extends Object> context) {
GenericDelegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
@@ -195,13 +195,13 @@ public class CommunicationEventServices {
String errorCallingSendMailService = UtilProperties.getMessage(resource, "commeventservices.errorCallingSendMailService", locale);
String errorInSendEmailToContactListService = UtilProperties.getMessage(resource, "commeventservices.errorInSendEmailToContactListService", locale);
String skippingInvalidEmailAddress = UtilProperties.getMessage(resource, "commeventservices.skippingInvalidEmailAddress", locale);
String contactListId = (String) context.get("contactListId");
String communicationEventId = (String) context.get("communicationEventId");
// Any exceptions thrown in this block will cause the service to return error
try {
GenericValue communicationEvent = delegator.findByPrimaryKey("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId));
GenericValue contactList = delegator.findByPrimaryKey("ContactList", UtilMisc.toMap("contactListId", contactListId));
@@ -225,7 +225,7 @@ public class CommunicationEventServices {
List<GenericValue> sendToEmails = delegator.findList("ContactListPartyAndContactMech", conditions, fieldsToSelect, null,
new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true), false);
// Send an email to each contact list member
// TODO: Contact lists for emails really should be written as an EntityListIterator for very large lists!
List<String> orderBy = UtilMisc.toList("-fromDate");
@@ -233,87 +233,87 @@ public class CommunicationEventServices {
// Any exceptions thrown in this inner block will only relate to a single email of the list, so should
// only be logged and not cause the service to return an error
try {
String emailAddress = contactListPartyAndContactMech.getString("infoString");
if (UtilValidate.isEmpty(emailAddress)) continue;
emailAddress = emailAddress.trim();
if (! UtilValidate.isEmail(emailAddress)) {
// If validation fails, just log and skip the email address
Debug.logError(skippingInvalidEmailAddress + ": " + emailAddress, module);
errorMessages.add(skippingInvalidEmailAddress + ": " + emailAddress);
continue;
}
// Because we're retrieving infoString only above (so as not to pollute the distinctness), we
// need to retrieve the partyId it's related to. Since this could be multiple parties, get
// only the most recent valid one via ContactListPartyAndContactMech.
List<EntityCondition> clpConditionList = UtilMisc.makeListWritable(conditionList);
clpConditionList.add(EntityCondition.makeCondition("infoString", EntityOperator.EQUALS, emailAddress));
EntityConditionList clpConditions = EntityCondition.makeCondition(clpConditionList, EntityOperator.AND);
List<GenericValue> emailCLPaCMs = delegator.findList("ContactListPartyAndContactMech", clpConditions, null, orderBy, null, true);
GenericValue lastContactListPartyACM = EntityUtil.getFirst(emailCLPaCMs);
if (lastContactListPartyACM == null) continue;
String partyId = lastContactListPartyACM.getString("partyId");
sendMailParams.put("sendTo", emailAddress);
sendMailParams.put("partyId", partyId);
// if it is a NEWSLETTER then we do not want the outgoing emails stored, so put a communicationEventId in the sendMail context to prevent storeEmailAsCommunicationEvent from running
if ("NEWSLETTER".equals(contactList.getString("contactListTypeId"))) {
sendMailParams.put("communicationEventId", communicationEventId);
}
// Retrieve a record for this contactMechId from ContactListCommStatus
Map<String, String> contactListCommStatusRecordMap = UtilMisc.toMap("contactListId", contactListId, "communicationEventId", communicationEventId, "contactMechId", lastContactListPartyACM.getString("preferredContactMechId"));
GenericValue contactListCommStatusRecord = delegator.findByPrimaryKey("ContactListCommStatus", contactListCommStatusRecordMap);
if (contactListCommStatusRecord == null) {
// No attempt has been made previously to send to this address, so create a record to reflect
// the beginning of the current attempt
Map<String, String> newContactListCommStatusRecordMap = UtilMisc.makeMapWritable(contactListCommStatusRecordMap);
newContactListCommStatusRecordMap.put("statusId", "COM_IN_PROGRESS");
contactListCommStatusRecord = delegator.create("ContactListCommStatus", newContactListCommStatusRecordMap);
} else if (contactListCommStatusRecord.get("statusId") != null && contactListCommStatusRecord.getString("statusId").equals("COM_COMPLETE")) {
// There was a successful earlier attempt, so skip this address
continue;
}
Map<String, Object> tmpResult = null;
// Make the attempt to send the email to the address
tmpResult = dispatcher.runSync("sendMail", sendMailParams);
if (tmpResult == null || ServiceUtil.isError(tmpResult)) {
// If the send attempt fails, just log and skip the email address
Debug.logError(errorCallingSendMailService + ": " + ServiceUtil.getErrorMessage(tmpResult), module);
errorMessages.add(errorCallingSendMailService + ": " + ServiceUtil.getErrorMessage(tmpResult));
continue;
}
if ("Y".equals(contactList.get("singleUse"))) {
// Expire the ContactListParty if the list is single use and sendEmail finishes successfully
tmpResult = dispatcher.runSync("updateContactListParty", UtilMisc.toMap("contactListId", lastContactListPartyACM.get("contactListId"),
"partyId", partyId, "fromDate", lastContactListPartyACM.get("fromDate"),
"thruDate", UtilDateTime.nowTimestamp(), "userLogin", userLogin));
if (ServiceUtil.isError(tmpResult)) {
// If the expiry fails, just log and skip the email address
Debug.logError(errorCallingUpdateContactListPartyService + ": " + ServiceUtil.getErrorMessage(tmpResult), module);
errorMessages.add(errorCallingUpdateContactListPartyService + ": " + ServiceUtil.getErrorMessage(tmpResult));
continue;
}
}
// All is successful, so update the ContactListCommStatus record
contactListCommStatusRecord.set("statusId", "COM_COMPLETE");
delegator.store(contactListCommStatusRecord);
// Don't return a service error just because of failure for one address - just log the error and continue
} catch (GenericEntityException nonFatalGEE) {
Debug.logError(nonFatalGEE, errorInSendEmailToContactListService, module);
@@ -323,19 +323,19 @@ public class CommunicationEventServices {
errorMessages.add(errorInSendEmailToContactListService + ": " + nonFatalGSE.getMessage());
}
}
} catch (GenericEntityException fatalGEE) {
ServiceUtil.returnError(fatalGEE.getMessage());
}
return errorMessages.size() == 0 ? ServiceUtil.returnSuccess() : ServiceUtil.returnError(errorMessages);
}
public static Map<String, Object> setCommEventComplete(DispatchContext dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue) context.get("userLogin");
String communicationEventId = (String) context.get("communicationEventId");
try {
Map<String, Object> result = dispatcher.runSync("updateCommunicationEvent", UtilMisc.<String, Object>toMap("communicationEventId", communicationEventId,
"statusId", "COM_COMPLETE", "userLogin", userLogin));
@@ -358,14 +358,14 @@ public class CommunicationEventServices {
public static Map<String, Object> storeEmailAsCommunication(DispatchContext dctx, Map<String, ? extends Object> serviceContext) {
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue) serviceContext.get("userLogin");
String subject = (String) serviceContext.get("subject");
String body = (String) serviceContext.get("body");
String partyId = (String) serviceContext.get("partyId");
String communicationEventId = (String) serviceContext.get("communicationEventId");
String contentType = (String) serviceContext.get("contentType");
String emailType = (String) serviceContext.get("emailType");
// only create a new communication event if the email is not already associated with one
if (communicationEventId == null) {
String partyIdFrom = (String) userLogin.get("partyId");
@@ -392,7 +392,7 @@ public class CommunicationEventServices {
return ServiceUtil.returnError("Cannot store email as communication event; see logs");
}
}
return ServiceUtil.returnSuccess();
}
@@ -426,7 +426,7 @@ public class CommunicationEventServices {
* @return
*/
public static Map<String, Object> storeIncomingEmail(DispatchContext dctx, Map<String, ? extends Object> context) {
GenericDelegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper");
@@ -439,7 +439,7 @@ public class CommunicationEventServices {
String communicationEventId = null;
String contactMechIdFrom = null;
String contactMechIdTo = null;
Map result = null;
try {
String contentTypeRaw = message.getContentType();
@@ -453,7 +453,7 @@ public class CommunicationEventServices {
Address[] addressesCC = message.getRecipients(MimeMessage.RecipientType.CC);
Address[] addressesBCC = message.getRecipients(MimeMessage.RecipientType.BCC);
String messageId = message.getMessageID();
String aboutThisEmail = "message [" + messageId + "] from [" +
(addressesFrom[0] == null? "not found" : addressesFrom[0].toString()) + "] to [" +
(addressesTo[0] == null? "not found" : addressesTo[0].toString()) + "]";
@@ -492,7 +492,7 @@ public class CommunicationEventServices {
Debug.logInfo("Persisting New Email: " + aboutThisEmail, module);
}
// get the related partId's
List toParties = buildListOfPartyInfoFromEmailAddresses(addressesTo, userLogin, dispatcher);
List ccParties = buildListOfPartyInfoFromEmailAddresses(addressesCC, userLogin, dispatcher);
@@ -515,7 +515,7 @@ public class CommunicationEventServices {
deliveredTo = deliveredTo.substring(dn.length()+1, deliveredTo.length());
}
}
// if partyIdTo not found try to find the "to" address using the delivered-to header
if ((partyIdTo == null) && (deliveredTo != null)) {
result = dispatcher.runSync("findPartyFromEmailAddress", UtilMisc.<String, Object>toMap("address", deliveredTo, "userLogin", userLogin));
@@ -529,20 +529,20 @@ public class CommunicationEventServices {
}
userLogin.put("partyId", partyIdTo.substring(0,ch)); //allow services to be called to have prefix
}
// get the 'from' partyId
result = getParyInfoFromEmailAddress(addressesFrom, userLogin, dispatcher);
partyIdFrom = (String)result.get("partyId");
contactMechIdFrom = (String)result.get("contactMechId");
Map commEventMap = FastMap.newInstance();
commEventMap.put("communicationEventTypeId", "AUTO_EMAIL_COMM");
commEventMap.put("contactMechTypeId", "EMAIL_ADDRESS");
commEventMap.put("messageId", messageId);
String subject = message.getSubject();
commEventMap.put("subject", subject);
// Set sent and received dates
commEventMap.put("entryDate", nowTimestamp);
commEventMap.put("datetimeStarted", UtilDateTime.toTimestamp(message.getSentDate()));
@@ -631,7 +631,7 @@ public class CommunicationEventServices {
commNote += "Delivered-To: " + deliveredTo + "; ";
}
}
commNote += "Sent to: " + ((InternetAddress)addressesTo[0]).getAddress() + "; ";
commNote += "Delivered-To: " + deliveredTo + "; ";
@@ -641,13 +641,13 @@ public class CommunicationEventServices {
commEventMap.put("statusId", "COM_UNKNOWN_PARTY");
}
if (commNote.length() > 255) commNote = commNote.substring(0,255);
if (!("".equals(commNote))) {
commEventMap.put("note", commNote);
}
commEventMap.put("userLogin", userLogin);
// Populate the CommunicationEvent.headerString field with the email headers
String headerString = "";
Enumeration headerLines = message.getAllHeaderLines();
@@ -659,18 +659,18 @@ public class CommunicationEventServices {
result = dispatcher.runSync("createCommunicationEvent", commEventMap);
communicationEventId = (String)result.get("communicationEventId");
if (messageContent instanceof Multipart) {
Debug.logInfo("===message has attachments=====", module);
int attachmentCount = addAttachmentsToCommEvent((Multipart) messageContent, subject, communicationEventId, dispatcher, userLogin);
if (Debug.infoOn()) Debug.logInfo(attachmentCount + " attachments added to CommunicationEvent:" + communicationEventId,module);
}
// For all addresses create a CommunicationEventRoles
createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, toParties, "ADDRESSEE");
createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, ccParties, "CC");
createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, bccParties, "BCC");
Map results = ServiceUtil.returnSuccess();
results.put("communicationEventId", communicationEventId);
results.put("statusId", commEventMap.get("statusId"));
@@ -689,7 +689,7 @@ public class CommunicationEventServices {
return ServiceUtil.returnError(e.getMessage());
}
}
private static void createCommEventRoles(GenericValue userLogin, GenericDelegator delegator, LocalDispatcher dispatcher, String communicationEventId, List parties, String roleTypeId) {
// It's not clear what the "role" of this communication event should be, so we'll just put _NA_
// check and see if this role was already created and ignore if true
@@ -722,28 +722,28 @@ public class CommunicationEventServices {
InternetAddress emailAddress = null;
Map map = null;
Map result = null;
if (addresses == null) {
return null;
}
if (addresses.length > 0) {
Address addr = addresses[0];
if (addr instanceof InternetAddress) {
emailAddress = (InternetAddress)addr;
}
}
if (!UtilValidate.isEmpty(emailAddress)) {
map = FastMap.newInstance();
map.put("address", emailAddress.getAddress());
map.put("userLogin", userLogin);
result = dispatcher.runSync("findPartyFromEmailAddress", map);
}
return result;
}
/*
* Calls findPartyFromEmailAddress service and returns a List of the results for the array of addresses
*/
@@ -753,13 +753,13 @@ public class CommunicationEventServices {
Map map = null;
Map result = null;
List tempResults = FastList.newInstance();
if (addresses != null) {
for (int i = 0; i < addresses.length; i++) {
addr = addresses[i];
if (addr instanceof InternetAddress) {
emailAddress = (InternetAddress)addr;
if (!UtilValidate.isEmpty(emailAddress)) {
result = dispatcher.runSync("findPartyFromEmailAddress",
UtilMisc.<String, Object>toMap("address", emailAddress.getAddress(), "userLogin", userLogin));
@@ -826,7 +826,7 @@ public class CommunicationEventServices {
String fieldValue = null;
return fieldValue;
}
public static int addAttachmentsToCommEvent(Multipart messageContent, String subject, String communicationEventId, LocalDispatcher dispatcher, GenericValue userLogin)
throws MessagingException, IOException, GenericServiceException {
Map commEventMap = FastMap.newInstance();
@@ -33,9 +33,9 @@ import org.ofbiz.entity.util.EntityUtil;
* Accessors for Contact Mechanisms
*/
public class ContactHelper {
public static final String module = ContactHelper.class.getName();
public static Collection<GenericValue> getContactMech(GenericValue party, boolean includeOld) {
return getContactMech(party, null, null, includeOld);
}
@@ -959,7 +959,7 @@ public class ContactMechServices {
result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
return result;
}
/**
* Just wraps the ContactMechWorker method of the same name.
*
@@ -1035,7 +1035,7 @@ public class ContactMechServices {
}
return ServiceUtil.returnSuccess();
}
/**
* Creates an EmailAddressVerification
*/
@@ -1043,14 +1043,14 @@ public class ContactMechServices {
GenericDelegator delegator = (GenericDelegator) dctx.getDelegator();
String emailAddress = (String) context.get("emailAddress");
String verifyHash = null;
String expireTime = UtilProperties.getPropertyValue("security", "email_verification.expire.hours");
Integer expTime = Integer.valueOf(expireTime);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR, expTime.intValue());
Date date = calendar.getTime();
Timestamp expireDate = UtilDateTime.toTimestamp(date);
SecureRandom secureRandom = new SecureRandom();
synchronized(ContactMechServices.class) {
@@ -1079,10 +1079,10 @@ public class ContactMechServices {
}
}
}
Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("verifyHash", verifyHash);
return result;
}
}
@@ -44,9 +44,9 @@ import org.ofbiz.entity.util.EntityUtil;
* Worker methods for Contact Mechanisms
*/
public class ContactMechWorker {
public static final String module = ContactMechWorker.class.getName();
/** @deprecated */
public static void getPartyContactMechValueMaps(PageContext pageContext, String partyId, boolean showOld, String partyContactMechValueMapsAttr) {
GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator");
@@ -55,11 +55,11 @@ public class ContactMechWorker {
pageContext.setAttribute(partyContactMechValueMapsAttr, partyContactMechValueMaps);
}
}
public static List<Map<String, Object>> getPartyContactMechValueMaps(GenericDelegator delegator, String partyId, boolean showOld) {
return getPartyContactMechValueMaps(delegator, partyId, showOld, null);
}
public static List<Map<String, Object>> getPartyContactMechValueMaps(GenericDelegator delegator, String partyId, boolean showOld, String contactMechTypeId) {
List<Map<String, Object>> partyContactMechValueMaps = FastList.newInstance();
@@ -74,7 +74,7 @@ public class ContactMechWorker {
if (contactMech != null && contactMechTypeId.equals(contactMech.getString("contactMechTypeId"))) {
tempColTemp.add(partyContactMech);
}
}
tempCol = tempColTemp;
}
@@ -130,7 +130,7 @@ public class ContactMechWorker {
return partyContactMechValueMaps;
}
public static List<Map<String, Object>> getFacilityContactMechValueMaps(GenericDelegator delegator, String facilityId, boolean showOld, String contactMechTypeId) {
List<Map<String, Object>> facilityContactMechValueMaps = FastList.newInstance();
@@ -145,7 +145,7 @@ public class ContactMechWorker {
if (contactMech != null && contactMechTypeId.equals(contactMech.getString("contactMechTypeId"))) {
tempColTemp.add(partyContactMech);
}
}
tempCol = tempColTemp;
}
@@ -201,7 +201,7 @@ public class ContactMechWorker {
return facilityContactMechValueMaps;
}
/** @deprecated */
public static void getOrderContactMechValueMaps(PageContext pageContext, String orderId, String orderContactMechValueMapsAttr) {
@@ -316,7 +316,7 @@ public class ContactMechWorker {
return workEffortContactMechValueMaps.size() > 0 ? workEffortContactMechValueMaps : null;
}
public static void getContactMechAndRelated(ServletRequest request, String partyId, Map<String, Object> target) {
GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
@@ -483,7 +483,7 @@ public class ContactMechWorker {
Debug.logWarning(e, module);
}
}
/** Returns the first valid FacilityContactMech found based on the given facilityId and a prioritized list of purposes
* @param delegator
* @param facilityId
@@ -493,7 +493,7 @@ public class ContactMechWorker {
public static GenericValue getFacilityContactMechByPurpose(GenericDelegator delegator, String facilityId, List<String> purposeTypes) {
if (UtilValidate.isEmpty(facilityId)) return null;
if (UtilValidate.isEmpty(purposeTypes)) return null;
for (String purposeType: purposeTypes) {
List<GenericValue> facilityContactMechPurposes = null;
List<EntityCondition> conditionList = FastList.newInstance();
@@ -523,7 +523,7 @@ public class ContactMechWorker {
return EntityUtil.getFirst(facilityContactMechs);
}
}
}
return null;
}
@@ -746,7 +746,7 @@ public class ContactMechWorker {
public static Map<String, Object> getCurrentPostalAddress(ServletRequest request, String partyId, String curContactMechId) {
GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
Map<String, Object> results = FastMap.newInstance();
if (curContactMechId != null) {
List<GenericValue> partyContactMechs = null;
@@ -911,13 +911,13 @@ public class ContactMechWorker {
return attr.getString("attrValue");
}
}
public static String getPostalAddressPostalCodeGeoId(GenericValue postalAddress, GenericDelegator delegator) throws GenericEntityException {
// if postalCodeGeoId not empty use that
if (UtilValidate.isNotEmpty(postalAddress.getString("postalCodeGeoId"))) {
return postalAddress.getString("postalCodeGeoId");
}
// no postalCodeGeoId, see if there is a Geo record matching the countryGeoId and postalCode fields
if (UtilValidate.isNotEmpty(postalAddress.getString("countryGeoId")) && UtilValidate.isNotEmpty(postalAddress.getString("postalCode"))) {
// first try the shortcut with the geoId convention for "{countryGeoId}-{postalCode}"
@@ -926,7 +926,7 @@ public class ContactMechWorker {
// save the value to the database for quicker future reference
postalAddress.set("postalCodeGeoId", geo.getString("geoId"));
postalAddress.store();
return geo.getString("geoId");
}
@@ -938,11 +938,11 @@ public class ContactMechWorker {
// save the value to the database for quicker future reference
postalAddress.set("postalCodeGeoId", geoAssocAndGeoTo.getString("geoId"));
postalAddress.store();
return geoAssocAndGeoTo.getString("geoId");
}
}
// nothing found, return null
return null;
}
@@ -85,7 +85,7 @@ public class PartyContentWrapper implements ContentWrapper {
return null;
}
}
public List<String> getList(String contentTypeId) {
try {
return getPartyContentTextList(party, contentTypeId, locale, mimeTypeId, party.getDelegator(), dispatcher);
@@ -38,9 +38,9 @@ import org.ofbiz.service.ServiceUtil;
* PartyHelper
*/
public class PartyHelper {
public static final String module = PartyHelper.class.getName();
public static String getPartyName(GenericValue partyObject) {
return getPartyName(partyObject, false);
}
@@ -81,7 +81,7 @@ public class PartyHelper {
}
}
}
public static String formatPartyNameObject(GenericValue partyValue, boolean lastNameFirst) {
if (partyValue == null) {
return "";
@@ -218,7 +218,7 @@ public class PartyServices {
Debug.logWarning(errorMsg, module);
return ServiceUtil.returnError(errorMsg);
}
// record the oldStatusId and change the party status
String oldStatusId = party.getString("statusId");
party.set("statusId", statusId);
@@ -943,7 +943,7 @@ public class PartyServices {
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
//get party types
try {
List<GenericValue> partyTypes = delegator.findList("PartyType", null, null, UtilMisc.toList("description"), null, false);
@@ -953,7 +953,7 @@ public class PartyServices {
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
// current party type
String partyTypeId;
try {
@@ -1054,7 +1054,7 @@ public class PartyServices {
EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("partyRelationshipTypeId"), EntityOperator.EQUALS, EntityFunction.UPPER(partyRelationshipTypeId))));
fieldsToSelect.add("partyIdTo");
}
// get the params
String partyId = (String) context.get("partyId");
String statusId = (String) context.get("statusId");
@@ -1183,7 +1183,7 @@ public class PartyServices {
if (UtilValidate.isNotEmpty(inventoryItemId) ||
UtilValidate.isNotEmpty(serialNumber) ||
UtilValidate.isNotEmpty(softIdentifier)) {
// add role to view
dynamicView.addMemberEntity("II", "InventoryItem");
dynamicView.addAlias("II", "ownerPartyId");
@@ -1357,7 +1357,7 @@ public class PartyServices {
if (highIndex > partyListSize) {
highIndex = partyListSize;
}
// close the list iterator
pli.close();
} catch (GenericEntityException e) {
@@ -1609,7 +1609,7 @@ public class PartyServices {
return ServiceUtil.returnError(e.getMessage());
}
}
Map<String, Object> resp = ServiceUtil.returnSuccess();
resp.put("partyId", partyIdTo);
return resp;
@@ -48,9 +48,9 @@ import org.ofbiz.entity.util.EntityUtil;
* Worker methods for Party Information
*/
public class PartyWorker {
public static String module = PartyWorker.class.getName();
public static Map<String, GenericValue> getPartyOtherValues(ServletRequest request, String partyId, String partyAttr, String personAttr, String partyGroupAttr) {
GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
Map<String, GenericValue> result = FastMap.newInstance();
@@ -82,13 +82,13 @@ public class PartyWorker {
}
return result;
}
/** @deprecated */
public static void getPartyOtherValues(PageContext pageContext, String partyId, String partyAttr, String personAttr, String partyGroupAttr) {
Map<String, GenericValue> partyMap = getPartyOtherValues(pageContext.getRequest(), partyId, partyAttr, personAttr, partyGroupAttr);
for (Map.Entry<String, GenericValue> e: partyMap.entrySet()) {
pageContext.setAttribute(e.getKey(), e.getValue());
}
}
@@ -188,7 +188,7 @@ public class PartyWorker {
Debug.logError(e, "Error while finding latest login time for party with ID [" + partyId + "]: " + e.toString(), module);
return null;
}
}
public static Locale findPartyLastLocale(String partyId, GenericDelegator delegator) {