Adobe与Oracle的联手共创辉煌
在数字化时代,软件行业日新月异,眼花缭乱的新技术层出不穷。在这样一个竞争激烈的环境下,企业之间的合作变得越来越重要。当今最知名的两个软件企业之一,Adobe和Oracle,正在联手以共创辉煌。
Adobe是一家软件公司,最著名的产品是PhotoShop和Acrobat。Oracle是一家企业级软件公司,提供的产品包括数据库、云服务、SaaS等等。这两家公司都是软件行业的领军企业,各自在自己的领域内占有基本壟断地位。
2017年4月,Adobe与Oracle宣布结盟的消息震动了整个软件行业。这项战略合作的目的是将Adobe的数字化创意和Oracle的企业软件集成在一起。这就意味着客户将可以用更好的体验去运用Oracle系统,同时也将是Adobe深入企业市场的一次机会。
此合作的最直接产物就是Oracle CX Content和Adobe Experience管理(AEM)的结合。Oracle CX Content是Oracle的一款企业内容管理系统(ECM),可以集中存储并管理所有数字内容。它与Adobe Experience管理(AEM)结合,可以提供更好的数码内容编辑、管理、生成、发布等服务。
在这项战略合作的同时,Adobe也将继续与其他企业级软件公司合作,如Salesforce。根据Adobe官网上的介绍,Adobe Experience Cloud向所有客户开放,以便于它们能够与账单、财务等企业系统集成在一起。这就为Adobe打开了一个新的市场,并且有望与Oracle达成更深层次的合作。
战略合作的另一个重要方面是许多领域的专业技术合作。这将包括Oracle和Adobe的合作伙伴,例如度量分析和广告技术服务。这种合作将为客户提供更完整和更全面的数字营销解决方案。
Adobe与Oracle的联手是一项震撼性战略合作计划,被视为行业内的一项重大举动。它为企业提供了一个强大的综合数字内容管理解决方案,并提升了两家公司的竞争能力。此举也再次证明了企业之间的合作是解决竞争激烈的市场环境中的一个有效策略,为顾客带来更好的数字体验。
以下是Oracle CX Content和Adobe Experience管理(AEM)集成的代码示例:
“`html
<%
/* creating a new node in the content repository */
Node newNode = null;
// lock the session for write
if (resourceResolver.adaptTo(Session.class).isLive()) {
resourceResolver.adaptTo(Session.class).getWorkspace().getLockManager().lock(resourceResolver.adaptTo(Session.class).getRootNode().getPath(), true, true, -1L, “Sample lock”);
Page parentPage = helper.getPage();
if (parentPage != null) {
Node parentNode = parentPage.adaptTo(Node.class);
if (parentNode != null) {
newNode = parentNode.addNode(“newNode”);
newNode.setProperty(“title”, “New Node”);
}
}
// unlock the session
resourceResolver.adaptTo(Session.class).getWorkspace().getLockManager().unlock(resourceResolver.adaptTo(Session.class).getRootNode().getPath());
}
%>
```java
public class AEMFormService extends FormService {
private static final String TEMPLATE_FILE = "/content/forms/af/samples/submittoajax/customsubmit/customsubmitgqq.post.html";
private static final Logger LOG = LoggerFactory.getLogger(AEMFormService.class);
/* other methods */
@Inject
private ResourceResolverFactory resourceResolverFactory;
@Override
public boolean submitForm(FormHandler formHandler, FormRequest formRequest, FormResult formResult) {
boolean result = false;
ResourceResolver resourceResolver = null;
try {
Resource templateResource = formRequest.getResourceResolver().getResource(TEMPLATE_FILE);
java.util.Map formData = formRequest.getFormData();
Map formArgs = formHandler.getArguments();
String ajaxClient = (String) formArgs.get("ajaxclient");
if (ajaxClient == null) ajaxClient = "jQuery";
String ajaxAction = formRequest.getParameter("af-ajax-action");
if (ajaxAction == null) ajaxAction = formRequest.getParameter("ajaxaction");
LOG.debug("ajaxAction: {}", ajaxAction);
if (ajaxAction == null) {
// convert formData to IFrame post string and return
formResult.setRenderParameter(FormResult.PARAM_NAME_ACTION, "posttoiframe");
return true;
}
resourceResolver = resourceResolverFactory.getAdministrativeResourceResolver(null);
ResourceResolver savedResourceResolver = formRequest.getResourceResolver();
formRequest.setResourceResolver(resourceResolver);
// Check that we can edit the data under configuration path.
Resource dataResource = formRequest.getResource();
if (!formHandler.isConfigurationEditable(formRequest, dataResource)) {
throw new FormException("Form data could not be saved.");
}
// Set the generic impl parameters and save the data.
Map implParams = formHandler.getImplParameters(formRequest, dataResource);
setServerSideValidationStatus(implParams, formHandler, formRequest, false);
String jsonString = null;
ObjectMapper mapper = new ObjectMapper();
rootNode.put("type", "order");
rootNode.put("action", "create");
PageContext ctx = getPageContext();
String orderId = generateUUID();
rootNode.put("orderId", orderId);
Order order = new Order();
// Populate order from form data.
success = populateOrder(formRequest, order);
if (!success) {
return false;
}
LOG.debug("Order populated: {}", order);
order.setOrderId(orderId);
rootNode.putPOJO("order", order);
Session session = resourceResolver.adaptTo(Session.class);
Workspace workspace = session.getWorkspace();
VersionManager versionManager = workspace.getVersionManager();
Node dataNode = dataResource.adaptTo(Node.class);
String path = dataNode.getPath();
String nodeName = dataNode.getName();
String versionableNodePath = null;
Node newNode = null;
String parentPath = path + "/" + nodeName + "_" + validateGUID(orderId);
newNode = JcrUtils.getOrCreateByPath(parentPath + "/" + nodeName, "nt:unstructured",
session);
Resource parentResource = resourceResolver.getResource(parentPath);
LOG.debug("got parentResource: {}", parentResource);
Node orderNode = newNode.getNode("order");
Node lineItemsNode = orderNode.addNode("lineItems");
BigDecimal totalAmount = BigDecimal.ZERO;
for(LineItem item: order.getLineItems()){
Node lineItemNode = lineItemsNode.addNode("lineItem");
lineItemNode.setProperty("productId", item.getProductId());
lineItemNode.setProperty("quantity", item.getQuantity());
lineItemNode.setProperty("price", item.getPrice());
BigDecimal amount = item.getPrice().multiply(new BigDecimal(item.getQuantity()));
totalAmount.add(amount);
}
formResult.setRenderParameter(FormResult.PARAM_NAME_ACTION, "submittoajax");
formResult.setRenderParameter(ajaxClient + "-ajaxurl", ajaxAction);
jsonString = mapper.writeValueAsString(rootNode);
String jsonObj = "[{\"cmd\":\"cmd\",\"cmd_data\":\"content_json=" + jsonString + "\"}]";
LOG.debug("JSON Submit data: {}", jsonObj);
// Reset the resourceResolver to get access to the template data.
formRequest.setResourceResolver(savedResourceResolver);
// render the data into the template
RequestDispatcherOptions opts = new RequestDispatcherOptions();
opts.setForceSameContext(true);
opts.setReplaceSelectors(null);
opts.setReplaceSuffix("/customsubmit");
opts.setAddSelectors("ajaxresponse");
RequestDispatcher requestDispatcher = request.getRequestDispatcher(templateResource, opts);
request.setAttribute("submitFormAjaxResponse", jsonObj);
requestDispatcher.include(request, response);
result = true;
} catch (Exception e) {
LOG.error("Error submitting form", e);
clearFormExceptions(formResult);
formResult.addException(e);
result = false;
} finally {
if (resourceResolver != null) {
resourceResolver.close();
}
}
return result;
}
}
参考资料: