use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project liferay-ide by liferay.
the class HookDescriptorHelper method setPortalProperties.
public IStatus setPortalProperties(final IDataModel model, final String propertiesFile) {
final IFile descriptorFile = getDescriptorFile();
DOMModelOperation operation = new DOMModelEditOperation(descriptorFile) {
protected void createDefaultFile() {
createDefaultDescriptor(_HOOK_DESCRIPTOR_TEMPLATE, getDescriptorVersion());
}
protected IStatus doExecute(IDOMDocument document) {
return doSetPortalProperties(document, model, propertiesFile);
}
};
IStatus status = operation.execute();
if (!status.isOK()) {
return status;
}
return status;
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project liferay-ide by liferay.
the class HookDescriptorHelper method getCustomJSPFolder.
public String getCustomJSPFolder(final IDataModel model) {
String[] retval = new String[1];
IFile descriptorFile = getDescriptorFile();
if (FileUtil.notExists(descriptorFile)) {
return null;
}
DOMModelOperation operation = new DOMModelReadOperation(descriptorFile) {
protected IStatus doExecute(IDOMDocument document) {
retval[0] = readCustomJSPFolder(document, model);
return Status.OK_STATUS;
}
};
IStatus status = operation.execute();
if (!status.isOK()) {
return null;
}
return retval[0];
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project liferay-ide by liferay.
the class HookDescriptorHelper method createDefaultDescriptor.
public void createDefaultDescriptor() {
IFile descriptorFile = getDescriptorFile();
DOMModelEditOperation operation = new DOMModelEditOperation(descriptorFile) {
@Override
protected void createDefaultFile() {
createDefaultDescriptor(_HOOK_DESCRIPTOR_TEMPLATE, getDescriptorVersion());
}
@Override
protected IStatus doExecute(IDOMDocument document) {
return Status.OK_STATUS;
}
};
operation.execute();
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project liferay-ide by liferay.
the class HookDescriptorHelper method addLanguageProperties.
public IStatus addLanguageProperties(final List<String> languageProperties) {
IFile descriptorFile = getDescriptorFile();
DOMModelOperation operation = new DOMModelEditOperation(descriptorFile) {
protected void createDefaultFile() {
createDefaultDescriptor(_HOOK_DESCRIPTOR_TEMPLATE, getDescriptorVersion());
}
protected IStatus doExecute(IDOMDocument document) {
return doAddLanguageProperties(document, languageProperties);
}
};
IStatus status = operation.execute();
if (!status.isOK()) {
return status;
}
return status;
}
use of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument in project liferay-ide by liferay.
the class HookDescriptorHelper method addActionItems.
public IStatus addActionItems(final List<String[]> actionItems) {
IFile descriptorFile = getDescriptorFile();
DOMModelOperation operation = new DOMModelEditOperation(descriptorFile) {
protected void createDefaultFile() {
createDefaultDescriptor(_HOOK_DESCRIPTOR_TEMPLATE, getDescriptorVersion());
}
protected IStatus doExecute(IDOMDocument document) {
return doAddActionItems(document, actionItems);
}
};
IStatus status = operation.execute();
if (!status.isOK()) {
return status;
}
return status;
}
Aggregations