Compare commits
318 Commits
release/5.
...
release/5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
318b2e55cd | ||
|
|
6952d67b63 | ||
|
|
fe7d5fb1b2 | ||
|
|
67b8734846 | ||
|
|
24d9dc57d9 | ||
|
|
8973fe3d80 | ||
|
|
3382845dea | ||
|
|
34780e383a | ||
|
|
56ccdc3a1d | ||
|
|
771b22c5ea | ||
|
|
8c2c8378c7 | ||
|
|
0b16e773b0 | ||
|
|
909ee24e6a | ||
|
|
d492dc9019 | ||
|
|
3a6a2134c3 | ||
|
|
2b9fa412a8 | ||
|
|
7f63c512a0 | ||
|
|
1858912816 | ||
|
|
d994a62da3 | ||
|
|
91d5f5dd10 | ||
|
|
6026d4693f | ||
|
|
ca74b8305a | ||
|
|
072ab2d624 | ||
|
|
60941241c1 | ||
|
|
e63e207d0e | ||
|
|
a8f6e80b77 | ||
|
|
162a04721e | ||
|
|
96e72e81dd | ||
|
|
f84b11f054 | ||
|
|
cbcada0dd4 | ||
|
|
e88d0bef06 | ||
|
|
b9b33711c4 | ||
|
|
a541b3867e | ||
|
|
f51ab4a86c | ||
|
|
fb3bb857af | ||
|
|
bc66ed653b | ||
|
|
ba469d89aa | ||
|
|
0c9b357307 | ||
|
|
b8ad95763f | ||
|
|
c9d2c70b29 | ||
|
|
b5be75e74d | ||
|
|
f67dc9439c | ||
|
|
1340a5149f | ||
|
|
966e665563 | ||
|
|
d069fb6d48 | ||
|
|
d117428729 | ||
|
|
7d3cf48ee0 | ||
|
|
37644bd3a7 | ||
|
|
61eb0a6e24 | ||
|
|
a7797b6a56 | ||
|
|
44d4ff2836 | ||
|
|
6abe61d003 | ||
|
|
f3ba4b9e1f | ||
|
|
55d0c8cf7a | ||
|
|
5d6a9da6c1 | ||
|
|
27e4d6887a | ||
|
|
8baae08e1a | ||
|
|
025ae75cfe | ||
|
|
96372ee9c8 | ||
|
|
adf63b4581 | ||
|
|
7d16e466ca | ||
|
|
0b0e47f90e | ||
|
|
3fa1b64557 | ||
|
|
4ff9121327 | ||
|
|
8b22997e89 | ||
|
|
27f079de90 | ||
|
|
dff41d0ca1 | ||
|
|
3bf6c024a9 | ||
|
|
dda51a6c4d | ||
|
|
ba700675dc | ||
|
|
ac24c606b2 | ||
|
|
92f0d904e0 | ||
|
|
5580c4f746 | ||
|
|
5dc9434446 | ||
|
|
d327510dbb | ||
|
|
8b1f10b6f0 | ||
|
|
1d43d196fa | ||
|
|
79f959f6ba | ||
|
|
671552768d | ||
|
|
6b3db7d520 | ||
|
|
48d823e701 | ||
|
|
4e331b6435 | ||
|
|
1c48f80336 | ||
|
|
f9a2fec665 | ||
|
|
b307495787 | ||
|
|
fc18cd9826 | ||
|
|
bfa79a2c7d | ||
|
|
3fe6b7072f | ||
|
|
3fc8772d98 | ||
|
|
4b4fe8254c | ||
|
|
4a274ce551 | ||
|
|
67e7c1e360 | ||
|
|
11c0b50642 | ||
|
|
dc7f98170f | ||
|
|
c2e19faf31 | ||
|
|
14fa9b9ab4 | ||
|
|
20ade70c18 | ||
|
|
8f47ca06bf | ||
|
|
89af574ae3 | ||
|
|
04868f33dd | ||
|
|
476a47f6d7 | ||
|
|
12d5738edb | ||
|
|
b37dcdad6d | ||
|
|
791bb97f68 | ||
|
|
837e018058 | ||
|
|
5477fb511b | ||
|
|
a1676262b1 | ||
|
|
1e97bfebd7 | ||
|
|
6cdca170c1 | ||
|
|
ce7ea8f587 | ||
|
|
998a94ef86 | ||
|
|
57133af940 | ||
|
|
346699c965 | ||
|
|
179bc4ca41 | ||
|
|
51a7845fe4 | ||
|
|
c2c9f9c0c1 | ||
|
|
ba32f5ba0f | ||
|
|
c9e6815ea0 | ||
|
|
481ee969fc | ||
|
|
62ff41ca2c | ||
|
|
5db0dddacf | ||
|
|
f406122851 | ||
|
|
d70fddc07d | ||
|
|
1bd12dde38 | ||
|
|
9390a6f16e | ||
|
|
c3e59b7662 | ||
|
|
0dc20c334f | ||
|
|
a41fbfbe58 | ||
|
|
d141c1f29c | ||
|
|
54e632c861 | ||
|
|
af7043807b | ||
|
|
8ef5277bfb | ||
|
|
a76cb33d21 | ||
|
|
04a2084555 | ||
|
|
b277e6dd13 | ||
|
|
9aa7d8d28f | ||
|
|
629f23b5ef | ||
|
|
cc5c5bbd22 | ||
|
|
956cb457be | ||
|
|
cbf14e35a0 | ||
|
|
2f7d35f24c | ||
|
|
0731a48ecb | ||
|
|
a57259815e | ||
|
|
2d32eef25f | ||
|
|
3f534c2ece | ||
|
|
4eda2aef8e | ||
|
|
c6d4fdb890 | ||
|
|
6b254e23ad | ||
|
|
13b418de87 | ||
|
|
fba08078fe | ||
|
|
7f9b93f650 | ||
|
|
86729d7ea6 | ||
|
|
27169ab3e3 | ||
|
|
de6f004ab7 | ||
|
|
cdfda37cc4 | ||
|
|
55896a35bc | ||
|
|
1aeda8fd97 | ||
|
|
477ce66633 | ||
|
|
69b410a73c | ||
|
|
b46fffad4b | ||
|
|
a1a0b8c53c | ||
|
|
84e8d16f61 | ||
|
|
131a060979 | ||
|
|
d49fc79aff | ||
|
|
93c45f90fc | ||
|
|
a8f0e499d2 | ||
|
|
a9b59e25bf | ||
|
|
824ee2144d | ||
|
|
ef1a9bc0c9 | ||
|
|
71fc8e661b | ||
|
|
0527978183 | ||
|
|
ecb6131c67 | ||
|
|
b790f27629 | ||
|
|
ac46e57615 | ||
|
|
1e52d915a6 | ||
|
|
d0be52e8f3 | ||
|
|
dcdc6f9de1 | ||
|
|
ae58ffb1db | ||
|
|
3c9597ef56 | ||
|
|
4fbd95a69e | ||
|
|
a667abd7d3 | ||
|
|
124ccf6d08 | ||
|
|
cb8e9dc1c5 | ||
|
|
a7d84f6631 | ||
|
|
9c2cc27fed | ||
|
|
de68301f94 | ||
|
|
f6265f728c | ||
|
|
c05245c97d | ||
|
|
c4ab265d5e | ||
|
|
8d1fb2b5e9 | ||
|
|
f487848efa | ||
|
|
7dfd9eb5f2 | ||
|
|
8bc6cb3514 | ||
|
|
88bb955b12 | ||
|
|
88bb63dbec | ||
|
|
9451097465 | ||
|
|
85203d3488 | ||
|
|
33ca3cd4c6 | ||
|
|
b042706b78 | ||
|
|
d5023ee2d0 | ||
|
|
425f8c74e3 | ||
|
|
eed50f4acc | ||
|
|
8070f0337c | ||
|
|
be7cc36fe1 | ||
|
|
091b43aa8c | ||
|
|
b2be8f45e1 | ||
|
|
67084b33f1 | ||
|
|
431d2295f1 | ||
|
|
664cbda6f5 | ||
|
|
946d99935b | ||
|
|
c3f231717c | ||
|
|
984496b2cd | ||
|
|
23a374ee96 | ||
|
|
f7ca748efc | ||
|
|
6c28e8797d | ||
|
|
e391ce6f04 | ||
|
|
88e2fd5f88 | ||
|
|
720a0a9166 | ||
|
|
ebd07a17bf | ||
|
|
2bc92157ec | ||
|
|
654a2165cf | ||
|
|
9e830d4a4c | ||
|
|
2f506a8564 | ||
|
|
016f4d3162 | ||
|
|
438209d786 | ||
|
|
06b65fa196 | ||
|
|
0c1f4de4fd | ||
|
|
7b8b4a4803 | ||
|
|
5c40e48b57 | ||
|
|
09467cbda1 | ||
|
|
11a1146f02 | ||
|
|
903b935a83 | ||
|
|
c990d6704a | ||
|
|
6d80f9d129 | ||
|
|
7a544a1330 | ||
|
|
3be7686641 | ||
|
|
274e29ef71 | ||
|
|
fc643f11e3 | ||
|
|
a54c5f2031 | ||
|
|
5e5e9b8357 | ||
|
|
9a8fc1d90b | ||
|
|
fe38139f9c | ||
|
|
73a808043b | ||
|
|
fba4b0e14d | ||
|
|
89583c76b6 | ||
|
|
2c92949a89 | ||
|
|
4bba82799f | ||
|
|
b675bbfe69 | ||
|
|
c03bc2546c | ||
|
|
6e9f84e0a1 | ||
|
|
7e79551faf | ||
|
|
0becd5225e | ||
|
|
cc79fb20b8 | ||
|
|
5534b3c0df | ||
|
|
aa001743a4 | ||
|
|
3bf83faa59 | ||
|
|
73cf44b806 | ||
|
|
0e27da60a8 | ||
|
|
f425577f6c | ||
|
|
b2a7c8175d | ||
|
|
3d5d5eb52c | ||
|
|
c122bd6863 | ||
|
|
c3cf28ac39 | ||
|
|
8debb7852f | ||
|
|
d4e8e0e49c | ||
|
|
f5d33f99bf | ||
|
|
7dee5ea298 | ||
|
|
8241a44867 | ||
|
|
337e92b9fe | ||
|
|
3e3d20c775 | ||
|
|
a48fe71712 | ||
|
|
16a06fb61b | ||
|
|
778c88e5d1 | ||
|
|
4da509065b | ||
|
|
af0866d3c7 | ||
|
|
972204e54c | ||
|
|
5e8adf6be7 | ||
|
|
472859a371 | ||
|
|
2fe371c609 | ||
|
|
d535e09cae | ||
|
|
b831da367d | ||
|
|
d144e3ab7b | ||
|
|
356d226b28 | ||
|
|
1565ca19b9 | ||
|
|
0945eccf9e | ||
|
|
7a68b88b96 | ||
|
|
7204185af1 | ||
|
|
ffbc900692 | ||
|
|
10ab6ca310 | ||
|
|
4f22cdc3c5 | ||
|
|
c4333b8e97 | ||
|
|
e2c552e965 | ||
|
|
9cb9727798 | ||
|
|
0a05b20a52 | ||
|
|
12f9ef0cf5 | ||
|
|
aefdc66221 | ||
|
|
66a8975e48 | ||
|
|
0816d975c2 | ||
|
|
c5e7eae92b | ||
|
|
320c295952 | ||
|
|
e28ef8ef92 | ||
|
|
a1fd73eccb | ||
|
|
bd49b9c4fb | ||
|
|
842d53771c | ||
|
|
00f2ca59ef | ||
|
|
60a868a56e | ||
|
|
008cad994c | ||
|
|
83fc90b319 | ||
|
|
fd5671b6cc | ||
|
|
afd3184f20 | ||
|
|
4f05eb9c72 | ||
|
|
eeba280121 | ||
|
|
47b22e5da1 | ||
|
|
ee8bbe2ff3 | ||
|
|
fad295b2c0 | ||
|
|
52769aca2f | ||
|
|
4b16b2a5e1 | ||
|
|
544b6acc29 |
@@ -740,7 +740,7 @@
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="true"/>
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jet.core"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
PushToPaletteActionProvider.Error2=Fout
|
||||
PushToPaletteActionProvider.Error=Fout
|
||||
NewActionProvider.New=Nieuw
|
||||
NewActionProvider.NewComponent=Nieuw Component
|
||||
AbstractXMLConfigPage.Delete=Verwijderen
|
||||
CreateComponentWizard.NewComponent=Nieuw Component
|
||||
WizardComponentFolderPage.Name=Naam
|
||||
AbstractXMLConfigPage.New=Nieuw
|
||||
@@ -1,2 +1,3 @@
|
||||
PushToPaletteActionProvider.Error2=Gre\u0161ka
|
||||
PushToPaletteActionProvider.Error=Gre\u0161ka
|
||||
AbstractXMLConfigPage.Delete=DELETE
|
||||
|
||||
@@ -39,6 +39,7 @@ public class NewActionProvider extends CommonActionProvider {
|
||||
|
||||
private IAction newProjectAction;
|
||||
|
||||
@Override
|
||||
public void init(ICommonActionExtensionSite anExtensionSite) {
|
||||
|
||||
if (anExtensionSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
|
||||
@@ -49,6 +50,7 @@ public class NewActionProvider extends CommonActionProvider {
|
||||
/**
|
||||
* Adds a submenu to the given menu with the name "New Component".
|
||||
*/
|
||||
@Override
|
||||
public void fillContextMenu(IMenuManager menu) {
|
||||
for (IContributionItem item : menu.getItems()) {
|
||||
if (item == null || item.getId() == null) {
|
||||
@@ -82,6 +84,7 @@ public class NewActionProvider extends CommonActionProvider {
|
||||
/*
|
||||
* (non-Javadoc) Method declared on IAction.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
CreateComponentWizard wizard = new CreateComponentWizard();
|
||||
wizard.init(PlatformUI.getWorkbench(), null);
|
||||
|
||||
@@ -60,6 +60,7 @@ public class TreeNodeAttrCompsite extends Composite {
|
||||
|
||||
nodeText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
nodeData.getXMLNode().setTextContent(nodeText.getText());
|
||||
nodeData.setBodayText(nodeText.getText());
|
||||
@@ -87,6 +88,7 @@ public class TreeNodeAttrCompsite extends Composite {
|
||||
|
||||
attrText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
String attrName = attrLabel.getText().split(MARK)[0];
|
||||
if (attrText.getText().equals(PluginConstant.EMPTY_STRING)) {
|
||||
@@ -128,6 +130,7 @@ public class TreeNodeAttrCompsite extends Composite {
|
||||
|
||||
attrCombo.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
String attrName = attrLabel.getText().split(MARK)[0];
|
||||
if (attrCombo.getText().equals(PluginConstant.EMPTY_STRING)) {
|
||||
|
||||
@@ -134,6 +134,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
|
||||
*
|
||||
* @see org.talend.componentdesigner.ui.wizard.creatcomponent.AbstractComponentPage#initialize()
|
||||
*/
|
||||
@Override
|
||||
protected void initialize() {
|
||||
availableXmlTree.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@@ -152,6 +153,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
|
||||
itemDel.setText(Messages.getString("AbstractXMLConfigPage.Delete")); //$NON-NLS-1$
|
||||
itemDel.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
TreeNodeData currentNodeData = (TreeNodeData) treeItem[0].getParentItem().getData();
|
||||
currentNodeData.getXMLNode().removeChild(((TreeNodeData) treeItem[0].getData()).getXMLNode());
|
||||
@@ -171,6 +173,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
|
||||
nodeMenuItem.setText(itemName);
|
||||
nodeMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
TreeItem newItem = new TreeItem(treeItem[0], 0);
|
||||
newItem.setText(itemName);
|
||||
@@ -226,6 +229,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
|
||||
*
|
||||
* @see org.talend.componentdesigner.ui.wizard.creatcomponent.AbstractComponentPage#validatePage()
|
||||
*/
|
||||
@Override
|
||||
protected boolean validatePage() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
prefs.configuration.LINK_STYLE.AUTO=Automatisch
|
||||
prefs.configuration.LINK_STYLE.LINE=Lijnen (snel)
|
||||
prefs.configuration.LINK_STYLE.BEZIER_CURVE=Rondingen
|
||||
@@ -1,5 +0,0 @@
|
||||
AlfrescoModelDialog.modelTable.title=Titel
|
||||
AlfrescoOutputManager.schemaError.title=Fout in schema
|
||||
AlfrescoModelDialog.add=Toevoegen
|
||||
AlfrescoModelDialog.removeModelFailed=Fout bij verwijderen model
|
||||
AlfrescoModelDialog.modelTable.name=Naam
|
||||
@@ -1,9 +0,0 @@
|
||||
AssignmentPropertySection.Name=Naam
|
||||
BusinessPaletteFactory.ActionComment=Nieuwe Aktie
|
||||
BusinessInitDiagramFileAction.Error=Fout
|
||||
AssignmentPropertySection.Comment=Opmerking
|
||||
BusinessPaletteFactory.Data=Data
|
||||
BusinessPaletteFactory.Ellipse=Elips
|
||||
BusinessPaletteFactory.Document=Document
|
||||
BusinessPaletteFactory.Action=Aktie
|
||||
BusinessPaletteFactory.DocuemntComment=Nieuw Document
|
||||
@@ -557,16 +557,5 @@
|
||||
level="20"
|
||||
name="ReadDiagramAction"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.expressions.definitions">
|
||||
<definition
|
||||
id="isActiveEditorOfBusinessModelEditor">
|
||||
<not>
|
||||
<instanceof
|
||||
value="org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor">
|
||||
</instanceof>
|
||||
</not>
|
||||
</definition>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -69,7 +69,6 @@ public class OpenDiagramAction extends AContextualAction implements IIntroAction
|
||||
*
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
@Override
|
||||
protected void doRun() {
|
||||
ISelection selection = getSelectedObject();
|
||||
if (selection == null) {
|
||||
@@ -97,11 +96,10 @@ public class OpenDiagramAction extends AContextualAction implements IIntroAction
|
||||
if (part instanceof BusinessDiagramEditor) {
|
||||
((BusinessDiagramEditor) part).setLastVersion(true);
|
||||
}
|
||||
// TDI-21143 : Studio repository view : remove all refresh call to repo view
|
||||
// IRepositoryView view = getViewPart();
|
||||
// if (view != null) {
|
||||
// view.refresh(repositoryNode);
|
||||
// }
|
||||
IRepositoryView view = getViewPart();
|
||||
if (view != null) {
|
||||
view.refresh(repositoryNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,9 +213,9 @@ public abstract class BusinessItemShapeEditPart extends ShapeNodeEditPart {
|
||||
private BusinessAlignment getAlignment(String alignment) {
|
||||
BusinessAlignment[] alignments = BusinessAlignment.values();
|
||||
BusinessAlignment position = null;
|
||||
for (int i = 0; i < alignments.length; i++) {
|
||||
if (alignments[i].toString().equalsIgnoreCase(alignment)) {
|
||||
position = alignments[i];
|
||||
for (BusinessAlignment alignment2 : alignments) {
|
||||
if (alignment2.toString().equalsIgnoreCase(alignment)) {
|
||||
position = alignment2;
|
||||
return position;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.runtime.image.OverlayImage;
|
||||
import org.talend.commons.ui.runtime.image.OverlayImage.EPosition;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
import org.talend.core.model.metadata.MetadataTool;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.Query;
|
||||
import org.talend.core.model.metadata.builder.connection.SAPFunctionUnit;
|
||||
@@ -42,16 +42,15 @@ public class RepositoryFactoryProxyLabelProvider extends AdapterFactoryLabelProv
|
||||
if (columnIndex == 0) {
|
||||
IRepositoryViewObject lastVersion = getLastVersion(object);
|
||||
if (lastVersion == null) {
|
||||
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(assignment.getTalendItem().getId());
|
||||
MetadataTable table = MetadataTool.getMetadataTableFromRepository(assignment.getTalendItem().getId());
|
||||
if (table != null) {
|
||||
return image;
|
||||
}
|
||||
Query query = MetadataToolHelper.getQueryFromRepository(assignment.getTalendItem().getId());
|
||||
Query query = MetadataTool.getQueryFromRepository(assignment.getTalendItem().getId());
|
||||
if (query != null) {
|
||||
return image;
|
||||
}
|
||||
SAPFunctionUnit function = MetadataToolHelper
|
||||
.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
|
||||
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
|
||||
if (function != null) {
|
||||
return image;
|
||||
}
|
||||
@@ -98,26 +97,22 @@ public class RepositoryFactoryProxyLabelProvider extends AdapterFactoryLabelProv
|
||||
try {
|
||||
if (columnIndex == 0) {
|
||||
if (lastVersion == null) {
|
||||
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(assignment.getTalendItem().getId());
|
||||
MetadataTable table = MetadataTool.getMetadataTableFromRepository(assignment.getTalendItem().getId());
|
||||
if (table != null) {
|
||||
if (SubItemHelper.isDeleted(table)) {
|
||||
if (SubItemHelper.isDeleted(table))
|
||||
columnText += Messages.getString("RepositoryFactoryProxyLabelProvider.Deleted"); //$NON-NLS-1$
|
||||
}
|
||||
return columnText;
|
||||
}
|
||||
Query query = MetadataToolHelper.getQueryFromRepository(assignment.getTalendItem().getId());
|
||||
Query query = MetadataTool.getQueryFromRepository(assignment.getTalendItem().getId());
|
||||
if (query != null) {
|
||||
if (SubItemHelper.isDeleted(query)) {
|
||||
if (SubItemHelper.isDeleted(query))
|
||||
columnText += Messages.getString("RepositoryFactoryProxyLabelProvider.Deleted"); //$NON-NLS-1$
|
||||
}
|
||||
return columnText;
|
||||
}
|
||||
SAPFunctionUnit function = MetadataToolHelper
|
||||
.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
|
||||
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
|
||||
if (function != null) {
|
||||
if (SubItemHelper.isDeleted(function)) {
|
||||
if (SubItemHelper.isDeleted(function))
|
||||
columnText += Messages.getString("RepositoryFactoryProxyLabelProvider.Deleted"); //$NON-NLS-1$
|
||||
}
|
||||
return columnText;
|
||||
}
|
||||
TalendItem item = assignment.getTalendItem();
|
||||
@@ -156,8 +151,8 @@ public class RepositoryFactoryProxyLabelProvider extends AdapterFactoryLabelProv
|
||||
if (lastVersion != null) {
|
||||
String label = lastVersion.getProperty().getLabel();
|
||||
if (!label.equals(columnText)) {
|
||||
ChangeTalendItemLabelCommand command = new ChangeTalendItemLabelCommand(
|
||||
((BusinessAssignment) object).getTalendItem(), label);
|
||||
ChangeTalendItemLabelCommand command = new ChangeTalendItemLabelCommand(((BusinessAssignment) object)
|
||||
.getTalendItem(), label);
|
||||
try {
|
||||
command.execute(null, null);
|
||||
} catch (ExecutionException e) {
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.talend.commons.ui.runtime.image.ImageUtils.ICON_SIZE;
|
||||
import org.talend.commons.ui.runtime.image.OverlayImage;
|
||||
import org.talend.commons.ui.runtime.image.OverlayImage.EPosition;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
import org.talend.core.model.metadata.MetadataTool;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.Query;
|
||||
import org.talend.core.model.metadata.builder.connection.SAPFunctionUnit;
|
||||
@@ -117,9 +117,9 @@ public class ElementHelper {
|
||||
labels.add(label);
|
||||
} else {
|
||||
|
||||
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(talendItem.getId());
|
||||
Query query = MetadataToolHelper.getQueryFromRepository(talendItem.getId());
|
||||
SAPFunctionUnit function = MetadataToolHelper.getSAPFunctionFromRepository(talendItem.getId());
|
||||
MetadataTable table = MetadataTool.getMetadataTableFromRepository(talendItem.getId());
|
||||
Query query = MetadataTool.getQueryFromRepository(talendItem.getId());
|
||||
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(talendItem.getId());
|
||||
if (table != null) {
|
||||
img = ImageDescriptor.createFromFile(ECoreImage.class,
|
||||
ECoreImage.METADATA_TABLE_ICON.getPath()).createImage();
|
||||
|
||||
@@ -57,7 +57,7 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.swt.actions.ITreeContextualAction;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.model.business.BusinessType;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
import org.talend.core.model.metadata.MetadataTool;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.builder.connection.SAPFunctionUnit;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
@@ -289,7 +289,7 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
|
||||
curNode = RepositoryNodeUtilities.getRepositoryNode(lastVersion);
|
||||
select(viewer, curNode);
|
||||
} else if (item instanceof TableMetadata) {
|
||||
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(item.getId());
|
||||
MetadataTable table = MetadataTool.getMetadataTableFromRepository(item.getId());
|
||||
if (table != null) {
|
||||
String id = item.getId().split(" - ")[0]; //$NON-NLS-1$
|
||||
|
||||
@@ -303,8 +303,8 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
|
||||
|
||||
}
|
||||
} else if (item instanceof Query) {
|
||||
org.talend.core.model.metadata.builder.connection.Query query = MetadataToolHelper
|
||||
.getQueryFromRepository(item.getId());
|
||||
org.talend.core.model.metadata.builder.connection.Query query = MetadataTool.getQueryFromRepository(item
|
||||
.getId());
|
||||
if (query != null) {
|
||||
String id = item.getId().split(" - ")[0]; //$NON-NLS-1$
|
||||
IRepositoryView view = getRepositoryView();
|
||||
@@ -314,7 +314,7 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
|
||||
}
|
||||
|
||||
} else if (item instanceof SAPFunction) {
|
||||
SAPFunctionUnit function = MetadataToolHelper.getSAPFunctionFromRepository(item.getId());
|
||||
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(item.getId());
|
||||
if (function != null) {
|
||||
IRepositoryView view = getRepositoryView();
|
||||
RepositoryNode node = RepositoryNodeUtilities.getSAPFunctionFromConnection(item.getId());
|
||||
@@ -454,19 +454,18 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
|
||||
return repositoryNode;
|
||||
}
|
||||
} else if (item instanceof TableMetadata) {
|
||||
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(item.getId());
|
||||
MetadataTable table = MetadataTool.getMetadataTableFromRepository(item.getId());
|
||||
if (table != null) {
|
||||
return RepositoryNodeUtilities.getMetadataTableFromConnection(item.getId());
|
||||
}
|
||||
|
||||
} else if (item instanceof Query) {
|
||||
org.talend.core.model.metadata.builder.connection.Query query = MetadataToolHelper.getQueryFromRepository(item
|
||||
.getId());
|
||||
org.talend.core.model.metadata.builder.connection.Query query = MetadataTool.getQueryFromRepository(item.getId());
|
||||
if (query != null) {
|
||||
return RepositoryNodeUtilities.getQueryFromConnection(item.getId());
|
||||
}
|
||||
} else if (item instanceof SAPFunction) {
|
||||
SAPFunctionUnit function = MetadataToolHelper.getSAPFunctionFromRepository(item.getId());
|
||||
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(item.getId());
|
||||
if (function != null) {
|
||||
return RepositoryNodeUtilities.getSAPFunctionFromConnection(item.getId());
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
prefs.configuration.LINK_STYLE.AUTO=Automatisch
|
||||
prefs.configuration.LINK_STYLE.BEZIER_CURVE=Rondingen
|
||||
prefs.configuration.LINK_STYLE.LINE=Lijnen (snel)
|
||||
FAMILY.Access=Toegang
|
||||
FAMILY.Connections=Verbindingen
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="output" path="class"/>
|
||||
</classpath>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.talend.designer.codegen.test</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,7 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
@@ -1,8 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Test
|
||||
Bundle-SymbolicName: org.talend.designer.codegen.test
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Fragment-Host: org.talend.designer.codegen;bundle-version="2.2.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: org.junit4
|
||||
@@ -1,4 +0,0 @@
|
||||
source.. = src/main/java/
|
||||
output.. = class/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
@@ -1,53 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.codegen.junit;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory;
|
||||
|
||||
/**
|
||||
* created by nrousseau on Jul 25, 2012 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class JUnitStudioStartup {
|
||||
|
||||
private static final long ONE_MINUTE_IN_MILLISEC = 60000;
|
||||
|
||||
private static final long INIT_TIMEOUT = ONE_MINUTE_IN_MILLISEC * 10;
|
||||
|
||||
private static final long INIT_PAUSE = 100;
|
||||
|
||||
private final SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd-HH:mm:ss");
|
||||
|
||||
@Test
|
||||
public void test() throws InterruptedException {
|
||||
System.out.println("|" + format.format(new Date()) + "| Wait for full generation of jet emitters");
|
||||
long startTimer = System.currentTimeMillis();
|
||||
long endTimer = startTimer;
|
||||
while ((!CodeGeneratorEmittersPoolFactory.isInitialized()) && ((endTimer - startTimer) < INIT_TIMEOUT)) {
|
||||
Thread.sleep(INIT_PAUSE);
|
||||
endTimer = System.currentTimeMillis();
|
||||
}
|
||||
if ((endTimer - startTimer) > INIT_TIMEOUT) {
|
||||
System.out.println("|" + format.format(new Date())
|
||||
+ "| Timeout when generate jet emitters (10 minutes), will just continue with standards junits");
|
||||
} else {
|
||||
System.out.println("|" + format.format(new Date())
|
||||
+ "| Jet emitters initialized successfully, will proceed to standards junits");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,10 +6,8 @@
|
||||
org.talend.core.model.process.EConnectionType
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.utils.JavaResourcesHelper
|
||||
java.util.Vector
|
||||
java.util.List
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
<%
|
||||
@@ -17,107 +15,63 @@
|
||||
Vector v = (Vector) codeGenArgument.getArgument();
|
||||
IProcess process = (IProcess)v.get(0);
|
||||
|
||||
String jobFolderName = JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion());
|
||||
String packageName = codeGenArgument.getCurrentProjectName().toLowerCase() + "." + jobFolderName;
|
||||
|
||||
boolean stats = codeGenArgument.isStatistics();
|
||||
%>
|
||||
|
||||
}
|
||||
};
|
||||
getCamelContexts().get(0).addRoutes(routeBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* create a fully configured CameContext and add into map
|
||||
* the Registry of it is #TalendRouteRegistry
|
||||
* @return
|
||||
* <code>key: <%=process.getName()%>-ctx<code>
|
||||
* <code>value: DefaultCamelContext<code>
|
||||
*
|
||||
*/
|
||||
public Map<String, CamelContext> getCamelContextMap() {
|
||||
Map<String,CamelContext> answer = new HashMap<String, CamelContext>();
|
||||
DefaultCamelContext camelContext = camelContext();
|
||||
<%
|
||||
//process cConfig components first
|
||||
List<? extends INode> camelContextNodes = process.getNodesOfType("cConfig");
|
||||
for(INode node: camelContextNodes){
|
||||
%>
|
||||
<%=ElementParameterParser.getValue(node, "__CODE__")%>
|
||||
|
||||
protected void doStop() throws Exception {
|
||||
super.doStop();
|
||||
getCamelContexts().get(0).stop();
|
||||
}
|
||||
|
||||
protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate() {
|
||||
return getCamelContexts().get(0).createProducerTemplate();
|
||||
}
|
||||
|
||||
protected java.util.Map<String, org.apache.camel.CamelContext> getCamelContextMap() {
|
||||
java.util.Map<String, org.apache.camel.CamelContext> answer = new java.util.HashMap<String, org.apache.camel.CamelContext>();
|
||||
org.apache.camel.impl.DefaultCamelContext camelContext;
|
||||
org.apache.camel.spi.TypeConverterRegistry typeConverterRegistry;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
TalendRouteRegistry contextRegister = new TalendRouteRegistry(camelContext.getRegistry());
|
||||
camelContext.setRegistry(contextRegister);
|
||||
<%
|
||||
//then process cBeanRegister components
|
||||
List<? extends INode> beanRegisterNodes = process.getNodesOfType("cBeanRegister");
|
||||
if(beanRegisterNodes != null && beanRegisterNodes.size()>0){
|
||||
for(INode node: beanRegisterNodes){
|
||||
String id = ElementParameterParser.getValue(node, "__ID__");
|
||||
String isSimple = ElementParameterParser.getValue(node, "__SIMPLE_CONFIG__");
|
||||
String classQualifiedName = ElementParameterParser.getValue(node, "__CLASS_QUALIFIED_NAME__");
|
||||
String hasArguments = ElementParameterParser.getValue(node, "__SPECIFY_ARGUMENTS__");
|
||||
List<Map<String, String>> arguments = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node, "__ARGUMENTS__");
|
||||
|
||||
String code = ElementParameterParser.getValue(node, "__CODE__");
|
||||
|
||||
if("true".equals(isSimple)){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if("true".equals(hasArguments)){
|
||||
for(Map<String, String> s: arguments){
|
||||
if(sb.length() == 0){
|
||||
sb.append(s.get("VALUE"));
|
||||
}else{
|
||||
sb.append(",");
|
||||
sb.append(s.get("VALUE"));
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
contextRegister.register(<%=id%>, new <%=classQualifiedName%>(<%=sb.toString()%>));
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
{
|
||||
Object beanInstance = null;
|
||||
<%=code%>
|
||||
if(beanInstance != null){
|
||||
contextRegister.register(<%=id%>, beanInstance);
|
||||
}
|
||||
boolean startable = false;
|
||||
for (INode node : (List< ? extends INode>)process.getGraphicalNodes()) {
|
||||
Object value = node.getPropertyValue("STARTABLE");
|
||||
startable = value == null? false:(Boolean)value;
|
||||
if(startable){
|
||||
break;
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//after, process cDataset
|
||||
List<? extends INode> datasetNodes = process.getNodesOfType("cDataset");
|
||||
for(INode n: datasetNodes){
|
||||
String beanID = ElementParameterParser.getValue(n, "__DATASET_NAME__");
|
||||
String registerNewBean = ElementParameterParser.getValue(n, "__REGISTER_DATASET_BEAN__");
|
||||
if(!"true".equals(registerNewBean)){
|
||||
continue;
|
||||
}
|
||||
String beanClass = ElementParameterParser.getValue(n, "__BEAN_CLASS__");
|
||||
List<Map<String, String>> beanArguments = (List<Map<String, String>>) ElementParameterParser.getObjectValue(n, "__BEAN_ARGUMENTS__");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if(beanArguments != null){
|
||||
for(Map<String,String> map: beanArguments){
|
||||
if(sb.length() == 0){
|
||||
sb.append(map.get("VALUE"));
|
||||
}else{
|
||||
sb.append(",");
|
||||
sb.append(map.get("VALUE"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (startable) {
|
||||
%>
|
||||
contextRegister.register(<%=beanID%>, new <%=beanClass%>(<%=sb.toString()%>));
|
||||
if (bundleContext != null) {
|
||||
org.apache.camel.osgi.CamelContextFactory factory = new org.apache.camel.osgi.CamelContextFactory();
|
||||
factory.setBundleContext(bundleContext);
|
||||
camelContext = factory.createContext();
|
||||
bundleContext.registerService(org.apache.camel.CamelContext.class.getName(), camelContext, null);
|
||||
} else {
|
||||
camelContext = new org.apache.camel.impl.DefaultCamelContext();
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
camelContext = new org.apache.camel.impl.DefaultCamelContext();
|
||||
<%
|
||||
}
|
||||
%>
|
||||
typeConverterRegistry = camelContext.getTypeConverterRegistry();
|
||||
<%
|
||||
//cJMSConnectionFactory http://jira.talendforge.org/browse/TESB-4860
|
||||
List<? extends INode> jmsCFNodes = process.getNodesOfType("cJMSConnectionFactory");
|
||||
if(jmsCFNodes.size()>0){
|
||||
%>
|
||||
javax.jms.ConnectionFactory jmsConnectionFactory = null;
|
||||
<% }
|
||||
for(INode node: jmsCFNodes){
|
||||
//Use transaction http://jira.talendforge.org/browse/TESB-5160 By LiXiaopeng
|
||||
String useTransaction = ElementParameterParser.getValue(node, "__USE_TRANSACTION__");
|
||||
@@ -140,8 +94,7 @@
|
||||
String amqUri = ElementParameterParser.getValue(node, "__AMQ_BROKER_URI__").trim();
|
||||
|
||||
%>
|
||||
{
|
||||
javax.jms.ConnectionFactory jmsConnectionFactory = new org.apache.activemq.ActiveMQConnectionFactory(<%=amqUri%>);
|
||||
jmsConnectionFactory = new org.apache.activemq.ActiveMQConnectionFactory(<%=amqUri%>);
|
||||
<%
|
||||
String amqPool = ElementParameterParser.getValue(node, "__AMQ_POOL__").trim();
|
||||
if("true".equals(amqPool)){
|
||||
@@ -178,7 +131,7 @@
|
||||
org.apache.activemq.pool.PooledConnectionFactory pooledConnectionFactory_<%=node.getUniqueName()%>
|
||||
= new org.apache.activemq.pool.PooledConnectionFactory();
|
||||
pooledConnectionFactory_<%=node.getUniqueName()%>.setConnectionFactory(jmsConnectionFactory);
|
||||
pooledConnectionFactory_<%=node.getUniqueName()%>.setExpiryTimeout(<%=amq_pool_expiry_timeout%>L);
|
||||
pooledConnectionFactory_<%=node.getUniqueName()%>.setExpiryTimeout(<%=amq_pool_expiry_timeout%>);
|
||||
pooledConnectionFactory_<%=node.getUniqueName()%>.setIdleTimeout(<%=amq_pool_idle_timeout%>);
|
||||
pooledConnectionFactory_<%=node.getUniqueName()%>.setMaxConnections(<%=amq_pool_max_connections%>);
|
||||
pooledConnectionFactory_<%=node.getUniqueName()%>.setMaximumActive(<%=amq_pool_max_active%>);
|
||||
@@ -192,9 +145,6 @@
|
||||
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(jmsConnectionFactory));
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else if("WebSphere MQ".equals(mqType)){
|
||||
String wmqServer = ElementParameterParser.getValue(node, "__WQM_SEVER__");
|
||||
String wmqPort = ElementParameterParser.getValue(node, "__WMQ_PORT__");
|
||||
@@ -220,8 +170,7 @@
|
||||
}
|
||||
|
||||
%>
|
||||
{
|
||||
javax.jms.ConnectionFactory jmsConnectionFactory = new com.ibm.mq.jms.MQQueueConnectionFactory();
|
||||
jmsConnectionFactory = new com.ibm.mq.jms.MQQueueConnectionFactory();
|
||||
((com.ibm.mq.jms.MQConnectionFactory) jmsConnectionFactory).setHostName(<%=wmqServer%>);
|
||||
try {
|
||||
((com.ibm.mq.jms.MQConnectionFactory) jmsConnectionFactory).setPort(<%=wmqPort%>);
|
||||
@@ -248,22 +197,23 @@
|
||||
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(connectionFactoryAdapter<%=node.getUniqueName()%>));
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
|
||||
}else if("Other".equals(mqType)){
|
||||
%>
|
||||
{
|
||||
javax.jms.ConnectionFactory jmsConnectionFactory;
|
||||
<%=ElementParameterParser.getValue(node, "__OTHER_CODE__")%>
|
||||
camelContext.addComponent(<%=name%>,
|
||||
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(jmsConnectionFactory));
|
||||
}
|
||||
<%=ElementParameterParser.getValue(node, "__OTHER_CODE__")%>
|
||||
camelContext.addComponent(<%=name%>,
|
||||
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(jmsConnectionFactory));
|
||||
<%
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//cConfig
|
||||
List<? extends INode> camelContextNodes = process.getNodesOfType("cConfig");
|
||||
for(INode node: camelContextNodes){
|
||||
%>
|
||||
<%=ElementParameterParser.getValue(node, "__CODE__")%>
|
||||
<%
|
||||
}
|
||||
//http://jira.talendforge.org/browse/TESB-4087: Change CamelContext name
|
||||
%>
|
||||
//using Route name as CamelContext ID
|
||||
@@ -271,40 +221,36 @@
|
||||
camelContext.setName("<%=process.getName() + "-ctx"%>");
|
||||
return answer;
|
||||
}
|
||||
|
||||
/**
|
||||
* create a simple DefaultCamelContext
|
||||
* please use #getCamelContextMap() to get a fully configured CamelContext
|
||||
* @return DefaultCamelContext
|
||||
*/
|
||||
public DefaultCamelContext camelContext() {
|
||||
DefaultCamelContext camelContext;
|
||||
<%
|
||||
boolean startable = false;
|
||||
for (INode node : (List< ? extends INode>)process.getGraphicalNodes()) {
|
||||
Object value = node.getPropertyValue("STARTABLE");
|
||||
startable = value == null? false:(Boolean)value;
|
||||
if(startable){
|
||||
break;
|
||||
}
|
||||
|
||||
protected org.apache.camel.view.ModelFileGenerator createModelFileGenerator()
|
||||
throws javax.xml.bind.JAXBException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
final CamelImpl camelImplementation = new CamelImpl();
|
||||
if(start){
|
||||
stopDelegate = new TalendESBRoute() {
|
||||
|
||||
public int runJobInTOS(String[] args) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (startable) {
|
||||
%>
|
||||
if (bundleContext != null) {
|
||||
CamelContextFactory factory = new CamelContextFactory();
|
||||
factory.setBundleContext(bundleContext);
|
||||
camelContext = factory.createContext();
|
||||
bundleContext.registerService(CamelContext.class.getName(), camelContext, null);
|
||||
} else {
|
||||
camelContext = new DefaultCamelContext();
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
camelContext = new DefaultCamelContext();
|
||||
<%
|
||||
public String[][] runJob(String[] args) {
|
||||
return null;
|
||||
}
|
||||
%>
|
||||
return camelContext;
|
||||
}
|
||||
|
||||
public void stop() throws Exception {
|
||||
camelImplementation.stop();
|
||||
}
|
||||
|
||||
public void shutdown() throws Exception {
|
||||
camelImplementation.shutdown();
|
||||
}
|
||||
};
|
||||
camelImplementation.enableHangupSupport();
|
||||
camelImplementation.run();
|
||||
}
|
||||
return routeBuilder;
|
||||
|
||||
}
|
||||
@@ -42,21 +42,101 @@
|
||||
|
||||
List< ? extends INode> processNodes = (List< ? extends INode>)process.getGeneratingNodes();
|
||||
%>
|
||||
return new RouteBuilder() {
|
||||
|
||||
class CamelImpl extends org.apache.camel.impl.MainSupport {
|
||||
protected CamelImpl instance;
|
||||
|
||||
public CamelImpl() {
|
||||
try {
|
||||
postProcessContext();
|
||||
initRoute();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently executing main
|
||||
*
|
||||
* @return the current running instance
|
||||
*/
|
||||
public CamelImpl getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
protected void doStart() throws Exception {
|
||||
super.doStart();
|
||||
|
||||
org.apache.camel.management.JmxNotificationEventNotifier notifier = new org.apache.camel.management.JmxNotificationEventNotifier();
|
||||
notifier.setSource("MyCamel");
|
||||
notifier.setIgnoreCamelContextEvents(true);
|
||||
notifier.setIgnoreRouteEvents(true);
|
||||
notifier.setIgnoreServiceEvents(true);
|
||||
|
||||
getCamelContexts().get(0).getManagementStrategy().addEventNotifier(notifier);
|
||||
|
||||
java.net.URLClassLoader sysloader = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
|
||||
java.lang.reflect.Method method = java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { java.net.URL.class });
|
||||
method.setAccessible(true);
|
||||
String[] libPaths = new String[] {
|
||||
|
||||
|
||||
<%
|
||||
for (INode node : processNodes) {
|
||||
if (node.isActivate()) {
|
||||
if (node.getComponent().getName().equals("cMessagingEndpoint")) {
|
||||
List<Map<String, String>> dependencies = (List<Map<String,String>>) ElementParameterParser.getObjectValue(node, "__HOTLIBS__");
|
||||
for(Map<String, String> dependencie : dependencies){
|
||||
String librarieJar = dependencie.get("LIBPATH"); %>
|
||||
"<%=librarieJar %>",
|
||||
<% }
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
};
|
||||
for (String lib : libPaths) {
|
||||
String separator = System.getProperty("path.separator");
|
||||
String[] jarFiles = lib.split(separator);
|
||||
for (String jarFile : jarFiles) {
|
||||
method.invoke(sysloader, new Object[] { new java.io.File(jarFile).toURL() });
|
||||
}
|
||||
}
|
||||
|
||||
getCamelContexts().get(0).start();
|
||||
|
||||
|
||||
<% if(stats) { %>
|
||||
|
||||
CamelStat runStat = new CamelStat(getCamelContexts().get(0));
|
||||
|
||||
runStat.setParams();
|
||||
|
||||
runStat.openSocket(true);
|
||||
runStat.setAllPID(rootPid, fatherPid, pid, jobName);
|
||||
runStat.startThreadStat(clientHost, portStats);
|
||||
runStat.updateStatOnJob(RunStat.JOBSTART, "");
|
||||
|
||||
MyStatThread statsThread = new MyStatThread(runStat);
|
||||
statsThread.run();
|
||||
<% } //if stats %>
|
||||
|
||||
}
|
||||
|
||||
public void initRoute() throws Exception {
|
||||
routeBuilder = new org.apache.camel.builder.RouteBuilder() {
|
||||
public void configure() throws Exception {
|
||||
<%
|
||||
for (INode node : processNodes) {
|
||||
if (node.getComponent().getName().equals("cCXF")) {
|
||||
IElementParameter param = node.getElementParameter("LABEL");
|
||||
String cid = node.getUniqueName();
|
||||
// http://jira.talendforge.org/browse/TESB-5241
|
||||
/*
|
||||
* change to use label + unique to make it unique but readable
|
||||
*/
|
||||
if(param != null && !"__UNIQUE_NAME__".equals(param.getValue())){
|
||||
cid = (String)param.getValue()+"_"+cid;
|
||||
String cid = "";
|
||||
if (param != null && !"__UNIQUE_NAME__".equals(param.getValue())) {
|
||||
cid = (String)param.getValue();
|
||||
} else {
|
||||
cid = node.getUniqueName();
|
||||
}
|
||||
String endpointVar = "endpoint_" + node.getUniqueName();
|
||||
String endpointVar = "endpoint" + cid;
|
||||
String uriRef = "uriMap.get(\"" + cid + "\")";
|
||||
%>
|
||||
// CXF endpoint for <%=cid%>
|
||||
@@ -100,7 +180,7 @@
|
||||
}
|
||||
//http://jira.talendforge.org/browse/TESB-3850
|
||||
String formatType = ElementParameterParser.getValue(node, "__DATAFORMAT__");
|
||||
if ("true".equals(useSAM) && !"RAW".equals(formatType)) {
|
||||
if ("true".equals(useSAM) && !"MESSAGE".equals(formatType)) {
|
||||
%>
|
||||
// Add Service Activity Monitor Service to <%=endpointVar%>
|
||||
if (eventFeature != null) {
|
||||
|
||||
@@ -32,19 +32,9 @@ INode node = (INode) codeGenArgument.getArgument();
|
||||
List< ? extends IConnection> connsIf = node.getIncomingConnections();
|
||||
if(connsIf.size()>0) {
|
||||
if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_WHEN) {
|
||||
INode sourceNode = connsIf.get(0).getSource();
|
||||
String languageType = connsIf.get(0).getRouteConnectionType();
|
||||
String condition = connsIf.get(0).getCondition();
|
||||
String expression = "none".equals(languageType)?condition:languageType+"("+condition+")";
|
||||
if("cIntercept".equals(sourceNode.getComponent().getName())){
|
||||
%>
|
||||
.when(<%=expression%>)
|
||||
.when().<%=connsIf.get(0).getRouteConnectionType()%>(<%=connsIf.get(0).getCondition()%>)
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
.when().<%=expression%>
|
||||
<%
|
||||
}
|
||||
} else if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_OTHER) {
|
||||
%>
|
||||
.otherwise()
|
||||
|
||||
@@ -144,14 +144,9 @@ currentComponent="<%=node.getUniqueName() %>";
|
||||
if ((codePart.equals(ECodePart.BEGIN))&&(stat)&&connSet.size()>0) {
|
||||
for(IConnection con:connSet){
|
||||
%>
|
||||
|
||||
if (execStat) {
|
||||
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_<%=con.getUniqueName() %> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap");
|
||||
concurrentHashMap_<%=con.getUniqueName() %>.putIfAbsent("<%=con.getUniqueName() %>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0));
|
||||
java.util.concurrent.atomic.AtomicInteger stats_<%=con.getUniqueName() %> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=con.getUniqueName() %>.get("<%=con.getUniqueName() %>" + iterateLoop);
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>" + iterateId, stats_<%=con.getUniqueName() %>.incrementAndGet()<=1?0:1, 0);
|
||||
}
|
||||
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,0, 0);
|
||||
}
|
||||
<% }
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -45,12 +45,7 @@ public class CLASS
|
||||
// toReturn += createCallProcess(conn.getTarget(), className, isMultiThread);
|
||||
// }
|
||||
//}
|
||||
if(isMultiThread){
|
||||
toReturn += "\n}catch (Error e_" + rootNode.getUniqueName() + ") {\n";
|
||||
toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n";
|
||||
toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n";
|
||||
}
|
||||
toReturn += "\n}";
|
||||
toReturn += "\n}finally {\n}";
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
org.talend.core.model.process.IContextParameter
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.utils.JavaResourcesHelper
|
||||
java.util.Map
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
"
|
||||
class="Footer"
|
||||
skeleton="footer_java.skeleton"
|
||||
@@ -19,8 +17,7 @@
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
Vector v = (Vector) codeGenArgument.getArgument();
|
||||
IProcess process = (IProcess)v.get(0);
|
||||
|
||||
List<? extends INode> processNodes = (List<? extends INode>) process.getGeneratingNodes();
|
||||
|
||||
List<IContextParameter> params = new ArrayList<IContextParameter>();
|
||||
params=process.getContextManager().getDefaultContext().getContextParameterList();
|
||||
String jobFolderName = JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion());
|
||||
@@ -28,195 +25,6 @@
|
||||
boolean stats = codeGenArgument.isStatistics();
|
||||
|
||||
%>
|
||||
|
||||
protected void doStart() throws Exception {
|
||||
// init uriMap first
|
||||
initUriMap();
|
||||
|
||||
//add route
|
||||
addRouteBuilder(route());
|
||||
|
||||
//prepare camel contexts
|
||||
super.doStart();
|
||||
postProcessContext();
|
||||
|
||||
//add jmx notification
|
||||
JmxNotificationEventNotifier notifier = new JmxNotificationEventNotifier();
|
||||
notifier.setSource("MyCamel");
|
||||
notifier.setIgnoreCamelContextEvents(true);
|
||||
notifier.setIgnoreRouteEvents(true);
|
||||
notifier.setIgnoreServiceEvents(true);
|
||||
|
||||
getCamelContexts().get(0).getManagementStrategy().addEventNotifier(notifier);
|
||||
|
||||
<%
|
||||
StringBuilder librariesSb = new StringBuilder();
|
||||
for (INode node : processNodes) {
|
||||
if (node.isActivate()) {
|
||||
if (node.getComponent().getName().equals("cMessagingEndpoint")) {
|
||||
List<Map<String, String>> dependencies = (List<Map<String,String>>) ElementParameterParser.getObjectValue(node, "__HOTLIBS__");
|
||||
for(Map<String, String> dependencie : dependencies){
|
||||
String librarieJar = dependencie.get("LIBPATH");
|
||||
librariesSb.append("\"");
|
||||
librariesSb.append(librarieJar);
|
||||
librariesSb.append("\",");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(librariesSb.length()>0){
|
||||
%>
|
||||
// add external libraries
|
||||
java.net.URLClassLoader sysloader = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
|
||||
java.lang.reflect.Method method = java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { java.net.URL.class });
|
||||
method.setAccessible(true);
|
||||
String[] libPaths = new String[] {<%=librariesSb.toString()%>};
|
||||
for (String lib : libPaths) {
|
||||
String separator = System.getProperty("path.separator");
|
||||
String[] jarFiles = lib.split(separator);
|
||||
for (String jarFile : jarFiles) {
|
||||
method.invoke(sysloader, new Object[] { new java.io.File(jarFile).toURL() });
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
//start camel context
|
||||
getCamelContexts().get(0).start();
|
||||
|
||||
|
||||
<% if(stats) { %>
|
||||
|
||||
// add statistics which shows on the connection
|
||||
routines.system.CamelStat runStat = new routines.system.CamelStat(getCamelContexts().get(0));
|
||||
|
||||
runStat.setParams();
|
||||
|
||||
runStat.openSocket(true);
|
||||
runStat.setAllPID(rootPid, fatherPid, pid, jobName);
|
||||
runStat.startThreadStat(clientHost, portStats);
|
||||
runStat.updateStatOnJob(routines.system.RunStat.JOBSTART, "");
|
||||
|
||||
new Thread(new MyStatThread(runStat)).start();
|
||||
<% } //if stats %>
|
||||
|
||||
}
|
||||
|
||||
protected void doStop() throws Exception {
|
||||
super.doStop();
|
||||
getCamelContexts().get(0).stop();
|
||||
}
|
||||
|
||||
protected ProducerTemplate findOrCreateCamelTemplate() {
|
||||
return getCamelContexts().get(0).createProducerTemplate();
|
||||
}
|
||||
|
||||
public void stop() throws Exception {
|
||||
super.stop();
|
||||
}
|
||||
|
||||
public void shutdown() throws Exception {
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
protected ModelFileGenerator createModelFileGenerator()
|
||||
throws JAXBException {
|
||||
return null;
|
||||
}
|
||||
<% if(stats) { %>
|
||||
|
||||
class MyStatThread implements Runnable {
|
||||
|
||||
routines.system.CamelStat stats;
|
||||
boolean isFinished;
|
||||
|
||||
public MyStatThread(routines.system.CamelStat stats) {
|
||||
this.stats = stats;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
<%
|
||||
for (INode node : processNodes) {
|
||||
if (node.isActivate()) {
|
||||
for(int i=0; i<node.getIncomingConnections().size(); i++) {
|
||||
%>
|
||||
stats.updateStatOnConnection("<%=node.getIncomingConnections().get(i).getUniqueName()%>", 1, "<%=node.getUniqueName()%>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
Thread.sleep(1000);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<% } //if stats %>
|
||||
|
||||
|
||||
private Properties defaultProps = new Properties();
|
||||
|
||||
public class ContextProperties extends Properties {
|
||||
|
||||
public ContextProperties(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
public ContextProperties() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void synchronizeContext() {
|
||||
<% for (IContextParameter ctxParam : params){
|
||||
String cParaName = ctxParam.getName(); %>
|
||||
if(<%=cParaName %> != null){
|
||||
<% if(ctxParam.getType().equals("id_Date")){ %>
|
||||
String pattern_<%=cParaName %> = "yyyy-MM-dd HH:mm:ss";
|
||||
String value_<%=cParaName %> = "<%=ctxParam.getValue() %>";
|
||||
String[] parts_<%=cParaName %> = value_<%=cParaName %>.split(";");
|
||||
if (parts_<%=cParaName %>.length > 1) {
|
||||
pattern_<%=cParaName %> = parts_<%=cParaName %>[0];
|
||||
this.setProperty("<%=cParaName %>", pattern_<%=cParaName %> + ";" + FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
|
||||
} else {
|
||||
this.setProperty("<%=cParaName %>", FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
|
||||
}
|
||||
<% } else { %>
|
||||
this.setProperty("<%=cParaName %>", <%=cParaName %>.toString());
|
||||
<% } %>
|
||||
}
|
||||
<% } %>
|
||||
}
|
||||
|
||||
<%
|
||||
for (IContextParameter ctxParam : params) {
|
||||
if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")) { %>
|
||||
public String <%=ctxParam.getName()%>;
|
||||
public String get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
|
||||
return this.<%=ctxParam.getName()%>;
|
||||
}
|
||||
<% } else { %>
|
||||
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> <%=ctxParam.getName()%>;
|
||||
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
|
||||
return this.<%=ctxParam.getName()%>;
|
||||
}
|
||||
<% }
|
||||
}
|
||||
%>
|
||||
}
|
||||
|
||||
private ContextProperties context = new ContextProperties();
|
||||
public ContextProperties getContext() {
|
||||
return this.context;
|
||||
}
|
||||
|
||||
private final String jobVersion = "<%=process.getVersion() %>";
|
||||
private final String jobName = "<%=codeGenArgument.getJobName() %>";
|
||||
private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>";
|
||||
|
||||
public Integer errorCode = null;
|
||||
public String resuming_logs_dir_path = null;
|
||||
public String resuming_checkpoint_path = null;
|
||||
public String parent_part_launcher = null;
|
||||
@@ -240,8 +48,8 @@ for (IContextParameter ctxParam : params) {
|
||||
|
||||
private boolean execStat = true;
|
||||
|
||||
private Properties context_param = new Properties();
|
||||
public Map<String, Object> parentContextMap = new HashMap<String, Object>();
|
||||
private java.util.Properties context_param = new java.util.Properties();
|
||||
public java.util.Map<String, Object> parentContextMap = new java.util.HashMap<String, Object>();
|
||||
|
||||
public static void main(String[] args){
|
||||
final <%=process.getName() %> <%=process.getName() %>Class = new <%=process.getName() %>();
|
||||
@@ -307,27 +115,10 @@ for (IContextParameter ctxParam : params) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
//read context values
|
||||
readContextValues(contextStr);
|
||||
|
||||
|
||||
try {
|
||||
run();
|
||||
} catch (Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
e.printStackTrace();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* read context values from specified context
|
||||
* @parameter contextName : the name of context while will be used
|
||||
*/
|
||||
public void readContextValues(String contextName){
|
||||
|
||||
try {
|
||||
java.io.InputStream inContext = <%=process.getName()%>.class.getClassLoader().getResourceAsStream("<%=codeGenArgument.getCurrentProjectName().toLowerCase() %>/<%=jobFolderName %>/contexts/"+contextName+".properties");
|
||||
java.io.InputStream inContext = <%=process.getName()%>.class.getClassLoader().getResourceAsStream("<%=codeGenArgument.getCurrentProjectName().toLowerCase() %>/<%=jobFolderName %>/contexts/"+contextStr+".properties");
|
||||
|
||||
if (inContext!=null) {
|
||||
//defaultProps is in order to keep the original context value
|
||||
@@ -336,7 +127,7 @@ for (IContextParameter ctxParam : params) {
|
||||
context = new ContextProperties(defaultProps);
|
||||
}else{
|
||||
//print info and job continue to run, for case: context_param is not empty.
|
||||
System.err.println("Could not find the context " + contextName);
|
||||
System.err.println("Could not find the context " + contextStr);
|
||||
}
|
||||
|
||||
if(!context_param.isEmpty()) {
|
||||
@@ -392,7 +183,7 @@ for (IContextParameter ctxParam : params) {
|
||||
} //end for
|
||||
%>
|
||||
} catch (java.io.IOException ie) {
|
||||
System.err.println("Could not load context "+contextName);
|
||||
System.err.println("Could not load context "+contextStr);
|
||||
ie.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -415,6 +206,15 @@ for (IContextParameter ctxParam : params) {
|
||||
}
|
||||
%>
|
||||
}
|
||||
try {
|
||||
initUriMap();
|
||||
Route(true);
|
||||
} catch (Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
e.printStackTrace();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void evalParam(String arg) {
|
||||
@@ -453,64 +253,4 @@ for (IContextParameter ctxParam : params) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TalendRouteRegistry implements Registry {
|
||||
|
||||
private Map<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
private Registry wrapped = null;
|
||||
|
||||
public TalendRouteRegistry() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public TalendRouteRegistry(Registry wrapped) {
|
||||
this.wrapped = wrapped;
|
||||
}
|
||||
|
||||
public Object lookup(String name) {
|
||||
Object obj = null;
|
||||
if (wrapped != null) {
|
||||
obj = wrapped.lookup(name);
|
||||
}
|
||||
if (obj == null) {
|
||||
obj = map.get(name);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
public <T> T lookup(String name, Class<T> type) {
|
||||
T t = null;
|
||||
if (wrapped != null) {
|
||||
t = wrapped.lookup(name, type);
|
||||
}
|
||||
if (t == null) {
|
||||
t = (T) map.get(name);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
public <T> Map<String, T> lookupByType(Class<T> type) {
|
||||
Map<String, T> result = null;
|
||||
if (wrapped != null) {
|
||||
result = wrapped.lookupByType(type);
|
||||
}
|
||||
if (result == null) {
|
||||
result = new HashMap<String, T>();
|
||||
}
|
||||
if (result.isEmpty()) {
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
if (type.isInstance(entry.getValue())) {
|
||||
result.put(entry.getKey(), type.cast(entry.getValue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void register(String name, Object instance) {
|
||||
map.put(name, instance);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -99,8 +99,8 @@ import java.util.Comparator;
|
||||
String talendJobInterfaces = "TalendJob";
|
||||
|
||||
boolean talendMdmJob = !process.getNodesOfType("tMDMTriggerInput").isEmpty() || !process.getNodesOfType("tMDMTriggerOutput").isEmpty();
|
||||
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty();
|
||||
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty();
|
||||
|
||||
if (talendMdmJob) {
|
||||
talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job
|
||||
@@ -116,19 +116,7 @@ public class <%=process.getName()%> implements <%=talendJobInterfaces%> {
|
||||
|
||||
<% if (talendEsbJobFactory) { %>
|
||||
public TalendESBJob newTalendESBJob() {
|
||||
<%=process.getName()%> talendESBJob = new <%=process.getName()%>();
|
||||
java.util.Map<String, routines.system.TalendDataSource> talendDataSources =
|
||||
(java.util.Map<String, routines.system.TalendDataSource>) globalMap.get(KEY_DB_DATASOURCES);
|
||||
if (null != talendDataSources) {
|
||||
java.util.Map<String, javax.sql.DataSource> dataSources = new java.util.HashMap<String, javax.sql.DataSource>();
|
||||
for (java.util.Map.Entry<String, routines.system.TalendDataSource> talendDataSourceEntry : talendDataSources.entrySet()) {
|
||||
dataSources.put(talendDataSourceEntry.getKey(), talendDataSourceEntry.getValue().getRawDataSource());
|
||||
}
|
||||
talendESBJob.setDataSources(dataSources);
|
||||
}
|
||||
// fix for TESB-7714
|
||||
talendESBJob.setEndpointRegistry(registry);
|
||||
return talendESBJob;
|
||||
return new <%=process.getName()%>();
|
||||
}
|
||||
<% } %>
|
||||
|
||||
@@ -259,17 +247,6 @@ private RunTrace runTrace = new RunTrace();
|
||||
|
||||
public boolean isExportedAsOSGI = <%=exportAsOSGI%>;
|
||||
|
||||
// OSGi DataSource
|
||||
private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES";
|
||||
|
||||
public void setDataSources(java.util.Map<String, javax.sql.DataSource> dataSources) {
|
||||
java.util.Map<String, routines.system.TalendDataSource> talendDataSources = new java.util.HashMap<String, routines.system.TalendDataSource>();
|
||||
for (java.util.Map.Entry<String, javax.sql.DataSource> dataSourceEntry : dataSources.entrySet()) {
|
||||
talendDataSources.put(dataSourceEntry.getKey(), new routines.system.TalendDataSource(dataSourceEntry.getValue()));
|
||||
}
|
||||
globalMap.put(KEY_DB_DATASOURCES, talendDataSources);
|
||||
}
|
||||
|
||||
<%
|
||||
for (INode logCatcher : process.getNodesOfType("tLogCatcher")) {
|
||||
%>
|
||||
@@ -329,14 +306,6 @@ private class TalendException extends Exception {
|
||||
this.globalMap = globalMap;
|
||||
this.e = e;
|
||||
}
|
||||
|
||||
public Exception getException() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public String getCurrentComponent() {
|
||||
return this.currentComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace() {
|
||||
@@ -583,27 +552,9 @@ private class TalendException extends Exception {
|
||||
}
|
||||
}
|
||||
//end
|
||||
|
||||
/*
|
||||
This part of code has been added in order to call the correct onComponentError and onSubjobError for the specific components (like tWriteXMLField, tWriteJSONField, tMDMOutput, tBRMS, ...).
|
||||
*/
|
||||
INode subjob_start_node = node;
|
||||
boolean hasBeenChanged = true;
|
||||
|
||||
while(subjob_start_node.getDesignSubjobStartNode().isVirtualGenerateNode() && hasBeenChanged) {
|
||||
hasBeenChanged = false;
|
||||
if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK) != null) {
|
||||
if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK).size() >0) {
|
||||
if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK).get(0).getSource().getVirtualLinkTo()==EConnectionType.ON_COMPONENT_OK) {
|
||||
subjob_start_node = subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK).get(0).getSource();
|
||||
hasBeenChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%>
|
||||
<%=subjob_start_node.getDesignSubjobStartNode().getUniqueName() %>_onSubJobError(exception, errorComponent, globalMap);
|
||||
<%=node.getDesignSubjobStartNode().getUniqueName() %>_onSubJobError(exception, errorComponent, globalMap);
|
||||
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
org.talend.designer.codegen.ITalendSynchronizer
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.designer.runprocess.CodeGeneratorRoutine
|
||||
org.talend.core.model.process.EParameterFieldType
|
||||
"
|
||||
class="Header"
|
||||
%>
|
||||
@@ -56,77 +55,44 @@ if (service instanceof AbstractBrandingService) {
|
||||
package <%= packageName %>;
|
||||
|
||||
<%
|
||||
java.util.Set<String> importsSet = new java.util.TreeSet<String>();
|
||||
/* for (String routine : CodeGeneratorRoutine.getRequiredRoutineName(process)) {
|
||||
if (!routine.equals(ITalendSynchronizer.TEMPLATE)) {
|
||||
importsSet.add("import routines."+routine);
|
||||
}
|
||||
}
|
||||
*/
|
||||
importsSet.add("import java.util.HashMap");
|
||||
importsSet.add("import java.util.Map");
|
||||
importsSet.add("import javax.xml.bind.JAXBException");
|
||||
importsSet.add("import org.apache.camel.ProducerTemplate");
|
||||
importsSet.add("import org.apache.camel.builder.RouteBuilder");
|
||||
importsSet.add("import org.apache.camel.impl.DefaultCamelContext");
|
||||
importsSet.add("import org.apache.camel.main.MainSupport");
|
||||
importsSet.add("import routines.TalendString");
|
||||
importsSet.add("import routines.system.api.TalendESBRoute");
|
||||
importsSet.add("import org.apache.camel.view.ModelFileGenerator");
|
||||
importsSet.add("import org.apache.camel.spi.Registry");
|
||||
importsSet.add("import org.apache.camel.impl.DefaultCamelContext");
|
||||
importsSet.add("import org.apache.camel.osgi.CamelContextFactory");
|
||||
importsSet.add("import org.apache.camel.CamelContext");
|
||||
importsSet.add("import java.util.Properties");
|
||||
importsSet.add("import org.apache.camel.management.JmxNotificationEventNotifier");
|
||||
|
||||
String headerImports = ElementParameterParser.getValue(process, "__HEADER_IMPORT__");
|
||||
if(headerImports!=null && !"".equals(headerImports.trim())){
|
||||
String[] imports = headerImports.split(";");
|
||||
for(String s: imports){
|
||||
if(s!=null && !"".equals(s.trim())){
|
||||
importsSet.add(s.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
String footerImports = ElementParameterParser.getValue(process, "__FOOTER_IMPORT__");
|
||||
if(footerImports!=null && !"".equals(footerImports.trim())){
|
||||
String[] imports = footerImports.split(";");
|
||||
for(String s: imports){
|
||||
if(s!=null && !"".equals(s.trim())){
|
||||
importsSet.add(s.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<? extends INode> generatingNodes = process.getGeneratingNodes();
|
||||
for(INode n: generatingNodes){
|
||||
List<? extends IElementParameter> elementParameters = n.getElementParameters();
|
||||
for(IElementParameter p: elementParameters){
|
||||
if(p.getShowIf() != null && !p.isShow(elementParameters)){
|
||||
continue;
|
||||
}
|
||||
if(EParameterFieldType.MEMO_IMPORT == p.getFieldType()){
|
||||
Object value = p.getValue();
|
||||
if(value == null || !(value instanceof String) || "".equals(((String)value).trim())){
|
||||
continue;
|
||||
}
|
||||
String[] imports = ((String)value).trim().split(";");
|
||||
for(String s: imports){
|
||||
if(s!=null && !"".equals(s.trim())){
|
||||
importsSet.add(s.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(String s: importsSet){
|
||||
for (String routine : CodeGeneratorRoutine.getRequiredRoutineName(process)) {
|
||||
if (!routine.equals(ITalendSynchronizer.TEMPLATE)) {
|
||||
%>
|
||||
<%=s%> ;
|
||||
import routines.<%=routine%>;
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
import routines.system.*;
|
||||
import routines.system.api.*;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
|
||||
<%=ElementParameterParser.getValue(process, "__HEADER_IMPORT__") %>
|
||||
<%=ElementParameterParser.getValue(process, "__FOOTER_IMPORT__") %>
|
||||
|
||||
|
||||
<%
|
||||
List<INode> nodesWithImport = process.getNodesWithImport();
|
||||
if (nodesWithImport != null) {
|
||||
for (INode node:nodesWithImport) {
|
||||
%>
|
||||
//the import part of <%=node.getUniqueName() %>
|
||||
<%=ElementParameterParser.getValue(node, "__IMPORT__") %>
|
||||
|
||||
<% }
|
||||
}
|
||||
%>
|
||||
|
||||
/**
|
||||
@@ -136,9 +102,25 @@ package <%= packageName %>;
|
||||
* @version <%=version %>
|
||||
* @status <%=ElementParameterParser.getValue(process, "__STATUS__") %>
|
||||
*/
|
||||
public class <%=process.getName()%> extends MainSupport implements TalendESBRoute {
|
||||
public class <%=process.getName()%> implements TalendESBRoute {
|
||||
|
||||
private final String jobVersion = "<%=process.getVersion() %>";
|
||||
private final String jobName = "<%=codeGenArgument.getJobName() %>";
|
||||
private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>";
|
||||
public Integer errorCode = null;
|
||||
private String currentComponent = "";
|
||||
public TalendESBRoute stopDelegate = null;
|
||||
|
||||
public <%=process.getName()%>(){
|
||||
initUriMap();
|
||||
}
|
||||
|
||||
public void stop() throws Exception {
|
||||
if (stopDelegate != null) stopDelegate.stop();
|
||||
}
|
||||
|
||||
public void shutdown() throws Exception {
|
||||
if (stopDelegate != null) stopDelegate.shutdown();
|
||||
}
|
||||
|
||||
<%
|
||||
@@ -157,9 +139,7 @@ package <%= packageName %>;
|
||||
|
||||
<%
|
||||
for (INode node : graphicalNodes) {
|
||||
if("cCXF".equals(node.getComponent().getName())
|
||||
&& "true".equals(ElementParameterParser.getValue(node, "__ENABLE_SAM__"))
|
||||
&& !"RAW".equals(ElementParameterParser.getValue(node, "__DATAFORMAT__"))) { %>
|
||||
if("cCXF".equals(node.getComponent().getName())) { %>
|
||||
//ESB Service Activity Monitor Feature
|
||||
private org.apache.cxf.feature.AbstractFeature eventFeature;
|
||||
|
||||
@@ -171,158 +151,40 @@ package <%= packageName %>;
|
||||
}
|
||||
%>
|
||||
|
||||
private Map<String, String> uriMap;
|
||||
private org.apache.camel.builder.RouteBuilder routeBuilder;
|
||||
|
||||
public Map<String,String> getUriMap() {
|
||||
private java.util.Map<String, String> uriMap;
|
||||
|
||||
public java.util.Map<String,String> getUriMap() {
|
||||
return this.uriMap;
|
||||
}
|
||||
|
||||
public void loadCustomUriMap(Map<String,String> newMap) {
|
||||
public void loadCustomUriMap(java.util.Map<String,String> newMap) {
|
||||
if(newMap == null) {
|
||||
return;
|
||||
}
|
||||
for(Map.Entry<String, String> entry: newMap.entrySet()) {
|
||||
for(java.util.Map.Entry<String, String> entry: newMap.entrySet()) {
|
||||
uriMap.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* the readContextValues(contextName) may have to invoked first before this
|
||||
*/
|
||||
public void initUriMap() {
|
||||
uriMap = new HashMap<String, String>();
|
||||
protected void initUriMap() {
|
||||
uriMap = new java.util.HashMap<String, String>();
|
||||
<%
|
||||
String cid = "";
|
||||
String componentName = "";
|
||||
String uri = "";
|
||||
for (INode node : graphicalNodes) {
|
||||
if(!node.isActivate()){
|
||||
continue;
|
||||
}
|
||||
cid = node.getUniqueName();
|
||||
// http://jira.talendforge.org/browse/TESB-5241
|
||||
/*
|
||||
* change to use label + unique to make it unique but readable
|
||||
*/
|
||||
IElementParameter param = node.getElementParameter("LABEL");
|
||||
if(param != null && !"__UNIQUE_NAME__".equals(param.getValue())){
|
||||
cid = (String)param.getValue()+"_"+cid;
|
||||
if (param != null && !"__UNIQUE_NAME__".equals(param.getValue())) {
|
||||
cid = (String) param.getValue();
|
||||
} else {
|
||||
cid = node.getUniqueName();
|
||||
}
|
||||
|
||||
componentName = node.getComponent().getName();
|
||||
uri = "";
|
||||
if ("cMessagingEndpoint".equals(componentName)) {
|
||||
uri = ElementParameterParser.getValue(node, "__URI__");
|
||||
}else if("cTimer".equals(componentName)){
|
||||
uri = "\"timer:\"+\""+node.getUniqueName()+"\"";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String period = ElementParameterParser.getValue(node, "__PERIOD__");
|
||||
if(period!=null && !period.trim().equals("") && !"1000".equals(period)){
|
||||
sb.append("+\"?period=\"+");
|
||||
sb.append(period);
|
||||
}
|
||||
String repeat = ElementParameterParser.getValue(node, "__REPEATCOUNT__");
|
||||
if(repeat!=null && !repeat.trim().equals("") && !"0".equals(repeat)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?repeatCount=\"+");
|
||||
sb.append(repeat);
|
||||
}else{
|
||||
sb.append("+\"&repeatCount=\"+");
|
||||
sb.append(repeat);
|
||||
}
|
||||
}
|
||||
String delay = ElementParameterParser.getValue(node, "__DELAY__");
|
||||
if(delay!=null && !delay.trim().equals("") && !"1000".equals(delay)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?delay=\"+");
|
||||
sb.append(delay);
|
||||
}else{
|
||||
sb.append("+\"&delay=\"+");
|
||||
sb.append(delay);
|
||||
}
|
||||
}
|
||||
String fixedRate = ElementParameterParser.getValue(node, "__FIXEDRATE__");
|
||||
if("true".equals(fixedRate)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?fixedRate=true\"");
|
||||
}else{
|
||||
sb.append("+\"&fixedRate=true\"");
|
||||
}
|
||||
}
|
||||
String daemon = ElementParameterParser.getValue(node, "__DAEMON__");
|
||||
if("false".equals(daemon)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?daemon=false\"");
|
||||
}else{
|
||||
sb.append("+\"&daemon=false\"");
|
||||
}
|
||||
}
|
||||
String setTime = ElementParameterParser.getValue(node, "__SET_TIME__");
|
||||
if("true".equals(setTime)){
|
||||
String time = ElementParameterParser.getValue(node, "__TIME__");
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?time=\"+");
|
||||
sb.append(time);
|
||||
}else{
|
||||
sb.append("+\"&time=\"+");
|
||||
sb.append(time);
|
||||
}
|
||||
}
|
||||
if(sb.length()>0){
|
||||
uri = uri + sb.toString();
|
||||
}
|
||||
}else if("cDataset".equals(componentName)){
|
||||
uri = "\"dataset:\"+"+ElementParameterParser.getValue(node, "__DATASET_NAME__");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String produceDelay = ElementParameterParser.getValue(node, "__PRODUCE_DELAY__");
|
||||
if(produceDelay!=null && !produceDelay.trim().equals("") && !"3".equals(produceDelay)){
|
||||
sb.append("+\"?produceDelay=\"+");
|
||||
sb.append(produceDelay);
|
||||
}
|
||||
String consumeDelay = ElementParameterParser.getValue(node, "__CONSUME_DELAY__");
|
||||
if(consumeDelay!=null && !consumeDelay.trim().equals("") && !"0".equals(consumeDelay)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?consumeDelay=\"+");
|
||||
sb.append(consumeDelay);
|
||||
}else{
|
||||
sb.append("+\"&consumeDelay=\"+");
|
||||
sb.append(consumeDelay);
|
||||
}
|
||||
}
|
||||
String preloadSize = ElementParameterParser.getValue(node, "__PRELOAD_SIZE__");
|
||||
if(preloadSize!=null && !preloadSize.trim().equals("") && !"0".equals(preloadSize)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?preloadSize=\"+");
|
||||
sb.append(preloadSize);
|
||||
}else{
|
||||
sb.append("+\"&preloadSize=\"+");
|
||||
sb.append(preloadSize);
|
||||
}
|
||||
}
|
||||
String initialDelay = ElementParameterParser.getValue(node, "__INITIAL_DELAY__");
|
||||
if(initialDelay!=null && !initialDelay.trim().equals("") && !"1000".equals(initialDelay)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?initialDelay=\"+");
|
||||
sb.append(initialDelay);
|
||||
}else{
|
||||
sb.append("+\"&initialDelay=\"+");
|
||||
sb.append(initialDelay);
|
||||
}
|
||||
}
|
||||
String minRate = ElementParameterParser.getValue(node, "__MIN_RATE__");
|
||||
if(minRate!=null && !minRate.trim().equals("") && !"0".equals(minRate)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?minRate=\"+");
|
||||
sb.append(minRate);
|
||||
}else{
|
||||
sb.append("+\"&minRate=\"+");
|
||||
sb.append(minRate);
|
||||
}
|
||||
}
|
||||
|
||||
if(sb.length()>0){
|
||||
uri = uri + sb.toString();
|
||||
}
|
||||
} else if ("cFile".equals(componentName)) {
|
||||
String filePath = ElementParameterParser.getValue(node, "__URI__");
|
||||
String noop = ElementParameterParser.getValue(node, "__NOOP__");
|
||||
@@ -334,7 +196,7 @@ for (INode node : graphicalNodes) {
|
||||
|
||||
StringBuffer arguments = new StringBuffer();
|
||||
|
||||
uri = "\"file://\"+" + filePath;
|
||||
uri = "\"file:///\"+" + filePath;
|
||||
|
||||
if ("true".equals(noop)) {
|
||||
arguments.append("\"noop=true\"+");
|
||||
@@ -396,17 +258,7 @@ for (INode node : graphicalNodes) {
|
||||
sb.append("\"cxf://\"+").append(url).append("+\"?" + serviceType + "=\"");
|
||||
|
||||
if ("wsdlURL".equals(serviceType)) {
|
||||
|
||||
//http://jira.talendforge.org/browse/TESB-6226
|
||||
String filePath = "";
|
||||
|
||||
String wsdlType = ElementParameterParser.getValue(node, "__WSDL_TYPE__");
|
||||
if("file".equals(wsdlType)){
|
||||
filePath = ElementParameterParser.getValue(node, "__WSDL_FILE__");
|
||||
}else{
|
||||
filePath = ElementParameterParser.getValue(node, "__ROUTE_RESOURCE_TYPE_RES_URI__");
|
||||
filePath = "\"classpath:" + filePath + "\"";
|
||||
}
|
||||
String filePath = ElementParameterParser.getValue(node, "__WSDL_FILE__");
|
||||
filePath.replaceAll("\\\\","/");
|
||||
sb.append("+").append(filePath);
|
||||
} else {
|
||||
@@ -477,11 +329,10 @@ for (INode node : graphicalNodes) {
|
||||
|
||||
} else if("cJMS".equals(componentName)) {
|
||||
//http://jira.talendforge.org/browse/TESB-4861
|
||||
String name = ElementParameterParser.getValue(node, "__ROUTE_COMPONENT_TYPE_ID__");
|
||||
String name = ElementParameterParser.getValue(node, "__CONNECTION_FACOTRY__");
|
||||
if (name == null || name.equals("")) {
|
||||
name = "jms";
|
||||
}
|
||||
name = name.replace("_", "");
|
||||
name = "\"" + name + "\"";
|
||||
//String name = ElementParameterParser.getValue(node, "__NAME__").trim();
|
||||
//Remove unnecessary subfix
|
||||
@@ -675,10 +526,10 @@ for (INode node : graphicalNodes) {
|
||||
String resourceUri = ElementParameterParser.getValue(node, "__URI__");
|
||||
sb.append(resourceUri);
|
||||
|
||||
boolean hasParam = resourceUri==null?false:resourceUri.contains("?");
|
||||
boolean hasParam = false;
|
||||
|
||||
String method = ElementParameterParser.getValue(node, "__METHOD__");
|
||||
if("GET".equals(method)||"HEAD".equals(method) || "DELETE".equals(method)){
|
||||
if("GET".equals(method)||"HEAD".equals(method)){
|
||||
List<Map<String, String>> parameters = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node, "__PARAMETERS__");
|
||||
String encodeCharset = ElementParameterParser.getValue(node, "__ENCODER_CHARSET__");
|
||||
|
||||
@@ -720,3 +571,93 @@ for (INode node : graphicalNodes) {
|
||||
}
|
||||
%>
|
||||
}
|
||||
|
||||
private java.util.Properties defaultProps = new java.util.Properties();
|
||||
|
||||
public class ContextProperties extends java.util.Properties {
|
||||
|
||||
public ContextProperties(java.util.Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
public ContextProperties() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void synchronizeContext() {
|
||||
<% for (IContextParameter ctxParam : params){
|
||||
String cParaName = ctxParam.getName(); %>
|
||||
if(<%=cParaName %> != null){
|
||||
<% if(ctxParam.getType().equals("id_Date")){ %>
|
||||
String pattern_<%=cParaName %> = "yyyy-MM-dd HH:mm:ss";
|
||||
String value_<%=cParaName %> = "<%=ctxParam.getValue() %>";
|
||||
String[] parts_<%=cParaName %> = value_<%=cParaName %>.split(";");
|
||||
if (parts_<%=cParaName %>.length > 1) {
|
||||
pattern_<%=cParaName %> = parts_<%=cParaName %>[0];
|
||||
this.setProperty("<%=cParaName %>", pattern_<%=cParaName %> + ";" + FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
|
||||
} else {
|
||||
this.setProperty("<%=cParaName %>", FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
|
||||
}
|
||||
<% } else { %>
|
||||
this.setProperty("<%=cParaName %>", <%=cParaName %>.toString());
|
||||
<% } %>
|
||||
}
|
||||
<% } %>
|
||||
}
|
||||
|
||||
<%
|
||||
for (IContextParameter ctxParam : params) {
|
||||
if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")) { %>
|
||||
public String <%=ctxParam.getName()%>;
|
||||
public String get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
|
||||
return this.<%=ctxParam.getName()%>;
|
||||
}
|
||||
<% } else { %>
|
||||
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> <%=ctxParam.getName()%>;
|
||||
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
|
||||
return this.<%=ctxParam.getName()%>;
|
||||
}
|
||||
<% }
|
||||
}
|
||||
%>
|
||||
}
|
||||
|
||||
private ContextProperties context = new ContextProperties();
|
||||
public ContextProperties getContext() {
|
||||
return this.context;
|
||||
}
|
||||
|
||||
|
||||
|
||||
<% if(stats) { %>
|
||||
|
||||
class MyStatThread implements Runnable {
|
||||
|
||||
CamelStat stats;
|
||||
boolean isFinished;
|
||||
|
||||
public MyStatThread(CamelStat stats) {
|
||||
this.stats = stats;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
<%
|
||||
for (INode node : processNodes) {
|
||||
if (node.isActivate()) {
|
||||
for(int i=0; i<node.getIncomingConnections().size(); i++) {
|
||||
%>
|
||||
stats.updateStatOnConnection("<%=node.getIncomingConnections().get(i).getUniqueName()%>", 1, "<%=node.getUniqueName()%>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
Thread.sleep(1000);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<% } //if stats %>
|
||||
|
||||
@@ -53,7 +53,6 @@ for (IConnection iterateConn : iterateConnSet) { //1
|
||||
|
||||
%>
|
||||
NB_ITERATE_<%=iterateNodeName %>++;
|
||||
iterateLoop++;
|
||||
<%
|
||||
|
||||
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
|
||||
@@ -93,7 +92,6 @@ for (IConnection iterateConn : iterateConnSet) { //1
|
||||
private java.util.Map<String, Object> globalMap = null;
|
||||
boolean isRunning = false;
|
||||
String iterateId = "";
|
||||
int iterateLoop = 0;
|
||||
<%
|
||||
if(!subTree.isMergeSubTree()) {
|
||||
List< ? extends IConnection> rootConns = subTree.getRootNode().getOutgoingConnections();
|
||||
@@ -157,7 +155,6 @@ for (IConnection iterateConn : iterateConnSet) { //1
|
||||
<%}%>
|
||||
}
|
||||
iterateId = "." + threadID;
|
||||
iterateLoop++;
|
||||
<%if(isRunJob) {%>
|
||||
//bug21906 copy context to local for mutilthread
|
||||
context.synchronizeContext();
|
||||
|
||||
@@ -983,7 +983,6 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
|
||||
}
|
||||
boolean isRunning = false;
|
||||
String iterateId = "";
|
||||
int iterateLoop = 0;
|
||||
|
||||
public void run() {
|
||||
java.util.Map threadRunResultMap = new java.util.HashMap();
|
||||
@@ -1000,7 +999,6 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
|
||||
%>
|
||||
|
||||
String iterateId = "";
|
||||
int iterateLoop = 0;
|
||||
String currentComponent = "";
|
||||
|
||||
try {
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
boolean stat = codeGenArgument.isStatistics();
|
||||
%>
|
||||
|
||||
/**
|
||||
* please initial uri map first before using the returned RouteBuilder
|
||||
* @return RouteBuilder
|
||||
*/
|
||||
public RouteBuilder route() {
|
||||
public org.apache.camel.builder.RouteBuilder Route(final boolean start) throws Exception {
|
||||
|
||||
String iterateId = "";
|
||||
String currentComponent = "";
|
||||
|
||||
|
||||
@@ -669,14 +669,8 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
label = (String) parameter.getValue();
|
||||
}
|
||||
|
||||
/*
|
||||
* Fix https://jira.talendforge.org/browse/TESB-6685
|
||||
* label + uniqueName to make it unique
|
||||
*/
|
||||
if (label == null) {
|
||||
label = node.getUniqueName();
|
||||
}else{
|
||||
label += "_"+node.getUniqueName();
|
||||
}
|
||||
List<? extends IConnection> inConnections = node
|
||||
.getIncomingConnections();
|
||||
|
||||
@@ -69,7 +69,7 @@ import org.talend.core.model.components.IComponentsFactory;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.properties.ComponentSetting;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.core.utils.TalendCacheUtils;
|
||||
import org.talend.core.utils.BrandingChecker;
|
||||
import org.talend.designer.codegen.CodeGeneratorActivator;
|
||||
import org.talend.designer.codegen.i18n.Messages;
|
||||
import org.talend.designer.core.ITisLocalProviderService;
|
||||
@@ -145,7 +145,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// generation indirectly.
|
||||
// tFileInputFullRow + tSocketOutput : needed for DataViewer
|
||||
private static final String[] COMPONENTS_ALWAYS_NEEDED = { "tPrejob", "tPostjob", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"tJava", "tLibraryLoad", "tFileInputFullRow", "tSocketOutput", "tFilterRow", "tELTMysqlMap" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
"tJava", "tLibraryLoad", "tFileInputFullRow", "tSocketOutput", "tFilterRow" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
|
||||
public ComponentsFactory() {
|
||||
if (!INCLUDEFILEINJET_SUFFIX.equals(".inc.javajet")) { //$NON-NLS-1$
|
||||
@@ -159,7 +159,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
Project currentProject = ProjectManager.getInstance().getCurrentProject();
|
||||
if (currentProject != null && currentProject.getEmfProject() != null) {
|
||||
|
||||
List<ComponentSetting> components = currentProject.getEmfProject().getComponentsSettings();
|
||||
List<ComponentSetting> components = (List<ComponentSetting>) currentProject.getEmfProject().getComponentsSettings();
|
||||
return components;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
@@ -231,7 +231,8 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
ProjectManager manager = ProjectManager.getInstance();
|
||||
List<Project> referencedProjects = manager.getReferencedProjects();
|
||||
for (Project curProject : referencedProjects) {
|
||||
List<ComponentSetting> componentsSettings = curProject.getEmfProject().getComponentsSettings();
|
||||
List<ComponentSetting> componentsSettings = (List<ComponentSetting>) curProject.getEmfProject()
|
||||
.getComponentsSettings();
|
||||
for (ComponentSetting setting : componentsSettings) {
|
||||
if (setting.isHidden() && setting.getName().equals(settingInMain.getName())
|
||||
&& setting.getFamily().equals(settingInMain.getFamily())) {
|
||||
@@ -261,7 +262,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
skeletonList = new ArrayList<String>();
|
||||
String installLocation = new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
|
||||
componentToProviderMap = new HashMap<IComponent, AbstractComponentsProvider>();
|
||||
boolean isNeedClean = TalendCacheUtils.cleanComponentCache();
|
||||
boolean isNeedClean = cleanComponentCache();
|
||||
isCreated = hasComponentFile(installLocation) && !isNeedClean;
|
||||
if (isReset) {
|
||||
isCreated = false;
|
||||
@@ -347,7 +348,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
|
||||
@@ -482,6 +482,11 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return file.exists();
|
||||
}
|
||||
|
||||
private boolean cleanComponentCache() {
|
||||
return ArrayUtils.contains(Platform.getApplicationArgs(), "--clean_component_cache")
|
||||
|| ArrayUtils.contains(Platform.getApplicationArgs(), "-clean") || BrandingChecker.isBrandingChanged();
|
||||
}
|
||||
|
||||
private void loadComponentsFromComponentsProviderExtension() {
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
for (AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
|
||||
@@ -512,7 +517,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUserComponentsFromComponentsProviderExtension() {
|
||||
ComponentsProviderManager.getInstance().getProviders();
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
@@ -583,7 +587,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
|
||||
@@ -604,7 +607,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter skeletonFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
String fileName = file.getName();
|
||||
return file.isFile() && fileName.charAt(0) != '.'
|
||||
@@ -911,7 +913,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
component.setImageRegistry(componentsImageRegistry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -919,7 +920,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return componentList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IComponent get(String name) {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -933,7 +933,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeComponents(IProgressMonitor monitor) {
|
||||
this.monitor = monitor;
|
||||
if (componentList == null) {
|
||||
@@ -943,7 +942,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
this.subMonitor = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeComponents(IProgressMonitor monitor, boolean duringLogon) {
|
||||
this.monitor = monitor;
|
||||
if (componentList == null) {
|
||||
@@ -958,7 +956,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getComponents()
|
||||
*/
|
||||
@Override
|
||||
public Set<IComponent> getComponents() {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -966,7 +963,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return componentList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IComponent> getCustomComponents() {
|
||||
if (customComponentList == null) {
|
||||
init(false);
|
||||
@@ -979,7 +975,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getComponentPath()
|
||||
*/
|
||||
@Override
|
||||
public URL getComponentPath() throws IOException {
|
||||
String componentsPath = IComponentsFactory.COMPONENTS_LOCATION;
|
||||
IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
|
||||
@@ -997,7 +992,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getSkeletons()
|
||||
*/
|
||||
@Override
|
||||
public List<String> getSkeletons() {
|
||||
if (skeletonList == null) {
|
||||
init(false);
|
||||
@@ -1005,7 +999,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return skeletonList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
componentsImageRegistry.clear();
|
||||
componentList = null;
|
||||
@@ -1015,7 +1008,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCache() {
|
||||
componentsImageRegistry.clear();
|
||||
componentList = null;
|
||||
@@ -1034,7 +1026,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getFamilyTranslation(IComponent component,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getFamilyTranslation(Object component, String text) {
|
||||
String translated = Messages.getString(text);
|
||||
|
||||
@@ -1065,7 +1056,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getAllComponentsCanBeProvided()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> getAllComponentsCanBeProvided() {
|
||||
List source = new ArrayList();
|
||||
if (allComponents == null) {
|
||||
@@ -1090,7 +1080,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER);
|
||||
@@ -1149,17 +1138,14 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
analyseur = fabrique.newDocumentBuilder();
|
||||
analyseur.setErrorHandler(new ErrorHandler() {
|
||||
|
||||
@Override
|
||||
public void error(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fatalError(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warning(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
@@ -1211,12 +1197,10 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#resetSpecificComponents()
|
||||
*/
|
||||
@Override
|
||||
public void resetSpecificComponents() {
|
||||
loadComponentsFromExtensions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, File> getComponentsProvidersFolder() {
|
||||
Map<String, File> list = new HashMap<String, File>();
|
||||
|
||||
@@ -1233,7 +1217,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ImageDescriptor> getComponentsImageRegistry() {
|
||||
return componentsImageRegistry;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
|
||||
public UserComponentsProvider() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File getExternalComponentsLocation() {
|
||||
IPreferenceStore prefStore = CodeGeneratorActivator.getDefault().getPreferenceStore();
|
||||
String path = prefStore.getString(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER);
|
||||
@@ -76,7 +75,6 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
|
||||
return path.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preComponentsLoad() throws IOException {
|
||||
File installationFolder = getInstallationFolder();
|
||||
if (installationFolder.exists()) {
|
||||
@@ -85,9 +83,8 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
|
||||
FilesUtils.createFoldersIfNotExists(installationFolder.getAbsolutePath(), false);
|
||||
FileFilter ff = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File pathname) {
|
||||
if (FilesUtils.isSVNFolder(pathname)) {
|
||||
if (pathname.getName().equals(".svn")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -80,14 +80,20 @@ public class XsdValidationCacheManager {
|
||||
|
||||
public boolean needCheck(java.io.File file, long currentCRC) {
|
||||
String path = file.getAbsolutePath();
|
||||
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
|
||||
if (forceXSDAlreadyChecked) {
|
||||
alreadyCheckedXsd.put(path, currentCRC);
|
||||
return false;
|
||||
} else {
|
||||
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
|
||||
|
||||
if (lastCheckedCRC == null) {
|
||||
return true;
|
||||
if (lastCheckedCRC == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean isChanged = currentCRC != lastCheckedCRC;
|
||||
|
||||
return isChanged;
|
||||
}
|
||||
|
||||
boolean isChanged = currentCRC != lastCheckedCRC;
|
||||
return isChanged;
|
||||
}
|
||||
|
||||
public void setChecked(File file, long currentCRC) {
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.designer.codegen.config;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -28,6 +27,7 @@ import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
@@ -52,10 +52,12 @@ import org.eclipse.emf.common.util.Monitor;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.eclipse.jdt.core.IJavaModel;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.jdt.core.IPackageFragmentRoot;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
import org.talend.commons.debug.TalendDebugHandler;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.components.ComponentCompilations;
|
||||
import org.talend.designer.codegen.i18n.Messages;
|
||||
|
||||
/**
|
||||
@@ -298,107 +300,93 @@ public class TalendJetEmitter extends JETEmitter {
|
||||
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETOpeningJavaProject_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
// javaProject.open(new SubProgressMonitor(progressMonitor, 1));
|
||||
|
||||
IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots();
|
||||
IPackageFragmentRoot sourcePackageFragmentRoot = null;
|
||||
for (int j = 0; j < packageFragmentRoots.length; ++j) {
|
||||
IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[j];
|
||||
if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_SOURCE) {
|
||||
sourcePackageFragmentRoot = packageFragmentRoot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String packageName = jetCompiler.getSkeleton().getPackageName();
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(packageName, "."); //$NON-NLS-1$
|
||||
IProgressMonitor subProgressMonitor = new SubProgressMonitor(progressMonitor, 1);
|
||||
subProgressMonitor.beginTask("", stringTokenizer.countTokens() + 4); //$NON-NLS-1$
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_CreateTargetFile_message")); //$NON-NLS-1$
|
||||
IFolder sourceContainer = project.getFolder("src");
|
||||
|
||||
IContainer sourceContainer = (IContainer) sourcePackageFragmentRoot.getCorrespondingResource();
|
||||
while (stringTokenizer.hasMoreElements()) {
|
||||
String folderName = stringTokenizer.nextToken();
|
||||
sourceContainer = sourceContainer.getFolder(new Path(folderName));
|
||||
if (!sourceContainer.exists()) {
|
||||
try {
|
||||
sourceContainer.create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
((IFolder) sourceContainer).create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean needRebuild = true;
|
||||
IFile targetFile = sourceContainer.getFile(new Path(jetCompiler.getSkeleton().getClassName() + ".java")); //$NON-NLS-1$
|
||||
if (!targetFile.exists()) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.create(contents, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} else {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
DataInputStream dis = new DataInputStream(targetFile.getContents());
|
||||
int len = 0;
|
||||
byte[] buf = new byte[1024];
|
||||
while (((len = dis.read(buf))) != -1) {
|
||||
baos.write(buf, 0, len);
|
||||
}
|
||||
dis.close();
|
||||
|
||||
String currentContent = baos.toString();
|
||||
String newContent = outputStream.toString();
|
||||
// since the build is done on linux, if use windows, it will use different rules for \r + \n
|
||||
// so compare without \r, at least to see if original string is the same
|
||||
// if yes, consider all is ok, no need to replace the content and recompile
|
||||
currentContent = currentContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
|
||||
newContent = newContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
|
||||
if (!newContent.equals(currentContent)) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} else {
|
||||
needRebuild = false;
|
||||
}
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
}
|
||||
|
||||
// if jetEmitter.getMethod() == null, means the class file doesn't exist anymore
|
||||
// it should be impossible to have only the class file deleted and the .java never modified, but still
|
||||
// handle this case.
|
||||
if (needRebuild || jetEmitter.getMethod() == null) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
|
||||
if (!ComponentCompilations.getMarkers()) {
|
||||
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
}
|
||||
|
||||
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
|
||||
boolean errors = false;
|
||||
for (int i = 0; i < markers.length; ++i) {
|
||||
IMarker marker = markers[i];
|
||||
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
|
||||
errors = true;
|
||||
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
|
||||
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
|
||||
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
|
||||
+ Messages.getString(
|
||||
"TalendJetEmitter.compileFail", //$NON-NLS-1$
|
||||
marker.getAttribute(IMarker.MESSAGE),
|
||||
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
|
||||
}
|
||||
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
|
||||
boolean errors = false;
|
||||
for (int i = 0; i < markers.length; ++i) {
|
||||
IMarker marker = markers[i];
|
||||
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
|
||||
errors = true;
|
||||
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
|
||||
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
|
||||
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
|
||||
+ Messages.getString(
|
||||
"TalendJetEmitter.compileFail", //$NON-NLS-1$
|
||||
marker.getAttribute(IMarker.MESSAGE),
|
||||
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
|
||||
}
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
|
||||
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
|
||||
if (!errors) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
|
||||
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
|
||||
|
||||
// Construct a proper URL for relative lookup.
|
||||
//
|
||||
URL url = new File(project.getLocation()
|
||||
+ "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.toURL();
|
||||
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
|
||||
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ jetCompiler.getSkeleton().getClassName());
|
||||
String methodName = jetCompiler.getSkeleton().getMethodName();
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
jetEmitter.setMethod(methods[i]);
|
||||
break;
|
||||
}
|
||||
// Construct a proper URL for relative lookup.
|
||||
//
|
||||
URL url = new File(project.getLocation() + "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.toURL();
|
||||
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
|
||||
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ jetCompiler.getSkeleton().getClassName());
|
||||
String methodName = jetCompiler.getSkeleton().getMethodName();
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
jetEmitter.setMethod(methods[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subProgressMonitor.done();
|
||||
} catch (CoreException exception) {
|
||||
TalendDebugHandler.debug(exception);
|
||||
|
||||
@@ -620,16 +620,11 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
} catch (Error e) {
|
||||
throw new ClassNotFoundException(e.getMessage(), e);
|
||||
}
|
||||
// TDI-23079
|
||||
try {
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
return methods[i];
|
||||
}
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
return methods[i];
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
RefreshComponenentsAction.Label=Componentenlijst verversen
|
||||
@@ -1,7 +1,6 @@
|
||||
ExchangeView.Exchange=Exchange
|
||||
AvailableExtensionsComposite.ExtensionName=Nom de l'extension
|
||||
AvailableExtensionsComposite.Version=Version
|
||||
AvailableExtensionsComposite.Rating=Note
|
||||
AvailableExtensionsComposite.Author=Auteur
|
||||
AvailableExtensionsComposite.ViewDetail.installOperateStatus=Installer
|
||||
AvailableExtensionsComposite.ViewDetail.WriteReview=Donnez votre avis
|
||||
@@ -10,7 +9,6 @@ DownloadedExtensionsComposite.DownloadedVersion=Version t
|
||||
DownloadedExtensionsComposite.DownloadDate=Date de téléchargement
|
||||
DownloadedExtensionsComposite.installedOperateStatus=Installé
|
||||
DownloadedExtensionsComposite.updateOperateStatus=Mettre à jour
|
||||
MyExtensionsComposite.Version=Version
|
||||
MyExtensionsComposite.UploadDate=Date du chargement
|
||||
MyExtensionsComposite.AddNewExtensionTitle=Ajouter une nouvelle extension
|
||||
MyExtensionsComposite.UpLoadNewVersionOperateStatus=Charger une nouvelle version
|
||||
@@ -21,7 +19,6 @@ MyExtensionsComposite.Form.ExtensionTitle=Titre de l'extension
|
||||
MyExtensionsComposite.Form.InitialVersion=Version initiale
|
||||
MyExtensionsComposite.Form.Compatibility=Compatibilité
|
||||
MyExtensionsComposite.Form.Compatibility.AllVersions=Toutes les versions
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Version
|
||||
MyExtensionsComposite.Form.Compatibility.AllVersionsExcept=Toutes les versions sauf :
|
||||
MyExtensionsComposite.Form.Compatibility.OnlyTheseVersions=Uniquement ces versions :
|
||||
MyExtensionsComposite.Form.Description=Description
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
DownloadedExtensionsComposite.updateOperateStatus=Update
|
||||
MyExtensionsComposite.UpdateOperateStatus=Update
|
||||
MyExtensionsComposite.ModifyOperateStatus=Wijzigen
|
||||
MyExtensionsComposite.DeleteOperateStatus=Verwijderen
|
||||
MyExtensionsComposite.Form.Upload.Browse=Blader...
|
||||
RefreshJob.FindExtensions.Title=Beschikbare extensies zoeken
|
||||
RefreshJob.FindExtensions.Message=Extensies zoeken op Exchange...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
DownloadedExtensionsComposite.updateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.UpdateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.DeleteOperateStatus=DELETE
|
||||
ImportExchangeDialog.TEMPLATES_BUTTON=SQL \u0161abloni
|
||||
ImportExchangeDialog.REFRESH_BUTTON=Osve\u017Eavanje
|
||||
|
||||
@@ -75,16 +75,14 @@ public class ExchangeComponentsProvider extends AbstractComponentsProvider {
|
||||
private void copyFolder(File externalComponentsLocation, File installFolder) throws IOException {
|
||||
FileFilter folderFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File file) {
|
||||
return file.isDirectory();
|
||||
}
|
||||
};
|
||||
FileFilter ff = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File pathname) {
|
||||
if (FilesUtils.isSVNFolder(pathname)) {
|
||||
if (pathname.getName().equals(".svn")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.components.exchange.jobs;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.designer.components.exchange.util.ExchangeWebService;
|
||||
|
||||
import us.monoid.json.JSONObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC hcyi class global comment. Detailled comment
|
||||
*/
|
||||
public class ComponentDownloader {
|
||||
|
||||
private List<DownloadListener> fListeners = new ArrayList<DownloadListener>();
|
||||
|
||||
private boolean fCancel = false;
|
||||
|
||||
private static final int BUFFER_SIZE = 8192;
|
||||
|
||||
/**
|
||||
* Download file from specific url to local folder.
|
||||
*
|
||||
* @param componentUrl The file url to download
|
||||
* @param targetFolder Local folder to store downloaded file
|
||||
* @throws Exception
|
||||
*/
|
||||
public void download(String componentUrl, String targetFolder) throws Exception {
|
||||
String fileName = componentUrl.substring(componentUrl.lastIndexOf('/'));
|
||||
File destination = new File(targetFolder + fileName);
|
||||
URL url = new URL(componentUrl);
|
||||
|
||||
download(url, destination);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download file from specific url.
|
||||
*
|
||||
* @param componentUrl The file url to download
|
||||
* @param destination The local file to be saved
|
||||
* @throws Exception
|
||||
*/
|
||||
public void download(URL componentUrl, File destination) throws Exception {
|
||||
BufferedInputStream bis = null;
|
||||
BufferedOutputStream bos = null;
|
||||
try {
|
||||
|
||||
URLConnection connection = componentUrl.openConnection();
|
||||
|
||||
bis = new BufferedInputStream(connection.getInputStream());
|
||||
bos = new BufferedOutputStream(new FileOutputStream(destination));
|
||||
fireDownloadStart(connection.getContentLength());
|
||||
|
||||
byte[] buf = new byte[BUFFER_SIZE];
|
||||
int bytesDownloaded = 0;
|
||||
int bytesRead = -1;
|
||||
while ((bytesRead = bis.read(buf)) != -1) {
|
||||
bos.write(buf, 0, bytesRead);
|
||||
bytesDownloaded += bytesRead;
|
||||
|
||||
fireDownloadProgress(bytesRead);
|
||||
if (fCancel) {
|
||||
// cacel download process
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bos.flush();
|
||||
// System.out.println(bytesDownloaded);
|
||||
fireDownloadComplete();
|
||||
} finally {
|
||||
Exception e = null;
|
||||
if (bis != null) {
|
||||
try {
|
||||
bis.close();
|
||||
} catch (IOException ioe) {
|
||||
e = ioe;
|
||||
}
|
||||
}
|
||||
if (bos != null) {
|
||||
try {
|
||||
bos.close();
|
||||
} catch (IOException ioe) {
|
||||
e = ioe;
|
||||
}
|
||||
}
|
||||
if (e != null) {
|
||||
// rethrow the exception to caller
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the user cancel download process.
|
||||
*
|
||||
* @return the cancel
|
||||
*/
|
||||
public boolean isCancel() {
|
||||
return fCancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set true if the user cacel download process.
|
||||
*
|
||||
* @param cancel the cancel to set
|
||||
*/
|
||||
public void setCancel(boolean cancel) {
|
||||
fCancel = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify listeners about progress.
|
||||
*
|
||||
* @param bytesRead
|
||||
*/
|
||||
private void fireDownloadProgress(int bytesRead) {
|
||||
for (DownloadListener listener : fListeners) {
|
||||
listener.downloadProgress(this, bytesRead);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify listeners at the end of download process.
|
||||
*/
|
||||
private void fireDownloadComplete() {
|
||||
for (DownloadListener listener : fListeners) {
|
||||
listener.downloadComplete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify listeners at the begining of download process.
|
||||
*/
|
||||
private void fireDownloadStart(int contentLength) {
|
||||
for (DownloadListener listener : fListeners) {
|
||||
listener.downloadStart(contentLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add listener to observe the download process.
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
public void addDownloadListener(DownloadListener listener) {
|
||||
fListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeDownloadListener(DownloadListener listener) {
|
||||
fListeners.remove(listener);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
new ComponentDownloader().download("http://talendforge.org/ext/upload/extension-33/revision-45/tFileOutputPDF.zip", //$NON-NLS-1$
|
||||
"d:/temp"); //$NON-NLS-1$
|
||||
} catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.components.exchange.jobs;
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC hcyi class global comment. Detailled comment
|
||||
*/
|
||||
public interface DownloadListener {
|
||||
|
||||
/**
|
||||
* Notify before download start.
|
||||
*
|
||||
* @param totalSize The size of file.
|
||||
*/
|
||||
void downloadStart(int totalSize);
|
||||
|
||||
/**
|
||||
* Notify when download progress. DOC hcw Comment method "downloadProgress".
|
||||
*
|
||||
* @param downloader The source that trigger this event.
|
||||
* @param bytesDownloaded The number of bytes that have readed just now.
|
||||
*/
|
||||
void downloadProgress(ComponentDownloader downloader, int bytesDownloaded);
|
||||
|
||||
/**
|
||||
* Notify after download complete.
|
||||
*/
|
||||
void downloadComplete();
|
||||
|
||||
}
|
||||
@@ -42,8 +42,6 @@ import org.eclipse.ui.intro.config.IIntroAction;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.download.DownloadHelper;
|
||||
import org.talend.core.download.DownloadListener;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.components.ComponentUtilities;
|
||||
@@ -53,7 +51,9 @@ import org.talend.designer.codegen.ICodeGeneratorService;
|
||||
import org.talend.designer.components.exchange.ExchangeComponentsProvider;
|
||||
import org.talend.designer.components.exchange.ExchangeConstants;
|
||||
import org.talend.designer.components.exchange.i18n.Messages;
|
||||
import org.talend.designer.components.exchange.jobs.ComponentDownloader;
|
||||
import org.talend.designer.components.exchange.jobs.ComponentInstaller;
|
||||
import org.talend.designer.components.exchange.jobs.DownloadListener;
|
||||
import org.talend.designer.components.exchange.model.ComponentExtension;
|
||||
import org.talend.designer.components.exchange.ui.htmlcontent.ContentConstants;
|
||||
import org.talend.designer.components.exchange.ui.views.ExchangeManager;
|
||||
@@ -288,7 +288,7 @@ public class DownloadComponenentsAction extends Action implements IIntroAction {
|
||||
URL url = new URL(downloadUrl);
|
||||
|
||||
monitor.setTaskName(ExchangeConstants.getDownloadTaskNameLable() + url.toString());
|
||||
DownloadHelper downloader = new DownloadHelper();
|
||||
ComponentDownloader downloader = new ComponentDownloader();
|
||||
downloader.addDownloadListener(this);
|
||||
// block until download complete
|
||||
downloader.download(url, localZipFile);
|
||||
@@ -339,7 +339,7 @@ public class DownloadComponenentsAction extends Action implements IIntroAction {
|
||||
public void downloadComplete() {
|
||||
}
|
||||
|
||||
public void downloadProgress(DownloadHelper downloader, int bytesRead) {
|
||||
public void downloadProgress(ComponentDownloader downloader, int bytesRead) {
|
||||
if (fMonitor.isCanceled()) {
|
||||
// cancel download
|
||||
downloader.setCancel(true);
|
||||
|
||||
@@ -50,9 +50,9 @@ import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.download.DownloadHelper;
|
||||
import org.talend.designer.components.exchange.ExchangePlugin;
|
||||
import org.talend.designer.components.exchange.i18n.Messages;
|
||||
import org.talend.designer.components.exchange.jobs.ComponentDownloader;
|
||||
import org.talend.designer.components.exchange.jobs.ComponentSearcher;
|
||||
import org.talend.designer.components.exchange.model.ComponentExtension;
|
||||
import org.talend.designer.components.exchange.model.VersionRevision;
|
||||
@@ -182,7 +182,7 @@ public class ImportExchangeDialog extends Dialog {
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
new DownloadHelper().download(url, tempFile);
|
||||
new ComponentDownloader().download(url, tempFile);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="org.talend.designer.components.libs" default="process" basedir=".">
|
||||
|
||||
<property name="component.plugin.home" value="../../../org.talend.designer.components.localprovider/components" />
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
<!-- modification 1: config -->
|
||||
<property name="jar.name" value="cobolX.jar" />
|
||||
<property name="component.name" value="tFileInputEBCDIC" />
|
||||
<property name="author.name" value="jjzhou" />
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
<path id="compile.classpath">
|
||||
</path>
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
|
||||
<!-- sourcecode and final jar path -->
|
||||
<property name="source.home" value="." />
|
||||
<property name="jar.home" value="${component.plugin.home}/${component.name}/${jar.name}" />
|
||||
|
||||
<!-- temp dir for clasee files -->
|
||||
<property name="build.dir" value="../../build" />
|
||||
|
||||
<!-- compile option -->
|
||||
<property name="compile.debug" value="true" />
|
||||
<property name="compile.deprecation" value="false" />
|
||||
<property name="compile.optimize" value="true" />
|
||||
|
||||
|
||||
<target name="process" description="prepare a temp dir">
|
||||
<antcall target="prepare" />
|
||||
<antcall target="compile" />
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
|
||||
<target name="prepare" description="prepare a temp dir">
|
||||
<delete dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}/classes" />
|
||||
</target>
|
||||
|
||||
<target name="compile" description="Compile Java sources">
|
||||
|
||||
<!-- compile -->
|
||||
<javac srcdir="${source.home}" destdir="${build.dir}/classes" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}">
|
||||
<classpath refid="compile.classpath" />
|
||||
</javac>
|
||||
|
||||
<!-- include source code -->
|
||||
<copy todir="${build.dir}/classes">
|
||||
<fileset dir="${source.home}">
|
||||
<exclude name="build.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- make jar -->
|
||||
<tstamp>
|
||||
<format property="date" pattern="yyyy-MM-dd HH:mm:ss" />
|
||||
</tstamp>
|
||||
|
||||
<jar destfile="${build.dir}/${jar.name}" basedir="${build.dir}/classes">
|
||||
<manifest>
|
||||
<!-- who -->
|
||||
<attribute name="Built-By" value="${author.name}" />
|
||||
<!-- when -->
|
||||
<attribute name="Built-Date" value="${date}"/>
|
||||
<!-- JDK version -->
|
||||
<attribute name="Created-By" value="${java.version} (${java.vendor})" />
|
||||
<!-- Information about the program itself -->
|
||||
<attribute name="Implementation-Vendor" value="Talend SA" />
|
||||
<attribute name="Implementation-Title" value="${jar.name}" />
|
||||
<attribute name="Implementation-Version" value="1.0" />
|
||||
</manifest>
|
||||
</jar>
|
||||
|
||||
<!-- move jar -->
|
||||
<move file="${build.dir}/${jar.name}" tofile="${jar.home}" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="clean" description="clean the temp dir">
|
||||
<delete dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}" />
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,57 +0,0 @@
|
||||
package cobolConversion;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public enum CharSetEnum {
|
||||
// define data table for using
|
||||
Cp037("Cp037", "{ABCDEFGHI", "}JKLMNOPQR"), Cp273("Cp273", "äABCDEFGHI",
|
||||
"üJKLMNOPQR"), Cp277("Cp277", "æABCDEFGHI", "åJKLMNOPQR"), Cp278(
|
||||
"Cp278", "äABCDEFGHI", "åJKLMNOPQR"), Cp280("Cp280", "àABCDEFGHI",
|
||||
"èJKLMNOPQR"), Cp284("Cp284", "{ABCDEFGHI", "}JKLMNOPQR"), Cp285(
|
||||
"Cp285", "{ABCDEFGHI", "}JKLMNOPQR"), Cp297("Cp297", "éABCDEFGHI",
|
||||
"èJKLMNOPQR"), Cp420("Cp420", "{ABCDEFGHI", "}JKLMNOPQR"), Cp424(
|
||||
"Cp424", "{ABCDEFGHI", "}JKLMNOPQR"), Cp500("Cp500", "{ABCDEFGHI",
|
||||
"}JKLMNOPQR"), Cp870("Cp870", "{ABCDEFGHI", "}JKLMNOPQR"), Cp871(
|
||||
"Cp871", "þABCDEFGHI", "æJKLMNOPQR"), Cp875("Cp875", "{ABCDEFGHI",
|
||||
"}JKLMNOPQR"), Cp1025("Cp1025", "{ABCDEFGHI", "}JKLMNOPQR"), Cp1026(
|
||||
"Cp1026", "çABCDEFGHI", "ğJKLMNOPQR"), Cp1047("Cp1047",
|
||||
"{ABCDEFGHI", "}JKLMNOPQR"), Cp1112("Cp1112", "{ABCDEFGHI",
|
||||
"}JKLMNOPQR"), Cp1122("Cp1122", "äABCDEFGHI", "ğJKLMNOPQR"), Cp1123(
|
||||
"Cp1123", "{ABCDEFGHI", "}JKLMNOPQR"), Cp1140("Cp1140",
|
||||
"{ABCDEFGHI", "}JKLMNOPQR"), Cp1141("Cp1141", "äABCDEFGHI",
|
||||
"üJKLMNOPQR"), Cp1142("Cp1142", "æABCDEFGHI", "åJKLMNOPQR"), Cp1143(
|
||||
"Cp1143", "äABCDEFGHI", "åJKLMNOPQR"), Cp1144("Cp1144",
|
||||
"àABCDEFGHI", "èJKLMNOPQR"), Cp1145("Cp1145", "{ABCDEFGHI",
|
||||
"}JKLMNOPQR"), Cp1146("Cp1146", "{ABCDEFGHI", "}JKLMNOPQR"), Cp1147(
|
||||
"Cp1147", "éABCDEFGHI", "èJKLMNOPQR"), Cp1148("Cp1148",
|
||||
"{ABCDEFGHI", "}JKLMNOPQR"), Cp1149("Cp1149", "þABCDEFGHI",
|
||||
"æJKLMNOPQR");
|
||||
|
||||
String charSet;
|
||||
String failoverpositives;
|
||||
String failovernegatives;
|
||||
|
||||
//default construct
|
||||
CharSetEnum(String charSet, String failoverpositives,
|
||||
String failovernegatives) {
|
||||
this.charSet = charSet;
|
||||
this.failoverpositives = failoverpositives;
|
||||
this.failovernegatives = failovernegatives;
|
||||
}
|
||||
|
||||
public String getCharSet() {
|
||||
return charSet;
|
||||
}
|
||||
|
||||
public static void main(String[] a) {
|
||||
String charset = "Cp037";
|
||||
System.out.println(Charset.defaultCharset());
|
||||
for (CharSetEnum charsetEnum : CharSetEnum.values()) {
|
||||
if (charset.equals(charsetEnum.getCharSet())) {
|
||||
System.out.println(charsetEnum.failoverpositives);
|
||||
System.out.println(charsetEnum.failovernegatives);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package cobolConversion;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.commons.lang.mutable.MutableInt;
|
||||
|
||||
public class EBCDICType3 {
|
||||
|
||||
public static BigDecimal readType3Value(byte[] byteValue, int decimal,
|
||||
boolean isImpliedDecimal) throws Exception {
|
||||
int len = byteValue.length;
|
||||
StringBuffer strbuf = new StringBuffer();
|
||||
int tmp;
|
||||
int tmp1;
|
||||
int tmp2;
|
||||
for (int i = 0; i < len; i++) {
|
||||
tmp = byteValue[i];
|
||||
tmp1 = tmp & 0xF0;
|
||||
tmp2 = tmp1 >> 4;
|
||||
strbuf.append(tmp2);
|
||||
|
||||
if (i < (len - 1)) {
|
||||
tmp = byteValue[i];
|
||||
tmp1 = tmp & 0x0F;
|
||||
strbuf.append(tmp1);
|
||||
}
|
||||
}
|
||||
|
||||
if ((decimal > 0) && isImpliedDecimal) {
|
||||
strbuf.insert(strbuf.length() - decimal, '.');
|
||||
}
|
||||
|
||||
BigDecimal retVal;
|
||||
|
||||
try {
|
||||
retVal = new BigDecimal(strbuf.toString());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
tmp = byteValue[len - 1];
|
||||
tmp1 = tmp & 0x0F;
|
||||
|
||||
if ((tmp1 == 0x0F) || (tmp1 == 0x0C)) {
|
||||
return retVal;
|
||||
} else if (tmp1 == 0x0D) {
|
||||
return retVal.negate();
|
||||
} else {
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] writeType3Value(int length, int decimal,
|
||||
BigDecimal value, boolean isSigned) throws Exception {
|
||||
|
||||
if (decimal != value.scale()) {
|
||||
BigDecimal tmp = value.setScale(decimal, BigDecimal.ROUND_FLOOR);
|
||||
value = tmp;
|
||||
}
|
||||
|
||||
String str = value.toPlainString();
|
||||
int len = str.length();
|
||||
byte[] buf = new byte[length];
|
||||
MutableInt k = new MutableInt(len);
|
||||
byte even; // left and right nibble ( we go from right to left )
|
||||
byte odd;
|
||||
|
||||
for (int i = length - 1; i >= 0; i--) {
|
||||
// Last byte needs sign nibble
|
||||
if (i == (length - 1)) {
|
||||
even = getNextByte(str, k);
|
||||
|
||||
if (isSigned) {
|
||||
if (value.signum() >= 0) {
|
||||
odd = 0x0C;
|
||||
} else {
|
||||
odd = 0x0D;
|
||||
}
|
||||
} else {
|
||||
odd = (byte) 0x0F;
|
||||
}
|
||||
} else {
|
||||
// Packing rest of the digits...
|
||||
// Get even digit if exist or zero
|
||||
odd = getNextByte(str, k);
|
||||
even = getNextByte(str, k);
|
||||
}
|
||||
|
||||
buf[i] = (byte) ((even << 4) | odd);
|
||||
}
|
||||
|
||||
// TODO: Check if str ">" buf and eventually throw an Exc.
|
||||
return buf;
|
||||
}
|
||||
|
||||
private static byte getNextByte(String number, MutableInt recentlyReturned) {
|
||||
MutableInt zero = new MutableInt(0);
|
||||
recentlyReturned.decrement();
|
||||
|
||||
if (recentlyReturned.compareTo(zero) >= 0) {
|
||||
while (!"0123456789".contains(String.valueOf(number
|
||||
.charAt(recentlyReturned.intValue())))) {
|
||||
recentlyReturned.decrement();
|
||||
|
||||
if (recentlyReturned.compareTo(zero) < 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (byte) (Character.getNumericValue(number
|
||||
.charAt(recentlyReturned.intValue())));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
package cobolConversion;
|
||||
import java.math.BigDecimal;
|
||||
import cobolConversion.CharSetEnum;
|
||||
|
||||
public class EBCDICType9 {
|
||||
|
||||
public static byte[] writeType9Value(int length, int decimal, BigDecimal value,
|
||||
boolean isSigned, boolean isImpliedDecimal,String charset) throws Exception {
|
||||
|
||||
byte[] reValue = null;
|
||||
String failoverpositives = "{ABCDEFGHI";
|
||||
String failovernegatives = "}JKLMNOPQR";
|
||||
if (decimal != value.scale()) {
|
||||
BigDecimal tmp = value.setScale(decimal, BigDecimal.ROUND_FLOOR);
|
||||
value = tmp;
|
||||
}
|
||||
|
||||
String str = value.toPlainString();
|
||||
StringBuffer buf = new StringBuffer(str);
|
||||
|
||||
// Modify byte with sign ...
|
||||
if (isSigned) {
|
||||
int lastidx = buf.length() - 1;
|
||||
char lastbyte = buf.charAt(lastidx);
|
||||
char repl;
|
||||
for (CharSetEnum charsetEnum : CharSetEnum.values()){
|
||||
if(charset.equals(charsetEnum.getCharSet())){
|
||||
failoverpositives = charsetEnum.failoverpositives;
|
||||
failovernegatives = charsetEnum.failovernegatives;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (value.signum() >= 0) {
|
||||
repl = failoverpositives.charAt(Integer.parseInt(String
|
||||
.valueOf(lastbyte)));
|
||||
} else {
|
||||
repl = failovernegatives.charAt(Integer.parseInt(String
|
||||
.valueOf(lastbyte)));
|
||||
}
|
||||
|
||||
buf.setCharAt(lastidx, repl);
|
||||
|
||||
// Delete sign char
|
||||
String tmp = buf.toString();
|
||||
String tmp2 = tmp.replace("-", "");
|
||||
buf = new StringBuffer(tmp2);
|
||||
}
|
||||
|
||||
// Delete decimal point...
|
||||
if (isImpliedDecimal) {
|
||||
String tmp = buf.toString();
|
||||
String tmp2 = tmp.replace(".", "");
|
||||
buf = new StringBuffer(tmp2);
|
||||
}
|
||||
|
||||
// Adding some leading zeros ...
|
||||
while (length > buf.length()) {
|
||||
buf.insert(0, "0");
|
||||
}
|
||||
reValue = buf.toString().getBytes(charset);
|
||||
return reValue;
|
||||
}
|
||||
|
||||
|
||||
public static BigDecimal readType9Value(byte[] byteValue,int decimal,boolean isImpliedDecimal,String charset) throws Exception{
|
||||
|
||||
byte[] b = byteValue;
|
||||
String failoverpositives = "{ABCDEFGHI";
|
||||
String failovernegatives = "}JKLMNOPQR";
|
||||
int idx;
|
||||
char[] pos = { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9 };
|
||||
char[] neg = { 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9 };
|
||||
String IBMpositives = new String(pos);
|
||||
String IBMnegatives = new String(neg);
|
||||
String MFnegatives = "pqrstuvwxy";
|
||||
String CAnegatives = " !\"#$%&'()";
|
||||
for (CharSetEnum charsetEnum : CharSetEnum.values()){
|
||||
if(charset.equals(charsetEnum.getCharSet())){
|
||||
failoverpositives = charsetEnum.failoverpositives;
|
||||
failovernegatives = charsetEnum.failovernegatives;
|
||||
break;
|
||||
}
|
||||
}
|
||||
StringBuffer buf = new StringBuffer(new String(b, charset));
|
||||
int lastidx = buf.length() - 1;
|
||||
char lastbyte = buf.charAt(lastidx);
|
||||
boolean positive = true;
|
||||
|
||||
idx = IBMpositives.indexOf(lastbyte);
|
||||
if (idx > -1) {
|
||||
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
|
||||
positive = true;
|
||||
}
|
||||
|
||||
idx = IBMnegatives.indexOf(lastbyte);
|
||||
if (idx > -1) {
|
||||
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
|
||||
positive = false;
|
||||
}
|
||||
|
||||
idx = failoverpositives.indexOf(lastbyte);
|
||||
if (idx > -1) {
|
||||
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
|
||||
positive = true;
|
||||
}
|
||||
|
||||
idx = failovernegatives.indexOf(lastbyte);
|
||||
if (idx > -1) {
|
||||
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
|
||||
positive = false;
|
||||
|
||||
}
|
||||
|
||||
idx = MFnegatives.indexOf(lastbyte);
|
||||
if (idx > -1) {
|
||||
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
|
||||
positive = false;
|
||||
}
|
||||
|
||||
idx = CAnegatives.indexOf(lastbyte);
|
||||
if (idx > -1) {
|
||||
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
|
||||
positive = false;
|
||||
}
|
||||
|
||||
if ((decimal > 0) && isImpliedDecimal) {
|
||||
buf.insert(buf.length() - decimal, '.');
|
||||
}
|
||||
|
||||
BigDecimal retVal;
|
||||
|
||||
try {
|
||||
retVal = new BigDecimal(buf.toString());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
if (!positive) {
|
||||
retVal = retVal.negate();
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
package org.talend.datastewardship.server.ws;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlSchemaType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Java class for deleteTasks complex type.
|
||||
*
|
||||
* <p>
|
||||
* The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="deleteTasks">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="typeId" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
|
||||
* <element name="owner" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="tagLabel" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="createTimeLowerBound" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
|
||||
* <element name="createTimeUpperBound" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
|
||||
* <element name="starNum" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
|
||||
* <element name="limit" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "deleteTasks", propOrder = { "typeId", "owner", "tagLabel", "createTimeLowerBound", "createTimeUpperBound",
|
||||
"starNum", "limit", "status" })
|
||||
public class DeleteTasks {
|
||||
|
||||
protected Integer typeId;
|
||||
|
||||
protected String owner;
|
||||
|
||||
protected String tagLabel;
|
||||
|
||||
@XmlSchemaType(name = "dateTime")
|
||||
protected XMLGregorianCalendar createTimeLowerBound;
|
||||
|
||||
@XmlSchemaType(name = "dateTime")
|
||||
protected XMLGregorianCalendar createTimeUpperBound;
|
||||
|
||||
protected Integer starNum;
|
||||
|
||||
protected int limit;
|
||||
|
||||
protected String status;
|
||||
|
||||
/**
|
||||
* Gets the value of the typeId property.
|
||||
*
|
||||
* @return possible object is {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the typeId property.
|
||||
*
|
||||
* @param value allowed object is {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setTypeId(Integer value) {
|
||||
this.typeId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the owner property.
|
||||
*
|
||||
* @return possible object is {@link String }
|
||||
*
|
||||
*/
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the owner property.
|
||||
*
|
||||
* @param value allowed object is {@link String }
|
||||
*
|
||||
*/
|
||||
public void setOwner(String value) {
|
||||
this.owner = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the tagLabel property.
|
||||
*
|
||||
* @return possible object is {@link String }
|
||||
*
|
||||
*/
|
||||
public String getTagLabel() {
|
||||
return tagLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the tagLabel property.
|
||||
*
|
||||
* @param value allowed object is {@link String }
|
||||
*
|
||||
*/
|
||||
public void setTagLabel(String value) {
|
||||
this.tagLabel = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the createTimeLowerBound property.
|
||||
*
|
||||
* @return possible object is {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public XMLGregorianCalendar getCreateTimeLowerBound() {
|
||||
return createTimeLowerBound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the createTimeLowerBound property.
|
||||
*
|
||||
* @param value allowed object is {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public void setCreateTimeLowerBound(XMLGregorianCalendar value) {
|
||||
this.createTimeLowerBound = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the createTimeUpperBound property.
|
||||
*
|
||||
* @return possible object is {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public XMLGregorianCalendar getCreateTimeUpperBound() {
|
||||
return createTimeUpperBound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the createTimeUpperBound property.
|
||||
*
|
||||
* @param value allowed object is {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public void setCreateTimeUpperBound(XMLGregorianCalendar value) {
|
||||
this.createTimeUpperBound = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the starNum property.
|
||||
*
|
||||
* @return possible object is {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getStarNum() {
|
||||
return starNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the starNum property.
|
||||
*
|
||||
* @param value allowed object is {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setStarNum(Integer value) {
|
||||
this.starNum = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the limit property.
|
||||
*
|
||||
*/
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the limit property.
|
||||
*
|
||||
*/
|
||||
public void setLimit(int value) {
|
||||
this.limit = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the status property.
|
||||
*
|
||||
* @return possible object is {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the status property.
|
||||
*
|
||||
* @param value allowed object is {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStatus(String value) {
|
||||
this.status = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package org.talend.datastewardship.server.ws;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Java class for deleteTasksResponse complex type.
|
||||
*
|
||||
* <p>
|
||||
* The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="deleteTasksResponse">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="return" type="{http://jaxb.dev.java.net/array}int" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "deleteTasksResponse", propOrder = { "_return" })
|
||||
public class DeleteTasksResponse {
|
||||
|
||||
@XmlElement(name = "return")
|
||||
protected int _return;
|
||||
|
||||
/**
|
||||
* Gets the value of the return property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to
|
||||
* the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for
|
||||
* the return property.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public int getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the return property.
|
||||
*
|
||||
*/
|
||||
public void setReturn(int value) {
|
||||
this._return = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,10 +27,8 @@ public class ObjectFactory {
|
||||
private final static QName _GetTgtRecord_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getTgtRecord");
|
||||
private final static QName _Echo_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "echo");
|
||||
private final static QName _EchoResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "echoResponse");
|
||||
private final static QName _DeleteTasksResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/","deleteTasksResponse");
|
||||
private final static QName _GetSrcRecord_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getSrcRecord");
|
||||
private final static QName _GetTgtRecordResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getTgtRecordResponse");
|
||||
private final static QName _DeleteTasks_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "deleteTasks");
|
||||
private final static QName _SearchTasks_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "searchTasks");
|
||||
private final static QName _GetSrcRecordResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getSrcRecordResponse");
|
||||
private final static QName _SearchTasksResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "searchTasksResponse");
|
||||
@@ -149,15 +147,6 @@ public class ObjectFactory {
|
||||
return new JAXBElement<EchoResponse>(_EchoResponse_QNAME, EchoResponse.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link DeleteTasksResponse }{@code >}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://ws.server.datastewardship.talend.org/", name = "deleteTasksResponse")
|
||||
public JAXBElement<DeleteTasksResponse> createDeleteTasksResponse(DeleteTasksResponse value) {
|
||||
return new JAXBElement<DeleteTasksResponse>(_DeleteTasksResponse_QNAME, DeleteTasksResponse.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link GetSrcRecord }{@code >}}
|
||||
*
|
||||
@@ -185,15 +174,6 @@ public class ObjectFactory {
|
||||
return new JAXBElement<SearchTasks>(_SearchTasks_QNAME, SearchTasks.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link DeleteTasks }{@code >}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://ws.server.datastewardship.talend.org/", name = "deleteTasks")
|
||||
public JAXBElement<DeleteTasks> createDeleteTasks(DeleteTasks value) {
|
||||
return new JAXBElement<DeleteTasks>(_DeleteTasks_QNAME, DeleteTasks.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link GetSrcRecordResponse }{@code >}}
|
||||
*
|
||||
|
||||
@@ -68,27 +68,4 @@ public interface TDSCWS {
|
||||
@WebParam(name = "taskID", targetNamespace = "")
|
||||
java.lang.String taskID
|
||||
);
|
||||
|
||||
@WebResult(name = "return", targetNamespace = "")
|
||||
@RequestWrapper(localName = "deleteTasks", targetNamespace = "http://ws.server.datastewardship.talend.org/", className = "org.talend.datastewardship.server.ws.DeleteTasks")
|
||||
@WebMethod
|
||||
@ResponseWrapper(localName = "deleteTasksResponse", targetNamespace = "http://ws.server.datastewardship.talend.org/", className = "org.talend.datastewardship.server.ws.DeleteTasksResponse")
|
||||
public int deleteTasks(
|
||||
@WebParam(name = "typeId", targetNamespace = "")
|
||||
java.lang.Integer typeId,
|
||||
@WebParam(name = "owner", targetNamespace = "")
|
||||
java.lang.String owner,
|
||||
@WebParam(name = "tagLabel", targetNamespace = "")
|
||||
java.lang.String tagLabel,
|
||||
@WebParam(name = "createTimeLowerBound", targetNamespace = "")
|
||||
javax.xml.datatype.XMLGregorianCalendar createTimeLowerBound,
|
||||
@WebParam(name = "createTimeUpperBound", targetNamespace = "")
|
||||
javax.xml.datatype.XMLGregorianCalendar createTimeUpperBound,
|
||||
@WebParam(name = "starNum", targetNamespace = "")
|
||||
java.lang.Integer starNum,
|
||||
@WebParam(name = "limit", targetNamespace = "")
|
||||
int limit,
|
||||
@WebParam(name = "status", targetNamespace = "")
|
||||
java.lang.String status
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.talend.xml.sax;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -12,6 +11,12 @@ import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.talend.xml.sax.FunctionRegister;
|
||||
import org.talend.xml.sax.LoopEntry;
|
||||
import org.talend.xml.sax.SAXLoopCompositeHandler;
|
||||
import org.talend.xml.sax.SAXLoopHandler;
|
||||
import org.talend.xml.sax.SAXLoopIterator;
|
||||
import org.talend.xml.sax.SAXMultiLoopIterator;
|
||||
import org.talend.xml.sax.commons.ISAXLooper;
|
||||
import org.talend.xml.sax.function.inter.Function;
|
||||
import org.talend.xml.sax.io.UnicodeReader;
|
||||
@@ -137,7 +142,6 @@ public class ComplexSAXLooper implements ISAXLooper {
|
||||
*/
|
||||
public void parse(String fileURL, String charset) {
|
||||
this.charset = charset;
|
||||
Reader reader = null;
|
||||
try {
|
||||
DefaultHandler hd = null;
|
||||
SAXParser saxParser = null;
|
||||
@@ -154,8 +158,9 @@ public class ComplexSAXLooper implements ISAXLooper {
|
||||
hd = newHandler2();
|
||||
}
|
||||
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", hd);
|
||||
reader = new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(
|
||||
new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset));
|
||||
// inSource.setEncoding(this.charset);
|
||||
saxParser.parse(inSource, hd);
|
||||
|
||||
} catch (ParserConfigurationException e) {
|
||||
@@ -164,14 +169,6 @@ public class ComplexSAXLooper implements ISAXLooper {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(reader!=null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +179,6 @@ public class ComplexSAXLooper implements ISAXLooper {
|
||||
*/
|
||||
public void parse(java.io.InputStream is, String charset) {
|
||||
this.charset = charset;
|
||||
Reader reader = null;
|
||||
try {
|
||||
DefaultHandler hd = null;
|
||||
SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
|
||||
@@ -193,9 +189,9 @@ public class ComplexSAXLooper implements ISAXLooper {
|
||||
}
|
||||
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", hd);
|
||||
// routines.system.UnicodeReader.java is used to ignore the BOM of the source file.
|
||||
reader = new UnicodeReader(is,this.charset);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
|
||||
saxParser.parse(inSource, hd);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
|
||||
// inSource.setEncoding(this.charset);
|
||||
saxParser.parse(is, hd);
|
||||
|
||||
} catch (ParserConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
@@ -203,14 +199,6 @@ public class ComplexSAXLooper implements ISAXLooper {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(reader!=null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.xml.sax.simpleparser;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -114,7 +113,6 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
}
|
||||
|
||||
public Object call() throws Exception {
|
||||
Reader reader = null;
|
||||
try {
|
||||
DefaultHandler hd = new SimpleSAXLoopHandler(nodes, bcache);
|
||||
SAXParser saxParser = null;
|
||||
@@ -128,22 +126,17 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", hd);
|
||||
if (fileURL != null) {
|
||||
// routines.system.UnicodeReader.java is used to ignore the BOM of the source file.
|
||||
reader = new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(
|
||||
new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset));
|
||||
// inSource.setEncoding(this.charset);
|
||||
saxParser.parse(inSource, hd);
|
||||
} else {
|
||||
reader = new UnicodeReader(is,this.charset);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
|
||||
saxParser.parse(inSource, hd);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
|
||||
// inSource.setEncoding(this.charset);
|
||||
saxParser.parse(is, hd);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
if(reader!=null) {
|
||||
reader.close();
|
||||
}
|
||||
} finally {
|
||||
bcache.notifyErrorOccurred();
|
||||
}
|
||||
bcache.notifyErrorOccurred();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,7 @@ public class FileCopy {
|
||||
|
||||
public static void copyFile(String srcFileName, String desFileName, boolean delSrc) throws Exception {
|
||||
|
||||
FileInputStream srcInputStream = null;
|
||||
try{
|
||||
srcInputStream = new FileInputStream(srcFileName);
|
||||
FileInputStream srcInputStream = new FileInputStream(srcFileName);
|
||||
long lastModified = new File(srcFileName).lastModified();
|
||||
int available = srcInputStream.available();
|
||||
if (available > L_SIZE) {// X > 100M
|
||||
@@ -49,11 +47,6 @@ public class FileCopy {
|
||||
}
|
||||
// keep modification_time
|
||||
new File(desFileName).setLastModified(lastModified);
|
||||
}finally{
|
||||
if(srcInputStream!=null){
|
||||
srcInputStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyFileS(String srcFileName, FileInputStream srcInputStream, String desFileName, boolean delSrc)
|
||||
@@ -100,13 +93,8 @@ public class FileCopy {
|
||||
try {
|
||||
in = srcInputStream.getChannel();
|
||||
out = new FileOutputStream(dest).getChannel();
|
||||
|
||||
int maxCount = (32 * 1024 * 1024) - (28 * 1024);
|
||||
long size = in.size();
|
||||
long position = 0;
|
||||
while (position < size) {
|
||||
position += in.transferTo(position, maxCount, out);
|
||||
}
|
||||
|
||||
in.transferTo(0, in.size(), out);
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
|
||||
@@ -1,55 +1,32 @@
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
public class BulkloadClient {
|
||||
|
||||
private String url;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
private String universe;
|
||||
|
||||
private String cluster;
|
||||
|
||||
private String concept;
|
||||
|
||||
private String dataModel;
|
||||
|
||||
private BulkloadOptions options = new BulkloadOptions();
|
||||
|
||||
private static final AtomicInteger startedBulkloadCount = new AtomicInteger(0);
|
||||
|
||||
public BulkloadClient(String url, String username, String password, String universe, String cluster, String concept, String dataModel) {
|
||||
String url;
|
||||
String username;
|
||||
String password;
|
||||
String universe;
|
||||
String cluster;
|
||||
String concept;
|
||||
String datamodel;
|
||||
BulkloadOptions options=new BulkloadOptions();
|
||||
|
||||
public BulkloadClient(String url, String username,String password,String universe,String cluster,String concept,String datamodel) {
|
||||
this.url=url;
|
||||
this.username=username;
|
||||
this.password=password;
|
||||
this.universe=universe;
|
||||
this.cluster=cluster;
|
||||
this.concept=concept;
|
||||
this.dataModel = dataModel;
|
||||
this.datamodel=datamodel;
|
||||
}
|
||||
|
||||
public void startThreadCount(){
|
||||
// Kept for compatibility with tMDMBulkload.
|
||||
}
|
||||
|
||||
public void waitForEndOfQueue() {
|
||||
try {
|
||||
synchronized (startedBulkloadCount) {
|
||||
while (startedBulkloadCount.get() > 0) {
|
||||
System.out.println(startedBulkloadCount.get() + " remaining.");
|
||||
startedBulkloadCount.wait();
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
@@ -99,11 +76,11 @@ public class BulkloadClient {
|
||||
}
|
||||
|
||||
public String getDatamodel() {
|
||||
return dataModel;
|
||||
return datamodel;
|
||||
}
|
||||
|
||||
public void setDatamodel(String dataModel) {
|
||||
this.dataModel = dataModel;
|
||||
public void setDatamodel(String datamodel) {
|
||||
this.datamodel = datamodel;
|
||||
}
|
||||
|
||||
public BulkloadOptions getOptions() {
|
||||
@@ -113,75 +90,93 @@ public class BulkloadClient {
|
||||
public void setOptions(BulkloadOptions options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
/**
|
||||
* load from a huge xml string
|
||||
* @param xmlString A full xml document.
|
||||
* @throws Exception Thrown in case of bulk load error.
|
||||
*/
|
||||
public void load(String xmlString) throws Exception {
|
||||
load(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
|
||||
public void load(List<String > items) {
|
||||
doLoad(items);
|
||||
}
|
||||
/**
|
||||
* load from a huge xml string
|
||||
* @param xmlString
|
||||
*/
|
||||
public void load(String xmlString)throws Exception {
|
||||
List<String > items=BulkloadClientUtil.getItemXmls(xmlString);
|
||||
doLoad(items);
|
||||
}
|
||||
|
||||
private void doLoad(List<String> items) {
|
||||
if(items.size()>options.getArraySize()) {
|
||||
int loop=items.size()/options.getArraySize();
|
||||
int left=items.size()-options.getArraySize()*loop;
|
||||
for(int i=0; i<loop; i++) {
|
||||
List<String> subItems=items.subList(i*options.getArraySize(), (i+1)*options.getArraySize());
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(left>0) {
|
||||
List<String> subItems=items.subList(loop*options.getArraySize(), loop*options.getArraySize()+left);
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), items, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load from File
|
||||
* @param inputXmlFile
|
||||
*/
|
||||
public void load(Reader inputXmlFile) {
|
||||
BufferedReader reader=null;
|
||||
try {
|
||||
reader=new BufferedReader(inputXmlFile);
|
||||
StringBuffer sb=new StringBuffer();
|
||||
String line=reader.readLine();
|
||||
while(line!=null) {
|
||||
sb=sb.append(line);
|
||||
line=reader.readLine();
|
||||
}
|
||||
List<String > items=BulkloadClientUtil.getItemXmls(sb.toString());
|
||||
doLoad(items);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if(reader!=null)
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
//test
|
||||
//FileReader reader=new FileReader(file)
|
||||
URL url=BulkloadClient.class.getResource("test.xml");
|
||||
try {
|
||||
BufferedInputStream in=((BufferedInputStream)url.getContent());
|
||||
byte[] buf=new byte[in.available()];
|
||||
in.read(buf);
|
||||
String xml=new String(buf);
|
||||
BulkloadClient client=new BulkloadClient("http://localhost:8080/datamanager/loadServlet","admin","talend",null,"Order","Country","Order");
|
||||
client.setOptions(new BulkloadOptions());
|
||||
client.load(xml);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Loads XML documents in MDM using an InputStream. All documents should follow each other.
|
||||
* For instance this InputStream can be used with this method.
|
||||
* </p>
|
||||
*
|
||||
* <code>
|
||||
* InputStream is = new ByteArrayInputStream("<doc></doc><doc></doc><doc></doc>".getBytes());
|
||||
* </code>
|
||||
*
|
||||
* <p>
|
||||
* This method blocks until all documents in <code>xmlDocuments</code> are read. For non blocking use cases
|
||||
* see {@link #load()}.
|
||||
* </p>
|
||||
*
|
||||
* @param xmlDocuments A stream that contains several XML documents.
|
||||
* @throws Exception Thrown in case of bulk load error
|
||||
*/
|
||||
public void load(InputStream xmlDocuments) throws Exception {
|
||||
BulkloadClientUtil.bulkload(url,
|
||||
cluster,
|
||||
concept,
|
||||
dataModel,
|
||||
options.isValidate(),
|
||||
options.isSmartpk(),
|
||||
xmlDocuments,
|
||||
username,
|
||||
password,
|
||||
universe);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Loads XML documents in MDM using an InputStream created for the load. This method creates a {@link Thread} that
|
||||
* wait for {@link InputStreamMerger#push(java.io.InputStream)} to get called.
|
||||
* </p>
|
||||
*
|
||||
* <code>
|
||||
* BulkloadClient client = ...<br/>
|
||||
* InputStreamMerger is = client.load();<br/>
|
||||
* for(...) {<br/>
|
||||
* is.push(new ByteArrayInputStream("...".getBytes());<br/>
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* @throws Exception Thrown in case of communication error
|
||||
* @see InputStreamMerger
|
||||
* @return A {@link InputStreamMerger} that allow asynchronous push to bulkload client.
|
||||
*/
|
||||
public InputStreamMerger load() throws Exception {
|
||||
return BulkloadClientUtil.bulkload(url,
|
||||
cluster,
|
||||
concept,
|
||||
dataModel,
|
||||
options.isValidate(),
|
||||
options.isSmartpk(),
|
||||
username,
|
||||
password,
|
||||
universe,
|
||||
startedBulkloadCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,131 +1,189 @@
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.apache.commons.httpclient.HostConfiguration;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.URI;
|
||||
import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.cookie.CookiePolicy;
|
||||
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
|
||||
import org.apache.commons.httpclient.methods.PutMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.params.HttpClientParams;
|
||||
import org.apache.commons.httpclient.params.HttpMethodParams;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Bulkload amount items client
|
||||
* @author achen
|
||||
*
|
||||
*/
|
||||
public class BulkloadClientUtil {
|
||||
|
||||
public static void bulkload(String url, String cluster, String concept, String datamodel, boolean validate, boolean smartpk, InputStream itemdata,
|
||||
String username, String password, String universe) throws Exception {
|
||||
HostConfiguration config = new HostConfiguration();
|
||||
URI uri = new URI(url, false, "UTF-8"); //$NON-NLS-1$
|
||||
config.setHost(uri);
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args)throws Exception {
|
||||
if((!args[0].startsWith("http://") && args.length>0) && (args.length != 9 || args.length!=7 || args.length!=6)) {
|
||||
usage();
|
||||
return;
|
||||
}
|
||||
String url= args[0];
|
||||
String username=args[1];
|
||||
String password=args[2];
|
||||
String cluster= args[3];
|
||||
String concept= args[4];
|
||||
String datamodel= args[5];
|
||||
boolean validate= false;
|
||||
boolean smartpk= false;
|
||||
List<String> itemdata= new ArrayList<String>();
|
||||
if(args.length==9) {
|
||||
validate= Boolean.valueOf(args[6]);
|
||||
smartpk= Boolean.valueOf(args[7]);
|
||||
itemdata=getItemXmls(args[8]);
|
||||
}
|
||||
if(args.length==7) {
|
||||
itemdata=getItemXmls(args[6]);
|
||||
}
|
||||
if(args.length==6) {//get itemdata from System.in
|
||||
byte[] buf=new byte[System.in.available()];
|
||||
System.in.read(buf);
|
||||
itemdata=getItemXmls(new String(buf));
|
||||
}
|
||||
try {
|
||||
bulkload(url,cluster, concept,datamodel, validate, smartpk, itemdata,username,password,null);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static List<String> getItemXmls(String itemdata)throws Exception {
|
||||
Element root=parse(itemdata).getDocumentElement();
|
||||
List<String> items=new ArrayList<String>();
|
||||
for(int i=0; i<root.getChildNodes().getLength(); i++) {
|
||||
Node node=root.getChildNodes().item(i);
|
||||
if(node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
items.add(nodeToString(node, true));
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private static String nodeToString(Node n, boolean omitXMLDeclaration) throws TransformerException{
|
||||
StringWriter sw = new StringWriter();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
if (omitXMLDeclaration)
|
||||
transformer.setOutputProperty("omit-xml-declaration","yes");
|
||||
else
|
||||
transformer.setOutputProperty("omit-xml-declaration","no");
|
||||
transformer.setOutputProperty("indent","yes");
|
||||
transformer.transform(
|
||||
new DOMSource(n),
|
||||
new StreamResult(sw)
|
||||
);
|
||||
if (sw==null) return null;
|
||||
return sw.toString().replaceAll("\r\n", "\n");
|
||||
}
|
||||
|
||||
private static Document parse(String xmlString) throws ParserConfigurationException,IOException, SAXException{
|
||||
//parse
|
||||
Document d=null;
|
||||
|
||||
NameValuePair[] parameters = {new NameValuePair("cluster", cluster), //$NON-NLS-1$
|
||||
new NameValuePair("concept", concept), //$NON-NLS-1$
|
||||
new NameValuePair("datamodel", datamodel), //$NON-NLS-1$
|
||||
new NameValuePair("validate", String.valueOf(validate)), //$NON-NLS-1$
|
||||
new NameValuePair("action", "load"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new NameValuePair("smartpk", String.valueOf(smartpk))}; //$NON-NLS-1$
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
//Schema validation based on schemaURL
|
||||
factory.setNamespaceAware(true);
|
||||
factory.setAttribute(
|
||||
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
|
||||
"http://www.w3.org/2001/XMLSchema");
|
||||
DocumentBuilder builder;
|
||||
builder = factory.newDocumentBuilder();
|
||||
|
||||
HttpClient client = new HttpClient();
|
||||
String user = universe == null || universe.trim().length() == 0 ? username : universe + "/" + username; //$NON-NLS-1$
|
||||
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user, password));
|
||||
HttpClientParams clientParams = client.getParams();
|
||||
clientParams.setAuthenticationPreemptive(true);
|
||||
clientParams.setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
|
||||
d = builder.parse(new InputSource(new StringReader(xmlString)));
|
||||
|
||||
PutMethod putMethod = new PutMethod();
|
||||
// This setPath call is *really* important (if not set, request will be sent to the JBoss root '/')
|
||||
putMethod.setPath(url);
|
||||
String responseBody;
|
||||
try {
|
||||
// Configuration
|
||||
putMethod.setRequestHeader("Content-Type", "text/xml; charset=utf8"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
putMethod.setQueryString(parameters);
|
||||
putMethod.setContentChunked(true);
|
||||
// Set the content of the PUT request
|
||||
putMethod.setRequestEntity(new InputStreamRequestEntity(itemdata));
|
||||
return d;
|
||||
}
|
||||
private static void usage() {
|
||||
String usage="Usage:\n"+
|
||||
"\t java -jar bulkloadclient.jar <url> <username> <password> <datacontainer> <concept> <datamodel> [validate] [smartpk] [itemdata] \n"+
|
||||
"\t example1: java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order <itemdata><Country><isoCode>zh</isoCode><label>china</label><Continent>Asia</Continent></Country></itemdata>"+
|
||||
"\t example2(on linux): cat myfile.xml|java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order";
|
||||
|
||||
System.out.println(usage);
|
||||
}
|
||||
|
||||
|
||||
public static boolean bulkload(String URL, String cluster,String concept,String datamodel, boolean validate, boolean smartpk, List<String> itemdata,
|
||||
String username, String password,String universe) throws Exception {
|
||||
HttpClient client = new HttpClient();
|
||||
HttpClientParams params = new HttpClientParams();
|
||||
// params.setSoTimeout(1000);
|
||||
// params.setConnectionManagerTimeout(200);
|
||||
client.setParams(params);
|
||||
String user=universe==null||universe.trim().length()==0?username:universe+"/"+username;
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(user, password));
|
||||
|
||||
client.executeMethod(config, putMethod);
|
||||
responseBody = putMethod.getResponseBodyAsString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
putMethod.releaseConnection();
|
||||
}
|
||||
URI uri = new URI(URL, false, "utf-8");
|
||||
HostConfiguration config = new HostConfiguration();
|
||||
config.setHost(uri);
|
||||
|
||||
int statusCode = putMethod.getStatusCode();
|
||||
if (statusCode >= 400) {
|
||||
throw new BulkloadException(responseBody);
|
||||
}
|
||||
}
|
||||
PostMethod postMethod = new PostMethod(URL);
|
||||
HttpMethodParams reqParams = postMethod.getParams();
|
||||
reqParams.setContentCharset("UTF-8");
|
||||
List<NameValuePair> list=new ArrayList<NameValuePair>();
|
||||
NameValuePair[] data = { new NameValuePair("cluster", cluster),
|
||||
new NameValuePair("concept", concept),
|
||||
new NameValuePair("datamodel", datamodel),
|
||||
new NameValuePair("validate", String.valueOf(validate)),
|
||||
new NameValuePair("smartpk", String.valueOf(smartpk))};
|
||||
list.addAll(Arrays.asList(data));
|
||||
for(int i=0; i<itemdata.size(); i++) {
|
||||
list.add(new NameValuePair("itemdata"+i, itemdata.get(i)));
|
||||
}
|
||||
postMethod.setRequestBody((NameValuePair[])list.toArray(new NameValuePair[list.size()]));
|
||||
// post method
|
||||
int statusCode = 0;
|
||||
try {
|
||||
statusCode = client.executeMethod(config,postMethod);
|
||||
} catch (HttpException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
public static InputStreamMerger bulkload(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, String username, String password, String universe, AtomicInteger startedBulkloadCount) {
|
||||
InputStreamMerger merger = new InputStreamMerger();
|
||||
if (statusCode >= 400)
|
||||
return false;
|
||||
String str = "";
|
||||
try {
|
||||
str = postMethod.getResponseBodyAsString();
|
||||
} catch (IOException e) {
|
||||
|
||||
Runnable loadRunnable = new AsyncLoadRunnable(url, cluster, concept, dataModel, validate, smartPK, merger, username, password, universe, startedBulkloadCount);
|
||||
Thread loadThread = new Thread(loadRunnable);
|
||||
loadThread.start();
|
||||
}
|
||||
System.out.println(str);
|
||||
|
||||
return merger;
|
||||
}
|
||||
postMethod.releaseConnection();
|
||||
return true;
|
||||
}
|
||||
|
||||
private static class AsyncLoadRunnable implements Runnable {
|
||||
|
||||
private final String url;
|
||||
|
||||
private final String cluster;
|
||||
|
||||
private final String concept;
|
||||
|
||||
private final String dataModel;
|
||||
|
||||
private final boolean validate;
|
||||
|
||||
private final boolean smartPK;
|
||||
|
||||
private final InputStreamMerger inputStream;
|
||||
|
||||
private final String userName;
|
||||
|
||||
private final String password;
|
||||
|
||||
private final String universe;
|
||||
|
||||
private final AtomicInteger startedBulkloadCount;
|
||||
|
||||
public AsyncLoadRunnable(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, InputStreamMerger inputStream, String userName, String password, String universe, AtomicInteger startedBulkloadCount) {
|
||||
this.url = url;
|
||||
this.cluster = cluster;
|
||||
this.concept = concept;
|
||||
this.dataModel = dataModel;
|
||||
this.validate = validate;
|
||||
this.smartPK = smartPK;
|
||||
this.inputStream = inputStream;
|
||||
this.userName = userName;
|
||||
this.password = password;
|
||||
this.universe = universe;
|
||||
this.startedBulkloadCount = startedBulkloadCount;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
startedBulkloadCount.incrementAndGet();
|
||||
bulkload(url, cluster, concept, dataModel, validate, smartPK, inputStream, userName, password, universe);
|
||||
} catch (Throwable e) {
|
||||
inputStream.reportFailure(e);
|
||||
} finally {
|
||||
startedBulkloadCount.decrementAndGet();
|
||||
synchronized (startedBulkloadCount) {
|
||||
startedBulkloadCount.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
*
|
||||
* This source code is available under agreement available at
|
||||
* %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
*
|
||||
* You should have received a copy of the agreement
|
||||
* along with this program; if not, write to Talend SA
|
||||
* 9 rue Pages 92150 Suresnes, France
|
||||
*/
|
||||
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class BulkloadException extends RuntimeException {
|
||||
|
||||
private static final String SERVER_EXCEPTION_SEPARATOR = "== SERVER EXCEPTION ==";
|
||||
|
||||
private static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||
|
||||
private final String serverException;
|
||||
|
||||
public BulkloadException(String serverException) {
|
||||
super("An exception happened during bulk load on MDM server.");
|
||||
this.serverException = serverException;
|
||||
}
|
||||
|
||||
public String getServerException() {
|
||||
return serverException;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace(PrintStream s) {
|
||||
super.printStackTrace(s);
|
||||
s.append(LINE_SEPARATOR);
|
||||
s.append(SERVER_EXCEPTION_SEPARATOR);
|
||||
s.append(LINE_SEPARATOR);
|
||||
s.append(serverException);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace(PrintWriter s) {
|
||||
super.printStackTrace(s);
|
||||
s.println(SERVER_EXCEPTION_SEPARATOR);
|
||||
s.println(serverException);
|
||||
}
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
*
|
||||
* This source code is available under agreement available at
|
||||
* %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
*
|
||||
* You should have received a copy of the agreement
|
||||
* along with this program; if not, write to Talend SA
|
||||
* 9 rue Pages 92150 Suresnes, France
|
||||
*/
|
||||
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class InputStreamMerger extends InputStream {
|
||||
|
||||
private static final Logger log = Logger.getLogger(InputStreamMerger.class.getName());
|
||||
|
||||
private final Queue<InputStream> inputStreamBuffer = new ConcurrentLinkedQueue<InputStream>();
|
||||
|
||||
private final Object readLock = new Object();
|
||||
|
||||
private final Object exhaustLock = new Object();
|
||||
|
||||
private boolean isClosed;
|
||||
|
||||
private InputStream currentStream;
|
||||
|
||||
private boolean hasFinishedRead;
|
||||
|
||||
private Throwable lastFailure;
|
||||
|
||||
public void push(InputStream inputStream) throws IOException {
|
||||
if (inputStream == null) {
|
||||
throw new IllegalArgumentException("Input stream can not be null.");
|
||||
}
|
||||
if (isClosed) {
|
||||
throw new IOException("Stream is closed");
|
||||
}
|
||||
inputStreamBuffer.add(inputStream);
|
||||
debug("Added a new input stream (buffer now has " + inputStreamBuffer.size() + " streams)");
|
||||
}
|
||||
|
||||
public void reportFailure(Throwable e) {
|
||||
debug("Exception occurred in consumer thread: " + e.getMessage());
|
||||
lastFailure = e;
|
||||
synchronized (exhaustLock) {
|
||||
exhaustLock.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int available() throws IOException {
|
||||
return 4096;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean markSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p> Read block the current thread until data is pushed to this stream (using {@link #push(java.io.InputStream)}
|
||||
* or if {@link #close()} is called. </p>
|
||||
*
|
||||
* @return the next byte of data, or <code>-1</code> if the end of the stream is reached <b>or</b> if stream is
|
||||
* closed.
|
||||
* @throws IOException
|
||||
* @see java.io.InputStream#read()
|
||||
*/
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
int read = -1;
|
||||
if (currentStream != null) {
|
||||
read = currentStream.read();
|
||||
} else {
|
||||
moveToNextInputStream();
|
||||
if (currentStream != null) {
|
||||
read = currentStream.read();
|
||||
}
|
||||
}
|
||||
if (read < 0) {
|
||||
moveToNextInputStream();
|
||||
if (currentStream != null) {
|
||||
read = currentStream.read();
|
||||
}
|
||||
}
|
||||
if (read < 0) {
|
||||
synchronized (exhaustLock) {
|
||||
debug("Notify exhaust lock");
|
||||
exhaustLock.notifyAll();
|
||||
}
|
||||
}
|
||||
// Throw any exception that might have occurred during last record processing.
|
||||
throwLastFailure();
|
||||
return read;
|
||||
}
|
||||
|
||||
private void throwLastFailure() throws IOException {
|
||||
if (lastFailure != null) {
|
||||
debug("Report last failure exception to producer.");
|
||||
throw new IOException("An exception occurred while processing last record.", lastFailure);
|
||||
}
|
||||
}
|
||||
|
||||
private void moveToNextInputStream() throws IOException {
|
||||
// Throw any exception that might have occurred during previous records
|
||||
throwLastFailure();
|
||||
// Check the isClosed flag in case we've got waken up by a close()
|
||||
while (inputStreamBuffer.isEmpty() && !isClosed) {
|
||||
synchronized (readLock) {
|
||||
try {
|
||||
debug("Wait for more input...");
|
||||
readLock.wait();
|
||||
debug("Wait for more input done.");
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!inputStreamBuffer.isEmpty()) {
|
||||
if (currentStream != null) {
|
||||
currentStream.close();
|
||||
}
|
||||
currentStream = inputStreamBuffer.poll();
|
||||
} else {
|
||||
currentStream = null;
|
||||
hasFinishedRead = true;
|
||||
}
|
||||
debug("Remaining buffers : " + inputStreamBuffer.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* <p> Close this stream and perform some checks: <ul> <li>Mark this stream as closed (no more calls to {@link
|
||||
* #push(java.io.InputStream)} are allowed)</li> <li>Closes any remaining stream pushed to this stream</li> </ul>
|
||||
* </p> <p> Calling this method wakes up any thread blocked on {@link #read()} </p> <p> Wait till all streams pushed
|
||||
* to this stream (and stored in <code>inputStreamBuffer</code>) are processed by a reader. </p> <p> When this
|
||||
* method exits, the buffer is empty and the last stream in buffer is fully read (i.e. until read() returns -1).
|
||||
* </p>
|
||||
*
|
||||
* @throws IOException In case at least one stream in buffer hasn't been read.
|
||||
* @see java.io.InputStream#close()
|
||||
*/
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
super.close();
|
||||
isClosed = true;
|
||||
synchronized (readLock) {
|
||||
readLock.notifyAll();
|
||||
}
|
||||
debug("Input stream buffer size: " + +inputStreamBuffer.size());
|
||||
debug("Has finished read: " + hasFinishedRead);
|
||||
debug("Stop condition: " + (!inputStreamBuffer.isEmpty() && !hasFinishedRead));
|
||||
while (!inputStreamBuffer.isEmpty() && !hasFinishedRead) {
|
||||
try {
|
||||
debug("Waiting for exhaust... (" + inputStreamBuffer.size() + " remaining)");
|
||||
synchronized (exhaustLock) {
|
||||
exhaustLock.wait();
|
||||
}
|
||||
// In case we got woken up due to a failure
|
||||
throwLastFailure();
|
||||
debug("Waiting for exhaust done.");
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
// In case failure happened on very last read.
|
||||
throwLastFailure();
|
||||
debug("Close completed.");
|
||||
}
|
||||
|
||||
private static void debug(String message) {
|
||||
Level debugLevel = Level.FINEST;
|
||||
if (log.isLoggable(debugLevel)) {
|
||||
log.log(debugLevel, "[" + Thread.currentThread() + "] " + message);
|
||||
}
|
||||
}
|
||||
|
||||
public Throwable getLastReportedFailure() {
|
||||
return lastFailure;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
<pathelement location="lib/httpclient-4.0.1.jar"/>
|
||||
<pathelement location="lib/httpcore-4.0.1.jar"/>
|
||||
<pathelement location="lib/httpmime-4.0.1.jar"/>
|
||||
<pathelement location="lib/talendcsv.jar"/>
|
||||
<pathelement location="lib/javacsv-2.0.jar"/>
|
||||
</path>
|
||||
<target name="init">
|
||||
<mkdir dir="bin"/>
|
||||
|
||||
@@ -1,138 +1,131 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
|
||||
import org.apache.http.*;
|
||||
import org.apache.http.client.methods.*;
|
||||
import org.apache.http.client.utils.*;
|
||||
import org.apache.http.conn.*;
|
||||
import org.apache.http.conn.scheme.*;
|
||||
import org.apache.http.impl.client.*;
|
||||
import org.apache.http.impl.conn.tsccm.*;
|
||||
import org.apache.http.message.*;
|
||||
import org.apache.http.params.*;
|
||||
|
||||
//import java.math.BigInteger;
|
||||
//import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpVersion;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.utils.URIUtils;
|
||||
import org.apache.http.client.utils.URLEncodedUtils;
|
||||
import org.apache.http.conn.ClientConnectionManager;
|
||||
import org.apache.http.conn.scheme.PlainSocketFactory;
|
||||
import org.apache.http.conn.scheme.Scheme;
|
||||
import org.apache.http.conn.scheme.SchemeRegistry;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.params.BasicHttpParams;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.http.params.HttpProtocolParams;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.*;
|
||||
|
||||
public class paloconnection {
|
||||
|
||||
private HttpHost paloTargetHost;
|
||||
private DefaultHttpClient paloHttpClient;
|
||||
|
||||
private String strToken = "";
|
||||
private int iSessionTimeOut=0;
|
||||
private String strUserName = "";
|
||||
private String strUserPW = "";
|
||||
private String strServer = "";
|
||||
private String strPort = "";
|
||||
|
||||
public paloconnection(String strUserName, String strUserPW, String strServer, String strPort) throws paloexception{
|
||||
|
||||
super();
|
||||
this.strUserName = strUserName;
|
||||
this.strUserPW = strUserPW;
|
||||
this.strServer = strServer;
|
||||
this.strPort = strPort;
|
||||
|
||||
private HttpHost paloTargetHost;
|
||||
|
||||
private DefaultHttpClient paloHttpClient;
|
||||
|
||||
private String strToken = "";
|
||||
|
||||
private int iSessionTimeOut = 0;
|
||||
|
||||
private String strUserName = "";
|
||||
|
||||
private String strUserPW = "";
|
||||
|
||||
private String strServer = "";
|
||||
|
||||
private String strPort = "";
|
||||
|
||||
public paloconnection(String strUserName, String strUserPW, String strServer, String strPort) throws paloexception {
|
||||
|
||||
super();
|
||||
this.strUserName = strUserName;
|
||||
this.strUserPW = strUserPW;
|
||||
this.strServer = strServer;
|
||||
this.strPort = strPort;
|
||||
|
||||
initConnection();
|
||||
|
||||
initConnection();
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("user", this.strUserName));
|
||||
qparams.add(new BasicNameValuePair("password", palohelpers.getMD5(this.strUserPW)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = sendToServer(qparams, "/server/login");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
this.strToken = csv.get(0);
|
||||
this.iSessionTimeOut = Integer.valueOf(csv.get(1));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.toString());
|
||||
|
||||
try{
|
||||
HttpEntity entity = sendToServer(qparams, "/server/login");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
this.strToken = csv.get(0);
|
||||
this.iSessionTimeOut = Integer.valueOf(csv.get(1));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getPaloToken(){
|
||||
return strToken;
|
||||
}
|
||||
|
||||
public int getSessionTimeout(){
|
||||
return iSessionTimeOut;
|
||||
}
|
||||
|
||||
public palodatabases getDatabases()throws paloexception {
|
||||
return new palodatabases(this);
|
||||
}
|
||||
|
||||
// Load the Server
|
||||
public void load() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
sendToServerSingleRC(qparams, "/server/load");
|
||||
}
|
||||
|
||||
// Saves the Server
|
||||
public void save() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
sendToServerSingleRC(qparams, "/server/save");
|
||||
}
|
||||
|
||||
// Shutdowns the Server
|
||||
public void shutdown() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
sendToServerSingleRC(qparams, "/server/shutdown");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Logouts the current palo User
|
||||
public void logout() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
|
||||
try{
|
||||
HttpEntity entity = sendToServer(qparams, "/server/logout");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
|
||||
public String getPaloToken() {
|
||||
return strToken;
|
||||
}
|
||||
|
||||
public int getSessionTimeout() {
|
||||
return iSessionTimeOut;
|
||||
}
|
||||
|
||||
public palodatabases getDatabases() throws paloexception {
|
||||
return new palodatabases(this);
|
||||
}
|
||||
|
||||
// Load the Server
|
||||
public void load() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
sendToServerSingleRC(qparams, "/server/load");
|
||||
}
|
||||
|
||||
// Saves the Server
|
||||
public void save() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
sendToServerSingleRC(qparams, "/server/save");
|
||||
}
|
||||
|
||||
// Shutdowns the Server
|
||||
public void shutdown() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
sendToServerSingleRC(qparams, "/server/shutdown");
|
||||
}
|
||||
|
||||
// Logouts the current palo User
|
||||
public void logout() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.strToken));
|
||||
|
||||
try {
|
||||
HttpEntity entity = sendToServer(qparams, "/server/logout");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
|
||||
// CsvReader csv = new CsvReader(sendToServer(qparams, "/server/logout").getContent(),
|
||||
// Charset.defaultCharset());
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
// paloHttpClient.getConnectionManager().shutdown();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
//CsvReader csv = new CsvReader(sendToServer(qparams, "/server/logout").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
//paloHttpClient.getConnectionManager().shutdown();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void initConnection() {
|
||||
|
||||
pingPaloServer();
|
||||
|
||||
paloTargetHost = new HttpHost(strServer, Integer.valueOf(strPort), "http");
|
||||
}
|
||||
|
||||
|
||||
private void initConnection(){
|
||||
|
||||
pingPaloServer();
|
||||
|
||||
paloTargetHost = new HttpHost(strServer, Integer.valueOf(strPort), "http");
|
||||
SchemeRegistry supportedSchemes = new SchemeRegistry();
|
||||
supportedSchemes.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), Integer.valueOf(strPort)));
|
||||
supportedSchemes.register(new Scheme("http",PlainSocketFactory.getSocketFactory(), Integer.valueOf(strPort)));
|
||||
|
||||
// prepare parameters
|
||||
HttpParams params = new BasicHttpParams();
|
||||
@@ -140,129 +133,134 @@ public class paloconnection {
|
||||
HttpProtocolParams.setContentCharset(params, "UTF-8");
|
||||
HttpProtocolParams.setUseExpectContinue(params, true);
|
||||
|
||||
ClientConnectionManager connMgr = new ThreadSafeClientConnManager(params, supportedSchemes);
|
||||
ClientConnectionManager connMgr = new ThreadSafeClientConnManager(params,supportedSchemes);
|
||||
paloHttpClient = new DefaultHttpClient(connMgr, params);
|
||||
}
|
||||
|
||||
private void pingPaloServer() {
|
||||
try {
|
||||
// int timeOut = 1000; // I recommend 3 seconds at least int timeout = 3000; / / Ich empfehle 3 Sekunden
|
||||
// mindestens
|
||||
// boolean status = InetAddress.getByName(strServer).isReachable(timeOut);
|
||||
Socket s = new Socket(strServer, Integer.valueOf(strPort));
|
||||
s.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
private void pingPaloServer(){
|
||||
try{
|
||||
//int timeOut = 1000; // I recommend 3 seconds at least int timeout = 3000; / / Ich empfehle 3 Sekunden mindestens
|
||||
//boolean status = InetAddress.getByName(strServer).isReachable(timeOut);
|
||||
Socket s = new Socket(strServer, Integer.valueOf(strPort));
|
||||
s.close();
|
||||
}catch(Exception e){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Retrieves only true or false based on the given connection
|
||||
public boolean sendToServerSingleRC(List<NameValuePair> qparams, String strAPIUrl) throws paloexception{
|
||||
try{
|
||||
HttpEntity entity = sendToServer(qparams, strAPIUrl);
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
//CsvReader csv = new CsvReader(sendToServer(qparams, strAPIUrl).getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
boolean bStatus = Boolean.getBoolean(csv.get(0));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return bStatus;
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public HttpEntity sendToServer(List<NameValuePair> qparams, String strAPIUrl) throws paloexception{
|
||||
|
||||
try{
|
||||
URI uri = URIUtils.createURI("http", strServer, Integer.valueOf(strPort), strAPIUrl, URLEncodedUtils.format(qparams, "UTF-8"), null);
|
||||
HttpGet req = new HttpGet(uri);
|
||||
|
||||
// System.out.println(req.getURI());
|
||||
|
||||
// Send to Server
|
||||
HttpResponse rsp = paloHttpClient.execute(paloTargetHost, req);
|
||||
HttpEntity entity = rsp.getEntity();
|
||||
|
||||
///System.out.println(rsp.getStatusLine().getStatusCode());
|
||||
|
||||
if(rsp.getStatusLine().getStatusCode()!=200){
|
||||
// Error had been occured
|
||||
// Close Connection and thend raise paloexception error
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
paloexception plX = new paloexception(csv.get(0),csv.get(1),csv.get(2));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
//req.abort();
|
||||
//paloHttpClient.getConnectionManager().shutdown();
|
||||
throw(plX);
|
||||
}else{
|
||||
return entity;
|
||||
}
|
||||
|
||||
}catch(Exception e){
|
||||
//if(paloHttpClient!=null)paloHttpClient.getConnectionManager().shutdown();
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves only true or false based on the given connection
|
||||
public boolean sendToServerSingleRC(List<NameValuePair> qparams, String strAPIUrl) throws paloexception {
|
||||
try {
|
||||
HttpEntity entity = sendToServer(qparams, strAPIUrl);
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
// CsvReader csv = new CsvReader(sendToServer(qparams, strAPIUrl).getContent(), Charset.defaultCharset());
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
boolean bStatus = Boolean.getBoolean(csv.get(0));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return bStatus;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public HttpEntity sendToServer(List<NameValuePair> qparams, String strAPIUrl) throws paloexception {
|
||||
|
||||
try {
|
||||
URI uri = URIUtils.createURI("http", strServer, Integer.valueOf(strPort), strAPIUrl,
|
||||
URLEncodedUtils.format(qparams, "UTF-8"), null);
|
||||
HttpGet req = new HttpGet(uri);
|
||||
|
||||
// System.out.println(req.getURI());
|
||||
|
||||
// Send to Server
|
||||
HttpResponse rsp = paloHttpClient.execute(paloTargetHost, req);
|
||||
HttpEntity entity = rsp.getEntity();
|
||||
|
||||
// /System.out.println(rsp.getStatusLine().getStatusCode());
|
||||
|
||||
if (rsp.getStatusLine().getStatusCode() != 200) {
|
||||
// Error had been occured
|
||||
// Close Connection and thend raise paloexception error
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
paloexception plX = new paloexception(csv.get(0), csv.get(1), csv.get(2));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
// req.abort();
|
||||
// paloHttpClient.getConnectionManager().shutdown();
|
||||
throw (plX);
|
||||
} else {
|
||||
return entity;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// if(paloHttpClient!=null)paloHttpClient.getConnectionManager().shutdown();
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String getRulefunctions() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", getPaloToken()));
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
HttpEntity entity = sendToServer(qparams, "/rule/functions");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
sb.append(csv.get(0));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return sb.toString();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String getVersion() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("", ""));
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
HttpEntity entity = sendToServer(qparams, "/server/info");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
sb.append(csv.get(0));
|
||||
sb.append(".");
|
||||
sb.append(csv.get(1));
|
||||
sb.append(".");
|
||||
sb.append(csv.get(2));
|
||||
sb.append(".");
|
||||
sb.append(csv.get(3));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return sb.toString();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
if (paloHttpClient != null) {
|
||||
paloHttpClient.getConnectionManager().shutdown();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getRulefunctions()throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", getPaloToken()));
|
||||
try{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
HttpEntity entity = sendToServer(qparams, "/rule/functions");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
sb.append(csv.get(0));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return sb.toString();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getVersion() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("", ""));
|
||||
try{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
HttpEntity entity = sendToServer(qparams, "/server/info");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
sb.append(csv.get(0));
|
||||
sb.append(".");
|
||||
sb.append(csv.get(1));
|
||||
sb.append(".");
|
||||
sb.append(csv.get(2));
|
||||
sb.append(".");
|
||||
sb.append(csv.get(3));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return sb.toString();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
if(paloHttpClient!=null)paloHttpClient.getConnectionManager().shutdown();
|
||||
} catch(Exception e) {
|
||||
}
|
||||
finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,219 +8,216 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palocube {
|
||||
|
||||
// OK
|
||||
// OK
|
||||
|
||||
// @SuppressWarnings("unused")
|
||||
// private ArrayList<palocubelock> paloCubelocks = new ArrayList<palocubelock>();
|
||||
|
||||
//@SuppressWarnings("unused")
|
||||
//private ArrayList<palocubelock> paloCubelocks = new ArrayList<palocubelock>();
|
||||
|
||||
private paloconnection plConn;
|
||||
private long lDatabaseId;
|
||||
|
||||
private paloconnection plConn;
|
||||
private int iCubeId;
|
||||
private String strCubeName;
|
||||
private int iNumberOfDimensions;
|
||||
private int[] iArrDimensionsIdentifier;
|
||||
private long iNumberOfCells;
|
||||
private long lNumberOfFilledCells;
|
||||
private int iCubeStatus;
|
||||
private int iCubeType;
|
||||
@SuppressWarnings("unused")
|
||||
private int iCubeToken;
|
||||
|
||||
public palocube(paloconnection plConn, long lDatabaseId,
|
||||
int iCubeId, //0 cube identifier Identifier of the cube
|
||||
String strCubeName, //1 name_cube string Name of the cube
|
||||
int iNumberOfDimensions, //2 number_dimensions integer Number of dimensions
|
||||
int[] iArrDimensionsIdentifier, //3 dimensions integer Comma separate list of dimension identifiers
|
||||
long lNumberOfCells, //4 number_cells integer Total number of cells
|
||||
long lNumberOfFilledCells,//5 number_filled_cells integer Number of filled numeric base cells plus number of filled string cells
|
||||
int iCubeStatus, //6 status integer Status of cube (0=unloaded, 1=loaded and 2=changed)
|
||||
int iCubeType, //7 type integer Type of cube (0=normal, 1=system, 2=attribute, 3=user info)
|
||||
int strCubeToken//8 cube_token integer The cube token of the cube
|
||||
){
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId=lDatabaseId;
|
||||
|
||||
this.iCubeId=iCubeId;
|
||||
this.strCubeName=strCubeName;
|
||||
this.iNumberOfDimensions=iNumberOfDimensions;
|
||||
this.iArrDimensionsIdentifier=iArrDimensionsIdentifier;
|
||||
this.iNumberOfCells=lNumberOfCells;
|
||||
this.lNumberOfFilledCells=lNumberOfFilledCells;
|
||||
this.iCubeStatus=iCubeStatus;
|
||||
this.iCubeType=iCubeType;
|
||||
this.iCubeToken=strCubeToken;
|
||||
}
|
||||
|
||||
private long lDatabaseId;
|
||||
public String getName(){
|
||||
return strCubeName;
|
||||
}
|
||||
|
||||
private int iCubeId;
|
||||
public String getDatabaseName(){
|
||||
return "";//strDatabaseName;
|
||||
}
|
||||
|
||||
|
||||
public void rename(String strCubeNewName) throws paloexception{
|
||||
if(null!=strCubeNewName && strCubeNewName.length()>0 && !strCubeName.equals(strCubeNewName)){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("new_name", strCubeNewName));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/rename");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/cube/rename").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
this.strCubeName = csv.get(1);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getCubeId(){
|
||||
return iCubeId;
|
||||
}
|
||||
public int getNumberOfDimensions(){
|
||||
return iNumberOfDimensions;
|
||||
}
|
||||
public long getNumberOfCells(){
|
||||
return iNumberOfCells;
|
||||
}
|
||||
public long getNumberOfFilledCells(){
|
||||
return lNumberOfFilledCells;
|
||||
}
|
||||
|
||||
public int getCubeStatus(){
|
||||
return iCubeStatus;
|
||||
}
|
||||
|
||||
public int getCubeType(){
|
||||
return iCubeType;
|
||||
}
|
||||
|
||||
|
||||
public void save()throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/save");
|
||||
}
|
||||
|
||||
private String strCubeName;
|
||||
public void load() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/load");
|
||||
}
|
||||
|
||||
private int iNumberOfDimensions;
|
||||
public void unload() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/unload");
|
||||
}
|
||||
|
||||
public void refreshCubeInfo() throws paloexception{
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/info");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
|
||||
private int[] iArrDimensionsIdentifier;
|
||||
this.iCubeId = palohelpers.StringToInt(csv.get(0));
|
||||
this.strCubeName = csv.get(1);
|
||||
this.iNumberOfDimensions=palohelpers.StringToInt(csv.get(2));
|
||||
this.iArrDimensionsIdentifier=palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
|
||||
this.iNumberOfCells=palohelpers.StringToLong(csv.get(4));
|
||||
this.lNumberOfFilledCells=palohelpers.StringToLong(csv.get(5));
|
||||
this.iCubeStatus=palohelpers.StringToInt(csv.get(6));
|
||||
this.iCubeType=palohelpers.StringToInt(csv.get(7));
|
||||
this.iCubeToken=palohelpers.StringToInt(csv.get(8));
|
||||
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void clear() throws paloexception{
|
||||
clear(null);
|
||||
}
|
||||
|
||||
public void clear(String strArrArea) throws paloexception{
|
||||
|
||||
private long iNumberOfCells;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
|
||||
|
||||
if(strArrArea==null){
|
||||
qparams.add(new BasicNameValuePair("complete", "1"));
|
||||
}else{
|
||||
//qparams.add(new BasicNameValuePair("complete", "0"));
|
||||
qparams.add(new BasicNameValuePair("area", strArrArea));
|
||||
}
|
||||
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/clear");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
|
||||
private long lNumberOfFilledCells;
|
||||
this.iCubeId = palohelpers.StringToInt(csv.get(0));
|
||||
this.strCubeName = csv.get(1);
|
||||
this.iNumberOfDimensions=palohelpers.StringToInt(csv.get(2));
|
||||
this.iArrDimensionsIdentifier=palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
|
||||
this.iNumberOfCells=palohelpers.StringToLong(csv.get(4));
|
||||
this.lNumberOfFilledCells=palohelpers.StringToLong(csv.get(5));
|
||||
this.iCubeStatus=palohelpers.StringToInt(csv.get(6));
|
||||
this.iCubeType=palohelpers.StringToInt(csv.get(7));
|
||||
this.iCubeToken=palohelpers.StringToInt(csv.get(8));
|
||||
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palorules getCubeRules() throws paloexception {
|
||||
return new palorules(this.plConn, this.lDatabaseId, this.iCubeId);
|
||||
}
|
||||
|
||||
private int iCubeStatus;
|
||||
|
||||
private int iCubeType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private int iCubeToken;
|
||||
|
||||
public palocube(paloconnection plConn, long lDatabaseId, int iCubeId, // 0 cube identifier Identifier of the cube
|
||||
String strCubeName, // 1 name_cube string Name of the cube
|
||||
int iNumberOfDimensions, // 2 number_dimensions integer Number of dimensions
|
||||
int[] iArrDimensionsIdentifier, // 3 dimensions integer Comma separate list of dimension identifiers
|
||||
long lNumberOfCells, // 4 number_cells integer Total number of cells
|
||||
long lNumberOfFilledCells,// 5 number_filled_cells integer Number of filled numeric base cells plus number
|
||||
// of filled string cells
|
||||
int iCubeStatus, // 6 status integer Status of cube (0=unloaded, 1=loaded and 2=changed)
|
||||
int iCubeType, // 7 type integer Type of cube (0=normal, 1=system, 2=attribute, 3=user info)
|
||||
int strCubeToken// 8 cube_token integer The cube token of the cube
|
||||
) {
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
|
||||
this.iCubeId = iCubeId;
|
||||
this.strCubeName = strCubeName;
|
||||
this.iNumberOfDimensions = iNumberOfDimensions;
|
||||
this.iArrDimensionsIdentifier = iArrDimensionsIdentifier;
|
||||
this.iNumberOfCells = lNumberOfCells;
|
||||
this.lNumberOfFilledCells = lNumberOfFilledCells;
|
||||
this.iCubeStatus = iCubeStatus;
|
||||
this.iCubeType = iCubeType;
|
||||
this.iCubeToken = strCubeToken;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return strCubeName;
|
||||
}
|
||||
|
||||
public String getDatabaseName() {
|
||||
return "";// strDatabaseName;
|
||||
}
|
||||
|
||||
public void rename(String strCubeNewName) throws paloexception {
|
||||
if (null != strCubeNewName && strCubeNewName.length() > 0 && !strCubeName.equals(strCubeNewName)) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("new_name", strCubeNewName));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/rename");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
this.strCubeName = csv.get(1);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getCubeId() {
|
||||
return iCubeId;
|
||||
}
|
||||
|
||||
public int getNumberOfDimensions() {
|
||||
return iNumberOfDimensions;
|
||||
}
|
||||
|
||||
public long getNumberOfCells() {
|
||||
return iNumberOfCells;
|
||||
}
|
||||
|
||||
public long getNumberOfFilledCells() {
|
||||
return lNumberOfFilledCells;
|
||||
}
|
||||
|
||||
public int getCubeStatus() {
|
||||
return iCubeStatus;
|
||||
}
|
||||
|
||||
public int getCubeType() {
|
||||
return iCubeType;
|
||||
}
|
||||
|
||||
public void save() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/save");
|
||||
}
|
||||
|
||||
public void load() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/load");
|
||||
}
|
||||
|
||||
public void unload() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/unload");
|
||||
}
|
||||
|
||||
public void refreshCubeInfo() throws paloexception {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/info");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
|
||||
this.iCubeId = palohelpers.StringToInt(csv.get(0));
|
||||
this.strCubeName = csv.get(1);
|
||||
this.iNumberOfDimensions = palohelpers.StringToInt(csv.get(2));
|
||||
this.iArrDimensionsIdentifier = palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
|
||||
this.iNumberOfCells = palohelpers.StringToLong(csv.get(4));
|
||||
this.lNumberOfFilledCells = palohelpers.StringToLong(csv.get(5));
|
||||
this.iCubeStatus = palohelpers.StringToInt(csv.get(6));
|
||||
this.iCubeType = palohelpers.StringToInt(csv.get(7));
|
||||
this.iCubeToken = palohelpers.StringToInt(csv.get(8));
|
||||
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void clear() throws paloexception {
|
||||
clear(null);
|
||||
}
|
||||
|
||||
public void clear(String strArrArea) throws paloexception {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
|
||||
|
||||
if (strArrArea == null) {
|
||||
qparams.add(new BasicNameValuePair("complete", "1"));
|
||||
} else {
|
||||
// qparams.add(new BasicNameValuePair("complete", "0"));
|
||||
qparams.add(new BasicNameValuePair("area", strArrArea));
|
||||
}
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/clear");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
|
||||
this.iCubeId = palohelpers.StringToInt(csv.get(0));
|
||||
this.strCubeName = csv.get(1);
|
||||
this.iNumberOfDimensions = palohelpers.StringToInt(csv.get(2));
|
||||
this.iArrDimensionsIdentifier = palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
|
||||
this.iNumberOfCells = palohelpers.StringToLong(csv.get(4));
|
||||
this.lNumberOfFilledCells = palohelpers.StringToLong(csv.get(5));
|
||||
this.iCubeStatus = palohelpers.StringToInt(csv.get(6));
|
||||
this.iCubeType = palohelpers.StringToInt(csv.get(7));
|
||||
this.iCubeToken = palohelpers.StringToInt(csv.get(8));
|
||||
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palorules getCubeRules() throws paloexception {
|
||||
return new palorules(this.plConn, this.lDatabaseId, this.iCubeId);
|
||||
}
|
||||
|
||||
public palodimensions getDimensions() throws paloexception {
|
||||
return new palodimensions(this.plConn, this.lDatabaseId, this.iCubeType, this.iArrDimensionsIdentifier);
|
||||
}
|
||||
public palodimensions getDimensions() throws paloexception {
|
||||
return new palodimensions(this.plConn, this.lDatabaseId, this.iCubeType, this.iArrDimensionsIdentifier);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,248 +8,260 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palocubes {
|
||||
|
||||
public static final int CUBE_NORMAL = 0;
|
||||
|
||||
public static final int CUBE_NORMAL = 0;
|
||||
public static final int CUBE_SYSTEM= 1;
|
||||
public static final int CUBE_ATTRIBUT = 2;
|
||||
public static final int CUBE_USER_INFO = 3;
|
||||
public static final int CUBE_UNKNOWN = -1;
|
||||
|
||||
public static final int CUBE_STATUS_UNLOADED = 0;
|
||||
public static final int CUBE_STATUS_LOADED = 1;
|
||||
public static final int CUBE_STATUS_CHANGED = 2;
|
||||
public static final int CUBE_STATUS_UNKNOWN = -1;
|
||||
|
||||
private paloconnection plConn;
|
||||
private palodatabase plDB;
|
||||
|
||||
private ArrayList<palocube> paloCubes = new ArrayList<palocube>();
|
||||
|
||||
public palocubes(paloconnection plConn, palodatabase plDB, int iCubeType) throws paloexception{
|
||||
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.plDB = plDB;
|
||||
|
||||
|
||||
public static final int CUBE_SYSTEM = 1;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
|
||||
public static final int CUBE_ATTRIBUT = 2;
|
||||
|
||||
switch(iCubeType){
|
||||
case CUBE_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
break;
|
||||
case CUBE_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
break;
|
||||
case CUBE_ATTRIBUT:
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
break;
|
||||
case CUBE_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
break;
|
||||
case CUBE_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
break;
|
||||
}
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/cubes");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
palocube plCube = new palocube(plConn, plDB.getDatabaseId(),
|
||||
palohelpers.StringToInt(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2))),
|
||||
palohelpers.StringToLong(csv.get(4)),
|
||||
palohelpers.StringToLong(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToInt(csv.get(8))
|
||||
);
|
||||
|
||||
paloCubes.add(plCube);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public palocubes(paloconnection plConn, long lDatabaseId, int iCubeType, int iDimensionId) throws paloexception{
|
||||
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
|
||||
|
||||
public static final int CUBE_USER_INFO = 3;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
|
||||
|
||||
switch(iCubeType){
|
||||
case CUBE_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
break;
|
||||
case CUBE_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
break;
|
||||
case CUBE_ATTRIBUT:
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
break;
|
||||
case CUBE_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
break;
|
||||
case CUBE_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
break;
|
||||
}
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/cubes");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
palocube plCube = new palocube(plConn, lDatabaseId,
|
||||
palohelpers.StringToInt(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2))),
|
||||
palohelpers.StringToLong(csv.get(4)),
|
||||
palohelpers.StringToLong(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToInt(csv.get(8))
|
||||
);
|
||||
|
||||
paloCubes.add(plCube);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static final int CUBE_UNKNOWN = -1;
|
||||
|
||||
public static final int CUBE_STATUS_UNLOADED = 0;
|
||||
|
||||
public static final int CUBE_STATUS_LOADED = 1;
|
||||
|
||||
public static final int CUBE_STATUS_CHANGED = 2;
|
||||
|
||||
public static final int CUBE_STATUS_UNKNOWN = -1;
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
private palodatabase plDB;
|
||||
|
||||
private ArrayList<palocube> paloCubes = new ArrayList<palocube>();
|
||||
|
||||
public palocubes(paloconnection plConn, palodatabase plDB, int iCubeType) throws paloexception {
|
||||
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.plDB = plDB;
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
|
||||
switch (iCubeType) {
|
||||
case CUBE_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
break;
|
||||
case CUBE_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
break;
|
||||
case CUBE_ATTRIBUT:
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
break;
|
||||
case CUBE_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
break;
|
||||
case CUBE_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/cubes");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
palocube plCube = new palocube(plConn, plDB.getDatabaseId(), palohelpers.StringToInt(csv.get(0)), csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToIntArray(csv.get(3),
|
||||
palohelpers.StringToInt(csv.get(2))), palohelpers.StringToLong(csv.get(4)),
|
||||
palohelpers.StringToLong(csv.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv
|
||||
.get(7)), palohelpers.StringToInt(csv.get(8)));
|
||||
|
||||
paloCubes.add(plCube);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palocubes(paloconnection plConn, long lDatabaseId, int iCubeType, int iDimensionId) throws paloexception {
|
||||
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
|
||||
|
||||
switch (iCubeType) {
|
||||
case CUBE_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
break;
|
||||
case CUBE_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
break;
|
||||
case CUBE_ATTRIBUT:
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
break;
|
||||
case CUBE_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
break;
|
||||
case CUBE_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/cubes");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
palocube plCube = new palocube(plConn, lDatabaseId, palohelpers.StringToInt(csv.get(0)), csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToIntArray(csv.get(3),
|
||||
palohelpers.StringToInt(csv.get(2))), palohelpers.StringToLong(csv.get(4)),
|
||||
palohelpers.StringToLong(csv.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv
|
||||
.get(7)), palohelpers.StringToInt(csv.get(8)));
|
||||
|
||||
paloCubes.add(plCube);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public int getNumberOfCubes() {
|
||||
return paloCubes.size();
|
||||
}
|
||||
|
||||
public palocube getCube(int iIndex) {
|
||||
return paloCubes.get(iIndex);
|
||||
}
|
||||
|
||||
public ArrayList<palocube> getCubes() {
|
||||
return paloCubes;
|
||||
}
|
||||
|
||||
public void deleteCube(String strCubeName) throws paloexception {
|
||||
palocube paloCubeToRemove = getCube(strCubeName);
|
||||
if (null != paloCubeToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(paloCubeToRemove.getCubeId())));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/destroy");
|
||||
paloCubes.remove(paloCubeToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
public palocube getCube(String strCubeName) {
|
||||
for (palocube paloCube : paloCubes) {
|
||||
if (paloCube.getName().equals(strCubeName)) {
|
||||
return paloCube;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public palocube getCubeByIdentifier(int iCubeId) {
|
||||
for (palocube paloCube : paloCubes) {
|
||||
if (paloCube.getCubeId() == iCubeId) {
|
||||
return paloCube;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public palocube createCube(String strCubeName, String[] strArrDimensions, int iType) throws paloexception {
|
||||
palodimensions plDIMs = plDB.getDimensions(iType);
|
||||
StringBuilder sbDimensionsToCreate = new StringBuilder();
|
||||
int iPos = 0;
|
||||
for (String strDimensionName : strArrDimensions) {
|
||||
if (iPos > 0) {
|
||||
sbDimensionsToCreate.append(",");
|
||||
}
|
||||
palodimension plDIM = plDIMs.getDimension(strDimensionName);
|
||||
if (null == plDIM) {
|
||||
sbDimensionsToCreate.append("-1");
|
||||
} else {
|
||||
sbDimensionsToCreate.append(plDIMs.getDimension(strDimensionName).getDimensionId());
|
||||
}
|
||||
iPos++;
|
||||
}
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("new_name", strCubeName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
|
||||
qparams.add(new BasicNameValuePair("dimensions", sbDimensionsToCreate.toString()));
|
||||
|
||||
try {
|
||||
palocube plCube = null;
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/create");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
// System.out.println(csv.getRawRecord());
|
||||
plCube = new palocube(plConn, plDB.getDatabaseId(), palohelpers.StringToInt(csv.get(0)), csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToIntArray(csv.get(3),
|
||||
palohelpers.StringToInt(csv.get(2))), palohelpers.StringToLong(csv.get(4)),
|
||||
palohelpers.StringToLong(csv.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv
|
||||
.get(7)), palohelpers.StringToInt(csv.get(8)));
|
||||
|
||||
paloCubes.add(plCube);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return plCube;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getNumberOfCubes(){
|
||||
return paloCubes.size();
|
||||
}
|
||||
|
||||
public palocube getCube(int iIndex){
|
||||
return paloCubes.get(iIndex);
|
||||
}
|
||||
|
||||
public ArrayList<palocube> getCubes(){
|
||||
return paloCubes;
|
||||
}
|
||||
|
||||
public void deleteCube(String strCubeName) throws paloexception{
|
||||
palocube paloCubeToRemove = getCube(strCubeName);
|
||||
if(null != paloCubeToRemove){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(paloCubeToRemove.getCubeId())));
|
||||
plConn.sendToServerSingleRC(qparams, "/cube/destroy");
|
||||
paloCubes.remove(paloCubeToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
public palocube getCube(String strCubeName){
|
||||
for(palocube paloCube : paloCubes){
|
||||
if(paloCube.getName().equals(strCubeName)) return paloCube;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public palocube getCubeByIdentifier(int iCubeId){
|
||||
for(palocube paloCube : paloCubes){
|
||||
if(paloCube.getCubeId()==iCubeId) return paloCube;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public palocube createCube(String strCubeName, String[] strArrDimensions, int iType) throws paloexception{
|
||||
palodimensions plDIMs = plDB.getDimensions(iType);
|
||||
StringBuilder sbDimensionsToCreate = new StringBuilder();
|
||||
int iPos=0;
|
||||
for(String strDimensionName : strArrDimensions){
|
||||
if(iPos>0)sbDimensionsToCreate.append(",");
|
||||
palodimension plDIM = plDIMs.getDimension(strDimensionName);
|
||||
if(null==plDIM)sbDimensionsToCreate.append("-1");
|
||||
else sbDimensionsToCreate.append(plDIMs.getDimension(strDimensionName).getDimensionId());
|
||||
iPos++;
|
||||
}
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("new_name", strCubeName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
|
||||
qparams.add(new BasicNameValuePair("dimensions", sbDimensionsToCreate.toString()));
|
||||
|
||||
try{
|
||||
palocube plCube=null;
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/create");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
//System.out.println(csv.getRawRecord());
|
||||
plCube = new palocube(plConn, plDB.getDatabaseId(),
|
||||
palohelpers.StringToInt(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2))),
|
||||
palohelpers.StringToLong(csv.get(4)),
|
||||
palohelpers.StringToLong(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToInt(csv.get(8))
|
||||
);
|
||||
|
||||
paloCubes.add(plCube);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return plCube;
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,223 +1,216 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.csvreader.CsvReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
|
||||
public class palodata {
|
||||
|
||||
public palodata() {
|
||||
alPaloElements = new ArrayList();
|
||||
htPaloResultData = new Hashtable();
|
||||
lstDimensionElements = new LinkedList();
|
||||
}
|
||||
public palodata() {
|
||||
alPaloElements = new ArrayList();
|
||||
htPaloResultData = new Hashtable();
|
||||
lstDimensionElements = new LinkedList();
|
||||
}
|
||||
|
||||
public palodata(paloconnection plConn, palodatabase plDB, palocube paloCube)
|
||||
public palodata(paloconnection plConn, palodatabase plDB, palocube paloCube)
|
||||
|
||||
{
|
||||
alPaloElements = new ArrayList();
|
||||
htPaloResultData = new Hashtable();
|
||||
lstDimensionElements = new LinkedList();
|
||||
this.plConn = plConn;
|
||||
lDatabaseId = plDB.getDatabaseId();
|
||||
plCube = paloCube;
|
||||
}
|
||||
{
|
||||
alPaloElements = new ArrayList();
|
||||
htPaloResultData = new Hashtable();
|
||||
lstDimensionElements = new LinkedList();
|
||||
this.plConn = plConn;
|
||||
lDatabaseId = plDB.getDatabaseId();
|
||||
plCube = paloCube;
|
||||
}
|
||||
|
||||
public palodata(paloconnection plConn, palodatabase plDB, palocube paloCube, ArrayList alPaloElements,
|
||||
String strDimensionElementsArray[][], int iBatchSize) {
|
||||
this.alPaloElements = new ArrayList();
|
||||
htPaloResultData = new Hashtable();
|
||||
lstDimensionElements = new LinkedList();
|
||||
this.plConn = plConn;
|
||||
lDatabaseId = plDB.getDatabaseId();
|
||||
plCube = paloCube;
|
||||
this.alPaloElements = alPaloElements;
|
||||
this.strDimensionElementsArray = strDimensionElementsArray;
|
||||
public palodata(paloconnection plConn, palodatabase plDB,
|
||||
palocube paloCube, ArrayList alPaloElements,
|
||||
String strDimensionElementsArray[][], int iBatchSize) {
|
||||
this.alPaloElements = new ArrayList();
|
||||
htPaloResultData = new Hashtable();
|
||||
lstDimensionElements = new LinkedList();
|
||||
this.plConn = plConn;
|
||||
lDatabaseId = plDB.getDatabaseId();
|
||||
plCube = paloCube;
|
||||
this.alPaloElements = alPaloElements;
|
||||
this.strDimensionElementsArray = strDimensionElementsArray;
|
||||
|
||||
this.iBatchSize = iBatchSize;
|
||||
htPaloResultData = new Hashtable();
|
||||
buildDimElemIteratorFromArray();
|
||||
}
|
||||
this.iBatchSize = iBatchSize;
|
||||
htPaloResultData = new Hashtable();
|
||||
buildDimElemIteratorFromArray();
|
||||
}
|
||||
|
||||
private void buildDimElemIteratorFromArray() {
|
||||
iDimensionElementLength = strDimensionElementsArray.length;
|
||||
for (String[] element : strDimensionElementsArray) {
|
||||
lstDimensionElements.add(Arrays.asList(element));
|
||||
}
|
||||
private void buildDimElemIteratorFromArray() {
|
||||
iDimensionElementLength = strDimensionElementsArray.length;
|
||||
for (int i = 0; i < strDimensionElementsArray.length; i++)
|
||||
|
||||
itDimensionElements = palohelpers.finiteCartesianProduct(lstDimensionElements).iterator();
|
||||
}
|
||||
lstDimensionElements.add(Arrays
|
||||
.asList(strDimensionElementsArray[i]));
|
||||
|
||||
public boolean getResults() throws paloexception {
|
||||
int iRowCounter = 0;
|
||||
List lstDimensionElementArray = new LinkedList();
|
||||
htPaloResultData = new Hashtable();
|
||||
for (; itDimensionElements.hasNext() && iRowCounter < iBatchSize; iRowCounter++) {
|
||||
List x = (List) itDimensionElements.next();
|
||||
for (int i = 0; i < x.size(); i++) {
|
||||
lstDimensionElementArray.add(x.get(i));
|
||||
}
|
||||
itDimensionElements = palohelpers.finiteCartesianProduct(
|
||||
lstDimensionElements).iterator();
|
||||
}
|
||||
|
||||
}
|
||||
public boolean getResults() throws paloexception {
|
||||
int iRowCounter = 0;
|
||||
List lstDimensionElementArray = new LinkedList();
|
||||
htPaloResultData = new Hashtable();
|
||||
for (; itDimensionElements.hasNext() && iRowCounter < iBatchSize; iRowCounter++) {
|
||||
List x = (List) itDimensionElements.next();
|
||||
for (int i = 0; i < x.size(); i++)
|
||||
lstDimensionElementArray.add((String) x.get(i));
|
||||
|
||||
int iPos = 0;
|
||||
int iCoordPos = 0;
|
||||
StringBuilder sbCoordinates = new StringBuilder();
|
||||
for (Iterator iterator = lstDimensionElementArray.iterator(); iterator.hasNext();) {
|
||||
String strCoordElement = (String) iterator.next();
|
||||
if (iPos > 0) {
|
||||
sbCoordinates.append(",");
|
||||
}
|
||||
paloelement plElm = ((paloelements) alPaloElements.get(iCoordPos)).getElement(strCoordElement);
|
||||
if (plElm == null) {
|
||||
sbCoordinates.append("-1");
|
||||
} else {
|
||||
sbCoordinates.append(plElm.getElementIdentifier());
|
||||
}
|
||||
iPos++;
|
||||
if (++iCoordPos >= iDimensionElementLength) {
|
||||
iCoordPos = 0;
|
||||
sbCoordinates.append(":");
|
||||
iPos = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (iRowCounter > 0) {
|
||||
List qparams = new ArrayList();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
|
||||
qparams.add(new BasicNameValuePair("paths", sbCoordinates.toString()));
|
||||
try {
|
||||
HttpEntity entity = plConn.sendToServer(qparams, "/cell/values");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
int iCoordElem = 0;
|
||||
while (csv.readNext()) {
|
||||
String strArrCoord[] = new String[iDimensionElementLength];
|
||||
for (int i = 0; i < iDimensionElementLength; i++) {
|
||||
strArrCoord[i] = (String) lstDimensionElementArray.get(iCoordElem++);
|
||||
}
|
||||
int iPos = 0;
|
||||
int iCoordPos = 0;
|
||||
StringBuilder sbCoordinates = new StringBuilder();
|
||||
for (Iterator iterator = lstDimensionElementArray.iterator(); iterator
|
||||
.hasNext();) {
|
||||
String strCoordElement = (String) iterator.next();
|
||||
if (iPos > 0)
|
||||
sbCoordinates.append(",");
|
||||
paloelement plElm = ((paloelements) alPaloElements.get(iCoordPos))
|
||||
.getElement(strCoordElement);
|
||||
if (plElm == null)
|
||||
sbCoordinates.append("-1");
|
||||
else
|
||||
sbCoordinates.append(plElm.getElementIdentifier());
|
||||
iPos++;
|
||||
if (++iCoordPos >= iDimensionElementLength) {
|
||||
iCoordPos = 0;
|
||||
sbCoordinates.append(":");
|
||||
iPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (palohelpers.StringToInt(csv.get(0)) == 1) {
|
||||
if (palohelpers.StringToInt(csv.get(1)) > 0) {
|
||||
htPaloResultData.put(strArrCoord,
|
||||
new palodatavalue(strArrCoord, palohelpers.StringToDouble(csv.get(2))));
|
||||
} else {
|
||||
htPaloResultData.put(strArrCoord, new palodatavalue(strArrCoord, 0.0D));
|
||||
}
|
||||
} else if (palohelpers.StringToInt(csv.get(0)) == 0) {
|
||||
htPaloResultData.put(strArrCoord, new palodatavalue(strArrCoord, csv.get(2)));
|
||||
}
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
return iRowCounter <= iBatchSize && iRowCounter > 0;
|
||||
}
|
||||
if (iRowCounter > 0) {
|
||||
List qparams = new ArrayList();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube
|
||||
.getCubeId())));
|
||||
qparams.add(new BasicNameValuePair("paths", sbCoordinates
|
||||
.toString()));
|
||||
try {
|
||||
HttpEntity entity = plConn
|
||||
.sendToServer(qparams, "/cell/values");
|
||||
CsvReader csv = new CsvReader(entity.getContent(),
|
||||
Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
int iCoordElem = 0;
|
||||
while (csv.readRecord()) {
|
||||
String strArrCoord[] = new String[iDimensionElementLength];
|
||||
for (int i = 0; i < iDimensionElementLength; i++)
|
||||
strArrCoord[i] = (String) lstDimensionElementArray
|
||||
.get(iCoordElem++);
|
||||
|
||||
public Hashtable getResultHashTable() {
|
||||
return htPaloResultData;
|
||||
}
|
||||
if (palohelpers.StringToInt(csv.get(0)) == 1) {
|
||||
if (palohelpers.StringToInt(csv.get(1)) > 0)
|
||||
htPaloResultData.put(
|
||||
strArrCoord,
|
||||
new palodatavalue(strArrCoord, palohelpers
|
||||
.StringToDouble(csv.get(2))));
|
||||
else
|
||||
htPaloResultData.put(strArrCoord,
|
||||
new palodatavalue(strArrCoord, 0.0D));
|
||||
} else if (palohelpers.StringToInt(csv.get(0)) == 0)
|
||||
htPaloResultData.put(strArrCoord, new palodatavalue(
|
||||
strArrCoord, csv.get(2)));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
return iRowCounter <= iBatchSize && iRowCounter > 0;
|
||||
}
|
||||
|
||||
public palodatavalue getValue(String strDimensionElementArray[], boolean bRefreshElements) throws paloexception {
|
||||
long lDimensionElementIdentifierArray[] = new long[strDimensionElementArray.length];
|
||||
if (plDims == null || bRefreshElements) {
|
||||
plDims = plCube.getDimensions();
|
||||
}
|
||||
for (int i = 0; i < strDimensionElementArray.length; i++) {
|
||||
paloelement plElm = plDims.getDimension(i).getElements(false).getElement(strDimensionElementArray[i]);
|
||||
if (plElm == null) {
|
||||
lDimensionElementIdentifierArray[i] = -1L;
|
||||
} else {
|
||||
lDimensionElementIdentifierArray[i] = plElm.getElementIdentifier();
|
||||
}
|
||||
}
|
||||
public Hashtable getResultHashTable() {
|
||||
return htPaloResultData;
|
||||
}
|
||||
|
||||
return getValue(lDimensionElementIdentifierArray);
|
||||
}
|
||||
public palodatavalue getValue(String strDimensionElementArray[],
|
||||
boolean bRefreshElements) throws paloexception {
|
||||
long lDimensionElementIdentifierArray[] = new long[strDimensionElementArray.length];
|
||||
if (plDims == null || bRefreshElements)
|
||||
plDims = plCube.getDimensions();
|
||||
for (int i = 0; i < strDimensionElementArray.length; i++) {
|
||||
paloelement plElm = plDims.getDimension(i).getElements(false)
|
||||
.getElement(strDimensionElementArray[i]);
|
||||
if (plElm == null)
|
||||
lDimensionElementIdentifierArray[i] = -1L;
|
||||
else
|
||||
lDimensionElementIdentifierArray[i] = plElm
|
||||
.getElementIdentifier();
|
||||
}
|
||||
|
||||
public palodatavalue getValue(long lDimensionElementIdentifierArray[]) throws paloexception {
|
||||
List qparams = new ArrayList();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
|
||||
StringBuilder sbCoordinates = new StringBuilder();
|
||||
int iPos = 0;
|
||||
long al[];
|
||||
int j = (al = lDimensionElementIdentifierArray).length;
|
||||
for (int i = 0; i < j; i++) {
|
||||
long lDimensionElementIdentifier = al[i];
|
||||
if (iPos > 0) {
|
||||
sbCoordinates.append(",");
|
||||
}
|
||||
sbCoordinates.append(lDimensionElementIdentifier);
|
||||
iPos++;
|
||||
}
|
||||
return getValue(lDimensionElementIdentifierArray);
|
||||
}
|
||||
|
||||
qparams.add(new BasicNameValuePair("path", sbCoordinates.toString()));
|
||||
palodatavalue rcDataValue = null;
|
||||
try {
|
||||
HttpEntity entity = plConn.sendToServer(qparams, "/cell/value");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
if (palohelpers.StringToInt(csv.get(0)) == 1) {
|
||||
if (palohelpers.StringToInt(csv.get(1)) > 0) {
|
||||
rcDataValue = new palodatavalue(palohelpers.StringToDouble(csv.get(2)));
|
||||
} else {
|
||||
rcDataValue = new palodatavalue(0.0D);
|
||||
}
|
||||
} else if (palohelpers.StringToInt(csv.get(0)) == 0) {
|
||||
rcDataValue = new palodatavalue(csv.get(2));
|
||||
}
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return rcDataValue;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
public palodatavalue getValue(long lDimensionElementIdentifierArray[])
|
||||
throws paloexception {
|
||||
List qparams = new ArrayList();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube
|
||||
.getCubeId())));
|
||||
StringBuilder sbCoordinates = new StringBuilder();
|
||||
int iPos = 0;
|
||||
long al[];
|
||||
int j = (al = lDimensionElementIdentifierArray).length;
|
||||
for (int i = 0; i < j; i++) {
|
||||
long lDimensionElementIdentifier = al[i];
|
||||
if (iPos > 0)
|
||||
sbCoordinates.append(",");
|
||||
sbCoordinates.append(lDimensionElementIdentifier);
|
||||
iPos++;
|
||||
}
|
||||
|
||||
public static final int PALO_SPLASH_DISABLE = 0;
|
||||
qparams.add(new BasicNameValuePair("path", sbCoordinates.toString()));
|
||||
palodatavalue rcDataValue = null;
|
||||
try {
|
||||
HttpEntity entity = plConn.sendToServer(qparams, "/cell/value");
|
||||
CsvReader csv = new CsvReader(entity.getContent(),
|
||||
Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while (csv.readRecord())
|
||||
if (palohelpers.StringToInt(csv.get(0)) == 1) {
|
||||
if (palohelpers.StringToInt(csv.get(1)) > 0)
|
||||
rcDataValue = new palodatavalue(
|
||||
palohelpers.StringToDouble(csv.get(2)));
|
||||
else
|
||||
rcDataValue = new palodatavalue(0.0D);
|
||||
} else if (palohelpers.StringToInt(csv.get(0)) == 0)
|
||||
rcDataValue = new palodatavalue(csv.get(2));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return rcDataValue;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static final int PALO_SPLASH_DEFAULT = 1;
|
||||
|
||||
public static final int PALO_SPLASH_BASE_SET = 3;
|
||||
|
||||
public static final int PALO_SPLASH_BASE_ADD = 2;
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
private palodimensions plDims;
|
||||
|
||||
private long lDatabaseId;
|
||||
|
||||
private ArrayList alPaloElements;
|
||||
|
||||
private Hashtable htPaloResultData;
|
||||
|
||||
private palocube plCube;
|
||||
|
||||
private String strDimensionElementsArray[][];
|
||||
|
||||
private List lstDimensionElements;
|
||||
|
||||
private Iterator itDimensionElements;
|
||||
|
||||
private int iBatchSize;
|
||||
|
||||
private int iDimensionElementLength;
|
||||
public static final int PALO_SPLASH_DISABLE = 0;
|
||||
public static final int PALO_SPLASH_DEFAULT = 1;
|
||||
public static final int PALO_SPLASH_BASE_SET = 3;
|
||||
public static final int PALO_SPLASH_BASE_ADD = 2;
|
||||
private paloconnection plConn;
|
||||
private palodimensions plDims;
|
||||
private long lDatabaseId;
|
||||
private ArrayList alPaloElements;
|
||||
private Hashtable htPaloResultData;
|
||||
private palocube plCube;
|
||||
private String strDimensionElementsArray[][];
|
||||
private List lstDimensionElements;
|
||||
private Iterator itDimensionElements;
|
||||
private int iBatchSize;
|
||||
private int iDimensionElementLength;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,148 +8,144 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palodatabase {
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
// OK
|
||||
// private native palodimensions JNIgetDimensions(palodatabase paloDatabase, int iDimensionType);
|
||||
// private native palocubes JNIgetCubes(palodatabase paloDatabase, int iDimensionType, int iWithCell);
|
||||
// OK
|
||||
//private native palodimensions JNIgetDimensions(palodatabase paloDatabase, int iDimensionType);
|
||||
//private native palocubes JNIgetCubes(palodatabase paloDatabase, int iDimensionType, int iWithCell);
|
||||
|
||||
private String strDatabaseName;
|
||||
private long lDatabaseId;
|
||||
private int iNumberOfDimensions;
|
||||
private int iNumberOfCubes;
|
||||
private int iStatus;
|
||||
private int iType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private String strDatabaseToken;
|
||||
|
||||
public palodatabase(paloconnection plConn, String strDatabaseName, long lDatabaseId, int iNumberOfDimensions, int iNumberOfCubes, int iStatus, int iType, String strDatabaseToken){
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.strDatabaseName = strDatabaseName;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iNumberOfCubes = iNumberOfCubes;
|
||||
this.iNumberOfDimensions = iNumberOfDimensions;
|
||||
this.iStatus = iStatus;
|
||||
this.iType = iType;
|
||||
this.strDatabaseToken = strDatabaseToken;
|
||||
}
|
||||
|
||||
public palodimensions getDimensions(int iDimensionType)throws paloexception{
|
||||
return new palodimensions(this.plConn, this, iDimensionType);
|
||||
}
|
||||
|
||||
|
||||
public palocubes getCubes(int iCubeType) throws paloexception{
|
||||
return new palocubes(this.plConn, this, iCubeType);
|
||||
//return getCubes(iCubeType, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
public palocubes getCubes(int iCubeType, int iOnlyWithCells){
|
||||
return JNIgetCubes(this, iCubeType, iOnlyWithCells);
|
||||
}*/
|
||||
|
||||
public void save()throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/save");
|
||||
}
|
||||
|
||||
private String strDatabaseName;
|
||||
public void load() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/load");
|
||||
}
|
||||
|
||||
private long lDatabaseId;
|
||||
public void unload()throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/unload");
|
||||
}
|
||||
|
||||
public void rename(String strNewName) throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("new_name",strNewName));
|
||||
|
||||
private int iNumberOfDimensions;
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/rename");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
|
||||
private int iNumberOfCubes;
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/database/rename").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
|
||||
private int iStatus;
|
||||
|
||||
private int iType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private String strDatabaseToken;
|
||||
|
||||
public palodatabase(paloconnection plConn, String strDatabaseName, long lDatabaseId, int iNumberOfDimensions,
|
||||
int iNumberOfCubes, int iStatus, int iType, String strDatabaseToken) {
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.strDatabaseName = strDatabaseName;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iNumberOfCubes = iNumberOfCubes;
|
||||
this.iNumberOfDimensions = iNumberOfDimensions;
|
||||
this.iStatus = iStatus;
|
||||
this.iType = iType;
|
||||
this.strDatabaseToken = strDatabaseToken;
|
||||
}
|
||||
|
||||
public palodimensions getDimensions(int iDimensionType) throws paloexception {
|
||||
return new palodimensions(this.plConn, this, iDimensionType);
|
||||
}
|
||||
|
||||
public palocubes getCubes(int iCubeType) throws paloexception {
|
||||
return new palocubes(this.plConn, this, iCubeType);
|
||||
// return getCubes(iCubeType, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* public palocubes getCubes(int iCubeType, int iOnlyWithCells){ return JNIgetCubes(this, iCubeType,
|
||||
* iOnlyWithCells); }
|
||||
*/
|
||||
|
||||
public void save() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/save");
|
||||
}
|
||||
|
||||
public void load() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/load");
|
||||
}
|
||||
|
||||
public void unload() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/unload");
|
||||
}
|
||||
|
||||
public void rename(String strNewName) throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("new_name", strNewName));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/rename");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
|
||||
this.strDatabaseName = csv.get(1);
|
||||
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
|
||||
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
|
||||
this.iStatus = Integer.valueOf(csv.get(4));
|
||||
this.iType = Integer.valueOf(csv.get(5));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
this.strDatabaseName = csv.get(1);
|
||||
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
|
||||
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
|
||||
this.iStatus = Integer.valueOf(csv.get(4));
|
||||
this.iType = Integer.valueOf(csv.get(5));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
return strDatabaseName;
|
||||
}
|
||||
public long getDatabaseId(){
|
||||
return lDatabaseId;
|
||||
}
|
||||
public int getNumberOfDimensions(){
|
||||
return iNumberOfDimensions;
|
||||
}
|
||||
public int getNumberOfCubes(){
|
||||
return iNumberOfCubes;
|
||||
}
|
||||
public int getStatus(){
|
||||
return iStatus;
|
||||
}
|
||||
public int getType(){
|
||||
return iType;
|
||||
}
|
||||
|
||||
public void refreshDatabaseInfo() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
|
||||
public String getName() {
|
||||
return strDatabaseName;
|
||||
}
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/info");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/database/info").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
|
||||
public long getDatabaseId() {
|
||||
return lDatabaseId;
|
||||
}
|
||||
|
||||
public int getNumberOfDimensions() {
|
||||
return iNumberOfDimensions;
|
||||
}
|
||||
|
||||
public int getNumberOfCubes() {
|
||||
return iNumberOfCubes;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return iStatus;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return iType;
|
||||
}
|
||||
|
||||
public void refreshDatabaseInfo() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/info");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
|
||||
this.strDatabaseName = csv.get(1);
|
||||
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
|
||||
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
|
||||
this.iStatus = Integer.valueOf(csv.get(4));
|
||||
this.iType = Integer.valueOf(csv.get(5));
|
||||
this.strDatabaseToken = csv.get(6);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
this.strDatabaseName = csv.get(1);
|
||||
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
|
||||
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
|
||||
this.iStatus = Integer.valueOf(csv.get(4));
|
||||
this.iType = Integer.valueOf(csv.get(5));
|
||||
this.strDatabaseToken = csv.get(6);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,110 +8,108 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palodatabases {
|
||||
|
||||
private paloconnection plConn;
|
||||
private paloconnection plConn;
|
||||
|
||||
// OK
|
||||
public static final int DATABASE_TYPE_NORMAL = 0;
|
||||
public static final int DATABASE_TYPE_SYSTEM_= 1;
|
||||
public static final int DATABASE_TYPE_UNKNOWN = -1;
|
||||
|
||||
public static final int DATABASE_STATUS_UNLOADED=0;
|
||||
public static final int DATABASE_STATUS_LOADED=1;
|
||||
public static final int DATABASE_STATUS_CHANGED=2;
|
||||
public static final int DATABASE_STATUS_LOADING=3;
|
||||
public static final int DATABASE_STATUS_UNKNOWN=-1;
|
||||
|
||||
// OK
|
||||
public static final int DATABASE_TYPE_NORMAL = 0;
|
||||
private ArrayList<palodatabase> paloDatabases = new ArrayList<palodatabase>();
|
||||
|
||||
public palodatabases(paloconnection plConn) throws paloexception{
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
|
||||
public static final int DATABASE_TYPE_SYSTEM_ = 1;
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/server/databases");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
|
||||
public static final int DATABASE_TYPE_UNKNOWN = -1;
|
||||
|
||||
public static final int DATABASE_STATUS_UNLOADED = 0;
|
||||
|
||||
public static final int DATABASE_STATUS_LOADED = 1;
|
||||
|
||||
public static final int DATABASE_STATUS_CHANGED = 2;
|
||||
|
||||
public static final int DATABASE_STATUS_LOADING = 3;
|
||||
|
||||
public static final int DATABASE_STATUS_UNKNOWN = -1;
|
||||
|
||||
private ArrayList<palodatabase> paloDatabases = new ArrayList<palodatabase>();
|
||||
|
||||
public palodatabases(paloconnection plConn) throws paloexception {
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/server/databases");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
paloDatabases.add(new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)), Integer.valueOf(csv
|
||||
.get(2)), Integer.valueOf(csv.get(3)), Integer.valueOf(csv.get(4)), Integer.valueOf(csv.get(5)), csv
|
||||
.get(6)));
|
||||
// System.out.println(csv.getRawRecord());
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/server/databases").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
paloDatabases.add(new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)), Integer.valueOf(csv.get(2)),Integer.valueOf(csv.get(3)),Integer.valueOf(csv.get(4)),Integer.valueOf(csv.get(5)), csv.get(6)));
|
||||
//System.out.println(csv.getRawRecord());
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palodatabase createDatabase(String strDatabaseName) throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("new_name", strDatabaseName));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/create");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
palodatabase plDB = new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)),
|
||||
Integer.valueOf(csv.get(2)), Integer.valueOf(csv.get(3)), Integer.valueOf(csv.get(4)), Integer.valueOf(csv
|
||||
.get(5)), "");
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
plDB.refreshDatabaseInfo();
|
||||
paloDatabases.add(plDB);
|
||||
return plDB;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
public palodatabase createDatabase(String strDatabaseName) throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("new_name",strDatabaseName));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/create");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/database/create").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
palodatabase plDB = new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)), Integer.valueOf(csv.get(2)),Integer.valueOf(csv.get(3)),Integer.valueOf(csv.get(4)),Integer.valueOf(csv.get(5)),"");
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
plDB.refreshDatabaseInfo();
|
||||
paloDatabases.add(plDB);
|
||||
return plDB;
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void deleteDatabase(String strDatabaseName) throws paloexception {
|
||||
palodatabase paloDBToRemove = getDatabase(strDatabaseName);
|
||||
if (null != paloDBToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(paloDBToRemove.getDatabaseId())));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/destroy");
|
||||
paloDatabases.remove(paloDBToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
public int getNumberOfDatabases() {
|
||||
return paloDatabases.size();
|
||||
}
|
||||
|
||||
public palodatabase getDatabase(int iIndex) {
|
||||
return paloDatabases.get(iIndex);
|
||||
}
|
||||
|
||||
public ArrayList<palodatabase> getDatabases() {
|
||||
return paloDatabases;
|
||||
}
|
||||
|
||||
public palodatabase getDatabase(String strDatabaseName) {
|
||||
for (palodatabase palodb : paloDatabases) {
|
||||
if (palodb.getName().equals(strDatabaseName)) {
|
||||
return palodb;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void deleteDatabase(String strDatabaseName) throws paloexception{
|
||||
palodatabase paloDBToRemove = getDatabase(strDatabaseName);
|
||||
if(null != paloDBToRemove){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(paloDBToRemove.getDatabaseId())));
|
||||
plConn.sendToServerSingleRC(qparams, "/database/destroy");
|
||||
paloDatabases.remove(paloDBToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getNumberOfDatabases(){
|
||||
return paloDatabases.size();
|
||||
}
|
||||
|
||||
public palodatabase getDatabase(int iIndex){
|
||||
return paloDatabases.get(iIndex);
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<palodatabase> getDatabases(){
|
||||
return paloDatabases;
|
||||
}
|
||||
|
||||
public palodatabase getDatabase(String strDatabaseName){
|
||||
for(palodatabase palodb : paloDatabases){
|
||||
if(palodb.getName().equals(strDatabaseName)) return palodb;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,134 +1,127 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palodatamulti {
|
||||
|
||||
public final static int PALO_SPLASH_DISABLE=0;
|
||||
public final static int PALO_SPLASH_DEFAULT=1;
|
||||
public final static int PALO_SPLASH_BASE_SET=3;
|
||||
public final static int PALO_SPLASH_BASE_ADD=2;
|
||||
|
||||
public final static int PALO_SPLASH_DISABLE = 0;
|
||||
|
||||
private paloconnection plConn;
|
||||
private long lDatabaseId;
|
||||
private ArrayList<paloelements> alPaloElements = new ArrayList<paloelements>();
|
||||
private List<palodatavalue> lstPaloValues = new ArrayList<palodatavalue>();
|
||||
private int iNbOfCoordinates=0;
|
||||
private int iNbOfDataVolumns=0;
|
||||
private int iCurrentPos=0;
|
||||
|
||||
private void initDataSetList(){
|
||||
String strArr[] = new String[iNbOfCoordinates];
|
||||
for(int i=0;i<iNbOfDataVolumns;i++){
|
||||
palodatavalue plDV = new palodatavalue(strArr, 0);
|
||||
lstPaloValues.add(plDV);
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanDataSetList(){
|
||||
iCurrentPos=0;
|
||||
}
|
||||
|
||||
|
||||
public palodatamulti(paloconnection plConn, palodatabase plDB, int iNbOfDataVolumns, int iNbOfCoordinates, ArrayList<paloelements> alPaloElements){
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = plDB.getDatabaseId();
|
||||
lstPaloValues = new ArrayList<palodatavalue>(iNbOfDataVolumns);
|
||||
this.iNbOfCoordinates = iNbOfCoordinates;
|
||||
this.iNbOfDataVolumns = iNbOfDataVolumns;
|
||||
this.alPaloElements = alPaloElements;
|
||||
// Init lstPaloValues
|
||||
initDataSetList();
|
||||
}
|
||||
|
||||
|
||||
public void addToValueList(String[] strArrCoordinates, double dValue){
|
||||
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
|
||||
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, dValue);
|
||||
}
|
||||
|
||||
public void addToValueList(String[] strArrCoordinates, String sValue){
|
||||
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
|
||||
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, sValue);
|
||||
}
|
||||
|
||||
public int getNumberOfValues(){
|
||||
return iCurrentPos;
|
||||
}
|
||||
|
||||
public palodatavalue getDataValue(int iPos){
|
||||
return lstPaloValues.get(iPos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public final static int PALO_SPLASH_DEFAULT = 1;
|
||||
public void setData( palocube plCube, int SPLASH_MODE, boolean bAddValue, boolean bUseEventProcessor) throws paloexception{
|
||||
|
||||
public final static int PALO_SPLASH_BASE_SET = 3;
|
||||
|
||||
public final static int PALO_SPLASH_BASE_ADD = 2;
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
private long lDatabaseId;
|
||||
|
||||
private ArrayList<paloelements> alPaloElements = new ArrayList<paloelements>();
|
||||
|
||||
private List<palodatavalue> lstPaloValues = new ArrayList<palodatavalue>();
|
||||
|
||||
private int iNbOfCoordinates = 0;
|
||||
|
||||
private int iNbOfDataVolumns = 0;
|
||||
|
||||
private int iCurrentPos = 0;
|
||||
|
||||
private void initDataSetList() {
|
||||
String strArr[] = new String[iNbOfCoordinates];
|
||||
for (int i = 0; i < iNbOfDataVolumns; i++) {
|
||||
palodatavalue plDV = new palodatavalue(strArr, 0);
|
||||
lstPaloValues.add(plDV);
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanDataSetList() {
|
||||
iCurrentPos = 0;
|
||||
}
|
||||
|
||||
public palodatamulti(paloconnection plConn, palodatabase plDB, int iNbOfDataVolumns, int iNbOfCoordinates,
|
||||
ArrayList<paloelements> alPaloElements) {
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = plDB.getDatabaseId();
|
||||
lstPaloValues = new ArrayList<palodatavalue>(iNbOfDataVolumns);
|
||||
this.iNbOfCoordinates = iNbOfCoordinates;
|
||||
this.iNbOfDataVolumns = iNbOfDataVolumns;
|
||||
this.alPaloElements = alPaloElements;
|
||||
// Init lstPaloValues
|
||||
initDataSetList();
|
||||
}
|
||||
|
||||
public void addToValueList(String[] strArrCoordinates, double dValue) {
|
||||
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
|
||||
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, dValue);
|
||||
}
|
||||
|
||||
public void addToValueList(String[] strArrCoordinates, String sValue) {
|
||||
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
|
||||
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, sValue);
|
||||
}
|
||||
|
||||
public int getNumberOfValues() {
|
||||
return iCurrentPos;
|
||||
}
|
||||
|
||||
public palodatavalue getDataValue(int iPos) {
|
||||
return lstPaloValues.get(iPos);
|
||||
}
|
||||
|
||||
public void setData(palocube plCube, int SPLASH_MODE, boolean bAddValue, boolean bUseEventProcessor) throws paloexception {
|
||||
|
||||
StringBuilder sbCoordinates = new StringBuilder();
|
||||
StringBuilder sbValues = new StringBuilder();
|
||||
int iPos = 0;
|
||||
for (int i = 0; i < iCurrentPos; i++) {
|
||||
// for(palodatavalue plValue : this.lstPaloValues){
|
||||
palodatavalue plValue = getDataValue(i);
|
||||
if (iPos > 0) {
|
||||
sbCoordinates.append(":");
|
||||
sbValues.append(":");
|
||||
}
|
||||
sbCoordinates.append(plValue.getCoordinatesString());
|
||||
if (palodatavalue.PALO_NUMERIC == plValue.getType()) {
|
||||
sbValues.append(plValue.getDoubleValue());
|
||||
} else {
|
||||
sbValues.append(plValue.getStringValue());
|
||||
}
|
||||
iPos++;
|
||||
}
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
|
||||
|
||||
qparams.add(new BasicNameValuePair("paths", sbCoordinates.toString()));
|
||||
qparams.add(new BasicNameValuePair("values", sbValues.toString()));
|
||||
qparams.add(new BasicNameValuePair("add", palohelpers.BooleanToString(bAddValue)));
|
||||
qparams.add(new BasicNameValuePair("event_processor", palohelpers.BooleanToString(bUseEventProcessor)));
|
||||
qparams.add(new BasicNameValuePair("splash", String.valueOf(SPLASH_MODE)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cell/replace_bulk");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private String[] replaceStringArrWithElementId(String[] strArr) {
|
||||
for (int i = 0; i < strArr.length; i++) {
|
||||
paloelement plElm = alPaloElements.get(i).getElement(strArr[i]);
|
||||
if (null == plElm) {
|
||||
strArr[i] = "-1";
|
||||
} else {
|
||||
strArr[i] = String.valueOf(plElm.getElementIdentifier());
|
||||
}
|
||||
}
|
||||
return strArr;
|
||||
}
|
||||
StringBuilder sbCoordinates = new StringBuilder();
|
||||
StringBuilder sbValues = new StringBuilder();
|
||||
int iPos=0;
|
||||
for(int i=0;i<iCurrentPos;i++){
|
||||
//for(palodatavalue plValue : this.lstPaloValues){
|
||||
palodatavalue plValue = getDataValue(i);
|
||||
if(iPos>0){
|
||||
sbCoordinates.append(":");
|
||||
sbValues.append(":");
|
||||
}
|
||||
sbCoordinates.append(plValue.getCoordinatesString());
|
||||
if(palodatavalue.PALO_NUMERIC == plValue.getType())
|
||||
sbValues.append(plValue.getDoubleValue());
|
||||
else
|
||||
sbValues.append(plValue.getStringValue());
|
||||
iPos++;
|
||||
}
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
|
||||
|
||||
qparams.add(new BasicNameValuePair("paths", sbCoordinates.toString()));
|
||||
qparams.add(new BasicNameValuePair("values", sbValues.toString()));
|
||||
qparams.add(new BasicNameValuePair("add", palohelpers.BooleanToString(bAddValue)));
|
||||
qparams.add(new BasicNameValuePair("event_processor", palohelpers.BooleanToString(bUseEventProcessor)));
|
||||
qparams.add(new BasicNameValuePair("splash", String.valueOf(SPLASH_MODE)));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cell/replace_bulk");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private String[] replaceStringArrWithElementId(String[] strArr){
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
paloelement plElm = alPaloElements.get(i).getElement(strArr[i]);
|
||||
if(null==plElm) strArr[i]="-1";
|
||||
else strArr[i] = String.valueOf(plElm.getElementIdentifier());
|
||||
}
|
||||
return strArr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -8,222 +9,233 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palodimension {
|
||||
|
||||
private paloelements paloElements;
|
||||
|
||||
|
||||
private paloconnection plConn;
|
||||
private paloelements paloElements;
|
||||
private paloconnection plConn;
|
||||
private long lDatabaseId;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private String strCubeName;
|
||||
|
||||
private String strDimensionName;
|
||||
private int iDimensionId;
|
||||
@SuppressWarnings("unused")
|
||||
private int iAssocDimension;
|
||||
private int iAttributCube;
|
||||
private int iRightsCube;
|
||||
private int iNumberOfElements;
|
||||
private int iMaximumLevel;
|
||||
private int iMaximumIndent;
|
||||
private int iMaximumDepth;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private int iDimensionToken;
|
||||
private int iDimensionType;
|
||||
|
||||
private long lDatabaseId;
|
||||
public palodimension(paloconnection plConn, long lDatabaseId,
|
||||
String strDimensionName,
|
||||
int iDimensionId,
|
||||
int iAssocDimension,
|
||||
int iAttributCube,
|
||||
int iRightsCube,
|
||||
int iNumberOfElements,
|
||||
int iMaximumLevel,
|
||||
int iMaximumIndent,
|
||||
int iMaximumDepth,
|
||||
int iDimensionToken
|
||||
){
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.strDimensionName=strDimensionName;
|
||||
this.iDimensionId=iDimensionId;
|
||||
this.iAssocDimension=iAssocDimension;
|
||||
this.iAttributCube=iAttributCube;
|
||||
this.iRightsCube=iRightsCube;
|
||||
this.iNumberOfElements=iNumberOfElements;
|
||||
this.iMaximumLevel=iMaximumLevel;
|
||||
this.iMaximumIndent=iMaximumIndent;
|
||||
this.iMaximumDepth=iMaximumDepth;
|
||||
this.iDimensionToken=iDimensionToken;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private String strCubeName;
|
||||
public paloelements getElements(boolean bRefresh) throws paloexception {
|
||||
if(null==paloElements || bRefresh)
|
||||
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
|
||||
return paloElements;
|
||||
}
|
||||
|
||||
|
||||
public paloelements getElements() throws paloexception {
|
||||
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
|
||||
//return new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
|
||||
return paloElements;
|
||||
}
|
||||
|
||||
public paloelements getElements(HashSet<String> hsFilteredElements) throws paloexception {
|
||||
return new paloelements(plConn, this.lDatabaseId, this.iDimensionId, hsFilteredElements);
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
return strDimensionName;
|
||||
}
|
||||
public int getDimensionId(){
|
||||
return iDimensionId;
|
||||
}
|
||||
|
||||
|
||||
public String getAssocDimension(){
|
||||
|
||||
private String strDimensionName;
|
||||
return "";//return iAssocDimension;
|
||||
}
|
||||
|
||||
public String getAttributCube() throws paloexception{
|
||||
try{
|
||||
palocubes plCubes = getCubes(palocubes.CUBE_ATTRIBUT);
|
||||
if(plCubes!=null && this.iAttributCube > 1){
|
||||
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iAttributCube);
|
||||
if(plAttributeCube!=null) return plAttributeCube.getName();
|
||||
}
|
||||
}catch(Exception e){
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
public String getRightsCube(){
|
||||
try{
|
||||
palocubes plCubes = getCubes(palocubes.CUBE_SYSTEM);
|
||||
if(plCubes!=null && this.iRightsCube > 1){
|
||||
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iRightsCube);
|
||||
if(plAttributeCube!=null) return plAttributeCube.getName();
|
||||
}
|
||||
}catch(Exception e){
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public int getNumberOfElements(){
|
||||
return iNumberOfElements;
|
||||
}
|
||||
public int getMaximumLevel(){
|
||||
return iMaximumLevel;
|
||||
}
|
||||
public int getMaximumIndent(){
|
||||
return iMaximumIndent;
|
||||
}
|
||||
public int getMaximumDepth(){
|
||||
return iMaximumDepth;
|
||||
}
|
||||
public int getDimensionType(){
|
||||
return iDimensionType;
|
||||
}
|
||||
|
||||
private int iDimensionId;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private int iAssocDimension;
|
||||
|
||||
public void rename(String strDimensionNewName) throws paloexception{
|
||||
if(null!=strDimensionNewName && strDimensionNewName.length()>0 && !strDimensionName.equals(strDimensionNewName)){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("new_name", strDimensionNewName));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/rename");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/rename").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
this.strDimensionName= csv.get(1);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public palocubes getCubes() throws paloexception{
|
||||
return new palocubes(this.plConn, this.lDatabaseId, this.iDimensionType, this.iDimensionId);
|
||||
}
|
||||
|
||||
|
||||
public palocubes getCubes(int iCubeType) throws paloexception{
|
||||
return new palocubes(this.plConn, this.lDatabaseId, iCubeType, this.iDimensionId);
|
||||
}
|
||||
|
||||
private int iAttributCube;
|
||||
|
||||
private int iRightsCube;
|
||||
|
||||
private int iNumberOfElements;
|
||||
|
||||
private int iMaximumLevel;
|
||||
|
||||
private int iMaximumIndent;
|
||||
|
||||
private int iMaximumDepth;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private int iDimensionToken;
|
||||
|
||||
private int iDimensionType;
|
||||
|
||||
public palodimension(paloconnection plConn, long lDatabaseId, String strDimensionName, int iDimensionId, int iAssocDimension,
|
||||
int iAttributCube, int iRightsCube, int iNumberOfElements, int iMaximumLevel, int iMaximumIndent, int iMaximumDepth,
|
||||
int iDimensionToken) {
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.strDimensionName = strDimensionName;
|
||||
this.iDimensionId = iDimensionId;
|
||||
this.iAssocDimension = iAssocDimension;
|
||||
this.iAttributCube = iAttributCube;
|
||||
this.iRightsCube = iRightsCube;
|
||||
this.iNumberOfElements = iNumberOfElements;
|
||||
this.iMaximumLevel = iMaximumLevel;
|
||||
this.iMaximumIndent = iMaximumIndent;
|
||||
this.iMaximumDepth = iMaximumDepth;
|
||||
this.iDimensionToken = iDimensionToken;
|
||||
}
|
||||
|
||||
public paloelements getElements(boolean bRefresh) throws paloexception {
|
||||
if (null == paloElements || bRefresh) {
|
||||
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
|
||||
|
||||
|
||||
public void clear() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/clear");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/clear").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
this.strDimensionName= csv.get(1);
|
||||
this.iDimensionId=Integer.valueOf(csv.get(0));
|
||||
this.iAssocDimension=palohelpers.StringToInt(csv.get(7));
|
||||
this.iAttributCube=palohelpers.StringToInt(csv.get(8));
|
||||
this.iRightsCube=palohelpers.StringToInt(csv.get(9));
|
||||
this.iNumberOfElements=palohelpers.StringToInt(csv.get(2));
|
||||
this.iMaximumLevel=palohelpers.StringToInt(csv.get(3));
|
||||
this.iMaximumIndent=palohelpers.StringToInt(csv.get(4));
|
||||
this.iMaximumDepth=palohelpers.StringToInt(csv.get(5));
|
||||
this.iDimensionToken=palohelpers.StringToInt(csv.get(10));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
return paloElements;
|
||||
}
|
||||
|
||||
public paloelements getElements() throws paloexception {
|
||||
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
|
||||
// return new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
|
||||
return paloElements;
|
||||
}
|
||||
|
||||
public paloelements getElements(HashSet<String> hsFilteredElements) throws paloexception {
|
||||
return new paloelements(plConn, this.lDatabaseId, this.iDimensionId, hsFilteredElements);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return strDimensionName;
|
||||
}
|
||||
|
||||
public int getDimensionId() {
|
||||
return iDimensionId;
|
||||
}
|
||||
|
||||
public String getAssocDimension() {
|
||||
|
||||
return "";// return iAssocDimension;
|
||||
}
|
||||
|
||||
public String getAttributCube() throws paloexception {
|
||||
try {
|
||||
palocubes plCubes = getCubes(palocubes.CUBE_ATTRIBUT);
|
||||
if (plCubes != null && this.iAttributCube > 1) {
|
||||
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iAttributCube);
|
||||
if (plAttributeCube != null) {
|
||||
return plAttributeCube.getName();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void refreshDimensionInfo() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/info");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/info").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
this.strDimensionName= csv.get(1);
|
||||
this.iDimensionId=Integer.valueOf(csv.get(0));
|
||||
this.iAssocDimension=palohelpers.StringToInt(csv.get(7));
|
||||
this.iAttributCube=palohelpers.StringToInt(csv.get(8));
|
||||
this.iRightsCube=palohelpers.StringToInt(csv.get(9));
|
||||
this.iNumberOfElements=palohelpers.StringToInt(csv.get(2));
|
||||
this.iMaximumLevel=palohelpers.StringToInt(csv.get(3));
|
||||
this.iMaximumIndent=palohelpers.StringToInt(csv.get(4));
|
||||
this.iMaximumDepth=palohelpers.StringToInt(csv.get(5));
|
||||
this.iDimensionToken=palohelpers.StringToInt(csv.get(10));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getRightsCube() {
|
||||
try {
|
||||
palocubes plCubes = getCubes(palocubes.CUBE_SYSTEM);
|
||||
if (plCubes != null && this.iRightsCube > 1) {
|
||||
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iRightsCube);
|
||||
if (plAttributeCube != null) {
|
||||
return plAttributeCube.getName();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public int getNumberOfElements() {
|
||||
return iNumberOfElements;
|
||||
}
|
||||
|
||||
public int getMaximumLevel() {
|
||||
return iMaximumLevel;
|
||||
}
|
||||
|
||||
public int getMaximumIndent() {
|
||||
return iMaximumIndent;
|
||||
}
|
||||
|
||||
public int getMaximumDepth() {
|
||||
return iMaximumDepth;
|
||||
}
|
||||
|
||||
public int getDimensionType() {
|
||||
return iDimensionType;
|
||||
}
|
||||
|
||||
public void rename(String strDimensionNewName) throws paloexception {
|
||||
if (null != strDimensionNewName && strDimensionNewName.length() > 0 && !strDimensionName.equals(strDimensionNewName)) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("new_name", strDimensionNewName));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/rename");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
this.strDimensionName = csv.get(1);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public palocubes getCubes() throws paloexception {
|
||||
return new palocubes(this.plConn, this.lDatabaseId, this.iDimensionType, this.iDimensionId);
|
||||
}
|
||||
|
||||
public palocubes getCubes(int iCubeType) throws paloexception {
|
||||
return new palocubes(this.plConn, this.lDatabaseId, iCubeType, this.iDimensionId);
|
||||
}
|
||||
|
||||
public void clear() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/clear");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
this.strDimensionName = csv.get(1);
|
||||
this.iDimensionId = Integer.valueOf(csv.get(0));
|
||||
this.iAssocDimension = palohelpers.StringToInt(csv.get(7));
|
||||
this.iAttributCube = palohelpers.StringToInt(csv.get(8));
|
||||
this.iRightsCube = palohelpers.StringToInt(csv.get(9));
|
||||
this.iNumberOfElements = palohelpers.StringToInt(csv.get(2));
|
||||
this.iMaximumLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iMaximumIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iMaximumDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iDimensionToken = palohelpers.StringToInt(csv.get(10));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshDimensionInfo() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/info");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
this.strDimensionName = csv.get(1);
|
||||
this.iDimensionId = Integer.valueOf(csv.get(0));
|
||||
this.iAssocDimension = palohelpers.StringToInt(csv.get(7));
|
||||
this.iAttributCube = palohelpers.StringToInt(csv.get(8));
|
||||
this.iRightsCube = palohelpers.StringToInt(csv.get(9));
|
||||
this.iNumberOfElements = palohelpers.StringToInt(csv.get(2));
|
||||
this.iMaximumLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iMaximumIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iMaximumDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iDimensionToken = palohelpers.StringToInt(csv.get(10));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,247 +8,273 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palodimensions {
|
||||
|
||||
public static final int DIMENSION_UNKNOWN = -1;
|
||||
public static final int DIMENSION_UNKNOWN=-1;
|
||||
public static final int DIMENSION_NORMAL =0;
|
||||
public static final int DIMENSION_SYSTEM =1;
|
||||
public static final int DIMENSION_ATTRIBUTE =2;
|
||||
public static final int DIMENSION_USER_INFO =3;
|
||||
|
||||
|
||||
public static final int DIMENSION_NORMAL = 0;
|
||||
|
||||
public static final int DIMENSION_SYSTEM = 1;
|
||||
|
||||
public static final int DIMENSION_ATTRIBUTE = 2;
|
||||
|
||||
public static final int DIMENSION_USER_INFO = 3;
|
||||
|
||||
private ArrayList<palodimension> paloDimensions = new ArrayList<palodimension>();
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
private palodatabase plDB;
|
||||
|
||||
private String strDatabaseName;
|
||||
|
||||
private String strCubeName;
|
||||
|
||||
public palodimensions(paloconnection plConn, palodatabase plDB, int iDimensionType) throws paloexception {
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.plDB = plDB;
|
||||
|
||||
strDatabaseName = plDB.getName();
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
|
||||
switch (iDimensionType) {
|
||||
case DIMENSION_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
break;
|
||||
case DIMENSION_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
break;
|
||||
case DIMENSION_ATTRIBUTE:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
break;
|
||||
case DIMENSION_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
break;
|
||||
case DIMENSION_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
break;
|
||||
private ArrayList<palodimension> paloDimensions = new ArrayList<palodimension>();
|
||||
|
||||
private paloconnection plConn;
|
||||
private palodatabase plDB;
|
||||
|
||||
private String strDatabaseName;
|
||||
private String strCubeName;
|
||||
|
||||
|
||||
|
||||
public palodimensions(paloconnection plConn, palodatabase plDB, int iDimensionType) throws paloexception{
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.plDB = plDB;
|
||||
|
||||
strDatabaseName = plDB.getName();
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
|
||||
switch(iDimensionType){
|
||||
case DIMENSION_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
break;
|
||||
case DIMENSION_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
break;
|
||||
case DIMENSION_ATTRIBUTE:
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
break;
|
||||
case DIMENSION_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
break;
|
||||
case DIMENSION_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
paloDimensions.add(new palodimension(
|
||||
this.plConn,
|
||||
this.plDB.getDatabaseId(),
|
||||
csv.get(1),
|
||||
Integer.valueOf(csv.get(0)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToInt(csv.get(8)),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(10))
|
||||
));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
paloDimensions.add(new palodimension(this.plConn, this.plDB.getDatabaseId(), csv.get(1), Integer.valueOf(csv
|
||||
.get(0)), palohelpers.StringToInt(csv.get(7)), palohelpers.StringToInt(csv.get(8)), palohelpers
|
||||
.StringToInt(csv.get(9)), palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv
|
||||
.get(10))));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
|
||||
public palodimensions(paloconnection plConn, long lDatabaseId, int iDimensionType, int[] iArrDimensionsIdentifier) throws paloexception{
|
||||
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
|
||||
switch(iDimensionType){
|
||||
case DIMENSION_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
break;
|
||||
case DIMENSION_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
break;
|
||||
case DIMENSION_ATTRIBUTE:
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_info","0"));
|
||||
break;
|
||||
case DIMENSION_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_normal","0"));
|
||||
qparams.add(new BasicNameValuePair("show_system","0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","0"));
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
break;
|
||||
case DIMENSION_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_normal","1"));
|
||||
qparams.add(new BasicNameValuePair("show_system","1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute","1"));
|
||||
qparams.add(new BasicNameValuePair("show_info","1"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
try{
|
||||
|
||||
ArrayList<palodimension> paloDimensionsCube = new ArrayList<palodimension>();
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
paloDimensionsCube.add(new palodimension(
|
||||
this.plConn,
|
||||
lDatabaseId,
|
||||
csv.get(1),
|
||||
Integer.valueOf(csv.get(0)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToInt(csv.get(8)),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(10))
|
||||
));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
|
||||
for(int i=0;i<iArrDimensionsIdentifier.length;i++){
|
||||
for(palodimension plDimCube : paloDimensionsCube){
|
||||
if(plDimCube.getDimensionId()==iArrDimensionsIdentifier[i]) paloDimensions.add(plDimCube);
|
||||
}
|
||||
}
|
||||
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palodimensions(paloconnection plConn, long lDatabaseId, int iDimensionType, int[] iArrDimensionsIdentifier)
|
||||
throws paloexception {
|
||||
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
|
||||
switch (iDimensionType) {
|
||||
case DIMENSION_NORMAL:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
break;
|
||||
case DIMENSION_SYSTEM:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
break;
|
||||
case DIMENSION_ATTRIBUTE:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "0"));
|
||||
break;
|
||||
case DIMENSION_USER_INFO:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "0"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
break;
|
||||
case DIMENSION_UNKNOWN:
|
||||
qparams.add(new BasicNameValuePair("show_normal", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_system", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_attribute", "1"));
|
||||
qparams.add(new BasicNameValuePair("show_info", "1"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
public palodimension createDimension(String strDimensionName, int iType) throws paloexception{
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("new_name", strDimensionName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/create");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/create").getContent(), Charset.defaultCharset());
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
palodimension plDim = new palodimension(
|
||||
this.plConn,
|
||||
this.plDB.getDatabaseId(),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(0)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToInt(csv.get(8)),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(10))
|
||||
);
|
||||
paloDimensions.add(plDim);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return plDim;
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palodimension createDimension(String strDimensionName) throws paloexception{
|
||||
return createDimension(strDimensionName, palodimensions.DIMENSION_NORMAL);
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<palodimension> getDimensions(){
|
||||
return paloDimensions;
|
||||
}
|
||||
|
||||
public String getDatabaseName(){
|
||||
return strDatabaseName;
|
||||
}
|
||||
|
||||
public String getCubeName(){
|
||||
return strCubeName;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
ArrayList<palodimension> paloDimensionsCube = new ArrayList<palodimension>();
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
paloDimensionsCube.add(new palodimension(this.plConn, lDatabaseId, csv.get(1), Integer.valueOf(csv.get(0)),
|
||||
palohelpers.StringToInt(csv.get(7)), palohelpers.StringToInt(csv.get(8)), palohelpers.StringToInt(csv
|
||||
.get(9)), palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)), palohelpers
|
||||
.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv
|
||||
.get(10))));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
|
||||
for (int element : iArrDimensionsIdentifier) {
|
||||
for (palodimension plDimCube : paloDimensionsCube) {
|
||||
if (plDimCube.getDimensionId() == element) {
|
||||
paloDimensions.add(plDimCube);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palodimension createDimension(String strDimensionName, int iType) throws paloexception {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("new_name", strDimensionName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/create");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
palodimension plDim = new palodimension(this.plConn, this.plDB.getDatabaseId(), csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(0)), palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToInt(csv.get(8)), palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(10)));
|
||||
paloDimensions.add(plDim);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return plDim;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public palodimension createDimension(String strDimensionName) throws paloexception {
|
||||
return createDimension(strDimensionName, palodimensions.DIMENSION_NORMAL);
|
||||
}
|
||||
|
||||
public ArrayList<palodimension> getDimensions() {
|
||||
return paloDimensions;
|
||||
}
|
||||
|
||||
public String getDatabaseName() {
|
||||
return strDatabaseName;
|
||||
}
|
||||
|
||||
public String getCubeName() {
|
||||
return strCubeName;
|
||||
}
|
||||
|
||||
public int getNumberOfDimensions() {
|
||||
return paloDimensions.size();
|
||||
}
|
||||
|
||||
public palodimension getDimension(int iIndex) {
|
||||
return paloDimensions.get(iIndex);
|
||||
}
|
||||
|
||||
public palodimension getDimension(String strDimensionName) {
|
||||
for (palodimension palodim : paloDimensions) {
|
||||
if (palodim.getName().equals(strDimensionName)) {
|
||||
return palodim;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public palodimension getDimensionByIdentifier(int iDimensionId) {
|
||||
for (palodimension palodim : paloDimensions) {
|
||||
if (palodim.getDimensionId() == iDimensionId) {
|
||||
return palodim;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void deleteDimension(String strDimensionName) throws paloexception {
|
||||
palodimension paloDimToRemove = getDimension(strDimensionName);
|
||||
if (null != paloDimToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(paloDimToRemove.getDimensionId())));
|
||||
plConn.sendToServerSingleRC(qparams, "/dimension/destroy");
|
||||
paloDimensions.remove(paloDimToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
public int getNumberOfDimensions(){
|
||||
return paloDimensions.size();
|
||||
}
|
||||
|
||||
public palodimension getDimension(int iIndex){
|
||||
return paloDimensions.get(iIndex);
|
||||
}
|
||||
|
||||
public palodimension getDimension(String strDimensionName){
|
||||
for(palodimension palodim : paloDimensions){
|
||||
if(palodim.getName().equals(strDimensionName)) return palodim;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public palodimension getDimensionByIdentifier(int iDimensionId){
|
||||
for(palodimension palodim : paloDimensions){
|
||||
if(palodim.getDimensionId()==iDimensionId) return palodim;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void deleteDimension(String strDimensionName) throws paloexception{
|
||||
palodimension paloDimToRemove = getDimension(strDimensionName);
|
||||
if(null != paloDimToRemove){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(plDB.getDatabaseId())));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(paloDimToRemove.getDimensionId())));
|
||||
plConn.sendToServerSingleRC(qparams, "/dimension/destroy");
|
||||
paloDimensions.remove(paloDimToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,438 +8,425 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class paloelement implements Comparable {
|
||||
public class paloelement implements Comparable {
|
||||
|
||||
/*
|
||||
* private native void JNIupdateElement(paloelement plElem, paloconsolidations plCons, int iAddToConsolidation);
|
||||
*/
|
||||
/*
|
||||
private native void JNIupdateElement(paloelement plElem, paloconsolidations plCons, int iAddToConsolidation);
|
||||
*/
|
||||
|
||||
private paloconnection plConn;
|
||||
private long lDatabaseId;
|
||||
private int iDimensionId;
|
||||
|
||||
|
||||
private long lElementIdentifier;
|
||||
private String strElementName="";
|
||||
private int iElementType;
|
||||
private int iElementLevel;
|
||||
private int iElementIndent;
|
||||
private int iElementDepth;
|
||||
private int iElementPosition;
|
||||
private int iElementNumOfParents;
|
||||
private int[] iArrElementParents;
|
||||
private int iElementNumOfChildren;
|
||||
private int[] iArrElementChildren;
|
||||
private double[] dArrElementChildrenWeights;
|
||||
|
||||
private long lElementParentIdentifier;
|
||||
|
||||
private paloelements paloElements;
|
||||
|
||||
public paloelement(paloconnection plConn, long lDatabaseId, int iDimensionId, paloelements paloElements,
|
||||
long lElementIdentifier, //0 element identifier Identifier of the element
|
||||
String strElementName, //1 name_element string Name of the element
|
||||
int iElementPosition, //2 position integer Position of the element
|
||||
int iElementLevel, //3 level integer Level of the element
|
||||
int iElementIndent, //4 indent integer Indent of the element
|
||||
int iElementDepth, //5 depth integer Depth of the element
|
||||
int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
|
||||
int iElementNumOfParents, //7 number_parents integer Number of parents
|
||||
int[] iArrElementParents, //8 parents identifier Comma separate list of parent identifiers
|
||||
int iElementNumOfChildren, //9 number_children integer Number of children
|
||||
int[] iArrElementChildren, //10 children identifier Comma separate list of children identifiers
|
||||
double[] dArrElementChildrenWeights //11 weights double Comma separate list of children weight
|
||||
){
|
||||
super();
|
||||
this.plConn=plConn;
|
||||
this.lDatabaseId=lDatabaseId;
|
||||
this.iDimensionId=iDimensionId;
|
||||
this.paloElements = paloElements;
|
||||
this.lElementIdentifier=lElementIdentifier;
|
||||
this.strElementName=strElementName;
|
||||
this.iElementPosition=iElementPosition;
|
||||
this.iElementLevel=iElementLevel;
|
||||
this.iElementIndent=iElementIndent;
|
||||
this.iElementDepth= iElementDepth;
|
||||
this.iElementType=iElementType;
|
||||
this.iElementNumOfParents=iElementNumOfParents;
|
||||
this.iArrElementParents=iArrElementParents;
|
||||
this.iElementNumOfChildren=iElementNumOfChildren;
|
||||
this.iArrElementChildren=iArrElementChildren;
|
||||
this.dArrElementChildrenWeights=dArrElementChildrenWeights;
|
||||
|
||||
this.lElementParentIdentifier = (null==this.iArrElementParents)? this.lElementIdentifier : this.iArrElementParents[0];
|
||||
}
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
private long lDatabaseId;
|
||||
|
||||
private int iDimensionId;
|
||||
|
||||
private long lElementIdentifier;
|
||||
|
||||
private String strElementName = "";
|
||||
|
||||
private int iElementType;
|
||||
|
||||
private int iElementLevel;
|
||||
|
||||
private int iElementIndent;
|
||||
|
||||
private int iElementDepth;
|
||||
|
||||
private int iElementPosition;
|
||||
|
||||
private int iElementNumOfParents;
|
||||
|
||||
private int[] iArrElementParents;
|
||||
|
||||
private int iElementNumOfChildren;
|
||||
|
||||
private int[] iArrElementChildren;
|
||||
|
||||
private double[] dArrElementChildrenWeights;
|
||||
|
||||
private long lElementParentIdentifier;
|
||||
|
||||
private paloelements paloElements;
|
||||
|
||||
public paloelement(paloconnection plConn, long lDatabaseId, int iDimensionId, paloelements paloElements,
|
||||
long lElementIdentifier, // 0 element identifier Identifier of the element
|
||||
String strElementName, // 1 name_element string Name of the element
|
||||
int iElementPosition, // 2 position integer Position of the element
|
||||
int iElementLevel, // 3 level integer Level of the element
|
||||
int iElementIndent, // 4 indent integer Indent of the element
|
||||
int iElementDepth, // 5 depth integer Depth of the element
|
||||
int iElementType, // 6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
|
||||
int iElementNumOfParents, // 7 number_parents integer Number of parents
|
||||
int[] iArrElementParents, // 8 parents identifier Comma separate list of parent identifiers
|
||||
int iElementNumOfChildren, // 9 number_children integer Number of children
|
||||
int[] iArrElementChildren, // 10 children identifier Comma separate list of children identifiers
|
||||
double[] dArrElementChildrenWeights // 11 weights double Comma separate list of children weight
|
||||
) {
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iDimensionId = iDimensionId;
|
||||
this.paloElements = paloElements;
|
||||
this.lElementIdentifier = lElementIdentifier;
|
||||
this.strElementName = strElementName;
|
||||
this.iElementPosition = iElementPosition;
|
||||
this.iElementLevel = iElementLevel;
|
||||
this.iElementIndent = iElementIndent;
|
||||
this.iElementDepth = iElementDepth;
|
||||
this.iElementType = iElementType;
|
||||
this.iElementNumOfParents = iElementNumOfParents;
|
||||
this.iArrElementParents = iArrElementParents;
|
||||
this.iElementNumOfChildren = iElementNumOfChildren;
|
||||
this.iArrElementChildren = iArrElementChildren;
|
||||
this.dArrElementChildrenWeights = dArrElementChildrenWeights;
|
||||
|
||||
this.lElementParentIdentifier = (null == this.iArrElementParents) ? this.lElementIdentifier : this.iArrElementParents[0];
|
||||
}
|
||||
|
||||
public paloelement(paloelements paloElements) {
|
||||
super();
|
||||
this.paloElements = paloElements;
|
||||
}
|
||||
|
||||
/*
|
||||
* public void setPaloElements(paloelements paloElements){ this.paloElements = paloElements; }
|
||||
*/
|
||||
|
||||
public long getElementIdentifier() {
|
||||
return lElementIdentifier;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return strElementName;
|
||||
}
|
||||
|
||||
public int getElementType() {
|
||||
return iElementType;
|
||||
}
|
||||
|
||||
public long getElementLevel() {
|
||||
return iElementLevel;
|
||||
}
|
||||
|
||||
public long getElementIndent() {
|
||||
return iElementIndent;
|
||||
}
|
||||
|
||||
public long getElementDepth() {
|
||||
return iElementDepth;
|
||||
}
|
||||
|
||||
public long getElementPosition() {
|
||||
return iElementPosition;
|
||||
}
|
||||
|
||||
public long getElementNumOfParents() {
|
||||
return iElementNumOfParents;
|
||||
}
|
||||
|
||||
public long getElementNumOfChildren() {
|
||||
return iElementNumOfChildren;
|
||||
}
|
||||
|
||||
public long getElementParentIdentifier() {
|
||||
return lElementParentIdentifier;
|
||||
}
|
||||
|
||||
public boolean hasChildren() {
|
||||
if (iElementNumOfChildren > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isConsolidation() {
|
||||
if (paloelements.ELEMENT_CONSOLIDATION == iElementType) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isNumeric() {
|
||||
if (paloelements.ELEMENT_NUMERIC == iElementType) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isString() {
|
||||
if (paloelements.ELEMENT_STRING == iElementType) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isRule() {
|
||||
if (paloelements.ELEMENT_RULE == iElementType) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sbRC = new StringBuffer();
|
||||
sbRC.append(lElementIdentifier + " / ");
|
||||
sbRC.append(strElementName + " / ");
|
||||
sbRC.append(iElementType + " / ");
|
||||
sbRC.append(iElementLevel + " / ");
|
||||
sbRC.append(iElementIndent + " / ");
|
||||
sbRC.append(iElementDepth + " / ");
|
||||
sbRC.append(iElementPosition + " / ");
|
||||
sbRC.append(iElementNumOfParents + " / ");
|
||||
sbRC.append(iElementNumOfChildren + " / ");
|
||||
sbRC.append(lElementParentIdentifier);
|
||||
return sbRC.toString();
|
||||
}
|
||||
|
||||
public void rename(String strElementNewName) throws paloexception {
|
||||
if (null != strElementNewName && strElementNewName.length() > 0 && !strElementName.equals(strElementNewName)) {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("new_name", strElementNewName));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/rename");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
this.strElementName = csv.get(1);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
strElementName = strElementNewName;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getElementChildren() {
|
||||
return iArrElementChildren;
|
||||
}
|
||||
|
||||
public int[] getElementParents() {
|
||||
return iArrElementParents;
|
||||
}
|
||||
|
||||
public double[] getElementChildrenWeights() {
|
||||
return dArrElementChildrenWeights;
|
||||
}
|
||||
|
||||
public void move(long lElementNewPosition) throws paloexception {
|
||||
if (lElementNewPosition > -1 && lElementNewPosition != iElementPosition) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("position", String.valueOf(lElementNewPosition)));
|
||||
|
||||
try {
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/move");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
|
||||
this.strElementName = csv.get(1);
|
||||
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
|
||||
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iElementType = palohelpers.StringToInt(csv.get(6));
|
||||
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
|
||||
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
|
||||
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
|
||||
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
|
||||
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11),
|
||||
palohelpers.StringToInt(csv.get(9)));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get father paloelement
|
||||
public paloelement getFatherPaloelement() throws paloexception {
|
||||
long identifier = getElementParentIdentifier();
|
||||
paloelement plElm = null;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(identifier)));
|
||||
|
||||
try {
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
if (palohelpers.StringToLong(csv.get(0)) == identifier) {
|
||||
plElm = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, paloElements,
|
||||
palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv
|
||||
.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)), palohelpers.StringToIntArray(csv.get(10),
|
||||
palohelpers.StringToInt(csv.get(9))), palohelpers.StringToDoubleArray(csv.get(11),
|
||||
palohelpers.StringToInt(csv.get(9))));
|
||||
}
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
|
||||
public paloelement(paloelements paloElements){
|
||||
super();
|
||||
this.paloElements = paloElements;
|
||||
}
|
||||
|
||||
/*
|
||||
public void setPaloElements(paloelements paloElements){
|
||||
this.paloElements = paloElements;
|
||||
}*/
|
||||
|
||||
public long getElementIdentifier(){
|
||||
return lElementIdentifier;
|
||||
}
|
||||
public String getName(){
|
||||
return strElementName;
|
||||
}
|
||||
public int getElementType(){
|
||||
return iElementType;
|
||||
}
|
||||
public long getElementLevel(){
|
||||
return iElementLevel;
|
||||
}
|
||||
public long getElementIndent(){
|
||||
return iElementIndent;
|
||||
}
|
||||
public long getElementDepth(){
|
||||
return iElementDepth;
|
||||
}
|
||||
public long getElementPosition(){
|
||||
return iElementPosition;
|
||||
}
|
||||
public long getElementNumOfParents(){
|
||||
return iElementNumOfParents;
|
||||
}
|
||||
public long getElementNumOfChildren(){
|
||||
return iElementNumOfChildren;
|
||||
}
|
||||
public long getElementParentIdentifier(){
|
||||
return lElementParentIdentifier;
|
||||
}
|
||||
|
||||
public boolean hasChildren(){
|
||||
if(iElementNumOfChildren>0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isConsolidation(){
|
||||
if(paloelements.ELEMENT_CONSOLIDATION==iElementType) return true;
|
||||
return false;
|
||||
}
|
||||
public boolean isNumeric(){
|
||||
if(paloelements.ELEMENT_NUMERIC==iElementType) return true;
|
||||
return false;
|
||||
}
|
||||
public boolean isString(){
|
||||
if(paloelements.ELEMENT_STRING==iElementType) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isRule(){
|
||||
if(paloelements.ELEMENT_RULE==iElementType) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
StringBuffer sbRC = new StringBuffer();
|
||||
sbRC.append(lElementIdentifier+" / ");
|
||||
sbRC.append(strElementName+" / ");
|
||||
sbRC.append(iElementType+" / ");
|
||||
sbRC.append(iElementLevel+" / ");
|
||||
sbRC.append(iElementIndent+" / ");
|
||||
sbRC.append(iElementDepth+" / ");
|
||||
sbRC.append(iElementPosition+" / ");
|
||||
sbRC.append(iElementNumOfParents+" / ");
|
||||
sbRC.append(iElementNumOfChildren+" / ");
|
||||
sbRC.append(lElementParentIdentifier);
|
||||
return sbRC.toString();
|
||||
}
|
||||
|
||||
|
||||
public void rename(String strElementNewName) throws paloexception{
|
||||
if(null!=strElementNewName && strElementNewName.length()>0 && !strElementName.equals(strElementNewName)){
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("new_name", strElementNewName));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/rename");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.readRecord();
|
||||
this.strElementName= csv.get(1);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
strElementName = strElementNewName;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getElementChildren(){
|
||||
return iArrElementChildren;
|
||||
}
|
||||
|
||||
public int[] getElementParents(){
|
||||
return iArrElementParents;
|
||||
}
|
||||
|
||||
public double[] getElementChildrenWeights(){
|
||||
return dArrElementChildrenWeights;
|
||||
}
|
||||
|
||||
|
||||
public void move(long lElementNewPosition) throws paloexception{
|
||||
if(lElementNewPosition >-1 && lElementNewPosition != iElementPosition){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("position", String.valueOf(lElementNewPosition)));
|
||||
|
||||
try{
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/move");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.setUseTextQualifier(true);
|
||||
while(csv.readRecord()){
|
||||
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
|
||||
this.strElementName = csv.get(1);
|
||||
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
|
||||
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iElementType = palohelpers.StringToInt(csv.get(6));
|
||||
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
|
||||
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
|
||||
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
|
||||
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
|
||||
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get father paloelement
|
||||
public paloelement getFatherPaloelement() throws paloexception{
|
||||
long identifier = getElementParentIdentifier();
|
||||
paloelement plElm = null;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(identifier)));
|
||||
|
||||
try{
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.setUseTextQualifier(true);
|
||||
while(csv.readRecord()){
|
||||
if(palohelpers.StringToLong(csv.get(0)) == identifier){
|
||||
plElm = new paloelement(
|
||||
this.plConn,
|
||||
this.lDatabaseId,
|
||||
this.iDimensionId,
|
||||
paloElements,
|
||||
palohelpers.StringToLong(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
|
||||
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9))));
|
||||
}
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
return plElm;
|
||||
}
|
||||
|
||||
public void refreshElementInfo() throws paloexception {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
|
||||
|
||||
try {
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
|
||||
this.strElementName = csv.get(1);
|
||||
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
|
||||
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iElementType = palohelpers.StringToInt(csv.get(6));
|
||||
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
|
||||
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
|
||||
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
|
||||
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
|
||||
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11),
|
||||
palohelpers.StringToInt(csv.get(9)));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
|
||||
public void refreshElementInfo() throws paloexception{
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
|
||||
|
||||
try{
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.setUseTextQualifier(true);
|
||||
while(csv.readRecord()){
|
||||
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
|
||||
this.strElementName = csv.get(1);
|
||||
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
|
||||
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iElementType = palohelpers.StringToInt(csv.get(6));
|
||||
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
|
||||
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
|
||||
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
|
||||
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
|
||||
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public paloconsolidations getConsolidations() {
|
||||
return new paloconsolidations(paloElements, this);
|
||||
}
|
||||
|
||||
public void updateElement(paloconsolidations plCons, boolean bAddToConsolidation) throws paloexception{
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
|
||||
|
||||
|
||||
public paloconsolidations getConsolidations() {
|
||||
return new paloconsolidations(paloElements, this);
|
||||
}
|
||||
String strURLApiCall = "/element/append";
|
||||
|
||||
if(!bAddToConsolidation){
|
||||
if(plCons!=null) iElementType=paloelements.ELEMENT_CONSOLIDATION;
|
||||
qparams.add(new BasicNameValuePair("name_element", strElementName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
|
||||
strURLApiCall ="/element/replace";
|
||||
}
|
||||
|
||||
public void updateElement(paloconsolidations plCons, boolean bAddToConsolidation) throws paloexception {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
|
||||
|
||||
String strURLApiCall = "/element/append";
|
||||
|
||||
if (!bAddToConsolidation) {
|
||||
if (plCons != null) {
|
||||
iElementType = paloelements.ELEMENT_CONSOLIDATION;
|
||||
}
|
||||
qparams.add(new BasicNameValuePair("name_element", strElementName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
|
||||
strURLApiCall = "/element/replace";
|
||||
//if(plConsiElementType=paloelements.ELEMENT_CONSOLIDATION;
|
||||
|
||||
|
||||
if(plCons != null){
|
||||
qparams.add(new BasicNameValuePair("children", plCons.getConsolidationStringElementIdentifiers()));
|
||||
qparams.add(new BasicNameValuePair("weights", plCons.getConsolidationStringElementWeights()));
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, strURLApiCall);
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.setUseTextQualifier(true);
|
||||
csv.readRecord();
|
||||
//System.out.println(csv.getRawRecord());
|
||||
|
||||
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
|
||||
this.strElementName = csv.get(1);
|
||||
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
|
||||
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iElementType = palohelpers.StringToInt(csv.get(6));
|
||||
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
|
||||
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
|
||||
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
|
||||
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
|
||||
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
|
||||
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
|
||||
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void updateElementConsolidation(String strElementChildrensId, String strElementChildrenWeights, boolean bReplace) throws paloexception{
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
|
||||
|
||||
|
||||
// if(plConsiElementType=paloelements.ELEMENT_CONSOLIDATION;
|
||||
String strURLApiCall = "/element/append";
|
||||
if(bReplace) strURLApiCall = "/element/replace";
|
||||
iElementType=paloelements.ELEMENT_CONSOLIDATION;
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
|
||||
|
||||
if (plCons != null) {
|
||||
qparams.add(new BasicNameValuePair("children", plCons.getConsolidationStringElementIdentifiers()));
|
||||
qparams.add(new BasicNameValuePair("weights", plCons.getConsolidationStringElementWeights()));
|
||||
qparams.add(new BasicNameValuePair("children", strElementChildrensId));
|
||||
qparams.add(new BasicNameValuePair("weights", strElementChildrenWeights));
|
||||
|
||||
try{
|
||||
this.plConn.sendToServerSingleRC(qparams, strURLApiCall);
|
||||
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void updateElement() throws paloexception {
|
||||
updateElement(getConsolidations(), false);
|
||||
}
|
||||
|
||||
public void updateElement(paloconsolidations plCons) throws paloexception {
|
||||
updateElement(plCons, false);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, strURLApiCall);
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
// System.out.println(csv.getRawRecord());
|
||||
|
||||
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
|
||||
this.strElementName = csv.get(1);
|
||||
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
|
||||
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
|
||||
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
|
||||
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
|
||||
this.iElementType = palohelpers.StringToInt(csv.get(6));
|
||||
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
|
||||
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
|
||||
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
|
||||
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
|
||||
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
|
||||
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void updateElementConsolidation(String strElementChildrensId, String strElementChildrenWeights, boolean bReplace)
|
||||
throws paloexception {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
|
||||
|
||||
String strURLApiCall = "/element/append";
|
||||
if (bReplace) {
|
||||
strURLApiCall = "/element/replace";
|
||||
}
|
||||
iElementType = paloelements.ELEMENT_CONSOLIDATION;
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
|
||||
|
||||
qparams.add(new BasicNameValuePair("children", strElementChildrensId));
|
||||
qparams.add(new BasicNameValuePair("weights", strElementChildrenWeights));
|
||||
|
||||
try {
|
||||
this.plConn.sendToServerSingleRC(qparams, strURLApiCall);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void updateElement() throws paloexception {
|
||||
updateElement(getConsolidations(), false);
|
||||
}
|
||||
|
||||
public void updateElement(paloconsolidations plCons) throws paloexception {
|
||||
updateElement(plCons, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (null == obj) {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj){
|
||||
if (null == obj){
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if (obj instanceof paloelement) {
|
||||
if (obj instanceof paloelement){
|
||||
return strElementName.equals(((paloelement) obj).strElementName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int compareTo(Object o) {
|
||||
if (this.iElementPosition > ((paloelement) o).getElementPosition()) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public int compareTo ( Object o ){
|
||||
if(this.iElementPosition>((paloelement)o).getElementPosition()) return -1;
|
||||
else return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,354 +1,404 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.*;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class paloelements {
|
||||
|
||||
// OK
|
||||
// OK
|
||||
|
||||
public static final int ELEMENT_NUMERIC = 1;
|
||||
public static final int ELEMENT_STRING = 2;
|
||||
public static final int ELEMENT_CONSOLIDATION = 4;
|
||||
|
||||
public static final int ELEMENT_RULE = 4;
|
||||
public static final int ELEMENT_UNKNOWN = -1;
|
||||
|
||||
public static final int MODE_UNKNOWN = 0;
|
||||
public static final int MODE_ADD = 1;
|
||||
public static final int MODE_FORCE_ADD = 2;
|
||||
public static final int MODE_UPDATE = 3;
|
||||
public static final int MODE_ADD_OR_UPDATE = 4;
|
||||
|
||||
//D private Hashtable<Integer, String> paloElementsIdentifier = new Hashtable<Integer, String>();
|
||||
//D private Hashtable<String, paloelement> paloElements = new Hashtable<String,paloelement>();
|
||||
|
||||
private Hashtable<Long, String> paloElementsIdentifier = new Hashtable<Long, String>();
|
||||
private Hashtable<String, paloelement> paloElementsList = new Hashtable<String,paloelement>();
|
||||
|
||||
private ArrayList<paloelement> paloSortedElements = new ArrayList<paloelement>();
|
||||
|
||||
public static final int ELEMENT_NUMERIC = 1;
|
||||
private elementComparator elemComp = new elementComparator();
|
||||
|
||||
public static final int ELEMENT_STRING = 2;
|
||||
|
||||
public static final int ELEMENT_CONSOLIDATION = 4;
|
||||
|
||||
public static final int ELEMENT_RULE = 4;
|
||||
|
||||
public static final int ELEMENT_UNKNOWN = -1;
|
||||
|
||||
public static final int MODE_UNKNOWN = 0;
|
||||
|
||||
public static final int MODE_ADD = 1;
|
||||
|
||||
public static final int MODE_FORCE_ADD = 2;
|
||||
|
||||
public static final int MODE_UPDATE = 3;
|
||||
|
||||
public static final int MODE_ADD_OR_UPDATE = 4;
|
||||
|
||||
// D private Hashtable<Integer, String> paloElementsIdentifier = new Hashtable<Integer, String>();
|
||||
// D private Hashtable<String, paloelement> paloElements = new Hashtable<String,paloelement>();
|
||||
|
||||
private Hashtable<Long, String> paloElementsIdentifier = new Hashtable<Long, String>();
|
||||
|
||||
private Hashtable<String, paloelement> paloElementsList = new Hashtable<String, paloelement>();
|
||||
|
||||
private ArrayList<paloelement> paloSortedElements = new ArrayList<paloelement>();
|
||||
|
||||
private elementComparator elemComp = new elementComparator();
|
||||
|
||||
private paloconnection plConn;
|
||||
|
||||
private long lDatabaseId;
|
||||
|
||||
private int iDimensionId;
|
||||
|
||||
private List<String> elementNameList = new ArrayList<String>();
|
||||
|
||||
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId, HashSet<String> hsFilteredElements)
|
||||
throws paloexception {
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iDimensionId = iDimensionId;
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
try {
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
|
||||
if (hsFilteredElements.contains(csv.get(1))) {
|
||||
paloelement plElm = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, this,
|
||||
palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv
|
||||
.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)), palohelpers.StringToIntArray(csv.get(10),
|
||||
palohelpers.StringToInt(csv.get(9))), palohelpers.StringToDoubleArray(csv.get(11),
|
||||
palohelpers.StringToInt(csv.get(9))));
|
||||
|
||||
paloElementsList.put(plElm.getName(), plElm);
|
||||
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)), csv.get(1));
|
||||
// plElm.setPaloElements(this);
|
||||
/*
|
||||
* long lElementIdentifier, //0 element identifier Identifier of the element String strElementName,
|
||||
* //1 name_element string Name of the element int iElementPosition, //2 position integer Position
|
||||
* of the element int iElementLevel, //3 level integer Level of the element int iElementIndent, //4
|
||||
* indent integer Indent of the element int iElementDepth, //5 depth integer Depth of the element
|
||||
* int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED) int
|
||||
* iElementNumOfParents, //7 number_parents integer Number of parents int[] iArrElementParents, //8
|
||||
* parents identifier Comma separate list of parent identifiers int iElementNumOfChildren, //9
|
||||
* number_children integer Number of children int[] iArrElementChildren, //10 children identifier
|
||||
* Comma separate list of children identifiers double[] dArrElementChildrenWeights //11 weights
|
||||
* double Comma separate list of children weight
|
||||
*/
|
||||
}
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
private paloconnection plConn;
|
||||
private long lDatabaseId;
|
||||
private int iDimensionId;
|
||||
private List<String> elementNameList = new ArrayList<String>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId, HashSet<String> hsFilteredElements)throws paloexception{
|
||||
super();
|
||||
|
||||
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId=lDatabaseId;
|
||||
this.iDimensionId = iDimensionId;
|
||||
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
|
||||
try{
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.setUseTextQualifier(true);
|
||||
while(csv.readRecord()){
|
||||
|
||||
if(hsFilteredElements.contains(csv.get(1))){
|
||||
paloelement plElm = new paloelement(
|
||||
this.plConn,
|
||||
this.lDatabaseId,
|
||||
this.iDimensionId,
|
||||
this,
|
||||
palohelpers.StringToLong(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
|
||||
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
|
||||
);
|
||||
|
||||
|
||||
paloElementsList.put(plElm.getName(), plElm);
|
||||
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)),csv.get(1));
|
||||
//plElm.setPaloElements(this);
|
||||
/*
|
||||
long lElementIdentifier, //0 element identifier Identifier of the element
|
||||
String strElementName, //1 name_element string Name of the element
|
||||
int iElementPosition, //2 position integer Position of the element
|
||||
int iElementLevel, //3 level integer Level of the element
|
||||
int iElementIndent, //4 indent integer Indent of the element
|
||||
int iElementDepth, //5 depth integer Depth of the element
|
||||
int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
|
||||
int iElementNumOfParents, //7 number_parents integer Number of parents
|
||||
int[] iArrElementParents, //8 parents identifier Comma separate list of parent identifiers
|
||||
int iElementNumOfChildren, //9 number_children integer Number of children
|
||||
int[] iArrElementChildren, //10 children identifier Comma separate list of children identifiers
|
||||
double[] dArrElementChildrenWeights //11 weights double Comma separate list of children weight
|
||||
*/
|
||||
}}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId) throws paloexception {
|
||||
super();
|
||||
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iDimensionId = iDimensionId;
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
try {
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
/*
|
||||
*
|
||||
* paloElementsList.put(csv.get(1), new paloelement( this.plConn, this.lDatabaseId, this.iDimensionId,
|
||||
* this, palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
|
||||
* palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)),
|
||||
* palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv.get(6)),
|
||||
* palohelpers.StringToInt(csv.get(7)), palohelpers.StringToIntArray(csv.get(8),
|
||||
* palohelpers.StringToInt(csv.get(7))), palohelpers.StringToInt(csv.get(9)),
|
||||
* palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
|
||||
* palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9))) ));
|
||||
*/
|
||||
|
||||
paloelement plElm = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, this,
|
||||
palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv
|
||||
.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)), palohelpers.StringToIntArray(csv.get(10),
|
||||
palohelpers.StringToInt(csv.get(9))), palohelpers.StringToDoubleArray(csv.get(11),
|
||||
palohelpers.StringToInt(csv.get(9))));
|
||||
|
||||
paloElementsList.put(plElm.getName(), plElm);
|
||||
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)), csv.get(1));
|
||||
// plElm.setPaloElements(this);
|
||||
/*
|
||||
* long lElementIdentifier, //0 element identifier Identifier of the element String strElementName, //1
|
||||
* name_element string Name of the element int iElementPosition, //2 position integer Position of the
|
||||
* element int iElementLevel, //3 level integer Level of the element int iElementIndent, //4 indent
|
||||
* integer Indent of the element int iElementDepth, //5 depth integer Depth of the element int
|
||||
* iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED) int
|
||||
* iElementNumOfParents, //7 number_parents integer Number of parents int[] iArrElementParents, //8
|
||||
* parents identifier Comma separate list of parent identifiers int iElementNumOfChildren, //9
|
||||
* number_children integer Number of children int[] iArrElementChildren, //10 children identifier Comma
|
||||
* separate list of children identifiers double[] dArrElementChildrenWeights //11 weights double Comma
|
||||
* separate list of children weight
|
||||
*/
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId)throws paloexception{
|
||||
super();
|
||||
|
||||
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId=lDatabaseId;
|
||||
this.iDimensionId = iDimensionId;
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
|
||||
try{
|
||||
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.setUseTextQualifier(true);
|
||||
while(csv.readRecord()){
|
||||
/*
|
||||
|
||||
paloElementsList.put(csv.get(1), new paloelement(
|
||||
this.plConn,
|
||||
this.lDatabaseId,
|
||||
this.iDimensionId,
|
||||
this,
|
||||
palohelpers.StringToLong(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
|
||||
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
|
||||
));*/
|
||||
|
||||
|
||||
|
||||
paloelement plElm = new paloelement(
|
||||
this.plConn,
|
||||
this.lDatabaseId,
|
||||
this.iDimensionId,
|
||||
this,
|
||||
palohelpers.StringToLong(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
|
||||
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
|
||||
);
|
||||
|
||||
|
||||
paloElementsList.put(plElm.getName(), plElm);
|
||||
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)),csv.get(1));
|
||||
//plElm.setPaloElements(this);
|
||||
/*
|
||||
long lElementIdentifier, //0 element identifier Identifier of the element
|
||||
String strElementName, //1 name_element string Name of the element
|
||||
int iElementPosition, //2 position integer Position of the element
|
||||
int iElementLevel, //3 level integer Level of the element
|
||||
int iElementIndent, //4 indent integer Indent of the element
|
||||
int iElementDepth, //5 depth integer Depth of the element
|
||||
int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
|
||||
int iElementNumOfParents, //7 number_parents integer Number of parents
|
||||
int[] iArrElementParents, //8 parents identifier Comma separate list of parent identifiers
|
||||
int iElementNumOfChildren, //9 number_children integer Number of children
|
||||
int[] iArrElementChildren, //10 children identifier Comma separate list of children identifiers
|
||||
double[] dArrElementChildrenWeights //11 weights double Comma separate list of children weight
|
||||
*/
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void createElementsBulk(String strElementNames, String strElementTypes) throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
qparams.add(new BasicNameValuePair("name_elements", strElementNames));
|
||||
qparams.add(new BasicNameValuePair("types", strElementTypes));
|
||||
this.plConn.sendToServerSingleRC(qparams, "/element/create_bulk");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public paloelement createElement(String strElementName, int iElementType, int iMode) throws paloexception{
|
||||
paloelement plElem = null;
|
||||
|
||||
if(!elementNameList.contains(strElementName)){
|
||||
elementNameList.add(strElementName);
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
qparams.add(new BasicNameValuePair("new_name", strElementName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
|
||||
|
||||
try{
|
||||
HttpEntity entity=null;
|
||||
switch(iMode){
|
||||
case MODE_ADD:
|
||||
entity = this.plConn.sendToServer(qparams, "/element/create");
|
||||
break;
|
||||
case MODE_UNKNOWN:
|
||||
case MODE_ADD_OR_UPDATE:
|
||||
paloelement plElm = getElement(strElementName);
|
||||
if(null==plElm) entity = this.plConn.sendToServer(qparams, "/element/create");
|
||||
else{
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
|
||||
entity = this.plConn.sendToServer(qparams, "/element/replace");
|
||||
}
|
||||
break;
|
||||
case MODE_UPDATE:
|
||||
plElm = getElement(strElementName);
|
||||
if(null==plElm) throw new paloexception("Element " + strElementName +" does not exists!");
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
|
||||
entity = this.plConn.sendToServer(qparams, "/element/replace");
|
||||
break;
|
||||
case MODE_FORCE_ADD:
|
||||
plElm = getElement(strElementName);
|
||||
if(null!=plElm) deleteElement(plElm);
|
||||
entity = this.plConn.sendToServer(qparams, "/element/create");
|
||||
break;
|
||||
|
||||
public void createElementsBulk(String strElementNames, String strElementTypes) throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
}
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
csv.setUseTextQualifier(true);
|
||||
csv.readRecord();
|
||||
plElem = new paloelement(
|
||||
this.plConn,
|
||||
this.lDatabaseId,
|
||||
this.iDimensionId,
|
||||
this,
|
||||
palohelpers.StringToLong(csv.get(0)),
|
||||
csv.get(1),
|
||||
palohelpers.StringToInt(csv.get(2)),
|
||||
palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)),
|
||||
palohelpers.StringToInt(csv.get(5)),
|
||||
palohelpers.StringToInt(csv.get(6)),
|
||||
palohelpers.StringToInt(csv.get(7)),
|
||||
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
|
||||
palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
|
||||
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
|
||||
);
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
paloElementsList.put(plElem.getName(), plElem);
|
||||
paloElementsIdentifier.put(plElem.getElementIdentifier(),plElem.getName());
|
||||
//plElem.setPaloElements(this);
|
||||
|
||||
}catch(Exception e){
|
||||
System.out.println("Hier " + strElementName);
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
return plElem;
|
||||
}
|
||||
|
||||
qparams.add(new BasicNameValuePair("name_elements", strElementNames));
|
||||
qparams.add(new BasicNameValuePair("types", strElementTypes));
|
||||
this.plConn.sendToServerSingleRC(qparams, "/element/create_bulk");
|
||||
|
||||
}
|
||||
public paloelement createElement(String strElementName, int iElementType)throws paloexception{
|
||||
return createElement(strElementName, iElementType, MODE_ADD);
|
||||
}
|
||||
|
||||
public paloelement createElement(String strElementName, int iElementType, int iMode) throws paloexception {
|
||||
paloelement plElem = null;
|
||||
public paloelement createElement(String strElementName) throws paloexception{
|
||||
return createElement(strElementName, ELEMENT_NUMERIC, MODE_ADD);
|
||||
}
|
||||
|
||||
|
||||
public void deleteElement(paloelement paloElemToRemove) throws paloexception{
|
||||
if(null != paloElemToRemove){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/element/destroy");
|
||||
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
|
||||
paloElementsList.remove(paloElemToRemove.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void deleteElement(String strElementName) throws paloexception{
|
||||
paloelement paloElemToRemove = getElement(strElementName);
|
||||
if(null != paloElemToRemove){
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/element/destroy");
|
||||
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
|
||||
paloElementsList.remove(paloElemToRemove.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public int getNumberOfElements(){
|
||||
return paloElementsList.size();
|
||||
}
|
||||
|
||||
public paloelement getElement(int iIndex){
|
||||
return paloElementsList.get(iIndex);
|
||||
}
|
||||
|
||||
public paloelement getElementByIdentifier(long lElementIdentifier){
|
||||
return paloElementsList.get(paloElementsIdentifier.get(lElementIdentifier));
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<paloelement> getFilteredElements(long lParentPosition){
|
||||
|
||||
if (!elementNameList.contains(strElementName)) {
|
||||
elementNameList.add(strElementName);
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
|
||||
qparams.add(new BasicNameValuePair("new_name", strElementName));
|
||||
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = null;
|
||||
switch (iMode) {
|
||||
case MODE_ADD:
|
||||
entity = this.plConn.sendToServer(qparams, "/element/create");
|
||||
break;
|
||||
case MODE_UNKNOWN:
|
||||
case MODE_ADD_OR_UPDATE:
|
||||
paloelement plElm = getElement(strElementName);
|
||||
if (null == plElm) {
|
||||
entity = this.plConn.sendToServer(qparams, "/element/create");
|
||||
} else {
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
|
||||
entity = this.plConn.sendToServer(qparams, "/element/replace");
|
||||
}
|
||||
break;
|
||||
case MODE_UPDATE:
|
||||
plElm = getElement(strElementName);
|
||||
if (null == plElm) {
|
||||
throw new paloexception("Element " + strElementName + " does not exists!");
|
||||
}
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
|
||||
entity = this.plConn.sendToServer(qparams, "/element/replace");
|
||||
break;
|
||||
case MODE_FORCE_ADD:
|
||||
plElm = getElement(strElementName);
|
||||
if (null != plElm) {
|
||||
deleteElement(plElm);
|
||||
}
|
||||
entity = this.plConn.sendToServer(qparams, "/element/create");
|
||||
break;
|
||||
|
||||
}
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
csv.readNext();
|
||||
plElem = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, this, palohelpers.StringToLong(csv
|
||||
.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)),
|
||||
palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv
|
||||
.get(6)), palohelpers.StringToInt(csv.get(7)), palohelpers.StringToIntArray(csv.get(8),
|
||||
palohelpers.StringToInt(csv.get(7))), palohelpers.StringToInt(csv.get(9)),
|
||||
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
|
||||
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9))));
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
paloElementsList.put(plElem.getName(), plElem);
|
||||
paloElementsIdentifier.put(plElem.getElementIdentifier(), plElem.getName());
|
||||
// plElem.setPaloElements(this);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("Hier " + strElementName);
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
return plElem;
|
||||
}
|
||||
|
||||
public paloelement createElement(String strElementName, int iElementType) throws paloexception {
|
||||
return createElement(strElementName, iElementType, MODE_ADD);
|
||||
}
|
||||
|
||||
public paloelement createElement(String strElementName) throws paloexception {
|
||||
return createElement(strElementName, ELEMENT_NUMERIC, MODE_ADD);
|
||||
}
|
||||
|
||||
public void deleteElement(paloelement paloElemToRemove) throws paloexception {
|
||||
if (null != paloElemToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/element/destroy");
|
||||
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
|
||||
paloElementsList.remove(paloElemToRemove.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteElement(String strElementName) throws paloexception {
|
||||
paloelement paloElemToRemove = getElement(strElementName);
|
||||
if (null != paloElemToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
|
||||
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/element/destroy");
|
||||
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
|
||||
paloElementsList.remove(paloElemToRemove.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public int getNumberOfElements() {
|
||||
return paloElementsList.size();
|
||||
}
|
||||
|
||||
public paloelement getElement(int iIndex) {
|
||||
return paloElementsList.get(iIndex);
|
||||
}
|
||||
|
||||
public paloelement getElementByIdentifier(long lElementIdentifier) {
|
||||
return paloElementsList.get(paloElementsIdentifier.get(lElementIdentifier));
|
||||
}
|
||||
|
||||
public ArrayList<paloelement> getFilteredElements(long lParentPosition) {
|
||||
|
||||
ArrayList<paloelement> paloFilteredElements = new ArrayList<paloelement>();
|
||||
for (paloelement plElement : getElements()) {
|
||||
if (lParentPosition == plElement.getElementParentIdentifier()) {
|
||||
paloFilteredElements.add(plElement);
|
||||
}
|
||||
}
|
||||
return paloFilteredElements;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void buildSortedElementArray() {
|
||||
paloSortedElements = new ArrayList<paloelement>();
|
||||
Object[] arObjectsToSort = paloElementsList.entrySet().toArray();
|
||||
Arrays.sort(arObjectsToSort, (Comparator) elemComp);
|
||||
for (Object element : arObjectsToSort) {
|
||||
paloSortedElements.add(((paloelement) ((Map.Entry) element).getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<paloelement> getElements() {
|
||||
if (paloSortedElements == null || paloSortedElements.size() < 1) {
|
||||
buildSortedElementArray();
|
||||
}
|
||||
return paloSortedElements;
|
||||
|
||||
/*
|
||||
* ArrayList<paloelement> rcArrayList = new ArrayList<paloelement>(); Object[] arObjectsToSort =
|
||||
* paloElements.entrySet().toArray(); Arrays.sort(arObjectsToSort, (Comparator)elemComp); for(int
|
||||
* i=0;i<arObjectsToSort.length;i++){
|
||||
* rcArrayList.add(((paloelement)((Map.Entry)arObjectsToSort[i]).getValue())); } return rcArrayList;
|
||||
*/
|
||||
}
|
||||
|
||||
public paloelement getElement(String strElementName) {
|
||||
return paloElementsList.get(strElementName);
|
||||
}
|
||||
|
||||
class elementComparator implements Comparator<Map.Entry<String, paloelement>> {
|
||||
|
||||
public int compare(Map.Entry<String, paloelement> o1, Map.Entry<String, paloelement> o2) {
|
||||
if (o1.getValue().getElementPosition() > o2.getValue().getElementPosition()) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
ArrayList<paloelement> paloFilteredElements = new ArrayList<paloelement>();
|
||||
for(paloelement plElement:getElements()){
|
||||
if(lParentPosition==plElement.getElementParentIdentifier()){
|
||||
paloFilteredElements.add(plElement);
|
||||
}
|
||||
}
|
||||
return paloFilteredElements;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void buildSortedElementArray(){
|
||||
paloSortedElements = new ArrayList<paloelement>();
|
||||
Object[] arObjectsToSort = paloElementsList.entrySet().toArray();
|
||||
Arrays.sort(arObjectsToSort, (Comparator)elemComp);
|
||||
for(int i=0;i<arObjectsToSort.length;i++){
|
||||
paloSortedElements.add(((paloelement)((Map.Entry)arObjectsToSort[i]).getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<paloelement> getElements(){
|
||||
if(paloSortedElements==null || paloSortedElements.size()<1) buildSortedElementArray();
|
||||
return paloSortedElements;
|
||||
|
||||
/*
|
||||
ArrayList<paloelement> rcArrayList = new ArrayList<paloelement>();
|
||||
Object[] arObjectsToSort = paloElements.entrySet().toArray();
|
||||
Arrays.sort(arObjectsToSort, (Comparator)elemComp);
|
||||
for(int i=0;i<arObjectsToSort.length;i++){
|
||||
rcArrayList.add(((paloelement)((Map.Entry)arObjectsToSort[i]).getValue()));
|
||||
}
|
||||
return rcArrayList;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
public paloelement getElement(String strElementName){
|
||||
return paloElementsList.get(strElementName);
|
||||
}
|
||||
|
||||
class elementComparator implements Comparator<Map.Entry<String, paloelement>>{
|
||||
public int compare(Map.Entry<String, paloelement> o1, Map.Entry<String, paloelement> o2){
|
||||
if(o1.getValue().getElementPosition()> o2.getValue().getElementPosition()) return 1;
|
||||
else return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -8,150 +9,147 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palorule {
|
||||
|
||||
private paloconnection plConn;
|
||||
private paloconnection plConn;
|
||||
private long lDatabaseId;
|
||||
private int iCubeId;
|
||||
|
||||
private long lDatabaseId;
|
||||
private int lIdentifier;
|
||||
private String strDefinition;
|
||||
private String strExtern_Id;
|
||||
private String strComment;
|
||||
private long lTimeStamp;
|
||||
private boolean bActivated;
|
||||
|
||||
private int iCubeId;
|
||||
|
||||
public palorule(
|
||||
paloconnection plConn,
|
||||
long lDatabaseId,
|
||||
int iCubeId,
|
||||
int lIdentifier, //0 rule identifier Identifier of the rule
|
||||
String strDefinition,//1 rule_string string Textual representation for the rule
|
||||
String strExtern_Id,//2 external_identifier string external identifier of the rule
|
||||
String strComment, //3 comment string comment for the rule
|
||||
long lTimeStamp, // 4 timestamp string creation time of the rule in seconds since 1970-01-01
|
||||
boolean bActivated // 5 active integer 0=rule is not active, 1=rule is active
|
||||
){
|
||||
super();
|
||||
this.plConn=plConn;
|
||||
this.lDatabaseId=lDatabaseId;
|
||||
this.iCubeId=iCubeId;
|
||||
this.lIdentifier=lIdentifier;
|
||||
this.strDefinition=strDefinition;
|
||||
this.strExtern_Id=strExtern_Id;
|
||||
this.strComment=strComment;
|
||||
this.lTimeStamp=lTimeStamp;
|
||||
this.bActivated=bActivated;
|
||||
|
||||
}
|
||||
|
||||
private int lIdentifier;
|
||||
public long getIdentifier(){
|
||||
return lIdentifier;
|
||||
}
|
||||
|
||||
private String strDefinition;
|
||||
public String getDefinition(){
|
||||
return strDefinition;
|
||||
}
|
||||
public void setDefinition(String strDefinition){
|
||||
this.strDefinition= strDefinition;
|
||||
}
|
||||
|
||||
public String getExtern_Id(){
|
||||
return strExtern_Id;
|
||||
}
|
||||
public void setExtern_Id(String strExtern_Id){
|
||||
this.strExtern_Id=strExtern_Id;
|
||||
}
|
||||
|
||||
public String getComment(){
|
||||
return strComment;
|
||||
}
|
||||
public void setComment(String strComment){
|
||||
this.strComment=strComment;
|
||||
}
|
||||
|
||||
public long getTimeStamp(){
|
||||
return lTimeStamp;
|
||||
}
|
||||
|
||||
public Date getModificationData(){
|
||||
return palohelpers.getCalcDateBegin((int)lTimeStamp);
|
||||
}
|
||||
|
||||
public boolean getActivated(){
|
||||
return bActivated;
|
||||
}
|
||||
public void setActivated(boolean bActivated){
|
||||
this.bActivated=bActivated;
|
||||
}
|
||||
|
||||
private String strExtern_Id;
|
||||
|
||||
private String strComment;
|
||||
|
||||
private long lTimeStamp;
|
||||
|
||||
private boolean bActivated;
|
||||
|
||||
public palorule(paloconnection plConn, long lDatabaseId, int iCubeId, int lIdentifier, // 0 rule identifier
|
||||
// Identifier of the rule
|
||||
String strDefinition,// 1 rule_string string Textual representation for the rule
|
||||
String strExtern_Id,// 2 external_identifier string external identifier of the rule
|
||||
String strComment, // 3 comment string comment for the rule
|
||||
long lTimeStamp, // 4 timestamp string creation time of the rule in seconds since 1970-01-01
|
||||
boolean bActivated // 5 active integer 0=rule is not active, 1=rule is active
|
||||
) {
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iCubeId = iCubeId;
|
||||
this.lIdentifier = lIdentifier;
|
||||
this.strDefinition = strDefinition;
|
||||
this.strExtern_Id = strExtern_Id;
|
||||
this.strComment = strComment;
|
||||
this.lTimeStamp = lTimeStamp;
|
||||
this.bActivated = bActivated;
|
||||
|
||||
}
|
||||
|
||||
public long getIdentifier() {
|
||||
return lIdentifier;
|
||||
}
|
||||
|
||||
public String getDefinition() {
|
||||
return strDefinition;
|
||||
}
|
||||
|
||||
public void setDefinition(String strDefinition) {
|
||||
this.strDefinition = strDefinition;
|
||||
}
|
||||
|
||||
public String getExtern_Id() {
|
||||
return strExtern_Id;
|
||||
}
|
||||
|
||||
public void setExtern_Id(String strExtern_Id) {
|
||||
this.strExtern_Id = strExtern_Id;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return strComment;
|
||||
}
|
||||
|
||||
public void setComment(String strComment) {
|
||||
this.strComment = strComment;
|
||||
}
|
||||
|
||||
public long getTimeStamp() {
|
||||
return lTimeStamp;
|
||||
}
|
||||
|
||||
public Date getModificationData() {
|
||||
return palohelpers.getCalcDateBegin((int) lTimeStamp);
|
||||
}
|
||||
|
||||
public boolean getActivated() {
|
||||
return bActivated;
|
||||
}
|
||||
|
||||
public void setActivated(boolean bActivated) {
|
||||
this.bActivated = bActivated;
|
||||
}
|
||||
|
||||
public void refreshRuleInfo() throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/info");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
lIdentifier = palohelpers.StringToInt(csv.get(0));
|
||||
strDefinition = csv.get(1);
|
||||
strExtern_Id = csv.get(2);
|
||||
strComment = csv.get(3);
|
||||
lTimeStamp = palohelpers.StringToLong(csv.get(4));
|
||||
bActivated = palohelpers.StringToBoolean(csv.get(5));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void modifyRule() throws paloexception {
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("definition", strDefinition));
|
||||
qparams.add(new BasicNameValuePair("activate", palohelpers.BooleanToString(this.bActivated)));
|
||||
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
|
||||
qparams.add(new BasicNameValuePair("comment", strComment));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/modify");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
lIdentifier = palohelpers.StringToInt(csv.get(0));
|
||||
strDefinition = csv.get(1);
|
||||
strExtern_Id = csv.get(2);
|
||||
strComment = csv.get(3);
|
||||
lTimeStamp = palohelpers.StringToLong(csv.get(4));
|
||||
bActivated = palohelpers.StringToBoolean(csv.get(5));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshRuleInfo() throws paloexception{
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/info");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
lIdentifier = palohelpers.StringToInt(csv.get(0));
|
||||
strDefinition = csv.get(1);
|
||||
strExtern_Id =csv.get(2);
|
||||
strComment = csv.get(3);
|
||||
lTimeStamp=palohelpers.StringToLong(csv.get(4));
|
||||
bActivated = palohelpers.StringToBoolean(csv.get(5));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void modifyRule() throws paloexception{
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
|
||||
qparams.add(new BasicNameValuePair("definition", strDefinition));
|
||||
qparams.add(new BasicNameValuePair("activate", palohelpers.BooleanToString(this.bActivated)));
|
||||
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
|
||||
qparams.add(new BasicNameValuePair("comment", strComment));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
|
||||
|
||||
try{
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/modify");
|
||||
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while(csv.readRecord()){
|
||||
lIdentifier = palohelpers.StringToInt(csv.get(0));
|
||||
strDefinition = csv.get(1);
|
||||
strExtern_Id =csv.get(2);
|
||||
strComment = csv.get(3);
|
||||
lTimeStamp=palohelpers.StringToLong(csv.get(4));
|
||||
bActivated = palohelpers.StringToBoolean(csv.get(5));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
}catch(Exception e){
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.talend.jpalo;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,214 +8,243 @@ import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.talend.csv.CSVReader;
|
||||
import com.csvreader.CsvReader;
|
||||
|
||||
public class palorules {
|
||||
public static final int RULES_TEXT = 0;
|
||||
public static final int RULES_NUMERIC = 1;
|
||||
|
||||
public static final int RULES_TEXT = 0;
|
||||
private ArrayList<palorule> paloRules = new ArrayList<palorule>();
|
||||
|
||||
public static final int RULES_NUMERIC = 1;
|
||||
private paloconnection plConn;
|
||||
private long lDatabaseId;
|
||||
private int iCubeId;
|
||||
|
||||
private ArrayList<palorule> paloRules = new ArrayList<palorule>();
|
||||
private String strRuleParseResult;
|
||||
|
||||
private paloconnection plConn;
|
||||
public palorules(paloconnection plConn, long lDatabaseId, int iCubeId)
|
||||
throws paloexception {
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iCubeId = iCubeId;
|
||||
|
||||
private long lDatabaseId;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", "0"));
|
||||
try {
|
||||
HttpEntity entity = this.plConn
|
||||
.sendToServer(qparams, "/cube/rules");
|
||||
CsvReader csv = new CsvReader(entity.getContent(),
|
||||
Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while (csv.readRecord()) {
|
||||
// System.out.println(csv.getRawRecord());
|
||||
paloRules.add(new palorule(plConn, lDatabaseId, iCubeId,
|
||||
palohelpers.StringToInt(csv.get(0)), csv.get(1), csv
|
||||
.get(2), csv.get(3), palohelpers
|
||||
.StringToLong(csv.get(4)), palohelpers
|
||||
.StringToBoolean(csv.get(5))));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
|
||||
private int iCubeId;
|
||||
}
|
||||
|
||||
private String strRuleParseResult;
|
||||
public int getNumberOfRules() {
|
||||
return paloRules.size();
|
||||
}
|
||||
|
||||
public palorules(paloconnection plConn, long lDatabaseId, int iCubeId) throws paloexception {
|
||||
super();
|
||||
this.plConn = plConn;
|
||||
this.lDatabaseId = lDatabaseId;
|
||||
this.iCubeId = iCubeId;
|
||||
// Returns the Rule at the given Position
|
||||
public palorule getRule(int iIndex) {
|
||||
return paloRules.get(iIndex);
|
||||
}
|
||||
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", "0"));
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/rules");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
// System.out.println(csv.getRawRecord());
|
||||
paloRules.add(new palorule(plConn, lDatabaseId, iCubeId, palohelpers.StringToInt(csv.get(0)), csv.get(1), csv
|
||||
.get(2), csv.get(3), palohelpers.StringToLong(csv.get(4)), palohelpers.StringToBoolean(csv.get(5))));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
// Returns the Rule with the given Identifier
|
||||
public palorule getRule(long lIdentifier) {
|
||||
for (palorule paloRule : paloRules) {
|
||||
if (paloRule.getIdentifier() == lIdentifier)
|
||||
return paloRule;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
// Returns the Rule with the given Extern_Id
|
||||
public palorule getRule(String strExtern_Id) {
|
||||
for (palorule paloRule : paloRules) {
|
||||
if (paloRule.getExtern_Id().equals(strExtern_Id))
|
||||
return paloRule;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getNumberOfRules() {
|
||||
return paloRules.size();
|
||||
}
|
||||
public ArrayList<palorule> getRules() {
|
||||
return paloRules;
|
||||
}
|
||||
|
||||
// Returns the Rule at the given Position
|
||||
public palorule getRule(int iIndex) {
|
||||
return paloRules.get(iIndex);
|
||||
}
|
||||
// Deletes the Rule at the given position
|
||||
public void deleteRule(int iIndex) throws paloexception {
|
||||
palorule paloRuleToRemove = getRule(iIndex);
|
||||
if (null != paloRuleToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String
|
||||
.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String
|
||||
.valueOf(paloRuleToRemove.getIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
|
||||
paloRules.remove(paloRuleToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the Rule with the given Identifier
|
||||
public palorule getRule(long lIdentifier) {
|
||||
for (palorule paloRule : paloRules) {
|
||||
if (paloRule.getIdentifier() == lIdentifier) {
|
||||
return paloRule;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// Deletes the Rule with given Identifier
|
||||
public void deleteRule(long lIdentifier) throws paloexception {
|
||||
palorule paloRuleToRemove = getRule(lIdentifier);
|
||||
if (null != paloRuleToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String
|
||||
.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String
|
||||
.valueOf(paloRuleToRemove.getIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
|
||||
paloRules.remove(paloRuleToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the Rule with the given Extern_Id
|
||||
public palorule getRule(String strExtern_Id) {
|
||||
for (palorule paloRule : paloRules) {
|
||||
if (paloRule.getExtern_Id().equals(strExtern_Id)) {
|
||||
return paloRule;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// Deletes the Rule with given External_Id
|
||||
public void deleteRule(String strExtern_Id) throws paloexception {
|
||||
palorule paloRuleToRemove = getRule(strExtern_Id);
|
||||
if (null != paloRuleToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String
|
||||
.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String
|
||||
.valueOf(paloRuleToRemove.getIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
|
||||
paloRules.remove(paloRuleToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<palorule> getRules() {
|
||||
return paloRules;
|
||||
}
|
||||
public String parseRule(String strRuleToParse) throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("definition", strRuleToParse));
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
HttpEntity entity = this.plConn
|
||||
.sendToServer(qparams, "/rule/parse");
|
||||
CsvReader csv = new CsvReader(entity.getContent(),
|
||||
Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while (csv.readRecord()) {
|
||||
sb.append(csv.get(0));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return sb.toString();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Deletes the Rule at the given position
|
||||
public void deleteRule(int iIndex) throws paloexception {
|
||||
palorule paloRuleToRemove = getRule(iIndex);
|
||||
if (null != paloRuleToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String.valueOf(paloRuleToRemove.getIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
|
||||
paloRules.remove(paloRuleToRemove);
|
||||
}
|
||||
}
|
||||
public String getParseRuleResult() {
|
||||
return strRuleParseResult;
|
||||
}
|
||||
|
||||
// Deletes the Rule with given Identifier
|
||||
public void deleteRule(long lIdentifier) throws paloexception {
|
||||
palorule paloRuleToRemove = getRule(lIdentifier);
|
||||
if (null != paloRuleToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String.valueOf(paloRuleToRemove.getIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
|
||||
paloRules.remove(paloRuleToRemove);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Adds a rule to the given cube
|
||||
*
|
||||
*
|
||||
* @param The
|
||||
* rule definition
|
||||
* @param Identifier
|
||||
* flag
|
||||
* @param An
|
||||
* external Id
|
||||
* @param The
|
||||
* comment for this rule
|
||||
* @param Acitvation
|
||||
* flag
|
||||
* @return The added palorule
|
||||
*/
|
||||
public palorule addRule(String strRuleDefinition, boolean bUseIdentifier,
|
||||
String strExtern_Id, String strComment, boolean bActivate)
|
||||
throws paloexception {
|
||||
palorule plRule = null;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String
|
||||
.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("definition", strRuleDefinition));
|
||||
qparams.add(new BasicNameValuePair("activate", palohelpers
|
||||
.BooleanToString(bActivate)));
|
||||
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
|
||||
qparams.add(new BasicNameValuePair("comment", strComment));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", palohelpers
|
||||
.BooleanToString(bUseIdentifier)));
|
||||
|
||||
// Deletes the Rule with given External_Id
|
||||
public void deleteRule(String strExtern_Id) throws paloexception {
|
||||
palorule paloRuleToRemove = getRule(strExtern_Id);
|
||||
if (null != paloRuleToRemove) {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("rule", String.valueOf(paloRuleToRemove.getIdentifier())));
|
||||
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
|
||||
paloRules.remove(paloRuleToRemove);
|
||||
}
|
||||
}
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams,
|
||||
"/rule/create");
|
||||
CsvReader csv = new CsvReader(entity.getContent(),
|
||||
Charset.forName("UTF-8"));
|
||||
csv.setDelimiter(';');
|
||||
csv.setTextQualifier('"');
|
||||
while (csv.readRecord()) {
|
||||
// System.out.println(csv.getRawRecord());
|
||||
plRule = new palorule(plConn, lDatabaseId, iCubeId,
|
||||
palohelpers.StringToInt(csv.get(0)), csv.get(1),
|
||||
csv.get(2), csv.get(3), palohelpers.StringToLong(csv
|
||||
.get(4)), palohelpers.StringToBoolean(csv
|
||||
.get(5)));
|
||||
paloRules.add(plRule);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return plRule;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String parseRule(String strRuleToParse) throws paloexception {
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("definition", strRuleToParse));
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/parse");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
sb.append(csv.get(0));
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return sb.toString();
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String getParseRuleResult() {
|
||||
return strRuleParseResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a rule to the given cube
|
||||
*
|
||||
*
|
||||
* @param The rule definition
|
||||
* @param Identifier flag
|
||||
* @param An external Id
|
||||
* @param The comment for this rule
|
||||
* @param Acitvation flag
|
||||
* @return The added palorule
|
||||
*/
|
||||
public palorule addRule(String strRuleDefinition, boolean bUseIdentifier, String strExtern_Id, String strComment,
|
||||
boolean bActivate) throws paloexception {
|
||||
palorule plRule = null;
|
||||
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
|
||||
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
|
||||
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
|
||||
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
|
||||
qparams.add(new BasicNameValuePair("definition", strRuleDefinition));
|
||||
qparams.add(new BasicNameValuePair("activate", palohelpers.BooleanToString(bActivate)));
|
||||
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
|
||||
qparams.add(new BasicNameValuePair("comment", strComment));
|
||||
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(bUseIdentifier)));
|
||||
|
||||
try {
|
||||
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/create");
|
||||
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
|
||||
csv.setQuoteChar('"');
|
||||
while (csv.readNext()) {
|
||||
// System.out.println(csv.getRawRecord());
|
||||
plRule = new palorule(plConn, lDatabaseId, iCubeId, palohelpers.StringToInt(csv.get(0)), csv.get(1), csv.get(2),
|
||||
csv.get(3), palohelpers.StringToLong(csv.get(4)), palohelpers.StringToBoolean(csv.get(5)));
|
||||
paloRules.add(plRule);
|
||||
}
|
||||
csv.close();
|
||||
entity.consumeContent();
|
||||
return plRule;
|
||||
} catch (Exception e) {
|
||||
throw new paloexception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
paloconnection pcon = new paloconnection("admin", "admin", "localhost", "7777");
|
||||
palodatabases pds = new palodatabases(pcon);
|
||||
palodatabase pd = pds.createDatabase("PaloRuleTest");
|
||||
palodimensions pdims = pd.getDimensions(0);
|
||||
palodimension pdim = null;
|
||||
palodimension pdim1 = null;
|
||||
pdim = pdims.getDimension("Monat");
|
||||
if (pdim == null) {
|
||||
pdim = pdims.createDimension("Monat");
|
||||
}
|
||||
pdim1 = pdims.getDimension("D2");
|
||||
if (pdim1 == null) {
|
||||
pdim = pdims.createDimension("D2");
|
||||
}
|
||||
palocubes pcs = new palocubes(pcon, pd, 0);
|
||||
if (pcs.getCube("cube1") == null) {
|
||||
pcs.createCube("cube1", new String[] { "Monat", "D2" }, 0);
|
||||
}
|
||||
palorules pll = new palorules(pcon, pd.getDatabaseId(), pcs.getCube("cube1").getCubeId());
|
||||
}
|
||||
public static void main(String args[]) throws Exception {
|
||||
paloconnection pcon = new paloconnection("admin", "admin", "localhost",
|
||||
"7777");
|
||||
palodatabases pds = new palodatabases(pcon);
|
||||
palodatabase pd = pds.createDatabase("PaloRuleTest");
|
||||
palodimensions pdims = pd.getDimensions(0);
|
||||
palodimension pdim = null;
|
||||
palodimension pdim1 = null;
|
||||
pdim = pdims.getDimension("Monat");
|
||||
if (pdim == null)
|
||||
pdim = pdims.createDimension("Monat");
|
||||
pdim1 = pdims.getDimension("D2");
|
||||
if (pdim1 == null)
|
||||
pdim = pdims.createDimension("D2");
|
||||
palocubes pcs = new palocubes(pcon, pd, 0);
|
||||
if (pcs.getCube("cube1") == null)
|
||||
pcs.createCube("cube1", new String[] { "Monat", "D2" }, 0);
|
||||
palorules pll = new palorules(pcon, pd.getDatabaseId(), pcs.getCube(
|
||||
"cube1").getCubeId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<path id="compile.classpath">
|
||||
<pathelement location="${component.plugin.home}/tSalesforceBulkExec/partnerBulk.jar" />
|
||||
<pathelement location="${component.plugin.home}/tSalesforceBulkExec/wsc.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputDelimited/talendcsv.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputDelimited/javacsv.jar" />
|
||||
</path>
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
@@ -2,228 +2,167 @@ package com.sforce.soap.partner;
|
||||
|
||||
/** * Generated class, please do not edit. */
|
||||
public class ChildRelationship implements com.sforce.ws.bind.XMLizable {
|
||||
/** * Constructor */
|
||||
public ChildRelationship() {
|
||||
}
|
||||
|
||||
/**
|
||||
* * element : cascadeDelete of type
|
||||
* {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean
|
||||
*/
|
||||
private static final com.sforce.ws.bind.TypeInfo cascadeDelete__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "cascadeDelete",
|
||||
"http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
|
||||
private boolean cascadeDelete__is_set = false;
|
||||
private boolean cascadeDelete;
|
||||
/** * Constructor */
|
||||
public ChildRelationship() {
|
||||
}
|
||||
|
||||
public boolean getCascadeDelete() {
|
||||
return cascadeDelete;
|
||||
}
|
||||
/** * element : cascadeDelete of type {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean */
|
||||
private static final com.sforce.ws.bind.TypeInfo cascadeDelete__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "cascadeDelete", "http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
|
||||
|
||||
public boolean isCascadeDelete() {
|
||||
return cascadeDelete;
|
||||
}
|
||||
private boolean cascadeDelete__is_set = false;
|
||||
|
||||
public void setCascadeDelete(boolean cascadeDelete) {
|
||||
this.cascadeDelete = cascadeDelete;
|
||||
cascadeDelete__is_set = true;
|
||||
}
|
||||
private boolean cascadeDelete;
|
||||
|
||||
/**
|
||||
* * element : childSObject of type {http://www.w3.org/2001/XMLSchema}string
|
||||
* * java type: java.lang.String
|
||||
*/
|
||||
private static final com.sforce.ws.bind.TypeInfo childSObject__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "childSObject",
|
||||
"http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
|
||||
private boolean childSObject__is_set = false;
|
||||
private java.lang.String childSObject;
|
||||
public boolean getCascadeDelete() {
|
||||
return cascadeDelete;
|
||||
}
|
||||
|
||||
public java.lang.String getChildSObject() {
|
||||
return childSObject;
|
||||
}
|
||||
public boolean isCascadeDelete() {
|
||||
return cascadeDelete;
|
||||
}
|
||||
|
||||
public void setChildSObject(java.lang.String childSObject) {
|
||||
this.childSObject = childSObject;
|
||||
childSObject__is_set = true;
|
||||
}
|
||||
public void setCascadeDelete(boolean cascadeDelete) {
|
||||
this.cascadeDelete = cascadeDelete;
|
||||
cascadeDelete__is_set = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* * element : deprecatedAndHidden of type
|
||||
* {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean
|
||||
*/
|
||||
private static final com.sforce.ws.bind.TypeInfo deprecatedAndHidden__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "deprecatedAndHidden",
|
||||
"http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
|
||||
private boolean deprecatedAndHidden__is_set = false;
|
||||
private boolean deprecatedAndHidden;
|
||||
/** * element : childSObject of type {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String */
|
||||
private static final com.sforce.ws.bind.TypeInfo childSObject__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "childSObject", "http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
|
||||
|
||||
public boolean getDeprecatedAndHidden() {
|
||||
return deprecatedAndHidden;
|
||||
}
|
||||
private boolean childSObject__is_set = false;
|
||||
|
||||
public boolean isDeprecatedAndHidden() {
|
||||
return deprecatedAndHidden;
|
||||
}
|
||||
private java.lang.String childSObject;
|
||||
|
||||
public void setDeprecatedAndHidden(boolean deprecatedAndHidden) {
|
||||
this.deprecatedAndHidden = deprecatedAndHidden;
|
||||
deprecatedAndHidden__is_set = true;
|
||||
}
|
||||
public java.lang.String getChildSObject() {
|
||||
return childSObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* * element : field of type {http://www.w3.org/2001/XMLSchema}string * java
|
||||
* type: java.lang.String
|
||||
*/
|
||||
private static final com.sforce.ws.bind.TypeInfo field__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "field",
|
||||
"http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
|
||||
private boolean field__is_set = false;
|
||||
private java.lang.String field;
|
||||
public void setChildSObject(java.lang.String childSObject) {
|
||||
this.childSObject = childSObject;
|
||||
childSObject__is_set = true;
|
||||
}
|
||||
|
||||
public java.lang.String getField() {
|
||||
return field;
|
||||
}
|
||||
/** * element : deprecatedAndHidden of type {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean */
|
||||
private static final com.sforce.ws.bind.TypeInfo deprecatedAndHidden__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "deprecatedAndHidden", "http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
|
||||
|
||||
public void setField(java.lang.String field) {
|
||||
this.field = field;
|
||||
field__is_set = true;
|
||||
}
|
||||
private boolean deprecatedAndHidden__is_set = false;
|
||||
|
||||
/**
|
||||
* * element : relationshipName of type
|
||||
* {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String
|
||||
*/
|
||||
private static final com.sforce.ws.bind.TypeInfo relationshipName__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "relationshipName",
|
||||
"http://www.w3.org/2001/XMLSchema", "string", 0, 1, true);
|
||||
private boolean relationshipName__is_set = false;
|
||||
private java.lang.String relationshipName;
|
||||
private boolean deprecatedAndHidden;
|
||||
|
||||
public java.lang.String getRelationshipName() {
|
||||
return relationshipName;
|
||||
}
|
||||
public boolean getDeprecatedAndHidden() {
|
||||
return deprecatedAndHidden;
|
||||
}
|
||||
|
||||
public void setRelationshipName(java.lang.String relationshipName) {
|
||||
this.relationshipName = relationshipName;
|
||||
relationshipName__is_set = true;
|
||||
}
|
||||
public boolean isDeprecatedAndHidden() {
|
||||
return deprecatedAndHidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* * element : restrictedDelete of type
|
||||
* {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean
|
||||
*/
|
||||
private static final com.sforce.ws.bind.TypeInfo restrictedDelete__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "restrictedDelete",
|
||||
"http://www.w3.org/2001/XMLSchema", "boolean", 0, 1, true);
|
||||
private boolean restrictedDelete__is_set = false;
|
||||
private boolean restrictedDelete;
|
||||
public void setDeprecatedAndHidden(boolean deprecatedAndHidden) {
|
||||
this.deprecatedAndHidden = deprecatedAndHidden;
|
||||
deprecatedAndHidden__is_set = true;
|
||||
}
|
||||
|
||||
public boolean getRestrictedDelete() {
|
||||
return restrictedDelete;
|
||||
}
|
||||
/** * element : field of type {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String */
|
||||
private static final com.sforce.ws.bind.TypeInfo field__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "field", "http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
|
||||
|
||||
public boolean isRestrictedDelete() {
|
||||
return restrictedDelete;
|
||||
}
|
||||
private boolean field__is_set = false;
|
||||
|
||||
public void setRestrictedDelete(boolean restrictedDelete) {
|
||||
this.restrictedDelete = restrictedDelete;
|
||||
restrictedDelete__is_set = true;
|
||||
}
|
||||
private java.lang.String field;
|
||||
|
||||
/** */
|
||||
public void write(javax.xml.namespace.QName __element,
|
||||
com.sforce.ws.parser.XmlOutputStream __out,
|
||||
com.sforce.ws.bind.TypeMapper __typeMapper)
|
||||
throws java.io.IOException {
|
||||
__out.writeStartTag(__element.getNamespaceURI(),
|
||||
__element.getLocalPart());
|
||||
writeFields(__out, __typeMapper);
|
||||
__out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
|
||||
}
|
||||
public java.lang.String getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out,
|
||||
com.sforce.ws.bind.TypeMapper __typeMapper)
|
||||
throws java.io.IOException {
|
||||
__typeMapper.writeBoolean(__out, cascadeDelete__typeInfo,
|
||||
cascadeDelete, cascadeDelete__is_set);
|
||||
__typeMapper.writeString(__out, childSObject__typeInfo, childSObject,
|
||||
childSObject__is_set);
|
||||
__typeMapper.writeBoolean(__out, deprecatedAndHidden__typeInfo,
|
||||
deprecatedAndHidden, deprecatedAndHidden__is_set);
|
||||
__typeMapper.writeString(__out, field__typeInfo, field, field__is_set);
|
||||
__typeMapper.writeString(__out, relationshipName__typeInfo,
|
||||
relationshipName, relationshipName__is_set);
|
||||
__typeMapper.writeBoolean(__out, restrictedDelete__typeInfo,
|
||||
restrictedDelete, restrictedDelete__is_set);
|
||||
}
|
||||
public void setField(java.lang.String field) {
|
||||
this.field = field;
|
||||
field__is_set = true;
|
||||
}
|
||||
|
||||
public void load(com.sforce.ws.parser.XmlInputStream __in,
|
||||
com.sforce.ws.bind.TypeMapper __typeMapper)
|
||||
throws java.io.IOException, com.sforce.ws.ConnectionException {
|
||||
__typeMapper.consumeStartTag(__in);
|
||||
loadFields(__in, __typeMapper);
|
||||
__typeMapper.consumeEndTag(__in);
|
||||
}
|
||||
/** * element : relationshipName of type {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String */
|
||||
private static final com.sforce.ws.bind.TypeInfo relationshipName__typeInfo = new com.sforce.ws.bind.TypeInfo(
|
||||
"urn:partner.soap.sforce.com", "relationshipName", "http://www.w3.org/2001/XMLSchema", "string", 0, 1, true);
|
||||
|
||||
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
|
||||
com.sforce.ws.bind.TypeMapper __typeMapper)
|
||||
throws java.io.IOException, com.sforce.ws.ConnectionException {
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, cascadeDelete__typeInfo)) {
|
||||
setCascadeDelete((boolean) __typeMapper.readBoolean(__in,
|
||||
cascadeDelete__typeInfo, boolean.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, childSObject__typeInfo)) {
|
||||
setChildSObject((java.lang.String) __typeMapper.readString(__in,
|
||||
childSObject__typeInfo, java.lang.String.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, deprecatedAndHidden__typeInfo)) {
|
||||
setDeprecatedAndHidden((boolean) __typeMapper.readBoolean(__in,
|
||||
deprecatedAndHidden__typeInfo, boolean.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, field__typeInfo)) {
|
||||
setField((java.lang.String) __typeMapper.readString(__in,
|
||||
field__typeInfo, java.lang.String.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.isElement(__in, relationshipName__typeInfo)) {
|
||||
setRelationshipName((java.lang.String) __typeMapper.readString(
|
||||
__in, relationshipName__typeInfo, java.lang.String.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.isElement(__in, restrictedDelete__typeInfo)) {
|
||||
setRestrictedDelete((boolean) __typeMapper.readBoolean(__in,
|
||||
restrictedDelete__typeInfo, boolean.class));
|
||||
}
|
||||
}
|
||||
private boolean relationshipName__is_set = false;
|
||||
|
||||
public String toString() {
|
||||
java.lang.StringBuilder sb = new java.lang.StringBuilder();
|
||||
sb.append("[ChildRelationship ");
|
||||
sb.append(" cascadeDelete=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(cascadeDelete)
|
||||
+ "'\n");
|
||||
sb.append(" childSObject=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(childSObject)
|
||||
+ "'\n");
|
||||
sb.append(" deprecatedAndHidden=");
|
||||
sb.append("'"
|
||||
+ com.sforce.ws.util.Verbose.toString(deprecatedAndHidden)
|
||||
+ "'\n");
|
||||
sb.append(" field=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(field) + "'\n");
|
||||
sb.append(" relationshipName=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(relationshipName)
|
||||
+ "'\n");
|
||||
sb.append(" restrictedDelete=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(restrictedDelete)
|
||||
+ "'\n");
|
||||
sb.append("]\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
private java.lang.String relationshipName;
|
||||
|
||||
public java.lang.String getRelationshipName() {
|
||||
return relationshipName;
|
||||
}
|
||||
|
||||
public void setRelationshipName(java.lang.String relationshipName) {
|
||||
this.relationshipName = relationshipName;
|
||||
relationshipName__is_set = true;
|
||||
}
|
||||
|
||||
/** */
|
||||
public void write(javax.xml.namespace.QName __element, com.sforce.ws.parser.XmlOutputStream __out,
|
||||
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
|
||||
__out.writeStartTag(__element.getNamespaceURI(), __element.getLocalPart());
|
||||
writeFields(__out, __typeMapper);
|
||||
__out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
|
||||
}
|
||||
|
||||
protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper)
|
||||
throws java.io.IOException {
|
||||
__typeMapper.writeBoolean(__out, cascadeDelete__typeInfo, cascadeDelete, cascadeDelete__is_set);
|
||||
__typeMapper.writeString(__out, childSObject__typeInfo, childSObject, childSObject__is_set);
|
||||
__typeMapper.writeBoolean(__out, deprecatedAndHidden__typeInfo, deprecatedAndHidden, deprecatedAndHidden__is_set);
|
||||
__typeMapper.writeString(__out, field__typeInfo, field, field__is_set);
|
||||
__typeMapper.writeString(__out, relationshipName__typeInfo, relationshipName, relationshipName__is_set);
|
||||
}
|
||||
|
||||
public void load(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper)
|
||||
throws java.io.IOException, com.sforce.ws.ConnectionException {
|
||||
__typeMapper.consumeStartTag(__in);
|
||||
loadFields(__in, __typeMapper);
|
||||
__typeMapper.consumeEndTag(__in);
|
||||
}
|
||||
|
||||
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper)
|
||||
throws java.io.IOException, com.sforce.ws.ConnectionException {
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, cascadeDelete__typeInfo)) {
|
||||
setCascadeDelete((boolean) __typeMapper.readBoolean(__in, cascadeDelete__typeInfo, boolean.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, childSObject__typeInfo)) {
|
||||
setChildSObject((java.lang.String) __typeMapper.readString(__in, childSObject__typeInfo, java.lang.String.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, deprecatedAndHidden__typeInfo)) {
|
||||
setDeprecatedAndHidden((boolean) __typeMapper.readBoolean(__in, deprecatedAndHidden__typeInfo, boolean.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.verifyElement(__in, field__typeInfo)) {
|
||||
setField((java.lang.String) __typeMapper.readString(__in, field__typeInfo, java.lang.String.class));
|
||||
}
|
||||
__in.peekTag();
|
||||
if (__typeMapper.isElement(__in, relationshipName__typeInfo)) {
|
||||
setRelationshipName((java.lang.String) __typeMapper.readString(__in, relationshipName__typeInfo,
|
||||
java.lang.String.class));
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
java.lang.StringBuilder sb = new java.lang.StringBuilder();
|
||||
sb.append("[ChildRelationship ");
|
||||
sb.append(" cascadeDelete=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(cascadeDelete) + "'\n");
|
||||
sb.append(" childSObject=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(childSObject) + "'\n");
|
||||
sb.append(" deprecatedAndHidden=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(deprecatedAndHidden) + "'\n");
|
||||
sb.append(" field=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(field) + "'\n");
|
||||
sb.append(" relationshipName=");
|
||||
sb.append("'" + com.sforce.ws.util.Verbose.toString(relationshipName) + "'\n");
|
||||
sb.append("]\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.sforce.ws.ConnectionException;
|
||||
/** * Generated class, please do not edit. */
|
||||
public class Connector {
|
||||
|
||||
public static final String END_POINT = "https://login.salesforce.com/services/Soap/u/25.0";
|
||||
public static final String END_POINT = "https://login.salesforce.com/services/Soap/u/24.0";
|
||||
|
||||
public static PartnerConnection newConnection(String username, String password) throws ConnectionException {
|
||||
ConnectorConfig config = new ConnectorConfig();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,28 +2,48 @@ package com.sforce.soap.partner;
|
||||
|
||||
/** * Generated enum, please do not edit. */
|
||||
public enum FieldType {
|
||||
/** * Enumeration : string */
|
||||
string, /** * Enumeration : picklist */
|
||||
picklist, /** * Enumeration : multipicklist */
|
||||
multipicklist, /** * Enumeration : combobox */
|
||||
combobox, /** * Enumeration : reference */
|
||||
reference, /** * Enumeration : base64 */
|
||||
base64, /** * Enumeration : _boolean */
|
||||
_boolean, /** * Enumeration : currency */
|
||||
currency, /** * Enumeration : textarea */
|
||||
textarea, /** * Enumeration : _int */
|
||||
_int, /** * Enumeration : _double */
|
||||
_double, /** * Enumeration : percent */
|
||||
percent, /** * Enumeration : phone */
|
||||
phone, /** * Enumeration : id */
|
||||
id, /** * Enumeration : date */
|
||||
date, /** * Enumeration : datetime */
|
||||
datetime, /** * Enumeration : time */
|
||||
time, /** * Enumeration : url */
|
||||
url, /** * Enumeration : email */
|
||||
email, /** * Enumeration : encryptedstring */
|
||||
encryptedstring, /** * Enumeration : datacategorygroupreference */
|
||||
datacategorygroupreference, /** * Enumeration : location */
|
||||
location, /** * Enumeration : anyType */
|
||||
anyType,
|
||||
}
|
||||
/** * Enumeration : string */
|
||||
string,
|
||||
/** * Enumeration : picklist */
|
||||
picklist,
|
||||
/** * Enumeration : multipicklist */
|
||||
multipicklist,
|
||||
/** * Enumeration : combobox */
|
||||
combobox,
|
||||
/** * Enumeration : reference */
|
||||
reference,
|
||||
/** * Enumeration : base64 */
|
||||
base64,
|
||||
/** * Enumeration : _boolean */
|
||||
_boolean,
|
||||
/** * Enumeration : currency */
|
||||
currency,
|
||||
/** * Enumeration : textarea */
|
||||
textarea,
|
||||
/** * Enumeration : _int */
|
||||
_int,
|
||||
/** * Enumeration : _double */
|
||||
_double,
|
||||
/** * Enumeration : percent */
|
||||
percent,
|
||||
/** * Enumeration : phone */
|
||||
phone,
|
||||
/** * Enumeration : id */
|
||||
id,
|
||||
/** * Enumeration : date */
|
||||
date,
|
||||
/** * Enumeration : datetime */
|
||||
datetime,
|
||||
/** * Enumeration : time */
|
||||
time,
|
||||
/** * Enumeration : url */
|
||||
url,
|
||||
/** * Enumeration : email */
|
||||
email,
|
||||
/** * Enumeration : encryptedstring */
|
||||
encryptedstring,
|
||||
/** * Enumeration : datacategorygroupreference */
|
||||
datacategorygroupreference,
|
||||
/** * Enumeration : anyType */
|
||||
anyType,
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,338 +2,338 @@ package com.sforce.soap.partner;
|
||||
|
||||
/** * Generated enum, please do not edit. */
|
||||
public enum StatusCode {
|
||||
/** * Enumeration : ALL_OR_NONE_OPERATION_ROLLED_BACK */
|
||||
ALL_OR_NONE_OPERATION_ROLLED_BACK, /** * Enumeration : ALREADY_IN_PROCESS */
|
||||
ALREADY_IN_PROCESS, /** * Enumeration : ASSIGNEE_TYPE_REQUIRED */
|
||||
ASSIGNEE_TYPE_REQUIRED, /** * Enumeration : BAD_CUSTOM_ENTITY_PARENT_DOMAIN */
|
||||
BAD_CUSTOM_ENTITY_PARENT_DOMAIN, /**
|
||||
* * Enumeration :
|
||||
* BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED
|
||||
*/
|
||||
BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_CASCADE_PRODUCT_ACTIVE
|
||||
*/
|
||||
CANNOT_CASCADE_PRODUCT_ACTIVE, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD
|
||||
*/
|
||||
CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE
|
||||
*/
|
||||
CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_DEACTIVATE_DIVISION
|
||||
*/
|
||||
CANNOT_DEACTIVATE_DIVISION, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_DELETE_LAST_DATED_CONVERSION_RATE
|
||||
*/
|
||||
CANNOT_DELETE_LAST_DATED_CONVERSION_RATE, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_DELETE_MANAGED_OBJECT
|
||||
*/
|
||||
CANNOT_DELETE_MANAGED_OBJECT, /** * Enumeration : CANNOT_DISABLE_LAST_ADMIN */
|
||||
CANNOT_DISABLE_LAST_ADMIN, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_ENABLE_IP_RESTRICT_REQUESTS
|
||||
*/
|
||||
CANNOT_ENABLE_IP_RESTRICT_REQUESTS, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
|
||||
*/
|
||||
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_MODIFY_MANAGED_OBJECT
|
||||
*/
|
||||
CANNOT_MODIFY_MANAGED_OBJECT, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_RENAME_APEX_REFERENCED_FIELD
|
||||
*/
|
||||
CANNOT_RENAME_APEX_REFERENCED_FIELD, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_RENAME_APEX_REFERENCED_OBJECT
|
||||
*/
|
||||
CANNOT_RENAME_APEX_REFERENCED_OBJECT, /**
|
||||
* * Enumeration :
|
||||
* CANNOT_REPARENT_RECORD
|
||||
*/
|
||||
CANNOT_REPARENT_RECORD, /** * Enumeration : CANNOT_UPDATE_CONVERTED_LEAD */
|
||||
CANNOT_UPDATE_CONVERTED_LEAD, /** * Enumeration : CANT_DISABLE_CORP_CURRENCY */
|
||||
CANT_DISABLE_CORP_CURRENCY, /** * Enumeration : CANT_UNSET_CORP_CURRENCY */
|
||||
CANT_UNSET_CORP_CURRENCY, /** * Enumeration : CHILD_SHARE_FAILS_PARENT */
|
||||
CHILD_SHARE_FAILS_PARENT, /** * Enumeration : CIRCULAR_DEPENDENCY */
|
||||
CIRCULAR_DEPENDENCY, /** * Enumeration : COMMUNITY_NOT_ACCESSIBLE */
|
||||
COMMUNITY_NOT_ACCESSIBLE, /**
|
||||
* * Enumeration : CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED
|
||||
*/
|
||||
CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* CUSTOM_ENTITY_OR_FIELD_LIMIT
|
||||
*/
|
||||
CUSTOM_ENTITY_OR_FIELD_LIMIT, /**
|
||||
* * Enumeration :
|
||||
* CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED
|
||||
*/
|
||||
CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED, /** * Enumeration : CUSTOM_INDEX_EXISTS */
|
||||
CUSTOM_INDEX_EXISTS, /** * Enumeration : CUSTOM_LINK_LIMIT_EXCEEDED */
|
||||
CUSTOM_LINK_LIMIT_EXCEEDED, /** * Enumeration : CUSTOM_TAB_LIMIT_EXCEEDED */
|
||||
CUSTOM_TAB_LIMIT_EXCEEDED, /** * Enumeration : DELETE_FAILED */
|
||||
DELETE_FAILED, /** * Enumeration : DELETE_OPERATION_TOO_LARGE */
|
||||
DELETE_OPERATION_TOO_LARGE, /** * Enumeration : DELETE_REQUIRED_ON_CASCADE */
|
||||
DELETE_REQUIRED_ON_CASCADE, /** * Enumeration : DEPENDENCY_EXISTS */
|
||||
DEPENDENCY_EXISTS, /** * Enumeration : DUPLICATE_CASE_SOLUTION */
|
||||
DUPLICATE_CASE_SOLUTION, /** * Enumeration : DUPLICATE_COMM_NICKNAME */
|
||||
DUPLICATE_COMM_NICKNAME, /**
|
||||
* * Enumeration :
|
||||
* DUPLICATE_CUSTOM_ENTITY_DEFINITION
|
||||
*/
|
||||
DUPLICATE_CUSTOM_ENTITY_DEFINITION, /**
|
||||
* * Enumeration :
|
||||
* DUPLICATE_CUSTOM_TAB_MOTIF
|
||||
*/
|
||||
DUPLICATE_CUSTOM_TAB_MOTIF, /** * Enumeration : DUPLICATE_DEVELOPER_NAME */
|
||||
DUPLICATE_DEVELOPER_NAME, /** * Enumeration : DUPLICATE_EXTERNAL_ID */
|
||||
DUPLICATE_EXTERNAL_ID, /** * Enumeration : DUPLICATE_MASTER_LABEL */
|
||||
DUPLICATE_MASTER_LABEL, /** * Enumeration : DUPLICATE_SENDER_DISPLAY_NAME */
|
||||
DUPLICATE_SENDER_DISPLAY_NAME, /** * Enumeration : DUPLICATE_USERNAME */
|
||||
DUPLICATE_USERNAME, /** * Enumeration : DUPLICATE_VALUE */
|
||||
DUPLICATE_VALUE, /** * Enumeration : EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR */
|
||||
EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR, /**
|
||||
* * Enumeration :
|
||||
* EMPTY_SCONTROL_FILE_NAME
|
||||
*/
|
||||
EMPTY_SCONTROL_FILE_NAME, /**
|
||||
* * Enumeration :
|
||||
* ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE
|
||||
*/
|
||||
ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE, /**
|
||||
* * Enumeration : ENTITY_IS_ARCHIVED
|
||||
*/
|
||||
ENTITY_IS_ARCHIVED, /** * Enumeration : ENTITY_IS_DELETED */
|
||||
ENTITY_IS_DELETED, /** * Enumeration : ENTITY_IS_LOCKED */
|
||||
ENTITY_IS_LOCKED, /** * Enumeration : ERROR_IN_MAILER */
|
||||
ERROR_IN_MAILER, /** * Enumeration : EXTERNAL_OBJECT_AUTHENTICATION_EXCEPTION */
|
||||
EXTERNAL_OBJECT_AUTHENTICATION_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* EXTERNAL_OBJECT_CONNECTION_EXCEPTION
|
||||
*/
|
||||
EXTERNAL_OBJECT_CONNECTION_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* EXTERNAL_OBJECT_EXCEPTION
|
||||
*/
|
||||
EXTERNAL_OBJECT_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* EXTERNAL_OBJECT_UNSUPPORTED_EXCEPTION
|
||||
*/
|
||||
EXTERNAL_OBJECT_UNSUPPORTED_EXCEPTION, /** * Enumeration : FAILED_ACTIVATION */
|
||||
FAILED_ACTIVATION, /** * Enumeration : FIELD_CUSTOM_VALIDATION_EXCEPTION */
|
||||
FIELD_CUSTOM_VALIDATION_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* FIELD_FILTER_VALIDATION_EXCEPTION
|
||||
*/
|
||||
FIELD_FILTER_VALIDATION_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* FIELD_INTEGRITY_EXCEPTION
|
||||
*/
|
||||
FIELD_INTEGRITY_EXCEPTION, /** * Enumeration : FILTERED_LOOKUP_LIMIT_EXCEEDED */
|
||||
FILTERED_LOOKUP_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* HTML_FILE_UPLOAD_NOT_ALLOWED
|
||||
*/
|
||||
HTML_FILE_UPLOAD_NOT_ALLOWED, /** * Enumeration : IMAGE_TOO_LARGE */
|
||||
IMAGE_TOO_LARGE, /** * Enumeration : INACTIVE_OWNER_OR_USER */
|
||||
INACTIVE_OWNER_OR_USER, /**
|
||||
* * Enumeration :
|
||||
* INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
|
||||
*/
|
||||
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, /**
|
||||
* * Enumeration :
|
||||
* INSUFFICIENT_ACCESS_OR_READONLY
|
||||
*/
|
||||
INSUFFICIENT_ACCESS_OR_READONLY, /** * Enumeration : INVALID_ACCESS_LEVEL */
|
||||
INVALID_ACCESS_LEVEL, /** * Enumeration : INVALID_ARGUMENT_TYPE */
|
||||
INVALID_ARGUMENT_TYPE, /** * Enumeration : INVALID_ASSIGNEE_TYPE */
|
||||
INVALID_ASSIGNEE_TYPE, /** * Enumeration : INVALID_ASSIGNMENT_RULE */
|
||||
INVALID_ASSIGNMENT_RULE, /** * Enumeration : INVALID_BATCH_OPERATION */
|
||||
INVALID_BATCH_OPERATION, /** * Enumeration : INVALID_CONTENT_TYPE */
|
||||
INVALID_CONTENT_TYPE, /** * Enumeration : INVALID_CREDIT_CARD_INFO */
|
||||
INVALID_CREDIT_CARD_INFO, /** * Enumeration : INVALID_CROSS_REFERENCE_KEY */
|
||||
INVALID_CROSS_REFERENCE_KEY, /**
|
||||
* * Enumeration :
|
||||
* INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD
|
||||
*/
|
||||
INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD, /**
|
||||
* * Enumeration :
|
||||
* INVALID_CURRENCY_CONV_RATE
|
||||
*/
|
||||
INVALID_CURRENCY_CONV_RATE, /** * Enumeration : INVALID_CURRENCY_CORP_RATE */
|
||||
INVALID_CURRENCY_CORP_RATE, /** * Enumeration : INVALID_CURRENCY_ISO */
|
||||
INVALID_CURRENCY_ISO, /**
|
||||
* * Enumeration :
|
||||
* INVALID_DATA_CATEGORY_GROUP_REFERENCE
|
||||
*/
|
||||
INVALID_DATA_CATEGORY_GROUP_REFERENCE, /** * Enumeration : INVALID_DATA_URI */
|
||||
INVALID_DATA_URI, /** * Enumeration : INVALID_EMAIL_ADDRESS */
|
||||
INVALID_EMAIL_ADDRESS, /** * Enumeration : INVALID_EMPTY_KEY_OWNER */
|
||||
INVALID_EMPTY_KEY_OWNER, /** * Enumeration : INVALID_FIELD */
|
||||
INVALID_FIELD, /** * Enumeration : INVALID_FIELD_FOR_INSERT_UPDATE */
|
||||
INVALID_FIELD_FOR_INSERT_UPDATE, /**
|
||||
* * Enumeration :
|
||||
* INVALID_FIELD_WHEN_USING_TEMPLATE
|
||||
*/
|
||||
INVALID_FIELD_WHEN_USING_TEMPLATE, /** * Enumeration : INVALID_FILTER_ACTION */
|
||||
INVALID_FILTER_ACTION, /** * Enumeration : INVALID_GOOGLE_DOCS_URL */
|
||||
INVALID_GOOGLE_DOCS_URL, /** * Enumeration : INVALID_ID_FIELD */
|
||||
INVALID_ID_FIELD, /** * Enumeration : INVALID_INET_ADDRESS */
|
||||
INVALID_INET_ADDRESS, /** * Enumeration : INVALID_LINEITEM_CLONE_STATE */
|
||||
INVALID_LINEITEM_CLONE_STATE, /**
|
||||
* * Enumeration :
|
||||
* INVALID_MASTER_OR_TRANSLATED_SOLUTION
|
||||
*/
|
||||
INVALID_MASTER_OR_TRANSLATED_SOLUTION, /**
|
||||
* * Enumeration :
|
||||
* INVALID_MESSAGE_ID_REFERENCE
|
||||
*/
|
||||
INVALID_MESSAGE_ID_REFERENCE, /** * Enumeration : INVALID_OPERATION */
|
||||
INVALID_OPERATION, /** * Enumeration : INVALID_OPERATOR */
|
||||
INVALID_OPERATOR, /** * Enumeration : INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST */
|
||||
INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, /**
|
||||
* * Enumeration :
|
||||
* INVALID_PACKAGE_VERSION
|
||||
*/
|
||||
INVALID_PACKAGE_VERSION, /** * Enumeration : INVALID_PARTNER_NETWORK_STATUS */
|
||||
INVALID_PARTNER_NETWORK_STATUS, /**
|
||||
* * Enumeration :
|
||||
* INVALID_PERSON_ACCOUNT_OPERATION
|
||||
*/
|
||||
INVALID_PERSON_ACCOUNT_OPERATION, /** * Enumeration : INVALID_QUERY_LOCATOR */
|
||||
INVALID_QUERY_LOCATOR, /** * Enumeration : INVALID_READ_ONLY_USER_DML */
|
||||
INVALID_READ_ONLY_USER_DML, /** * Enumeration : INVALID_SAVE_AS_ACTIVITY_FLAG */
|
||||
INVALID_SAVE_AS_ACTIVITY_FLAG, /** * Enumeration : INVALID_SESSION_ID */
|
||||
INVALID_SESSION_ID, /** * Enumeration : INVALID_SETUP_OWNER */
|
||||
INVALID_SETUP_OWNER, /** * Enumeration : INVALID_STATUS */
|
||||
INVALID_STATUS, /** * Enumeration : INVALID_TYPE */
|
||||
INVALID_TYPE, /** * Enumeration : INVALID_TYPE_FOR_OPERATION */
|
||||
INVALID_TYPE_FOR_OPERATION, /**
|
||||
* * Enumeration :
|
||||
* INVALID_TYPE_ON_FIELD_IN_RECORD
|
||||
*/
|
||||
INVALID_TYPE_ON_FIELD_IN_RECORD, /** * Enumeration : IP_RANGE_LIMIT_EXCEEDED */
|
||||
IP_RANGE_LIMIT_EXCEEDED, /** * Enumeration : LICENSE_LIMIT_EXCEEDED */
|
||||
LICENSE_LIMIT_EXCEEDED, /** * Enumeration : LIGHT_PORTAL_USER_EXCEPTION */
|
||||
LIGHT_PORTAL_USER_EXCEPTION, /** * Enumeration : LIMIT_EXCEEDED */
|
||||
LIMIT_EXCEEDED, /** * Enumeration : MALFORMED_ID */
|
||||
MALFORMED_ID, /** * Enumeration : MANAGER_NOT_DEFINED */
|
||||
MANAGER_NOT_DEFINED, /** * Enumeration : MASSMAIL_RETRY_LIMIT_EXCEEDED */
|
||||
MASSMAIL_RETRY_LIMIT_EXCEEDED, /** * Enumeration : MASS_MAIL_LIMIT_EXCEEDED */
|
||||
MASS_MAIL_LIMIT_EXCEEDED, /** * Enumeration : MAXIMUM_CCEMAILS_EXCEEDED */
|
||||
MAXIMUM_CCEMAILS_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED
|
||||
*/
|
||||
MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* MAXIMUM_HIERARCHY_LEVELS_REACHED
|
||||
*/
|
||||
MAXIMUM_HIERARCHY_LEVELS_REACHED, /**
|
||||
* * Enumeration :
|
||||
* MAXIMUM_SIZE_OF_ATTACHMENT
|
||||
*/
|
||||
MAXIMUM_SIZE_OF_ATTACHMENT, /** * Enumeration : MAXIMUM_SIZE_OF_DOCUMENT */
|
||||
MAXIMUM_SIZE_OF_DOCUMENT, /** * Enumeration : MAX_ACTIONS_PER_RULE_EXCEEDED */
|
||||
MAX_ACTIONS_PER_RULE_EXCEEDED, /** * Enumeration : MAX_ACTIVE_RULES_EXCEEDED */
|
||||
MAX_ACTIVE_RULES_EXCEEDED, /** * Enumeration : MAX_APPROVAL_STEPS_EXCEEDED */
|
||||
MAX_APPROVAL_STEPS_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* MAX_FORMULAS_PER_RULE_EXCEEDED
|
||||
*/
|
||||
MAX_FORMULAS_PER_RULE_EXCEEDED, /** * Enumeration : MAX_RULES_EXCEEDED */
|
||||
MAX_RULES_EXCEEDED, /** * Enumeration : MAX_RULE_ENTRIES_EXCEEDED */
|
||||
MAX_RULE_ENTRIES_EXCEEDED, /** * Enumeration : MAX_TASK_DESCRIPTION_EXCEEEDED */
|
||||
MAX_TASK_DESCRIPTION_EXCEEEDED, /** * Enumeration : MAX_TM_RULES_EXCEEDED */
|
||||
MAX_TM_RULES_EXCEEDED, /** * Enumeration : MAX_TM_RULE_ITEMS_EXCEEDED */
|
||||
MAX_TM_RULE_ITEMS_EXCEEDED, /** * Enumeration : MERGE_FAILED */
|
||||
MERGE_FAILED, /** * Enumeration : MISSING_ARGUMENT */
|
||||
MISSING_ARGUMENT, /** * Enumeration : MIXED_DML_OPERATION */
|
||||
MIXED_DML_OPERATION, /** * Enumeration : NONUNIQUE_SHIPPING_ADDRESS */
|
||||
NONUNIQUE_SHIPPING_ADDRESS, /** * Enumeration : NO_APPLICABLE_PROCESS */
|
||||
NO_APPLICABLE_PROCESS, /** * Enumeration : NO_ATTACHMENT_PERMISSION */
|
||||
NO_ATTACHMENT_PERMISSION, /** * Enumeration : NO_INACTIVE_DIVISION_MEMBERS */
|
||||
NO_INACTIVE_DIVISION_MEMBERS, /** * Enumeration : NO_MASS_MAIL_PERMISSION */
|
||||
NO_MASS_MAIL_PERMISSION, /** * Enumeration : NUMBER_OUTSIDE_VALID_RANGE */
|
||||
NUMBER_OUTSIDE_VALID_RANGE, /**
|
||||
* * Enumeration :
|
||||
* NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED
|
||||
*/
|
||||
NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* OPTED_OUT_OF_MASS_MAIL
|
||||
*/
|
||||
OPTED_OUT_OF_MASS_MAIL, /**
|
||||
* * Enumeration :
|
||||
* OP_WITH_INVALID_USER_TYPE_EXCEPTION
|
||||
*/
|
||||
OP_WITH_INVALID_USER_TYPE_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* PACKAGE_LICENSE_REQUIRED
|
||||
*/
|
||||
PACKAGE_LICENSE_REQUIRED, /** * Enumeration : PORTAL_NO_ACCESS */
|
||||
PORTAL_NO_ACCESS, /** * Enumeration : PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT */
|
||||
PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT, /**
|
||||
* * Enumeration :
|
||||
* PRIVATE_CONTACT_ON_ASSET
|
||||
*/
|
||||
PRIVATE_CONTACT_ON_ASSET, /** * Enumeration : QUERY_TIMEOUT */
|
||||
QUERY_TIMEOUT, /** * Enumeration : RECORD_IN_USE_BY_WORKFLOW */
|
||||
RECORD_IN_USE_BY_WORKFLOW, /** * Enumeration : REQUEST_RUNNING_TOO_LONG */
|
||||
REQUEST_RUNNING_TOO_LONG, /** * Enumeration : REQUIRED_FEATURE_MISSING */
|
||||
REQUIRED_FEATURE_MISSING, /** * Enumeration : REQUIRED_FIELD_MISSING */
|
||||
REQUIRED_FIELD_MISSING, /** * Enumeration : SELF_REFERENCE_FROM_TRIGGER */
|
||||
SELF_REFERENCE_FROM_TRIGGER, /** * Enumeration : SHARE_NEEDED_FOR_CHILD_OWNER */
|
||||
SHARE_NEEDED_FOR_CHILD_OWNER, /** * Enumeration : SINGLE_EMAIL_LIMIT_EXCEEDED */
|
||||
SINGLE_EMAIL_LIMIT_EXCEEDED, /** * Enumeration : STANDARD_PRICE_NOT_DEFINED */
|
||||
STANDARD_PRICE_NOT_DEFINED, /** * Enumeration : STORAGE_LIMIT_EXCEEDED */
|
||||
STORAGE_LIMIT_EXCEEDED, /** * Enumeration : STRING_TOO_LONG */
|
||||
STRING_TOO_LONG, /** * Enumeration : TABSET_LIMIT_EXCEEDED */
|
||||
TABSET_LIMIT_EXCEEDED, /** * Enumeration : TEMPLATE_NOT_ACTIVE */
|
||||
TEMPLATE_NOT_ACTIVE, /** * Enumeration : TERRITORY_REALIGN_IN_PROGRESS */
|
||||
TERRITORY_REALIGN_IN_PROGRESS, /**
|
||||
* * Enumeration :
|
||||
* TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET
|
||||
*/
|
||||
TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET, /**
|
||||
* * Enumeration :
|
||||
* TOO_MANY_APEX_REQUESTS
|
||||
*/
|
||||
TOO_MANY_APEX_REQUESTS, /** * Enumeration : TOO_MANY_ENUM_VALUE */
|
||||
TOO_MANY_ENUM_VALUE, /** * Enumeration : TRANSFER_REQUIRES_READ */
|
||||
TRANSFER_REQUIRES_READ, /** * Enumeration : UNABLE_TO_LOCK_ROW */
|
||||
UNABLE_TO_LOCK_ROW, /** * Enumeration : UNAVAILABLE_RECORDTYPE_EXCEPTION */
|
||||
UNAVAILABLE_RECORDTYPE_EXCEPTION, /** * Enumeration : UNDELETE_FAILED */
|
||||
UNDELETE_FAILED, /** * Enumeration : UNKNOWN_EXCEPTION */
|
||||
UNKNOWN_EXCEPTION, /** * Enumeration : UNSPECIFIED_EMAIL_ADDRESS */
|
||||
UNSPECIFIED_EMAIL_ADDRESS, /**
|
||||
* * Enumeration :
|
||||
* UNSUPPORTED_APEX_TRIGGER_OPERATON
|
||||
*/
|
||||
UNSUPPORTED_APEX_TRIGGER_OPERATON, /**
|
||||
* * Enumeration :
|
||||
* UNVERIFIED_SENDER_ADDRESS
|
||||
*/
|
||||
UNVERIFIED_SENDER_ADDRESS, /**
|
||||
* * Enumeration :
|
||||
* USER_OWNS_PORTAL_ACCOUNT_EXCEPTION
|
||||
*/
|
||||
USER_OWNS_PORTAL_ACCOUNT_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* USER_WITH_APEX_SHARES_EXCEPTION
|
||||
*/
|
||||
USER_WITH_APEX_SHARES_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* WEBLINK_SIZE_LIMIT_EXCEEDED
|
||||
*/
|
||||
WEBLINK_SIZE_LIMIT_EXCEEDED, /** * Enumeration : WRONG_CONTROLLER_TYPE */
|
||||
WRONG_CONTROLLER_TYPE,
|
||||
}
|
||||
/** * Enumeration : ALL_OR_NONE_OPERATION_ROLLED_BACK */
|
||||
ALL_OR_NONE_OPERATION_ROLLED_BACK,
|
||||
/** * Enumeration : ALREADY_IN_PROCESS */
|
||||
ALREADY_IN_PROCESS,
|
||||
/** * Enumeration : ASSIGNEE_TYPE_REQUIRED */
|
||||
ASSIGNEE_TYPE_REQUIRED,
|
||||
/** * Enumeration : BAD_CUSTOM_ENTITY_PARENT_DOMAIN */
|
||||
BAD_CUSTOM_ENTITY_PARENT_DOMAIN,
|
||||
/** * Enumeration : BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED */
|
||||
BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED,
|
||||
/** * Enumeration : CANNOT_CASCADE_PRODUCT_ACTIVE */
|
||||
CANNOT_CASCADE_PRODUCT_ACTIVE,
|
||||
/** * Enumeration : CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD */
|
||||
CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD,
|
||||
/** * Enumeration : CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE */
|
||||
CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE,
|
||||
/** * Enumeration : CANNOT_DEACTIVATE_DIVISION */
|
||||
CANNOT_DEACTIVATE_DIVISION,
|
||||
/** * Enumeration : CANNOT_DELETE_LAST_DATED_CONVERSION_RATE */
|
||||
CANNOT_DELETE_LAST_DATED_CONVERSION_RATE,
|
||||
/** * Enumeration : CANNOT_DELETE_MANAGED_OBJECT */
|
||||
CANNOT_DELETE_MANAGED_OBJECT,
|
||||
/** * Enumeration : CANNOT_DISABLE_LAST_ADMIN */
|
||||
CANNOT_DISABLE_LAST_ADMIN,
|
||||
/** * Enumeration : CANNOT_ENABLE_IP_RESTRICT_REQUESTS */
|
||||
CANNOT_ENABLE_IP_RESTRICT_REQUESTS,
|
||||
/** * Enumeration : CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY */
|
||||
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY,
|
||||
/** * Enumeration : CANNOT_MODIFY_MANAGED_OBJECT */
|
||||
CANNOT_MODIFY_MANAGED_OBJECT,
|
||||
/** * Enumeration : CANNOT_RENAME_APEX_REFERENCED_FIELD */
|
||||
CANNOT_RENAME_APEX_REFERENCED_FIELD,
|
||||
/** * Enumeration : CANNOT_RENAME_APEX_REFERENCED_OBJECT */
|
||||
CANNOT_RENAME_APEX_REFERENCED_OBJECT,
|
||||
/** * Enumeration : CANNOT_REPARENT_RECORD */
|
||||
CANNOT_REPARENT_RECORD,
|
||||
/** * Enumeration : CANNOT_UPDATE_CONVERTED_LEAD */
|
||||
CANNOT_UPDATE_CONVERTED_LEAD,
|
||||
/** * Enumeration : CANT_DISABLE_CORP_CURRENCY */
|
||||
CANT_DISABLE_CORP_CURRENCY,
|
||||
/** * Enumeration : CANT_UNSET_CORP_CURRENCY */
|
||||
CANT_UNSET_CORP_CURRENCY,
|
||||
/** * Enumeration : CHILD_SHARE_FAILS_PARENT */
|
||||
CHILD_SHARE_FAILS_PARENT,
|
||||
/** * Enumeration : CIRCULAR_DEPENDENCY */
|
||||
CIRCULAR_DEPENDENCY,
|
||||
/** * Enumeration : COMMUNITY_NOT_ACCESSIBLE */
|
||||
COMMUNITY_NOT_ACCESSIBLE,
|
||||
/** * Enumeration : CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED */
|
||||
CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : CUSTOM_ENTITY_OR_FIELD_LIMIT */
|
||||
CUSTOM_ENTITY_OR_FIELD_LIMIT,
|
||||
/** * Enumeration : CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED */
|
||||
CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : CUSTOM_INDEX_EXISTS */
|
||||
CUSTOM_INDEX_EXISTS,
|
||||
/** * Enumeration : CUSTOM_LINK_LIMIT_EXCEEDED */
|
||||
CUSTOM_LINK_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : CUSTOM_TAB_LIMIT_EXCEEDED */
|
||||
CUSTOM_TAB_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : DELETE_FAILED */
|
||||
DELETE_FAILED,
|
||||
/** * Enumeration : DELETE_OPERATION_TOO_LARGE */
|
||||
DELETE_OPERATION_TOO_LARGE,
|
||||
/** * Enumeration : DELETE_REQUIRED_ON_CASCADE */
|
||||
DELETE_REQUIRED_ON_CASCADE,
|
||||
/** * Enumeration : DEPENDENCY_EXISTS */
|
||||
DEPENDENCY_EXISTS,
|
||||
/** * Enumeration : DUPLICATE_CASE_SOLUTION */
|
||||
DUPLICATE_CASE_SOLUTION,
|
||||
/** * Enumeration : DUPLICATE_COMM_NICKNAME */
|
||||
DUPLICATE_COMM_NICKNAME,
|
||||
/** * Enumeration : DUPLICATE_CUSTOM_ENTITY_DEFINITION */
|
||||
DUPLICATE_CUSTOM_ENTITY_DEFINITION,
|
||||
/** * Enumeration : DUPLICATE_CUSTOM_TAB_MOTIF */
|
||||
DUPLICATE_CUSTOM_TAB_MOTIF,
|
||||
/** * Enumeration : DUPLICATE_DEVELOPER_NAME */
|
||||
DUPLICATE_DEVELOPER_NAME,
|
||||
/** * Enumeration : DUPLICATE_EXTERNAL_ID */
|
||||
DUPLICATE_EXTERNAL_ID,
|
||||
/** * Enumeration : DUPLICATE_MASTER_LABEL */
|
||||
DUPLICATE_MASTER_LABEL,
|
||||
/** * Enumeration : DUPLICATE_SENDER_DISPLAY_NAME */
|
||||
DUPLICATE_SENDER_DISPLAY_NAME,
|
||||
/** * Enumeration : DUPLICATE_USERNAME */
|
||||
DUPLICATE_USERNAME,
|
||||
/** * Enumeration : DUPLICATE_VALUE */
|
||||
DUPLICATE_VALUE,
|
||||
/** * Enumeration : EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR */
|
||||
EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR,
|
||||
/** * Enumeration : EMPTY_SCONTROL_FILE_NAME */
|
||||
EMPTY_SCONTROL_FILE_NAME,
|
||||
/** * Enumeration : ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE */
|
||||
ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE,
|
||||
/** * Enumeration : ENTITY_IS_ARCHIVED */
|
||||
ENTITY_IS_ARCHIVED,
|
||||
/** * Enumeration : ENTITY_IS_DELETED */
|
||||
ENTITY_IS_DELETED,
|
||||
/** * Enumeration : ENTITY_IS_LOCKED */
|
||||
ENTITY_IS_LOCKED,
|
||||
/** * Enumeration : ERROR_IN_MAILER */
|
||||
ERROR_IN_MAILER,
|
||||
/** * Enumeration : FAILED_ACTIVATION */
|
||||
FAILED_ACTIVATION,
|
||||
/** * Enumeration : FIELD_CUSTOM_VALIDATION_EXCEPTION */
|
||||
FIELD_CUSTOM_VALIDATION_EXCEPTION,
|
||||
/** * Enumeration : FIELD_FILTER_VALIDATION_EXCEPTION */
|
||||
FIELD_FILTER_VALIDATION_EXCEPTION,
|
||||
/** * Enumeration : FIELD_INTEGRITY_EXCEPTION */
|
||||
FIELD_INTEGRITY_EXCEPTION,
|
||||
/** * Enumeration : FILTERED_LOOKUP_LIMIT_EXCEEDED */
|
||||
FILTERED_LOOKUP_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : HTML_FILE_UPLOAD_NOT_ALLOWED */
|
||||
HTML_FILE_UPLOAD_NOT_ALLOWED,
|
||||
/** * Enumeration : IMAGE_TOO_LARGE */
|
||||
IMAGE_TOO_LARGE,
|
||||
/** * Enumeration : INACTIVE_OWNER_OR_USER */
|
||||
INACTIVE_OWNER_OR_USER,
|
||||
/** * Enumeration : INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY */
|
||||
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY,
|
||||
/** * Enumeration : INSUFFICIENT_ACCESS_OR_READONLY */
|
||||
INSUFFICIENT_ACCESS_OR_READONLY,
|
||||
/** * Enumeration : INVALID_ACCESS_LEVEL */
|
||||
INVALID_ACCESS_LEVEL,
|
||||
/** * Enumeration : INVALID_ARGUMENT_TYPE */
|
||||
INVALID_ARGUMENT_TYPE,
|
||||
/** * Enumeration : INVALID_ASSIGNEE_TYPE */
|
||||
INVALID_ASSIGNEE_TYPE,
|
||||
/** * Enumeration : INVALID_ASSIGNMENT_RULE */
|
||||
INVALID_ASSIGNMENT_RULE,
|
||||
/** * Enumeration : INVALID_BATCH_OPERATION */
|
||||
INVALID_BATCH_OPERATION,
|
||||
/** * Enumeration : INVALID_CONTENT_TYPE */
|
||||
INVALID_CONTENT_TYPE,
|
||||
/** * Enumeration : INVALID_CREDIT_CARD_INFO */
|
||||
INVALID_CREDIT_CARD_INFO,
|
||||
/** * Enumeration : INVALID_CROSS_REFERENCE_KEY */
|
||||
INVALID_CROSS_REFERENCE_KEY,
|
||||
/** * Enumeration : INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD */
|
||||
INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD,
|
||||
/** * Enumeration : INVALID_CURRENCY_CONV_RATE */
|
||||
INVALID_CURRENCY_CONV_RATE,
|
||||
/** * Enumeration : INVALID_CURRENCY_CORP_RATE */
|
||||
INVALID_CURRENCY_CORP_RATE,
|
||||
/** * Enumeration : INVALID_CURRENCY_ISO */
|
||||
INVALID_CURRENCY_ISO,
|
||||
/** * Enumeration : INVALID_DATA_CATEGORY_GROUP_REFERENCE */
|
||||
INVALID_DATA_CATEGORY_GROUP_REFERENCE,
|
||||
/** * Enumeration : INVALID_DATA_URI */
|
||||
INVALID_DATA_URI,
|
||||
/** * Enumeration : INVALID_EMAIL_ADDRESS */
|
||||
INVALID_EMAIL_ADDRESS,
|
||||
/** * Enumeration : INVALID_EMPTY_KEY_OWNER */
|
||||
INVALID_EMPTY_KEY_OWNER,
|
||||
/** * Enumeration : INVALID_FIELD */
|
||||
INVALID_FIELD,
|
||||
/** * Enumeration : INVALID_FIELD_FOR_INSERT_UPDATE */
|
||||
INVALID_FIELD_FOR_INSERT_UPDATE,
|
||||
/** * Enumeration : INVALID_FIELD_WHEN_USING_TEMPLATE */
|
||||
INVALID_FIELD_WHEN_USING_TEMPLATE,
|
||||
/** * Enumeration : INVALID_FILTER_ACTION */
|
||||
INVALID_FILTER_ACTION,
|
||||
/** * Enumeration : INVALID_GOOGLE_DOCS_URL */
|
||||
INVALID_GOOGLE_DOCS_URL,
|
||||
/** * Enumeration : INVALID_ID_FIELD */
|
||||
INVALID_ID_FIELD,
|
||||
/** * Enumeration : INVALID_INET_ADDRESS */
|
||||
INVALID_INET_ADDRESS,
|
||||
/** * Enumeration : INVALID_LINEITEM_CLONE_STATE */
|
||||
INVALID_LINEITEM_CLONE_STATE,
|
||||
/** * Enumeration : INVALID_MASTER_OR_TRANSLATED_SOLUTION */
|
||||
INVALID_MASTER_OR_TRANSLATED_SOLUTION,
|
||||
/** * Enumeration : INVALID_MESSAGE_ID_REFERENCE */
|
||||
INVALID_MESSAGE_ID_REFERENCE,
|
||||
/** * Enumeration : INVALID_OPERATION */
|
||||
INVALID_OPERATION,
|
||||
/** * Enumeration : INVALID_OPERATOR */
|
||||
INVALID_OPERATOR,
|
||||
/** * Enumeration : INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST */
|
||||
INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST,
|
||||
/** * Enumeration : INVALID_PACKAGE_VERSION */
|
||||
INVALID_PACKAGE_VERSION,
|
||||
/** * Enumeration : INVALID_PARTNER_NETWORK_STATUS */
|
||||
INVALID_PARTNER_NETWORK_STATUS,
|
||||
/** * Enumeration : INVALID_PERSON_ACCOUNT_OPERATION */
|
||||
INVALID_PERSON_ACCOUNT_OPERATION,
|
||||
/** * Enumeration : INVALID_READ_ONLY_USER_DML */
|
||||
INVALID_READ_ONLY_USER_DML,
|
||||
/** * Enumeration : INVALID_SAVE_AS_ACTIVITY_FLAG */
|
||||
INVALID_SAVE_AS_ACTIVITY_FLAG,
|
||||
/** * Enumeration : INVALID_SESSION_ID */
|
||||
INVALID_SESSION_ID,
|
||||
/** * Enumeration : INVALID_SETUP_OWNER */
|
||||
INVALID_SETUP_OWNER,
|
||||
/** * Enumeration : INVALID_STATUS */
|
||||
INVALID_STATUS,
|
||||
/** * Enumeration : INVALID_TYPE */
|
||||
INVALID_TYPE,
|
||||
/** * Enumeration : INVALID_TYPE_FOR_OPERATION */
|
||||
INVALID_TYPE_FOR_OPERATION,
|
||||
/** * Enumeration : INVALID_TYPE_ON_FIELD_IN_RECORD */
|
||||
INVALID_TYPE_ON_FIELD_IN_RECORD,
|
||||
/** * Enumeration : IP_RANGE_LIMIT_EXCEEDED */
|
||||
IP_RANGE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : LICENSE_LIMIT_EXCEEDED */
|
||||
LICENSE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : LIGHT_PORTAL_USER_EXCEPTION */
|
||||
LIGHT_PORTAL_USER_EXCEPTION,
|
||||
/** * Enumeration : LIMIT_EXCEEDED */
|
||||
LIMIT_EXCEEDED,
|
||||
/** * Enumeration : MALFORMED_ID */
|
||||
MALFORMED_ID,
|
||||
/** * Enumeration : MANAGER_NOT_DEFINED */
|
||||
MANAGER_NOT_DEFINED,
|
||||
/** * Enumeration : MASSMAIL_RETRY_LIMIT_EXCEEDED */
|
||||
MASSMAIL_RETRY_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : MASS_MAIL_LIMIT_EXCEEDED */
|
||||
MASS_MAIL_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : MAXIMUM_CCEMAILS_EXCEEDED */
|
||||
MAXIMUM_CCEMAILS_EXCEEDED,
|
||||
/** * Enumeration : MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED */
|
||||
MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED,
|
||||
/** * Enumeration : MAXIMUM_HIERARCHY_LEVELS_REACHED */
|
||||
MAXIMUM_HIERARCHY_LEVELS_REACHED,
|
||||
/** * Enumeration : MAXIMUM_SIZE_OF_ATTACHMENT */
|
||||
MAXIMUM_SIZE_OF_ATTACHMENT,
|
||||
/** * Enumeration : MAXIMUM_SIZE_OF_DOCUMENT */
|
||||
MAXIMUM_SIZE_OF_DOCUMENT,
|
||||
/** * Enumeration : MAX_ACTIONS_PER_RULE_EXCEEDED */
|
||||
MAX_ACTIONS_PER_RULE_EXCEEDED,
|
||||
/** * Enumeration : MAX_ACTIVE_RULES_EXCEEDED */
|
||||
MAX_ACTIVE_RULES_EXCEEDED,
|
||||
/** * Enumeration : MAX_APPROVAL_STEPS_EXCEEDED */
|
||||
MAX_APPROVAL_STEPS_EXCEEDED,
|
||||
/** * Enumeration : MAX_FORMULAS_PER_RULE_EXCEEDED */
|
||||
MAX_FORMULAS_PER_RULE_EXCEEDED,
|
||||
/** * Enumeration : MAX_RULES_EXCEEDED */
|
||||
MAX_RULES_EXCEEDED,
|
||||
/** * Enumeration : MAX_RULE_ENTRIES_EXCEEDED */
|
||||
MAX_RULE_ENTRIES_EXCEEDED,
|
||||
/** * Enumeration : MAX_TASK_DESCRIPTION_EXCEEEDED */
|
||||
MAX_TASK_DESCRIPTION_EXCEEEDED,
|
||||
/** * Enumeration : MAX_TM_RULES_EXCEEDED */
|
||||
MAX_TM_RULES_EXCEEDED,
|
||||
/** * Enumeration : MAX_TM_RULE_ITEMS_EXCEEDED */
|
||||
MAX_TM_RULE_ITEMS_EXCEEDED,
|
||||
/** * Enumeration : MERGE_FAILED */
|
||||
MERGE_FAILED,
|
||||
/** * Enumeration : MISSING_ARGUMENT */
|
||||
MISSING_ARGUMENT,
|
||||
/** * Enumeration : MIXED_DML_OPERATION */
|
||||
MIXED_DML_OPERATION,
|
||||
/** * Enumeration : NONUNIQUE_SHIPPING_ADDRESS */
|
||||
NONUNIQUE_SHIPPING_ADDRESS,
|
||||
/** * Enumeration : NO_APPLICABLE_PROCESS */
|
||||
NO_APPLICABLE_PROCESS,
|
||||
/** * Enumeration : NO_ATTACHMENT_PERMISSION */
|
||||
NO_ATTACHMENT_PERMISSION,
|
||||
/** * Enumeration : NO_INACTIVE_DIVISION_MEMBERS */
|
||||
NO_INACTIVE_DIVISION_MEMBERS,
|
||||
/** * Enumeration : NO_MASS_MAIL_PERMISSION */
|
||||
NO_MASS_MAIL_PERMISSION,
|
||||
/** * Enumeration : NUMBER_OUTSIDE_VALID_RANGE */
|
||||
NUMBER_OUTSIDE_VALID_RANGE,
|
||||
/** * Enumeration : NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED */
|
||||
NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED,
|
||||
/** * Enumeration : OPTED_OUT_OF_MASS_MAIL */
|
||||
OPTED_OUT_OF_MASS_MAIL,
|
||||
/** * Enumeration : OP_WITH_INVALID_USER_TYPE_EXCEPTION */
|
||||
OP_WITH_INVALID_USER_TYPE_EXCEPTION,
|
||||
/** * Enumeration : PACKAGE_LICENSE_REQUIRED */
|
||||
PACKAGE_LICENSE_REQUIRED,
|
||||
/** * Enumeration : PORTAL_NO_ACCESS */
|
||||
PORTAL_NO_ACCESS,
|
||||
/** * Enumeration : PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT */
|
||||
PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT,
|
||||
/** * Enumeration : PRIVATE_CONTACT_ON_ASSET */
|
||||
PRIVATE_CONTACT_ON_ASSET,
|
||||
/** * Enumeration : RECORD_IN_USE_BY_WORKFLOW */
|
||||
RECORD_IN_USE_BY_WORKFLOW,
|
||||
/** * Enumeration : REQUEST_RUNNING_TOO_LONG */
|
||||
REQUEST_RUNNING_TOO_LONG,
|
||||
/** * Enumeration : REQUIRED_FEATURE_MISSING */
|
||||
REQUIRED_FEATURE_MISSING,
|
||||
/** * Enumeration : REQUIRED_FIELD_MISSING */
|
||||
REQUIRED_FIELD_MISSING,
|
||||
/** * Enumeration : SELF_REFERENCE_FROM_TRIGGER */
|
||||
SELF_REFERENCE_FROM_TRIGGER,
|
||||
/** * Enumeration : SHARE_NEEDED_FOR_CHILD_OWNER */
|
||||
SHARE_NEEDED_FOR_CHILD_OWNER,
|
||||
/** * Enumeration : SINGLE_EMAIL_LIMIT_EXCEEDED */
|
||||
SINGLE_EMAIL_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : STANDARD_PRICE_NOT_DEFINED */
|
||||
STANDARD_PRICE_NOT_DEFINED,
|
||||
/** * Enumeration : STORAGE_LIMIT_EXCEEDED */
|
||||
STORAGE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : STRING_TOO_LONG */
|
||||
STRING_TOO_LONG,
|
||||
/** * Enumeration : TABSET_LIMIT_EXCEEDED */
|
||||
TABSET_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : TEMPLATE_NOT_ACTIVE */
|
||||
TEMPLATE_NOT_ACTIVE,
|
||||
/** * Enumeration : TERRITORY_REALIGN_IN_PROGRESS */
|
||||
TERRITORY_REALIGN_IN_PROGRESS,
|
||||
/** * Enumeration : TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET */
|
||||
TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET,
|
||||
/** * Enumeration : TOO_MANY_APEX_REQUESTS */
|
||||
TOO_MANY_APEX_REQUESTS,
|
||||
/** * Enumeration : TOO_MANY_ENUM_VALUE */
|
||||
TOO_MANY_ENUM_VALUE,
|
||||
/** * Enumeration : TRANSFER_REQUIRES_READ */
|
||||
TRANSFER_REQUIRES_READ,
|
||||
/** * Enumeration : UNABLE_TO_LOCK_ROW */
|
||||
UNABLE_TO_LOCK_ROW,
|
||||
/** * Enumeration : UNAVAILABLE_RECORDTYPE_EXCEPTION */
|
||||
UNAVAILABLE_RECORDTYPE_EXCEPTION,
|
||||
/** * Enumeration : UNDELETE_FAILED */
|
||||
UNDELETE_FAILED,
|
||||
/** * Enumeration : UNKNOWN_EXCEPTION */
|
||||
UNKNOWN_EXCEPTION,
|
||||
/** * Enumeration : UNSPECIFIED_EMAIL_ADDRESS */
|
||||
UNSPECIFIED_EMAIL_ADDRESS,
|
||||
/** * Enumeration : UNSUPPORTED_APEX_TRIGGER_OPERATON */
|
||||
UNSUPPORTED_APEX_TRIGGER_OPERATON,
|
||||
/** * Enumeration : UNVERIFIED_SENDER_ADDRESS */
|
||||
UNVERIFIED_SENDER_ADDRESS,
|
||||
/** * Enumeration : USER_OWNS_PORTAL_ACCOUNT_EXCEPTION */
|
||||
USER_OWNS_PORTAL_ACCOUNT_EXCEPTION,
|
||||
/** * Enumeration : USER_WITH_APEX_SHARES_EXCEPTION */
|
||||
USER_WITH_APEX_SHARES_EXCEPTION,
|
||||
/** * Enumeration : WEBLINK_SIZE_LIMIT_EXCEEDED */
|
||||
WEBLINK_SIZE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : WRONG_CONTROLLER_TYPE */
|
||||
WRONG_CONTROLLER_TYPE,
|
||||
}
|
||||
|
||||
@@ -2,170 +2,212 @@ package com.sforce.soap.partner.fault;
|
||||
|
||||
/** * Generated enum, please do not edit. */
|
||||
public enum ExceptionCode {
|
||||
/** * Enumeration : APEX_TRIGGER_COUPLING_LIMIT */
|
||||
APEX_TRIGGER_COUPLING_LIMIT, /** * Enumeration : API_CURRENTLY_DISABLED */
|
||||
API_CURRENTLY_DISABLED, /** * Enumeration : API_DISABLED_FOR_ORG */
|
||||
API_DISABLED_FOR_ORG, /** * Enumeration : ARGUMENT_OBJECT_PARSE_ERROR */
|
||||
ARGUMENT_OBJECT_PARSE_ERROR, /** * Enumeration : CANNOT_DELETE_OWNER */
|
||||
CANNOT_DELETE_OWNER, /**
|
||||
* * Enumeration :
|
||||
* CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY
|
||||
*/
|
||||
CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY, /**
|
||||
* * Enumeration :
|
||||
* CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY
|
||||
*/
|
||||
CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY, /**
|
||||
* * Enumeration :
|
||||
* CIRCULAR_OBJECT_GRAPH
|
||||
*/
|
||||
CIRCULAR_OBJECT_GRAPH, /** * Enumeration : CLIENT_NOT_ACCESSIBLE_FOR_USER */
|
||||
CLIENT_NOT_ACCESSIBLE_FOR_USER, /**
|
||||
* * Enumeration :
|
||||
* CLIENT_REQUIRE_UPDATE_FOR_USER
|
||||
*/
|
||||
CLIENT_REQUIRE_UPDATE_FOR_USER, /**
|
||||
* * Enumeration :
|
||||
* CUSTOM_METADATA_LIMIT_EXCEEDED
|
||||
*/
|
||||
CUSTOM_METADATA_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* DATACLOUD_API_CLIENT_EXCEPTION
|
||||
*/
|
||||
DATACLOUD_API_CLIENT_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* DATACLOUD_API_SERVER_BUSY_EXCEPTION
|
||||
*/
|
||||
DATACLOUD_API_SERVER_BUSY_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* DATACLOUD_API_SERVER_EXCEPTION
|
||||
*/
|
||||
DATACLOUD_API_SERVER_EXCEPTION, /** * Enumeration : DATACLOUD_API_UNAVAILABLE */
|
||||
DATACLOUD_API_UNAVAILABLE, /** * Enumeration : DUPLICATE_ARGUMENT_VALUE */
|
||||
DUPLICATE_ARGUMENT_VALUE, /** * Enumeration : DUPLICATE_VALUE */
|
||||
DUPLICATE_VALUE, /** * Enumeration : EMAIL_BATCH_SIZE_LIMIT_EXCEEDED */
|
||||
EMAIL_BATCH_SIZE_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* EMAIL_TO_CASE_INVALID_ROUTING
|
||||
*/
|
||||
EMAIL_TO_CASE_INVALID_ROUTING, /**
|
||||
* * Enumeration :
|
||||
* EMAIL_TO_CASE_LIMIT_EXCEEDED
|
||||
*/
|
||||
EMAIL_TO_CASE_LIMIT_EXCEEDED, /** * Enumeration : EMAIL_TO_CASE_NOT_ENABLED */
|
||||
EMAIL_TO_CASE_NOT_ENABLED, /** * Enumeration : EXCEEDED_ID_LIMIT */
|
||||
EXCEEDED_ID_LIMIT, /** * Enumeration : EXCEEDED_LEAD_CONVERT_LIMIT */
|
||||
EXCEEDED_LEAD_CONVERT_LIMIT, /** * Enumeration : EXCEEDED_MAX_SIZE_REQUEST */
|
||||
EXCEEDED_MAX_SIZE_REQUEST, /** * Enumeration : EXCEEDED_MAX_TYPES_LIMIT */
|
||||
EXCEEDED_MAX_TYPES_LIMIT, /** * Enumeration : EXCEEDED_QUOTA */
|
||||
EXCEEDED_QUOTA, /** * Enumeration : FEDERATED_SEARCH_ERROR */
|
||||
FEDERATED_SEARCH_ERROR, /** * Enumeration : FEED_NOT_ENABLED_FOR_OBJECT */
|
||||
FEED_NOT_ENABLED_FOR_OBJECT, /** * Enumeration : FUNCTIONALITY_NOT_ENABLED */
|
||||
FUNCTIONALITY_NOT_ENABLED, /**
|
||||
* * Enumeration :
|
||||
* FUNCTIONALITY_TEMPORARILY_UNAVAILABLE
|
||||
*/
|
||||
FUNCTIONALITY_TEMPORARILY_UNAVAILABLE, /**
|
||||
* * Enumeration :
|
||||
* ILLEGAL_QUERY_PARAMETER_VALUE
|
||||
*/
|
||||
ILLEGAL_QUERY_PARAMETER_VALUE, /** * Enumeration : INACTIVE_OWNER_OR_USER */
|
||||
INACTIVE_OWNER_OR_USER, /** * Enumeration : INACTIVE_PORTAL */
|
||||
INACTIVE_PORTAL, /** * Enumeration : INSUFFICIENT_ACCESS */
|
||||
INSUFFICIENT_ACCESS, /** * Enumeration : INVALID_ASSIGNMENT_RULE */
|
||||
INVALID_ASSIGNMENT_RULE, /** * Enumeration : INVALID_BATCH_SIZE */
|
||||
INVALID_BATCH_SIZE, /** * Enumeration : INVALID_CLIENT */
|
||||
INVALID_CLIENT, /** * Enumeration : INVALID_CROSS_REFERENCE_KEY */
|
||||
INVALID_CROSS_REFERENCE_KEY, /** * Enumeration : INVALID_FIELD */
|
||||
INVALID_FIELD, /** * Enumeration : INVALID_FILTER_LANGUAGE */
|
||||
INVALID_FILTER_LANGUAGE, /** * Enumeration : INVALID_FILTER_VALUE */
|
||||
INVALID_FILTER_VALUE, /** * Enumeration : INVALID_ID_FIELD */
|
||||
INVALID_ID_FIELD, /** * Enumeration : INVALID_INPUT_COMBINATION */
|
||||
INVALID_INPUT_COMBINATION, /** * Enumeration : INVALID_LOCALE_LANGUAGE */
|
||||
INVALID_LOCALE_LANGUAGE, /** * Enumeration : INVALID_LOCATOR */
|
||||
INVALID_LOCATOR, /** * Enumeration : INVALID_LOGIN */
|
||||
INVALID_LOGIN, /** * Enumeration : INVALID_MULTIPART_REQUEST */
|
||||
INVALID_MULTIPART_REQUEST, /** * Enumeration : INVALID_NEW_PASSWORD */
|
||||
INVALID_NEW_PASSWORD, /** * Enumeration : INVALID_OPERATION */
|
||||
INVALID_OPERATION, /**
|
||||
* * Enumeration : INVALID_OPERATION_WITH_EXPIRED_PASSWORD
|
||||
*/
|
||||
INVALID_OPERATION_WITH_EXPIRED_PASSWORD, /**
|
||||
* * Enumeration :
|
||||
* INVALID_PAGING_OPTION
|
||||
*/
|
||||
INVALID_PAGING_OPTION, /** * Enumeration : INVALID_QUERY_FILTER_OPERATOR */
|
||||
INVALID_QUERY_FILTER_OPERATOR, /** * Enumeration : INVALID_QUERY_LOCATOR */
|
||||
INVALID_QUERY_LOCATOR, /** * Enumeration : INVALID_QUERY_SCOPE */
|
||||
INVALID_QUERY_SCOPE, /** * Enumeration : INVALID_REPLICATION_DATE */
|
||||
INVALID_REPLICATION_DATE, /** * Enumeration : INVALID_SEARCH */
|
||||
INVALID_SEARCH, /** * Enumeration : INVALID_SEARCH_SCOPE */
|
||||
INVALID_SEARCH_SCOPE, /** * Enumeration : INVALID_SESSION_ID */
|
||||
INVALID_SESSION_ID, /** * Enumeration : INVALID_SOAP_HEADER */
|
||||
INVALID_SOAP_HEADER, /** * Enumeration : INVALID_SORT_OPTION */
|
||||
INVALID_SORT_OPTION, /** * Enumeration : INVALID_SSO_GATEWAY_URL */
|
||||
INVALID_SSO_GATEWAY_URL, /** * Enumeration : INVALID_TYPE */
|
||||
INVALID_TYPE, /** * Enumeration : INVALID_TYPE_FOR_OPERATION */
|
||||
INVALID_TYPE_FOR_OPERATION, /** * Enumeration : JIGSAW_IMPORT_LIMIT_EXCEEDED */
|
||||
JIGSAW_IMPORT_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration : JIGSAW_REQUEST_NOT_SUPPORTED
|
||||
*/
|
||||
JIGSAW_REQUEST_NOT_SUPPORTED, /** * Enumeration : JSON_PARSER_ERROR */
|
||||
JSON_PARSER_ERROR, /** * Enumeration : LICENSING_UNKNOWN_ERROR */
|
||||
LICENSING_UNKNOWN_ERROR, /** * Enumeration : LIMIT_EXCEEDED */
|
||||
LIMIT_EXCEEDED, /** * Enumeration : LOGIN_CHALLENGE_ISSUED */
|
||||
LOGIN_CHALLENGE_ISSUED, /** * Enumeration : LOGIN_CHALLENGE_PENDING */
|
||||
LOGIN_CHALLENGE_PENDING, /** * Enumeration : LOGIN_DURING_RESTRICTED_DOMAIN */
|
||||
LOGIN_DURING_RESTRICTED_DOMAIN, /**
|
||||
* * Enumeration :
|
||||
* LOGIN_DURING_RESTRICTED_TIME
|
||||
*/
|
||||
LOGIN_DURING_RESTRICTED_TIME, /**
|
||||
* * Enumeration :
|
||||
* LOGIN_MUST_USE_SECURITY_TOKEN
|
||||
*/
|
||||
LOGIN_MUST_USE_SECURITY_TOKEN, /** * Enumeration : MALFORMED_ID */
|
||||
MALFORMED_ID, /** * Enumeration : MALFORMED_QUERY */
|
||||
MALFORMED_QUERY, /** * Enumeration : MALFORMED_SEARCH */
|
||||
MALFORMED_SEARCH, /** * Enumeration : MISSING_ARGUMENT */
|
||||
MISSING_ARGUMENT, /** * Enumeration : NOT_MODIFIED */
|
||||
NOT_MODIFIED, /** * Enumeration : NO_SOFTPHONE_LAYOUT */
|
||||
NO_SOFTPHONE_LAYOUT, /** * Enumeration : NUMBER_OUTSIDE_VALID_RANGE */
|
||||
NUMBER_OUTSIDE_VALID_RANGE, /** * Enumeration : OPERATION_TOO_LARGE */
|
||||
OPERATION_TOO_LARGE, /** * Enumeration : ORG_IN_MAINTENANCE */
|
||||
ORG_IN_MAINTENANCE, /** * Enumeration : ORG_IS_DOT_ORG */
|
||||
ORG_IS_DOT_ORG, /** * Enumeration : ORG_LOCKED */
|
||||
ORG_LOCKED, /** * Enumeration : ORG_NOT_OWNED_BY_INSTANCE */
|
||||
ORG_NOT_OWNED_BY_INSTANCE, /** * Enumeration : PASSWORD_LOCKOUT */
|
||||
PASSWORD_LOCKOUT, /** * Enumeration : PORTAL_NO_ACCESS */
|
||||
PORTAL_NO_ACCESS, /** * Enumeration : POST_BODY_PARSE_ERROR */
|
||||
POST_BODY_PARSE_ERROR, /** * Enumeration : QUERY_TIMEOUT */
|
||||
QUERY_TIMEOUT, /** * Enumeration : QUERY_TOO_COMPLICATED */
|
||||
QUERY_TOO_COMPLICATED, /** * Enumeration : REQUEST_LIMIT_EXCEEDED */
|
||||
REQUEST_LIMIT_EXCEEDED, /** * Enumeration : REQUEST_RUNNING_TOO_LONG */
|
||||
REQUEST_RUNNING_TOO_LONG, /** * Enumeration : SERVER_UNAVAILABLE */
|
||||
SERVER_UNAVAILABLE, /**
|
||||
* * Enumeration :
|
||||
* SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION
|
||||
*/
|
||||
SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION
|
||||
*/
|
||||
SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE
|
||||
*/
|
||||
SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE, /** * Enumeration : SSO_SERVICE_DOWN */
|
||||
SSO_SERVICE_DOWN, /** * Enumeration : TOO_MANY_APEX_REQUESTS */
|
||||
TOO_MANY_APEX_REQUESTS, /** * Enumeration : TOO_MANY_RECIPIENTS */
|
||||
TOO_MANY_RECIPIENTS, /** * Enumeration : TRIAL_EXPIRED */
|
||||
TRIAL_EXPIRED, /** * Enumeration : UNKNOWN_ATTACHMENT_EXCEPTION */
|
||||
UNKNOWN_ATTACHMENT_EXCEPTION, /** * Enumeration : UNKNOWN_EXCEPTION */
|
||||
UNKNOWN_EXCEPTION, /** * Enumeration : UNSUPPORTED_API_VERSION */
|
||||
UNSUPPORTED_API_VERSION, /** * Enumeration : UNSUPPORTED_ATTACHMENT_ENCODING */
|
||||
UNSUPPORTED_ATTACHMENT_ENCODING, /** * Enumeration : UNSUPPORTED_CLIENT */
|
||||
UNSUPPORTED_CLIENT, /** * Enumeration : UNSUPPORTED_MEDIA_TYPE */
|
||||
UNSUPPORTED_MEDIA_TYPE, /** * Enumeration : XML_PARSER_ERROR */
|
||||
XML_PARSER_ERROR,
|
||||
}
|
||||
/** * Enumeration : API_CURRENTLY_DISABLED */
|
||||
API_CURRENTLY_DISABLED,
|
||||
/** * Enumeration : API_DISABLED_FOR_ORG */
|
||||
API_DISABLED_FOR_ORG,
|
||||
/** * Enumeration : ARGUMENT_OBJECT_PARSE_ERROR */
|
||||
ARGUMENT_OBJECT_PARSE_ERROR,
|
||||
/** * Enumeration : CANNOT_DELETE_OWNER */
|
||||
CANNOT_DELETE_OWNER,
|
||||
/** * Enumeration : CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY */
|
||||
CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY,
|
||||
/** * Enumeration : CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY */
|
||||
CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY,
|
||||
/** * Enumeration : CIRCULAR_OBJECT_GRAPH */
|
||||
CIRCULAR_OBJECT_GRAPH,
|
||||
/** * Enumeration : CLIENT_NOT_ACCESSIBLE_FOR_USER */
|
||||
CLIENT_NOT_ACCESSIBLE_FOR_USER,
|
||||
/** * Enumeration : CLIENT_REQUIRE_UPDATE_FOR_USER */
|
||||
CLIENT_REQUIRE_UPDATE_FOR_USER,
|
||||
/** * Enumeration : CUSTOM_METADATA_LIMIT_EXCEEDED */
|
||||
CUSTOM_METADATA_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : DATACLOUD_API_CLIENT_EXCEPTION */
|
||||
DATACLOUD_API_CLIENT_EXCEPTION,
|
||||
/** * Enumeration : DATACLOUD_API_SERVER_BUSY_EXCEPTION */
|
||||
DATACLOUD_API_SERVER_BUSY_EXCEPTION,
|
||||
/** * Enumeration : DATACLOUD_API_SERVER_EXCEPTION */
|
||||
DATACLOUD_API_SERVER_EXCEPTION,
|
||||
/** * Enumeration : DATACLOUD_API_UNAVAILABLE */
|
||||
DATACLOUD_API_UNAVAILABLE,
|
||||
/** * Enumeration : DUPLICATE_ARGUMENT_VALUE */
|
||||
DUPLICATE_ARGUMENT_VALUE,
|
||||
/** * Enumeration : DUPLICATE_VALUE */
|
||||
DUPLICATE_VALUE,
|
||||
/** * Enumeration : EMAIL_BATCH_SIZE_LIMIT_EXCEEDED */
|
||||
EMAIL_BATCH_SIZE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : EMAIL_TO_CASE_INVALID_ROUTING */
|
||||
EMAIL_TO_CASE_INVALID_ROUTING,
|
||||
/** * Enumeration : EMAIL_TO_CASE_LIMIT_EXCEEDED */
|
||||
EMAIL_TO_CASE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : EMAIL_TO_CASE_NOT_ENABLED */
|
||||
EMAIL_TO_CASE_NOT_ENABLED,
|
||||
/** * Enumeration : EXCEEDED_ID_LIMIT */
|
||||
EXCEEDED_ID_LIMIT,
|
||||
/** * Enumeration : EXCEEDED_LEAD_CONVERT_LIMIT */
|
||||
EXCEEDED_LEAD_CONVERT_LIMIT,
|
||||
/** * Enumeration : EXCEEDED_MAX_SIZE_REQUEST */
|
||||
EXCEEDED_MAX_SIZE_REQUEST,
|
||||
/** * Enumeration : EXCEEDED_MAX_TYPES_LIMIT */
|
||||
EXCEEDED_MAX_TYPES_LIMIT,
|
||||
/** * Enumeration : EXCEEDED_QUOTA */
|
||||
EXCEEDED_QUOTA,
|
||||
/** * Enumeration : FEED_NOT_ENABLED_FOR_OBJECT */
|
||||
FEED_NOT_ENABLED_FOR_OBJECT,
|
||||
/** * Enumeration : FUNCTIONALITY_NOT_ENABLED */
|
||||
FUNCTIONALITY_NOT_ENABLED,
|
||||
/** * Enumeration : FUNCTIONALITY_TEMPORARILY_UNAVAILABLE */
|
||||
FUNCTIONALITY_TEMPORARILY_UNAVAILABLE,
|
||||
/** * Enumeration : ILLEGAL_QUERY_PARAMETER_VALUE */
|
||||
ILLEGAL_QUERY_PARAMETER_VALUE,
|
||||
/** * Enumeration : INACTIVE_OWNER_OR_USER */
|
||||
INACTIVE_OWNER_OR_USER,
|
||||
/** * Enumeration : INACTIVE_PORTAL */
|
||||
INACTIVE_PORTAL,
|
||||
/** * Enumeration : INSUFFICIENT_ACCESS */
|
||||
INSUFFICIENT_ACCESS,
|
||||
/** * Enumeration : INVALID_ASSIGNMENT_RULE */
|
||||
INVALID_ASSIGNMENT_RULE,
|
||||
/** * Enumeration : INVALID_BATCH_SIZE */
|
||||
INVALID_BATCH_SIZE,
|
||||
/** * Enumeration : INVALID_CLIENT */
|
||||
INVALID_CLIENT,
|
||||
/** * Enumeration : INVALID_CROSS_REFERENCE_KEY */
|
||||
INVALID_CROSS_REFERENCE_KEY,
|
||||
/** * Enumeration : INVALID_FIELD */
|
||||
INVALID_FIELD,
|
||||
/** * Enumeration : INVALID_FILTER_LANGUAGE */
|
||||
INVALID_FILTER_LANGUAGE,
|
||||
/** * Enumeration : INVALID_FILTER_VALUE */
|
||||
INVALID_FILTER_VALUE,
|
||||
/** * Enumeration : INVALID_ID_FIELD */
|
||||
INVALID_ID_FIELD,
|
||||
/** * Enumeration : INVALID_LOCALE_LANGUAGE */
|
||||
INVALID_LOCALE_LANGUAGE,
|
||||
/** * Enumeration : INVALID_LOCATOR */
|
||||
INVALID_LOCATOR,
|
||||
/** * Enumeration : INVALID_LOGIN */
|
||||
INVALID_LOGIN,
|
||||
/** * Enumeration : INVALID_MULTIPART_REQUEST */
|
||||
INVALID_MULTIPART_REQUEST,
|
||||
/** * Enumeration : INVALID_NEW_PASSWORD */
|
||||
INVALID_NEW_PASSWORD,
|
||||
/** * Enumeration : INVALID_OPERATION */
|
||||
INVALID_OPERATION,
|
||||
/** * Enumeration : INVALID_OPERATION_WITH_EXPIRED_PASSWORD */
|
||||
INVALID_OPERATION_WITH_EXPIRED_PASSWORD,
|
||||
/** * Enumeration : INVALID_PAGING_OPTION */
|
||||
INVALID_PAGING_OPTION,
|
||||
/** * Enumeration : INVALID_QUERY_FILTER_OPERATOR */
|
||||
INVALID_QUERY_FILTER_OPERATOR,
|
||||
/** * Enumeration : INVALID_QUERY_LOCATOR */
|
||||
INVALID_QUERY_LOCATOR,
|
||||
/** * Enumeration : INVALID_QUERY_SCOPE */
|
||||
INVALID_QUERY_SCOPE,
|
||||
/** * Enumeration : INVALID_REPLICATION_DATE */
|
||||
INVALID_REPLICATION_DATE,
|
||||
/** * Enumeration : INVALID_SEARCH */
|
||||
INVALID_SEARCH,
|
||||
/** * Enumeration : INVALID_SEARCH_SCOPE */
|
||||
INVALID_SEARCH_SCOPE,
|
||||
/** * Enumeration : INVALID_SESSION_ID */
|
||||
INVALID_SESSION_ID,
|
||||
/** * Enumeration : INVALID_SOAP_HEADER */
|
||||
INVALID_SOAP_HEADER,
|
||||
/** * Enumeration : INVALID_SORT_OPTION */
|
||||
INVALID_SORT_OPTION,
|
||||
/** * Enumeration : INVALID_SSO_GATEWAY_URL */
|
||||
INVALID_SSO_GATEWAY_URL,
|
||||
/** * Enumeration : INVALID_TYPE */
|
||||
INVALID_TYPE,
|
||||
/** * Enumeration : INVALID_TYPE_FOR_OPERATION */
|
||||
INVALID_TYPE_FOR_OPERATION,
|
||||
/** * Enumeration : JIGSAW_IMPORT_LIMIT_EXCEEDED */
|
||||
JIGSAW_IMPORT_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : JIGSAW_REQUEST_NOT_SUPPORTED */
|
||||
JIGSAW_REQUEST_NOT_SUPPORTED,
|
||||
/** * Enumeration : JSON_PARSER_ERROR */
|
||||
JSON_PARSER_ERROR,
|
||||
/** * Enumeration : LICENSING_UNKNOWN_ERROR */
|
||||
LICENSING_UNKNOWN_ERROR,
|
||||
/** * Enumeration : LIMIT_EXCEEDED */
|
||||
LIMIT_EXCEEDED,
|
||||
/** * Enumeration : LOGIN_CHALLENGE_ISSUED */
|
||||
LOGIN_CHALLENGE_ISSUED,
|
||||
/** * Enumeration : LOGIN_CHALLENGE_PENDING */
|
||||
LOGIN_CHALLENGE_PENDING,
|
||||
/** * Enumeration : LOGIN_DURING_RESTRICTED_DOMAIN */
|
||||
LOGIN_DURING_RESTRICTED_DOMAIN,
|
||||
/** * Enumeration : LOGIN_DURING_RESTRICTED_TIME */
|
||||
LOGIN_DURING_RESTRICTED_TIME,
|
||||
/** * Enumeration : LOGIN_MUST_USE_SECURITY_TOKEN */
|
||||
LOGIN_MUST_USE_SECURITY_TOKEN,
|
||||
/** * Enumeration : MALFORMED_ID */
|
||||
MALFORMED_ID,
|
||||
/** * Enumeration : MALFORMED_QUERY */
|
||||
MALFORMED_QUERY,
|
||||
/** * Enumeration : MALFORMED_SEARCH */
|
||||
MALFORMED_SEARCH,
|
||||
/** * Enumeration : MISSING_ARGUMENT */
|
||||
MISSING_ARGUMENT,
|
||||
/** * Enumeration : NOT_MODIFIED */
|
||||
NOT_MODIFIED,
|
||||
/** * Enumeration : NO_SOFTPHONE_LAYOUT */
|
||||
NO_SOFTPHONE_LAYOUT,
|
||||
/** * Enumeration : NUMBER_OUTSIDE_VALID_RANGE */
|
||||
NUMBER_OUTSIDE_VALID_RANGE,
|
||||
/** * Enumeration : OPERATION_TOO_LARGE */
|
||||
OPERATION_TOO_LARGE,
|
||||
/** * Enumeration : ORG_IN_MAINTENANCE */
|
||||
ORG_IN_MAINTENANCE,
|
||||
/** * Enumeration : ORG_IS_DOT_ORG */
|
||||
ORG_IS_DOT_ORG,
|
||||
/** * Enumeration : ORG_LOCKED */
|
||||
ORG_LOCKED,
|
||||
/** * Enumeration : ORG_NOT_OWNED_BY_INSTANCE */
|
||||
ORG_NOT_OWNED_BY_INSTANCE,
|
||||
/** * Enumeration : PASSWORD_LOCKOUT */
|
||||
PASSWORD_LOCKOUT,
|
||||
/** * Enumeration : PORTAL_NO_ACCESS */
|
||||
PORTAL_NO_ACCESS,
|
||||
/** * Enumeration : POST_BODY_PARSE_ERROR */
|
||||
POST_BODY_PARSE_ERROR,
|
||||
/** * Enumeration : QUERY_TIMEOUT */
|
||||
QUERY_TIMEOUT,
|
||||
/** * Enumeration : QUERY_TOO_COMPLICATED */
|
||||
QUERY_TOO_COMPLICATED,
|
||||
/** * Enumeration : REQUEST_LIMIT_EXCEEDED */
|
||||
REQUEST_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : REQUEST_RUNNING_TOO_LONG */
|
||||
REQUEST_RUNNING_TOO_LONG,
|
||||
/** * Enumeration : SERVER_UNAVAILABLE */
|
||||
SERVER_UNAVAILABLE,
|
||||
/** * Enumeration : SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION */
|
||||
SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION,
|
||||
/** * Enumeration : SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION */
|
||||
SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION,
|
||||
/** * Enumeration : SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE */
|
||||
SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE,
|
||||
/** * Enumeration : SSO_SERVICE_DOWN */
|
||||
SSO_SERVICE_DOWN,
|
||||
/** * Enumeration : TOO_MANY_APEX_REQUESTS */
|
||||
TOO_MANY_APEX_REQUESTS,
|
||||
/** * Enumeration : TOO_MANY_RECIPIENTS */
|
||||
TOO_MANY_RECIPIENTS,
|
||||
/** * Enumeration : TRIAL_EXPIRED */
|
||||
TRIAL_EXPIRED,
|
||||
/** * Enumeration : UNKNOWN_ATTACHMENT_EXCEPTION */
|
||||
UNKNOWN_ATTACHMENT_EXCEPTION,
|
||||
/** * Enumeration : UNKNOWN_EXCEPTION */
|
||||
UNKNOWN_EXCEPTION,
|
||||
/** * Enumeration : UNSUPPORTED_API_VERSION */
|
||||
UNSUPPORTED_API_VERSION,
|
||||
/** * Enumeration : UNSUPPORTED_ATTACHMENT_ENCODING */
|
||||
UNSUPPORTED_ATTACHMENT_ENCODING,
|
||||
/** * Enumeration : UNSUPPORTED_CLIENT */
|
||||
UNSUPPORTED_CLIENT,
|
||||
/** * Enumeration : UNSUPPORTED_MEDIA_TYPE */
|
||||
UNSUPPORTED_MEDIA_TYPE,
|
||||
/** * Enumeration : XML_PARSER_ERROR */
|
||||
XML_PARSER_ERROR,
|
||||
}
|
||||
|
||||
@@ -2,170 +2,212 @@ package com.sforce.soap.partner.fault;
|
||||
|
||||
/** * Generated enum, please do not edit. */
|
||||
public enum FaultCode {
|
||||
/** * Enumeration : APEX_TRIGGER_COUPLING_LIMIT */
|
||||
APEX_TRIGGER_COUPLING_LIMIT, /** * Enumeration : API_CURRENTLY_DISABLED */
|
||||
API_CURRENTLY_DISABLED, /** * Enumeration : API_DISABLED_FOR_ORG */
|
||||
API_DISABLED_FOR_ORG, /** * Enumeration : ARGUMENT_OBJECT_PARSE_ERROR */
|
||||
ARGUMENT_OBJECT_PARSE_ERROR, /** * Enumeration : CANNOT_DELETE_OWNER */
|
||||
CANNOT_DELETE_OWNER, /**
|
||||
* * Enumeration :
|
||||
* CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY
|
||||
*/
|
||||
CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY, /**
|
||||
* * Enumeration :
|
||||
* CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY
|
||||
*/
|
||||
CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY, /**
|
||||
* * Enumeration :
|
||||
* CIRCULAR_OBJECT_GRAPH
|
||||
*/
|
||||
CIRCULAR_OBJECT_GRAPH, /** * Enumeration : CLIENT_NOT_ACCESSIBLE_FOR_USER */
|
||||
CLIENT_NOT_ACCESSIBLE_FOR_USER, /**
|
||||
* * Enumeration :
|
||||
* CLIENT_REQUIRE_UPDATE_FOR_USER
|
||||
*/
|
||||
CLIENT_REQUIRE_UPDATE_FOR_USER, /**
|
||||
* * Enumeration :
|
||||
* CUSTOM_METADATA_LIMIT_EXCEEDED
|
||||
*/
|
||||
CUSTOM_METADATA_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* DATACLOUD_API_CLIENT_EXCEPTION
|
||||
*/
|
||||
DATACLOUD_API_CLIENT_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* DATACLOUD_API_SERVER_BUSY_EXCEPTION
|
||||
*/
|
||||
DATACLOUD_API_SERVER_BUSY_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* DATACLOUD_API_SERVER_EXCEPTION
|
||||
*/
|
||||
DATACLOUD_API_SERVER_EXCEPTION, /** * Enumeration : DATACLOUD_API_UNAVAILABLE */
|
||||
DATACLOUD_API_UNAVAILABLE, /** * Enumeration : DUPLICATE_ARGUMENT_VALUE */
|
||||
DUPLICATE_ARGUMENT_VALUE, /** * Enumeration : DUPLICATE_VALUE */
|
||||
DUPLICATE_VALUE, /** * Enumeration : EMAIL_BATCH_SIZE_LIMIT_EXCEEDED */
|
||||
EMAIL_BATCH_SIZE_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration :
|
||||
* EMAIL_TO_CASE_INVALID_ROUTING
|
||||
*/
|
||||
EMAIL_TO_CASE_INVALID_ROUTING, /**
|
||||
* * Enumeration :
|
||||
* EMAIL_TO_CASE_LIMIT_EXCEEDED
|
||||
*/
|
||||
EMAIL_TO_CASE_LIMIT_EXCEEDED, /** * Enumeration : EMAIL_TO_CASE_NOT_ENABLED */
|
||||
EMAIL_TO_CASE_NOT_ENABLED, /** * Enumeration : EXCEEDED_ID_LIMIT */
|
||||
EXCEEDED_ID_LIMIT, /** * Enumeration : EXCEEDED_LEAD_CONVERT_LIMIT */
|
||||
EXCEEDED_LEAD_CONVERT_LIMIT, /** * Enumeration : EXCEEDED_MAX_SIZE_REQUEST */
|
||||
EXCEEDED_MAX_SIZE_REQUEST, /** * Enumeration : EXCEEDED_MAX_TYPES_LIMIT */
|
||||
EXCEEDED_MAX_TYPES_LIMIT, /** * Enumeration : EXCEEDED_QUOTA */
|
||||
EXCEEDED_QUOTA, /** * Enumeration : FEDERATED_SEARCH_ERROR */
|
||||
FEDERATED_SEARCH_ERROR, /** * Enumeration : FEED_NOT_ENABLED_FOR_OBJECT */
|
||||
FEED_NOT_ENABLED_FOR_OBJECT, /** * Enumeration : FUNCTIONALITY_NOT_ENABLED */
|
||||
FUNCTIONALITY_NOT_ENABLED, /**
|
||||
* * Enumeration :
|
||||
* FUNCTIONALITY_TEMPORARILY_UNAVAILABLE
|
||||
*/
|
||||
FUNCTIONALITY_TEMPORARILY_UNAVAILABLE, /**
|
||||
* * Enumeration :
|
||||
* ILLEGAL_QUERY_PARAMETER_VALUE
|
||||
*/
|
||||
ILLEGAL_QUERY_PARAMETER_VALUE, /** * Enumeration : INACTIVE_OWNER_OR_USER */
|
||||
INACTIVE_OWNER_OR_USER, /** * Enumeration : INACTIVE_PORTAL */
|
||||
INACTIVE_PORTAL, /** * Enumeration : INSUFFICIENT_ACCESS */
|
||||
INSUFFICIENT_ACCESS, /** * Enumeration : INVALID_ASSIGNMENT_RULE */
|
||||
INVALID_ASSIGNMENT_RULE, /** * Enumeration : INVALID_BATCH_SIZE */
|
||||
INVALID_BATCH_SIZE, /** * Enumeration : INVALID_CLIENT */
|
||||
INVALID_CLIENT, /** * Enumeration : INVALID_CROSS_REFERENCE_KEY */
|
||||
INVALID_CROSS_REFERENCE_KEY, /** * Enumeration : INVALID_FIELD */
|
||||
INVALID_FIELD, /** * Enumeration : INVALID_FILTER_LANGUAGE */
|
||||
INVALID_FILTER_LANGUAGE, /** * Enumeration : INVALID_FILTER_VALUE */
|
||||
INVALID_FILTER_VALUE, /** * Enumeration : INVALID_ID_FIELD */
|
||||
INVALID_ID_FIELD, /** * Enumeration : INVALID_INPUT_COMBINATION */
|
||||
INVALID_INPUT_COMBINATION, /** * Enumeration : INVALID_LOCALE_LANGUAGE */
|
||||
INVALID_LOCALE_LANGUAGE, /** * Enumeration : INVALID_LOCATOR */
|
||||
INVALID_LOCATOR, /** * Enumeration : INVALID_LOGIN */
|
||||
INVALID_LOGIN, /** * Enumeration : INVALID_MULTIPART_REQUEST */
|
||||
INVALID_MULTIPART_REQUEST, /** * Enumeration : INVALID_NEW_PASSWORD */
|
||||
INVALID_NEW_PASSWORD, /** * Enumeration : INVALID_OPERATION */
|
||||
INVALID_OPERATION, /**
|
||||
* * Enumeration : INVALID_OPERATION_WITH_EXPIRED_PASSWORD
|
||||
*/
|
||||
INVALID_OPERATION_WITH_EXPIRED_PASSWORD, /**
|
||||
* * Enumeration :
|
||||
* INVALID_PAGING_OPTION
|
||||
*/
|
||||
INVALID_PAGING_OPTION, /** * Enumeration : INVALID_QUERY_FILTER_OPERATOR */
|
||||
INVALID_QUERY_FILTER_OPERATOR, /** * Enumeration : INVALID_QUERY_LOCATOR */
|
||||
INVALID_QUERY_LOCATOR, /** * Enumeration : INVALID_QUERY_SCOPE */
|
||||
INVALID_QUERY_SCOPE, /** * Enumeration : INVALID_REPLICATION_DATE */
|
||||
INVALID_REPLICATION_DATE, /** * Enumeration : INVALID_SEARCH */
|
||||
INVALID_SEARCH, /** * Enumeration : INVALID_SEARCH_SCOPE */
|
||||
INVALID_SEARCH_SCOPE, /** * Enumeration : INVALID_SESSION_ID */
|
||||
INVALID_SESSION_ID, /** * Enumeration : INVALID_SOAP_HEADER */
|
||||
INVALID_SOAP_HEADER, /** * Enumeration : INVALID_SORT_OPTION */
|
||||
INVALID_SORT_OPTION, /** * Enumeration : INVALID_SSO_GATEWAY_URL */
|
||||
INVALID_SSO_GATEWAY_URL, /** * Enumeration : INVALID_TYPE */
|
||||
INVALID_TYPE, /** * Enumeration : INVALID_TYPE_FOR_OPERATION */
|
||||
INVALID_TYPE_FOR_OPERATION, /** * Enumeration : JIGSAW_IMPORT_LIMIT_EXCEEDED */
|
||||
JIGSAW_IMPORT_LIMIT_EXCEEDED, /**
|
||||
* * Enumeration : JIGSAW_REQUEST_NOT_SUPPORTED
|
||||
*/
|
||||
JIGSAW_REQUEST_NOT_SUPPORTED, /** * Enumeration : JSON_PARSER_ERROR */
|
||||
JSON_PARSER_ERROR, /** * Enumeration : LICENSING_UNKNOWN_ERROR */
|
||||
LICENSING_UNKNOWN_ERROR, /** * Enumeration : LIMIT_EXCEEDED */
|
||||
LIMIT_EXCEEDED, /** * Enumeration : LOGIN_CHALLENGE_ISSUED */
|
||||
LOGIN_CHALLENGE_ISSUED, /** * Enumeration : LOGIN_CHALLENGE_PENDING */
|
||||
LOGIN_CHALLENGE_PENDING, /** * Enumeration : LOGIN_DURING_RESTRICTED_DOMAIN */
|
||||
LOGIN_DURING_RESTRICTED_DOMAIN, /**
|
||||
* * Enumeration :
|
||||
* LOGIN_DURING_RESTRICTED_TIME
|
||||
*/
|
||||
LOGIN_DURING_RESTRICTED_TIME, /**
|
||||
* * Enumeration :
|
||||
* LOGIN_MUST_USE_SECURITY_TOKEN
|
||||
*/
|
||||
LOGIN_MUST_USE_SECURITY_TOKEN, /** * Enumeration : MALFORMED_ID */
|
||||
MALFORMED_ID, /** * Enumeration : MALFORMED_QUERY */
|
||||
MALFORMED_QUERY, /** * Enumeration : MALFORMED_SEARCH */
|
||||
MALFORMED_SEARCH, /** * Enumeration : MISSING_ARGUMENT */
|
||||
MISSING_ARGUMENT, /** * Enumeration : NOT_MODIFIED */
|
||||
NOT_MODIFIED, /** * Enumeration : NO_SOFTPHONE_LAYOUT */
|
||||
NO_SOFTPHONE_LAYOUT, /** * Enumeration : NUMBER_OUTSIDE_VALID_RANGE */
|
||||
NUMBER_OUTSIDE_VALID_RANGE, /** * Enumeration : OPERATION_TOO_LARGE */
|
||||
OPERATION_TOO_LARGE, /** * Enumeration : ORG_IN_MAINTENANCE */
|
||||
ORG_IN_MAINTENANCE, /** * Enumeration : ORG_IS_DOT_ORG */
|
||||
ORG_IS_DOT_ORG, /** * Enumeration : ORG_LOCKED */
|
||||
ORG_LOCKED, /** * Enumeration : ORG_NOT_OWNED_BY_INSTANCE */
|
||||
ORG_NOT_OWNED_BY_INSTANCE, /** * Enumeration : PASSWORD_LOCKOUT */
|
||||
PASSWORD_LOCKOUT, /** * Enumeration : PORTAL_NO_ACCESS */
|
||||
PORTAL_NO_ACCESS, /** * Enumeration : POST_BODY_PARSE_ERROR */
|
||||
POST_BODY_PARSE_ERROR, /** * Enumeration : QUERY_TIMEOUT */
|
||||
QUERY_TIMEOUT, /** * Enumeration : QUERY_TOO_COMPLICATED */
|
||||
QUERY_TOO_COMPLICATED, /** * Enumeration : REQUEST_LIMIT_EXCEEDED */
|
||||
REQUEST_LIMIT_EXCEEDED, /** * Enumeration : REQUEST_RUNNING_TOO_LONG */
|
||||
REQUEST_RUNNING_TOO_LONG, /** * Enumeration : SERVER_UNAVAILABLE */
|
||||
SERVER_UNAVAILABLE, /**
|
||||
* * Enumeration :
|
||||
* SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION
|
||||
*/
|
||||
SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION
|
||||
*/
|
||||
SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION, /**
|
||||
* * Enumeration :
|
||||
* SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE
|
||||
*/
|
||||
SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE, /** * Enumeration : SSO_SERVICE_DOWN */
|
||||
SSO_SERVICE_DOWN, /** * Enumeration : TOO_MANY_APEX_REQUESTS */
|
||||
TOO_MANY_APEX_REQUESTS, /** * Enumeration : TOO_MANY_RECIPIENTS */
|
||||
TOO_MANY_RECIPIENTS, /** * Enumeration : TRIAL_EXPIRED */
|
||||
TRIAL_EXPIRED, /** * Enumeration : UNKNOWN_ATTACHMENT_EXCEPTION */
|
||||
UNKNOWN_ATTACHMENT_EXCEPTION, /** * Enumeration : UNKNOWN_EXCEPTION */
|
||||
UNKNOWN_EXCEPTION, /** * Enumeration : UNSUPPORTED_API_VERSION */
|
||||
UNSUPPORTED_API_VERSION, /** * Enumeration : UNSUPPORTED_ATTACHMENT_ENCODING */
|
||||
UNSUPPORTED_ATTACHMENT_ENCODING, /** * Enumeration : UNSUPPORTED_CLIENT */
|
||||
UNSUPPORTED_CLIENT, /** * Enumeration : UNSUPPORTED_MEDIA_TYPE */
|
||||
UNSUPPORTED_MEDIA_TYPE, /** * Enumeration : XML_PARSER_ERROR */
|
||||
XML_PARSER_ERROR,
|
||||
}
|
||||
/** * Enumeration : API_CURRENTLY_DISABLED */
|
||||
API_CURRENTLY_DISABLED,
|
||||
/** * Enumeration : API_DISABLED_FOR_ORG */
|
||||
API_DISABLED_FOR_ORG,
|
||||
/** * Enumeration : ARGUMENT_OBJECT_PARSE_ERROR */
|
||||
ARGUMENT_OBJECT_PARSE_ERROR,
|
||||
/** * Enumeration : CANNOT_DELETE_OWNER */
|
||||
CANNOT_DELETE_OWNER,
|
||||
/** * Enumeration : CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY */
|
||||
CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY,
|
||||
/** * Enumeration : CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY */
|
||||
CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY,
|
||||
/** * Enumeration : CIRCULAR_OBJECT_GRAPH */
|
||||
CIRCULAR_OBJECT_GRAPH,
|
||||
/** * Enumeration : CLIENT_NOT_ACCESSIBLE_FOR_USER */
|
||||
CLIENT_NOT_ACCESSIBLE_FOR_USER,
|
||||
/** * Enumeration : CLIENT_REQUIRE_UPDATE_FOR_USER */
|
||||
CLIENT_REQUIRE_UPDATE_FOR_USER,
|
||||
/** * Enumeration : CUSTOM_METADATA_LIMIT_EXCEEDED */
|
||||
CUSTOM_METADATA_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : DATACLOUD_API_CLIENT_EXCEPTION */
|
||||
DATACLOUD_API_CLIENT_EXCEPTION,
|
||||
/** * Enumeration : DATACLOUD_API_SERVER_BUSY_EXCEPTION */
|
||||
DATACLOUD_API_SERVER_BUSY_EXCEPTION,
|
||||
/** * Enumeration : DATACLOUD_API_SERVER_EXCEPTION */
|
||||
DATACLOUD_API_SERVER_EXCEPTION,
|
||||
/** * Enumeration : DATACLOUD_API_UNAVAILABLE */
|
||||
DATACLOUD_API_UNAVAILABLE,
|
||||
/** * Enumeration : DUPLICATE_ARGUMENT_VALUE */
|
||||
DUPLICATE_ARGUMENT_VALUE,
|
||||
/** * Enumeration : DUPLICATE_VALUE */
|
||||
DUPLICATE_VALUE,
|
||||
/** * Enumeration : EMAIL_BATCH_SIZE_LIMIT_EXCEEDED */
|
||||
EMAIL_BATCH_SIZE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : EMAIL_TO_CASE_INVALID_ROUTING */
|
||||
EMAIL_TO_CASE_INVALID_ROUTING,
|
||||
/** * Enumeration : EMAIL_TO_CASE_LIMIT_EXCEEDED */
|
||||
EMAIL_TO_CASE_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : EMAIL_TO_CASE_NOT_ENABLED */
|
||||
EMAIL_TO_CASE_NOT_ENABLED,
|
||||
/** * Enumeration : EXCEEDED_ID_LIMIT */
|
||||
EXCEEDED_ID_LIMIT,
|
||||
/** * Enumeration : EXCEEDED_LEAD_CONVERT_LIMIT */
|
||||
EXCEEDED_LEAD_CONVERT_LIMIT,
|
||||
/** * Enumeration : EXCEEDED_MAX_SIZE_REQUEST */
|
||||
EXCEEDED_MAX_SIZE_REQUEST,
|
||||
/** * Enumeration : EXCEEDED_MAX_TYPES_LIMIT */
|
||||
EXCEEDED_MAX_TYPES_LIMIT,
|
||||
/** * Enumeration : EXCEEDED_QUOTA */
|
||||
EXCEEDED_QUOTA,
|
||||
/** * Enumeration : FEED_NOT_ENABLED_FOR_OBJECT */
|
||||
FEED_NOT_ENABLED_FOR_OBJECT,
|
||||
/** * Enumeration : FUNCTIONALITY_NOT_ENABLED */
|
||||
FUNCTIONALITY_NOT_ENABLED,
|
||||
/** * Enumeration : FUNCTIONALITY_TEMPORARILY_UNAVAILABLE */
|
||||
FUNCTIONALITY_TEMPORARILY_UNAVAILABLE,
|
||||
/** * Enumeration : ILLEGAL_QUERY_PARAMETER_VALUE */
|
||||
ILLEGAL_QUERY_PARAMETER_VALUE,
|
||||
/** * Enumeration : INACTIVE_OWNER_OR_USER */
|
||||
INACTIVE_OWNER_OR_USER,
|
||||
/** * Enumeration : INACTIVE_PORTAL */
|
||||
INACTIVE_PORTAL,
|
||||
/** * Enumeration : INSUFFICIENT_ACCESS */
|
||||
INSUFFICIENT_ACCESS,
|
||||
/** * Enumeration : INVALID_ASSIGNMENT_RULE */
|
||||
INVALID_ASSIGNMENT_RULE,
|
||||
/** * Enumeration : INVALID_BATCH_SIZE */
|
||||
INVALID_BATCH_SIZE,
|
||||
/** * Enumeration : INVALID_CLIENT */
|
||||
INVALID_CLIENT,
|
||||
/** * Enumeration : INVALID_CROSS_REFERENCE_KEY */
|
||||
INVALID_CROSS_REFERENCE_KEY,
|
||||
/** * Enumeration : INVALID_FIELD */
|
||||
INVALID_FIELD,
|
||||
/** * Enumeration : INVALID_FILTER_LANGUAGE */
|
||||
INVALID_FILTER_LANGUAGE,
|
||||
/** * Enumeration : INVALID_FILTER_VALUE */
|
||||
INVALID_FILTER_VALUE,
|
||||
/** * Enumeration : INVALID_ID_FIELD */
|
||||
INVALID_ID_FIELD,
|
||||
/** * Enumeration : INVALID_LOCALE_LANGUAGE */
|
||||
INVALID_LOCALE_LANGUAGE,
|
||||
/** * Enumeration : INVALID_LOCATOR */
|
||||
INVALID_LOCATOR,
|
||||
/** * Enumeration : INVALID_LOGIN */
|
||||
INVALID_LOGIN,
|
||||
/** * Enumeration : INVALID_MULTIPART_REQUEST */
|
||||
INVALID_MULTIPART_REQUEST,
|
||||
/** * Enumeration : INVALID_NEW_PASSWORD */
|
||||
INVALID_NEW_PASSWORD,
|
||||
/** * Enumeration : INVALID_OPERATION */
|
||||
INVALID_OPERATION,
|
||||
/** * Enumeration : INVALID_OPERATION_WITH_EXPIRED_PASSWORD */
|
||||
INVALID_OPERATION_WITH_EXPIRED_PASSWORD,
|
||||
/** * Enumeration : INVALID_PAGING_OPTION */
|
||||
INVALID_PAGING_OPTION,
|
||||
/** * Enumeration : INVALID_QUERY_FILTER_OPERATOR */
|
||||
INVALID_QUERY_FILTER_OPERATOR,
|
||||
/** * Enumeration : INVALID_QUERY_LOCATOR */
|
||||
INVALID_QUERY_LOCATOR,
|
||||
/** * Enumeration : INVALID_QUERY_SCOPE */
|
||||
INVALID_QUERY_SCOPE,
|
||||
/** * Enumeration : INVALID_REPLICATION_DATE */
|
||||
INVALID_REPLICATION_DATE,
|
||||
/** * Enumeration : INVALID_SEARCH */
|
||||
INVALID_SEARCH,
|
||||
/** * Enumeration : INVALID_SEARCH_SCOPE */
|
||||
INVALID_SEARCH_SCOPE,
|
||||
/** * Enumeration : INVALID_SESSION_ID */
|
||||
INVALID_SESSION_ID,
|
||||
/** * Enumeration : INVALID_SOAP_HEADER */
|
||||
INVALID_SOAP_HEADER,
|
||||
/** * Enumeration : INVALID_SORT_OPTION */
|
||||
INVALID_SORT_OPTION,
|
||||
/** * Enumeration : INVALID_SSO_GATEWAY_URL */
|
||||
INVALID_SSO_GATEWAY_URL,
|
||||
/** * Enumeration : INVALID_TYPE */
|
||||
INVALID_TYPE,
|
||||
/** * Enumeration : INVALID_TYPE_FOR_OPERATION */
|
||||
INVALID_TYPE_FOR_OPERATION,
|
||||
/** * Enumeration : JIGSAW_IMPORT_LIMIT_EXCEEDED */
|
||||
JIGSAW_IMPORT_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : JIGSAW_REQUEST_NOT_SUPPORTED */
|
||||
JIGSAW_REQUEST_NOT_SUPPORTED,
|
||||
/** * Enumeration : JSON_PARSER_ERROR */
|
||||
JSON_PARSER_ERROR,
|
||||
/** * Enumeration : LICENSING_UNKNOWN_ERROR */
|
||||
LICENSING_UNKNOWN_ERROR,
|
||||
/** * Enumeration : LIMIT_EXCEEDED */
|
||||
LIMIT_EXCEEDED,
|
||||
/** * Enumeration : LOGIN_CHALLENGE_ISSUED */
|
||||
LOGIN_CHALLENGE_ISSUED,
|
||||
/** * Enumeration : LOGIN_CHALLENGE_PENDING */
|
||||
LOGIN_CHALLENGE_PENDING,
|
||||
/** * Enumeration : LOGIN_DURING_RESTRICTED_DOMAIN */
|
||||
LOGIN_DURING_RESTRICTED_DOMAIN,
|
||||
/** * Enumeration : LOGIN_DURING_RESTRICTED_TIME */
|
||||
LOGIN_DURING_RESTRICTED_TIME,
|
||||
/** * Enumeration : LOGIN_MUST_USE_SECURITY_TOKEN */
|
||||
LOGIN_MUST_USE_SECURITY_TOKEN,
|
||||
/** * Enumeration : MALFORMED_ID */
|
||||
MALFORMED_ID,
|
||||
/** * Enumeration : MALFORMED_QUERY */
|
||||
MALFORMED_QUERY,
|
||||
/** * Enumeration : MALFORMED_SEARCH */
|
||||
MALFORMED_SEARCH,
|
||||
/** * Enumeration : MISSING_ARGUMENT */
|
||||
MISSING_ARGUMENT,
|
||||
/** * Enumeration : NOT_MODIFIED */
|
||||
NOT_MODIFIED,
|
||||
/** * Enumeration : NO_SOFTPHONE_LAYOUT */
|
||||
NO_SOFTPHONE_LAYOUT,
|
||||
/** * Enumeration : NUMBER_OUTSIDE_VALID_RANGE */
|
||||
NUMBER_OUTSIDE_VALID_RANGE,
|
||||
/** * Enumeration : OPERATION_TOO_LARGE */
|
||||
OPERATION_TOO_LARGE,
|
||||
/** * Enumeration : ORG_IN_MAINTENANCE */
|
||||
ORG_IN_MAINTENANCE,
|
||||
/** * Enumeration : ORG_IS_DOT_ORG */
|
||||
ORG_IS_DOT_ORG,
|
||||
/** * Enumeration : ORG_LOCKED */
|
||||
ORG_LOCKED,
|
||||
/** * Enumeration : ORG_NOT_OWNED_BY_INSTANCE */
|
||||
ORG_NOT_OWNED_BY_INSTANCE,
|
||||
/** * Enumeration : PASSWORD_LOCKOUT */
|
||||
PASSWORD_LOCKOUT,
|
||||
/** * Enumeration : PORTAL_NO_ACCESS */
|
||||
PORTAL_NO_ACCESS,
|
||||
/** * Enumeration : POST_BODY_PARSE_ERROR */
|
||||
POST_BODY_PARSE_ERROR,
|
||||
/** * Enumeration : QUERY_TIMEOUT */
|
||||
QUERY_TIMEOUT,
|
||||
/** * Enumeration : QUERY_TOO_COMPLICATED */
|
||||
QUERY_TOO_COMPLICATED,
|
||||
/** * Enumeration : REQUEST_LIMIT_EXCEEDED */
|
||||
REQUEST_LIMIT_EXCEEDED,
|
||||
/** * Enumeration : REQUEST_RUNNING_TOO_LONG */
|
||||
REQUEST_RUNNING_TOO_LONG,
|
||||
/** * Enumeration : SERVER_UNAVAILABLE */
|
||||
SERVER_UNAVAILABLE,
|
||||
/** * Enumeration : SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION */
|
||||
SOCIALCRM_FEEDSERVICE_API_CLIENT_EXCEPTION,
|
||||
/** * Enumeration : SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION */
|
||||
SOCIALCRM_FEEDSERVICE_API_SERVER_EXCEPTION,
|
||||
/** * Enumeration : SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE */
|
||||
SOCIALCRM_FEEDSERVICE_API_UNAVAILABLE,
|
||||
/** * Enumeration : SSO_SERVICE_DOWN */
|
||||
SSO_SERVICE_DOWN,
|
||||
/** * Enumeration : TOO_MANY_APEX_REQUESTS */
|
||||
TOO_MANY_APEX_REQUESTS,
|
||||
/** * Enumeration : TOO_MANY_RECIPIENTS */
|
||||
TOO_MANY_RECIPIENTS,
|
||||
/** * Enumeration : TRIAL_EXPIRED */
|
||||
TRIAL_EXPIRED,
|
||||
/** * Enumeration : UNKNOWN_ATTACHMENT_EXCEPTION */
|
||||
UNKNOWN_ATTACHMENT_EXCEPTION,
|
||||
/** * Enumeration : UNKNOWN_EXCEPTION */
|
||||
UNKNOWN_EXCEPTION,
|
||||
/** * Enumeration : UNSUPPORTED_API_VERSION */
|
||||
UNSUPPORTED_API_VERSION,
|
||||
/** * Enumeration : UNSUPPORTED_ATTACHMENT_ENCODING */
|
||||
UNSUPPORTED_ATTACHMENT_ENCODING,
|
||||
/** * Enumeration : UNSUPPORTED_CLIENT */
|
||||
UNSUPPORTED_CLIENT,
|
||||
/** * Enumeration : UNSUPPORTED_MEDIA_TYPE */
|
||||
UNSUPPORTED_MEDIA_TYPE,
|
||||
/** * Enumeration : XML_PARSER_ERROR */
|
||||
XML_PARSER_ERROR,
|
||||
}
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
package org.talend.salesforceBulk;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.Authenticator;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
import java.net.SocketAddress;
|
||||
import java.util.ArrayList;
|
||||
@@ -21,17 +17,16 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.csvreader.CsvReader;
|
||||
import com.sforce.async.AsyncApiException;
|
||||
import com.sforce.async.BatchInfo;
|
||||
import com.sforce.async.BatchStateEnum;
|
||||
import com.sforce.async.BulkConnection;
|
||||
import com.sforce.async.CSVReader;
|
||||
import com.sforce.async.ConcurrencyMode;
|
||||
import com.sforce.async.ContentType;
|
||||
import com.sforce.async.JobInfo;
|
||||
import com.sforce.async.JobStateEnum;
|
||||
import com.sforce.async.OperationEnum;
|
||||
import com.sforce.async.QueryResultList;
|
||||
import com.sforce.soap.partner.PartnerConnection;
|
||||
import com.sforce.ws.ConnectionException;
|
||||
import com.sforce.ws.ConnectorConfig;
|
||||
@@ -69,8 +64,6 @@ public class SalesforceBulkAPI {
|
||||
operation = OperationEnum.update;
|
||||
} else if ("upsert".equals(operationStr)) {
|
||||
operation = OperationEnum.upsert;
|
||||
} else if ("delete".equals(operationStr)) {
|
||||
operation = OperationEnum.delete;
|
||||
}
|
||||
|
||||
this.externalIdFieldName = externalIdFieldName;
|
||||
@@ -105,7 +98,7 @@ public class SalesforceBulkAPI {
|
||||
|
||||
private JobInfo job;
|
||||
|
||||
private com.talend.csv.CSVReader baseFileReader;
|
||||
private CsvReader baseFileReader;
|
||||
|
||||
private List<String> baseFileHeader;
|
||||
|
||||
@@ -122,11 +115,10 @@ public class SalesforceBulkAPI {
|
||||
}
|
||||
|
||||
private void prepareLog() throws IOException {
|
||||
baseFileReader = new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(
|
||||
new java.io.FileInputStream(bulkFileName), FILE_ENCODING)), ',');
|
||||
if (baseFileReader.readNext()) {
|
||||
baseFileReader = new CsvReader(new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(
|
||||
bulkFileName), FILE_ENCODING)), ',');
|
||||
if (baseFileReader.readRecord())
|
||||
baseFileHeader = Arrays.asList(baseFileReader.getValues());
|
||||
}
|
||||
baseFileHeaderSize = baseFileHeader.size();
|
||||
}
|
||||
|
||||
@@ -151,30 +143,22 @@ public class SalesforceBulkAPI {
|
||||
private void setProxyToConnection(ConnectorConfig conn) {
|
||||
Proxy socketProxy = null;
|
||||
if (!useProxy) {
|
||||
proxyHost = System.getProperty("https.proxyHost");
|
||||
if (proxyHost != null && System.getProperty("https.proxyPort") != null) {
|
||||
proxyPort = Integer.parseInt(System.getProperty("https.proxyPort"));
|
||||
proxyUsername = System.getProperty("https.proxyUser");
|
||||
proxyPassword = System.getProperty("https.proxyPassword");
|
||||
proxyHost = System.getProperty("http.proxyHost");
|
||||
if (proxyHost != null && System.getProperty("http.proxyPort") != null) {
|
||||
proxyPort = Integer.parseInt(System.getProperty("http.proxyPort"));
|
||||
proxyUsername = System.getProperty("http.proxyUser");
|
||||
proxyPassword = System.getProperty("http.proxyPassword");
|
||||
useProxy = true;
|
||||
} else {
|
||||
proxyHost = System.getProperty("http.proxyHost");
|
||||
if (proxyHost != null && System.getProperty("http.proxyPort") != null) {
|
||||
proxyPort = Integer.parseInt(System.getProperty("http.proxyPort"));
|
||||
proxyUsername = System.getProperty("http.proxyUser");
|
||||
proxyPassword = System.getProperty("http.proxyPassword");
|
||||
proxyHost = System.getProperty("socksProxyHost");
|
||||
if (proxyHost != null && System.getProperty("socksProxyPort") != null) {
|
||||
proxyPort = Integer.parseInt(System.getProperty("socksProxyPort"));
|
||||
proxyUsername = System.getProperty("java.net.socks.username");
|
||||
proxyPassword = System.getProperty("java.net.socks.password");
|
||||
useProxy = true;
|
||||
} else {
|
||||
proxyHost = System.getProperty("socksProxyHost");
|
||||
if (proxyHost != null && System.getProperty("socksProxyPort") != null) {
|
||||
proxyPort = Integer.parseInt(System.getProperty("socksProxyPort"));
|
||||
proxyUsername = System.getProperty("java.net.socks.username");
|
||||
proxyPassword = System.getProperty("java.net.socks.password");
|
||||
useProxy = true;
|
||||
|
||||
SocketAddress addr = new InetSocketAddress(proxyHost, proxyPort);
|
||||
socketProxy = new Proxy(Proxy.Type.SOCKS, addr);
|
||||
}
|
||||
SocketAddress addr = new InetSocketAddress(proxyHost, proxyPort);
|
||||
socketProxy = new Proxy(Proxy.Type.SOCKS, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,22 +170,9 @@ public class SalesforceBulkAPI {
|
||||
}
|
||||
if (proxyUsername != null && !"".equals(proxyUsername)) {
|
||||
conn.setProxyUsername(proxyUsername);
|
||||
if (proxyPassword != null && !"".equals(proxyPassword)) {
|
||||
conn.setProxyPassword(proxyPassword);
|
||||
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
|
||||
@Override
|
||||
public PasswordAuthentication getPasswordAuthentication() {
|
||||
if (getRequestorType() == Authenticator.RequestorType.PROXY) {
|
||||
return new PasswordAuthentication(proxyUsername, proxyPassword.toCharArray());
|
||||
} else {
|
||||
return super.getPasswordAuthentication();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
if (proxyPassword != null && !"".equals(proxyPassword)) {
|
||||
conn.setProxyPassword(proxyPassword);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,35 +200,16 @@ public class SalesforceBulkAPI {
|
||||
config.setRestEndpoint(restEndpoint);
|
||||
setProxyToConnection(config);
|
||||
// This should only be false when doing debugging.
|
||||
config.setCompression(needCompression);
|
||||
config.setCompression(true);
|
||||
// Set this to true to see HTTP requests and responses on stdout
|
||||
config.setTraceMessage(needTraceMessage);
|
||||
config.setTraceMessage(false);
|
||||
BulkConnection connection = new BulkConnection(config);
|
||||
return connection;
|
||||
}
|
||||
|
||||
private ConcurrencyMode concurrencyMode = null;
|
||||
|
||||
public void setConcurrencyMode(String mode) {
|
||||
concurrencyMode = ConcurrencyMode.valueOf(mode);
|
||||
}
|
||||
|
||||
private boolean needCompression = true;
|
||||
|
||||
public void setNeedCompression(boolean needCompression) {
|
||||
this.needCompression = needCompression;
|
||||
}
|
||||
|
||||
private boolean needTraceMessage = false;
|
||||
|
||||
public void setNeedTraceMessage(boolean needTraceMessage) {
|
||||
this.needTraceMessage = needTraceMessage;
|
||||
}
|
||||
|
||||
private JobInfo createJob() throws AsyncApiException {
|
||||
JobInfo job = new JobInfo();
|
||||
if (concurrencyMode != null)
|
||||
job.setConcurrencyMode(concurrencyMode);
|
||||
|
||||
job.setObject(sObjectType);
|
||||
job.setOperation(operation);
|
||||
if (OperationEnum.upsert.equals(operation)) {
|
||||
@@ -268,8 +220,8 @@ public class SalesforceBulkAPI {
|
||||
// System.out.println(job);
|
||||
return job;
|
||||
}
|
||||
|
||||
private int countQuotes(String value) {
|
||||
|
||||
private int countQuotes(String value){
|
||||
if (value == null || "".equals(value)) {
|
||||
return 0;
|
||||
} else {
|
||||
@@ -298,11 +250,11 @@ public class SalesforceBulkAPI {
|
||||
int currentBytes = 0;
|
||||
int currentLines = 0;
|
||||
String nextLine;
|
||||
boolean needStart = true;
|
||||
boolean needEnds = true;
|
||||
boolean needStart=true;
|
||||
boolean needEnds=true;
|
||||
while ((nextLine = rdr.readLine()) != null) {
|
||||
int num = countQuotes(nextLine);
|
||||
// nextLine is header or footer of the record
|
||||
int num=countQuotes(nextLine);
|
||||
//nextLine is header or footer of the record
|
||||
if (num % 2 == 1) {
|
||||
if (!needStart) {
|
||||
needEnds = false;
|
||||
@@ -310,13 +262,13 @@ public class SalesforceBulkAPI {
|
||||
needStart = false;
|
||||
}
|
||||
} else {
|
||||
// nextLine is a whole record or middle of the record
|
||||
//nextLine is a whole record or middle of the record
|
||||
if (needEnds && needStart) {
|
||||
needEnds = false;
|
||||
needStart = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
byte[] bytes = (nextLine + "\n").getBytes("UTF-8");
|
||||
|
||||
// Create a new batch when our batch size limit is reached
|
||||
@@ -333,10 +285,10 @@ public class SalesforceBulkAPI {
|
||||
}
|
||||
tmpOut.write(bytes);
|
||||
currentBytes += bytes.length;
|
||||
if (!needStart && !needEnds) {
|
||||
if(!needStart && !needEnds){
|
||||
currentLines++;
|
||||
needStart = true;
|
||||
needEnds = true;
|
||||
needStart=true;
|
||||
needEnds=true;
|
||||
}
|
||||
}
|
||||
// Finished processing all rows
|
||||
@@ -396,7 +348,7 @@ public class SalesforceBulkAPI {
|
||||
|
||||
private Map<String, String> getBaseFileRow() throws IOException {
|
||||
Map<String, String> dataInfo = new HashMap<String, String>();
|
||||
if (baseFileReader.readNext()) {
|
||||
if (baseFileReader.readRecord()) {
|
||||
List<String> row = Arrays.asList(baseFileReader.getValues());
|
||||
for (int i = 0; i < row.size(); i++) {
|
||||
dataInfo.put(baseFileHeader.get(i), row.get(i));
|
||||
@@ -439,77 +391,4 @@ public class SalesforceBulkAPI {
|
||||
public int getBatchCount() {
|
||||
return batchInfoList.size();
|
||||
}
|
||||
|
||||
private String[] queryResultIDs = null;
|
||||
|
||||
public void doBulkQuery(String moduleName, String queryStatement, int secToWait) throws AsyncApiException,
|
||||
InterruptedException {
|
||||
job = new JobInfo();
|
||||
job.setObject(moduleName);
|
||||
job.setOperation(OperationEnum.query);
|
||||
if (concurrencyMode != null)
|
||||
job.setConcurrencyMode(concurrencyMode);
|
||||
job.setContentType(ContentType.CSV);
|
||||
job = connection.createJob(job);
|
||||
|
||||
job = connection.getJobStatus(job.getId());
|
||||
batchInfoList = new ArrayList<BatchInfo>();
|
||||
BatchInfo info = null;
|
||||
ByteArrayInputStream bout = new ByteArrayInputStream(queryStatement.getBytes());
|
||||
info = connection.createBatchFromStream(job, bout);
|
||||
|
||||
while (true) {
|
||||
Thread.sleep(secToWait * 1000); // default is 30 sec
|
||||
info = connection.getBatchInfo(job.getId(), info.getId());
|
||||
|
||||
if (info.getState() == BatchStateEnum.Completed) {
|
||||
QueryResultList list = connection.getQueryResultList(job.getId(), info.getId());
|
||||
queryResultIDs = list.getResult();
|
||||
break;
|
||||
} else if (info.getState() == BatchStateEnum.Failed) {
|
||||
throw new RuntimeException("-------------- failed ----------" + info);
|
||||
} else {
|
||||
System.out.println("-------------- waiting ----------" + info);
|
||||
}
|
||||
}
|
||||
batchInfoList.add(info);
|
||||
}
|
||||
|
||||
public String[] getQueryResultIDs() {
|
||||
return queryResultIDs;
|
||||
}
|
||||
|
||||
public InputStream getQueryResultStream(String resultId) throws AsyncApiException, IOException {
|
||||
return connection.getQueryResultStream(job.getId(), batchInfoList.get(0).getId(), resultId);
|
||||
}
|
||||
|
||||
public List<Map<String, String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
|
||||
// batchInfoList was populated when batches were created and submitted
|
||||
List<Map<String, String>> resultInfoList = new ArrayList<Map<String, String>>();
|
||||
Map<String, String> resultInfo;
|
||||
CSVReader rdr = new CSVReader(connection.getQueryResultStream(job.getId(), batchInfoList.get(0).getId(), resultId));
|
||||
|
||||
List<String> resultHeader = rdr.nextRecord();
|
||||
int resultCols = resultHeader.size();
|
||||
List<String> row;
|
||||
while ((row = rdr.nextRecord()) != null) {
|
||||
resultInfo = new HashMap<String, String>();
|
||||
// resultInfo.putAll(getBaseFileRow());
|
||||
for (int i = 0; i < resultCols; i++) {
|
||||
resultInfo.put(resultHeader.get(i), row.get(i));
|
||||
}
|
||||
resultInfoList.add(resultInfo);
|
||||
// boolean success = Boolean.valueOf(resultInfo.get("Success"));
|
||||
// boolean created = Boolean.valueOf(resultInfo.get("Created"));
|
||||
// String id = resultInfo.get("Id");
|
||||
// String error = resultInfo.get("Error");
|
||||
// if (success && created) {
|
||||
// System.out.println("Created row with id " + id);
|
||||
// } else if (!success) {
|
||||
// System.out.println("Failed with error: " + error);
|
||||
// }
|
||||
}
|
||||
|
||||
return resultInfoList;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,7 @@
|
||||
/**
|
||||
* FieldType.java
|
||||
*
|
||||
* This file was auto-generated from WSDL
|
||||
* by the Apache Axis2 version: 1.6.2 Built on : Apr 17, 2012 (05:34:40 IST)
|
||||
*
|
||||
* This file was auto-generated from WSDL by the Apache Axis2 version: 1.6.2 Built on : Apr 17, 2012 (05:34:40 IST)
|
||||
*/
|
||||
|
||||
package com.salesforce.soap.partner;
|
||||
@@ -13,561 +12,469 @@ package com.salesforce.soap.partner;
|
||||
@SuppressWarnings({ "unchecked", "unused" })
|
||||
public class FieldType implements org.apache.axis2.databinding.ADBBean {
|
||||
|
||||
public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName(
|
||||
"urn:partner.soap.sforce.com", "fieldType", "ns1");
|
||||
public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("urn:partner.soap.sforce.com",
|
||||
"fieldType", "ns1");
|
||||
|
||||
/**
|
||||
* field for FieldType
|
||||
*/
|
||||
/**
|
||||
* field for FieldType
|
||||
*/
|
||||
|
||||
protected java.lang.String localFieldType;
|
||||
protected java.lang.String localFieldType;
|
||||
|
||||
private static java.util.HashMap _table_ = new java.util.HashMap();
|
||||
private static java.util.HashMap _table_ = new java.util.HashMap();
|
||||
|
||||
// Constructor
|
||||
// Constructor
|
||||
|
||||
protected FieldType(java.lang.String value, boolean isRegisterValue) {
|
||||
localFieldType = value;
|
||||
if (isRegisterValue) {
|
||||
protected FieldType(java.lang.String value, boolean isRegisterValue) {
|
||||
localFieldType = value;
|
||||
if (isRegisterValue) {
|
||||
|
||||
_table_.put(localFieldType, this);
|
||||
_table_.put(localFieldType, this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("string");
|
||||
public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("string");
|
||||
|
||||
public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("picklist");
|
||||
public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("picklist");
|
||||
|
||||
public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("multipicklist");
|
||||
public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("multipicklist");
|
||||
|
||||
public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("combobox");
|
||||
public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("combobox");
|
||||
|
||||
public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("reference");
|
||||
public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("reference");
|
||||
|
||||
public static final java.lang.String _value6 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("base64");
|
||||
public static final java.lang.String _value6 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("base64");
|
||||
|
||||
public static final java.lang.String _value7 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("boolean");
|
||||
public static final java.lang.String _value7 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("boolean");
|
||||
|
||||
public static final java.lang.String _value8 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("currency");
|
||||
public static final java.lang.String _value8 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("currency");
|
||||
|
||||
public static final java.lang.String _value9 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("textarea");
|
||||
public static final java.lang.String _value9 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("textarea");
|
||||
|
||||
public static final java.lang.String _value10 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("int");
|
||||
public static final java.lang.String _value10 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("int");
|
||||
|
||||
public static final java.lang.String _value11 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("double");
|
||||
public static final java.lang.String _value11 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("double");
|
||||
|
||||
public static final java.lang.String _value12 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("percent");
|
||||
public static final java.lang.String _value12 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("percent");
|
||||
|
||||
public static final java.lang.String _value13 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("phone");
|
||||
public static final java.lang.String _value13 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("phone");
|
||||
|
||||
public static final java.lang.String _value14 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("id");
|
||||
public static final java.lang.String _value14 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("id");
|
||||
|
||||
public static final java.lang.String _value15 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("date");
|
||||
public static final java.lang.String _value15 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("date");
|
||||
|
||||
public static final java.lang.String _value16 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("datetime");
|
||||
public static final java.lang.String _value16 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("datetime");
|
||||
|
||||
public static final java.lang.String _value17 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("time");
|
||||
public static final java.lang.String _value17 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("time");
|
||||
|
||||
public static final java.lang.String _value18 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("url");
|
||||
public static final java.lang.String _value18 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("url");
|
||||
|
||||
public static final java.lang.String _value19 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("email");
|
||||
public static final java.lang.String _value19 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("email");
|
||||
|
||||
public static final java.lang.String _value20 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("encryptedstring");
|
||||
public static final java.lang.String _value20 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("encryptedstring");
|
||||
|
||||
public static final java.lang.String _value21 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("datacategorygroupreference");
|
||||
public static final java.lang.String _value21 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("datacategorygroupreference");
|
||||
|
||||
public static final java.lang.String _value22 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("location");
|
||||
public static final java.lang.String _value22 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("anyType");
|
||||
|
||||
public static final java.lang.String _value23 = org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString("anyType");
|
||||
public static final FieldType value1 = new FieldType(_value1, true);
|
||||
|
||||
public static final FieldType value1 = new FieldType(_value1, true);
|
||||
public static final FieldType value2 = new FieldType(_value2, true);
|
||||
|
||||
public static final FieldType value2 = new FieldType(_value2, true);
|
||||
public static final FieldType value3 = new FieldType(_value3, true);
|
||||
|
||||
public static final FieldType value3 = new FieldType(_value3, true);
|
||||
public static final FieldType value4 = new FieldType(_value4, true);
|
||||
|
||||
public static final FieldType value4 = new FieldType(_value4, true);
|
||||
public static final FieldType value5 = new FieldType(_value5, true);
|
||||
|
||||
public static final FieldType value5 = new FieldType(_value5, true);
|
||||
public static final FieldType value6 = new FieldType(_value6, true);
|
||||
|
||||
public static final FieldType value6 = new FieldType(_value6, true);
|
||||
public static final FieldType value7 = new FieldType(_value7, true);
|
||||
|
||||
public static final FieldType value7 = new FieldType(_value7, true);
|
||||
public static final FieldType value8 = new FieldType(_value8, true);
|
||||
|
||||
public static final FieldType value8 = new FieldType(_value8, true);
|
||||
public static final FieldType value9 = new FieldType(_value9, true);
|
||||
|
||||
public static final FieldType value9 = new FieldType(_value9, true);
|
||||
public static final FieldType value10 = new FieldType(_value10, true);
|
||||
|
||||
public static final FieldType value10 = new FieldType(_value10, true);
|
||||
public static final FieldType value11 = new FieldType(_value11, true);
|
||||
|
||||
public static final FieldType value11 = new FieldType(_value11, true);
|
||||
public static final FieldType value12 = new FieldType(_value12, true);
|
||||
|
||||
public static final FieldType value12 = new FieldType(_value12, true);
|
||||
public static final FieldType value13 = new FieldType(_value13, true);
|
||||
|
||||
public static final FieldType value13 = new FieldType(_value13, true);
|
||||
public static final FieldType value14 = new FieldType(_value14, true);
|
||||
|
||||
public static final FieldType value14 = new FieldType(_value14, true);
|
||||
public static final FieldType value15 = new FieldType(_value15, true);
|
||||
|
||||
public static final FieldType value15 = new FieldType(_value15, true);
|
||||
public static final FieldType value16 = new FieldType(_value16, true);
|
||||
|
||||
public static final FieldType value16 = new FieldType(_value16, true);
|
||||
public static final FieldType value17 = new FieldType(_value17, true);
|
||||
|
||||
public static final FieldType value17 = new FieldType(_value17, true);
|
||||
public static final FieldType value18 = new FieldType(_value18, true);
|
||||
|
||||
public static final FieldType value18 = new FieldType(_value18, true);
|
||||
public static final FieldType value19 = new FieldType(_value19, true);
|
||||
|
||||
public static final FieldType value19 = new FieldType(_value19, true);
|
||||
public static final FieldType value20 = new FieldType(_value20, true);
|
||||
|
||||
public static final FieldType value20 = new FieldType(_value20, true);
|
||||
public static final FieldType value21 = new FieldType(_value21, true);
|
||||
|
||||
public static final FieldType value21 = new FieldType(_value21, true);
|
||||
public static final FieldType value22 = new FieldType(_value22, true);
|
||||
|
||||
public static final FieldType value22 = new FieldType(_value22, true);
|
||||
public java.lang.String getValue() {
|
||||
return localFieldType;
|
||||
}
|
||||
|
||||
public static final FieldType value23 = new FieldType(_value23, true);
|
||||
public boolean equals(java.lang.Object obj) {
|
||||
return (obj == this);
|
||||
}
|
||||
|
||||
public java.lang.String getValue() {
|
||||
return localFieldType;
|
||||
}
|
||||
public int hashCode() {
|
||||
return toString().hashCode();
|
||||
}
|
||||
|
||||
public boolean equals(java.lang.Object obj) {
|
||||
return (obj == this);
|
||||
}
|
||||
public java.lang.String toString() {
|
||||
|
||||
public int hashCode() {
|
||||
return toString().hashCode();
|
||||
}
|
||||
return localFieldType.toString();
|
||||
|
||||
public java.lang.String toString() {
|
||||
}
|
||||
|
||||
return localFieldType.toString();
|
||||
/**
|
||||
*
|
||||
* @param parentQName
|
||||
* @param factory
|
||||
* @return org.apache.axiom.om.OMElement
|
||||
*/
|
||||
public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName,
|
||||
final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException {
|
||||
|
||||
}
|
||||
org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME);
|
||||
return factory.createOMElement(dataSource, MY_QNAME);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parentQName
|
||||
* @param factory
|
||||
* @return org.apache.axiom.om.OMElement
|
||||
*/
|
||||
public org.apache.axiom.om.OMElement getOMElement(
|
||||
final javax.xml.namespace.QName parentQName,
|
||||
final org.apache.axiom.om.OMFactory factory)
|
||||
throws org.apache.axis2.databinding.ADBException {
|
||||
}
|
||||
|
||||
org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(
|
||||
this, MY_QNAME);
|
||||
return factory.createOMElement(dataSource, MY_QNAME);
|
||||
public void serialize(final javax.xml.namespace.QName parentQName, javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException {
|
||||
serialize(parentQName, xmlWriter, false);
|
||||
}
|
||||
|
||||
}
|
||||
public void serialize(final javax.xml.namespace.QName parentQName, javax.xml.stream.XMLStreamWriter xmlWriter,
|
||||
boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException {
|
||||
|
||||
public void serialize(final javax.xml.namespace.QName parentQName,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException,
|
||||
org.apache.axis2.databinding.ADBException {
|
||||
serialize(parentQName, xmlWriter, false);
|
||||
}
|
||||
// We can safely assume an element has only one type associated with it
|
||||
|
||||
public void serialize(final javax.xml.namespace.QName parentQName,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter, boolean serializeType)
|
||||
throws javax.xml.stream.XMLStreamException,
|
||||
org.apache.axis2.databinding.ADBException {
|
||||
java.lang.String namespace = parentQName.getNamespaceURI();
|
||||
java.lang.String _localName = parentQName.getLocalPart();
|
||||
|
||||
// We can safely assume an element has only one type associated with it
|
||||
writeStartElement(null, namespace, _localName, xmlWriter);
|
||||
|
||||
java.lang.String namespace = parentQName.getNamespaceURI();
|
||||
java.lang.String _localName = parentQName.getLocalPart();
|
||||
// add the type details if this is used in a simple type
|
||||
if (serializeType) {
|
||||
java.lang.String namespacePrefix = registerPrefix(xmlWriter, "urn:partner.soap.sforce.com");
|
||||
if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) {
|
||||
writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":fieldType",
|
||||
xmlWriter);
|
||||
} else {
|
||||
writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "fieldType", xmlWriter);
|
||||
}
|
||||
}
|
||||
|
||||
writeStartElement(null, namespace, _localName, xmlWriter);
|
||||
if (localFieldType == null) {
|
||||
|
||||
// add the type details if this is used in a simple type
|
||||
if (serializeType) {
|
||||
java.lang.String namespacePrefix = registerPrefix(xmlWriter,
|
||||
"urn:partner.soap.sforce.com");
|
||||
if ((namespacePrefix != null)
|
||||
&& (namespacePrefix.trim().length() > 0)) {
|
||||
writeAttribute("xsi",
|
||||
"http://www.w3.org/2001/XMLSchema-instance", "type",
|
||||
namespacePrefix + ":fieldType", xmlWriter);
|
||||
} else {
|
||||
writeAttribute("xsi",
|
||||
"http://www.w3.org/2001/XMLSchema-instance", "type",
|
||||
"fieldType", xmlWriter);
|
||||
}
|
||||
}
|
||||
|
||||
if (localFieldType == null) {
|
||||
|
||||
throw new org.apache.axis2.databinding.ADBException(
|
||||
"fieldType cannot be null !!");
|
||||
|
||||
} else {
|
||||
|
||||
xmlWriter.writeCharacters(localFieldType);
|
||||
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
|
||||
}
|
||||
|
||||
private static java.lang.String generatePrefix(java.lang.String namespace) {
|
||||
if (namespace.equals("urn:partner.soap.sforce.com")) {
|
||||
return "ns1";
|
||||
}
|
||||
return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to write an element start tag.
|
||||
*/
|
||||
private void writeStartElement(java.lang.String prefix,
|
||||
java.lang.String namespace, java.lang.String localPart,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
|
||||
if (writerPrefix != null) {
|
||||
xmlWriter.writeStartElement(namespace, localPart);
|
||||
} else {
|
||||
if (namespace.length() == 0) {
|
||||
prefix = "";
|
||||
} else if (prefix == null) {
|
||||
prefix = generatePrefix(namespace);
|
||||
}
|
||||
|
||||
xmlWriter.writeStartElement(prefix, localPart, namespace);
|
||||
xmlWriter.writeNamespace(prefix, namespace);
|
||||
xmlWriter.setPrefix(prefix, namespace);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to write an attribute with the ns prefix
|
||||
*/
|
||||
private void writeAttribute(java.lang.String prefix,
|
||||
java.lang.String namespace, java.lang.String attName,
|
||||
java.lang.String attValue,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
if (xmlWriter.getPrefix(namespace) == null) {
|
||||
xmlWriter.writeNamespace(prefix, namespace);
|
||||
xmlWriter.setPrefix(prefix, namespace);
|
||||
}
|
||||
xmlWriter.writeAttribute(namespace, attName, attValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to write an attribute without the ns prefix
|
||||
*/
|
||||
private void writeAttribute(java.lang.String namespace,
|
||||
java.lang.String attName, java.lang.String attValue,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
if (namespace.equals("")) {
|
||||
xmlWriter.writeAttribute(attName, attValue);
|
||||
} else {
|
||||
registerPrefix(xmlWriter, namespace);
|
||||
xmlWriter.writeAttribute(namespace, attName, attValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to write an attribute without the ns prefix
|
||||
*/
|
||||
private void writeQNameAttribute(java.lang.String namespace,
|
||||
java.lang.String attName, javax.xml.namespace.QName qname,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
|
||||
java.lang.String attributeNamespace = qname.getNamespaceURI();
|
||||
java.lang.String attributePrefix = xmlWriter
|
||||
.getPrefix(attributeNamespace);
|
||||
if (attributePrefix == null) {
|
||||
attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
|
||||
}
|
||||
java.lang.String attributeValue;
|
||||
if (attributePrefix.trim().length() > 0) {
|
||||
attributeValue = attributePrefix + ":" + qname.getLocalPart();
|
||||
} else {
|
||||
attributeValue = qname.getLocalPart();
|
||||
}
|
||||
|
||||
if (namespace.equals("")) {
|
||||
xmlWriter.writeAttribute(attName, attributeValue);
|
||||
} else {
|
||||
registerPrefix(xmlWriter, namespace);
|
||||
xmlWriter.writeAttribute(namespace, attName, attributeValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* method to handle Qnames
|
||||
*/
|
||||
|
||||
private void writeQName(javax.xml.namespace.QName qname,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
java.lang.String namespaceURI = qname.getNamespaceURI();
|
||||
if (namespaceURI != null) {
|
||||
java.lang.String prefix = xmlWriter.getPrefix(namespaceURI);
|
||||
if (prefix == null) {
|
||||
prefix = generatePrefix(namespaceURI);
|
||||
xmlWriter.writeNamespace(prefix, namespaceURI);
|
||||
xmlWriter.setPrefix(prefix, namespaceURI);
|
||||
}
|
||||
|
||||
if (prefix.trim().length() > 0) {
|
||||
xmlWriter.writeCharacters(prefix
|
||||
+ ":"
|
||||
+ org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(qname));
|
||||
} else {
|
||||
// i.e this is the default namespace
|
||||
xmlWriter
|
||||
.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(qname));
|
||||
}
|
||||
|
||||
} else {
|
||||
xmlWriter
|
||||
.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(qname));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeQNames(javax.xml.namespace.QName[] qnames,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
|
||||
if (qnames != null) {
|
||||
// we have to store this data until last moment since it is not
|
||||
// possible to write any
|
||||
// namespace data after writing the charactor data
|
||||
java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer();
|
||||
java.lang.String namespaceURI = null;
|
||||
java.lang.String prefix = null;
|
||||
|
||||
for (int i = 0; i < qnames.length; i++) {
|
||||
if (i > 0) {
|
||||
stringToWrite.append(" ");
|
||||
}
|
||||
namespaceURI = qnames[i].getNamespaceURI();
|
||||
if (namespaceURI != null) {
|
||||
prefix = xmlWriter.getPrefix(namespaceURI);
|
||||
if ((prefix == null) || (prefix.length() == 0)) {
|
||||
prefix = generatePrefix(namespaceURI);
|
||||
xmlWriter.writeNamespace(prefix, namespaceURI);
|
||||
xmlWriter.setPrefix(prefix, namespaceURI);
|
||||
}
|
||||
|
||||
if (prefix.trim().length() > 0) {
|
||||
stringToWrite
|
||||
.append(prefix)
|
||||
.append(":")
|
||||
.append(org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(qnames[i]));
|
||||
} else {
|
||||
stringToWrite
|
||||
.append(org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(qnames[i]));
|
||||
}
|
||||
} else {
|
||||
stringToWrite
|
||||
.append(org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(qnames[i]));
|
||||
}
|
||||
}
|
||||
xmlWriter.writeCharacters(stringToWrite.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a namespace prefix
|
||||
*/
|
||||
private java.lang.String registerPrefix(
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter,
|
||||
java.lang.String namespace)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
java.lang.String prefix = xmlWriter.getPrefix(namespace);
|
||||
if (prefix == null) {
|
||||
prefix = generatePrefix(namespace);
|
||||
javax.xml.namespace.NamespaceContext nsContext = xmlWriter
|
||||
.getNamespaceContext();
|
||||
while (true) {
|
||||
java.lang.String uri = nsContext.getNamespaceURI(prefix);
|
||||
if (uri == null || uri.length() == 0) {
|
||||
break;
|
||||
}
|
||||
prefix = org.apache.axis2.databinding.utils.BeanUtil
|
||||
.getUniquePrefix();
|
||||
}
|
||||
xmlWriter.writeNamespace(prefix, namespace);
|
||||
xmlWriter.setPrefix(prefix, namespace);
|
||||
}
|
||||
return prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* databinding method to get an XML representation of this object
|
||||
*
|
||||
*/
|
||||
public javax.xml.stream.XMLStreamReader getPullParser(
|
||||
javax.xml.namespace.QName qName)
|
||||
throws org.apache.axis2.databinding.ADBException {
|
||||
|
||||
// We can safely assume an element has only one type associated with it
|
||||
return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(
|
||||
MY_QNAME,
|
||||
new java.lang.Object[] {
|
||||
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT,
|
||||
org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(localFieldType) }, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory class that keeps the parse method
|
||||
*/
|
||||
public static class Factory {
|
||||
|
||||
public static FieldType fromValue(java.lang.String value)
|
||||
throws java.lang.IllegalArgumentException {
|
||||
FieldType enumeration = (FieldType)
|
||||
|
||||
_table_.get(value);
|
||||
|
||||
if ((enumeration == null)
|
||||
&& !((value == null) || (value.equals("")))) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return enumeration;
|
||||
}
|
||||
|
||||
public static FieldType fromString(java.lang.String value,
|
||||
java.lang.String namespaceURI)
|
||||
throws java.lang.IllegalArgumentException {
|
||||
try {
|
||||
|
||||
return fromValue(org.apache.axis2.databinding.utils.ConverterUtil
|
||||
.convertToString(value));
|
||||
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static FieldType fromString(
|
||||
javax.xml.stream.XMLStreamReader xmlStreamReader,
|
||||
java.lang.String content) {
|
||||
if (content.indexOf(":") > -1) {
|
||||
java.lang.String prefix = content.substring(0,
|
||||
content.indexOf(":"));
|
||||
java.lang.String namespaceUri = xmlStreamReader
|
||||
.getNamespaceContext().getNamespaceURI(prefix);
|
||||
return FieldType.Factory.fromString(content, namespaceUri);
|
||||
} else {
|
||||
return FieldType.Factory.fromString(content, "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* static method to create the object Precondition: If this object is an
|
||||
* element, the current or next start element starts this object and any
|
||||
* intervening reader events are ignorable If this object is not an
|
||||
* element, it is a complex type and the reader is at the event just
|
||||
* after the outer start element Postcondition: If this object is an
|
||||
* element, the reader is positioned at its end element If this object
|
||||
* is a complex type, the reader is positioned at the end element of its
|
||||
* outer element
|
||||
*/
|
||||
public static FieldType parse(javax.xml.stream.XMLStreamReader reader)
|
||||
throws java.lang.Exception {
|
||||
FieldType object = null;
|
||||
// initialize a hash map to keep values
|
||||
java.util.Map attributeMap = new java.util.HashMap();
|
||||
java.util.List extraAttributeList = new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();
|
||||
|
||||
int event;
|
||||
java.lang.String nillableValue = null;
|
||||
java.lang.String prefix = "";
|
||||
java.lang.String namespaceuri = "";
|
||||
try {
|
||||
|
||||
while (!reader.isStartElement() && !reader.isEndElement())
|
||||
reader.next();
|
||||
|
||||
// Note all attributes that were handled. Used to differ normal
|
||||
// attributes
|
||||
// from anyAttributes.
|
||||
java.util.Vector handledAttributes = new java.util.Vector();
|
||||
|
||||
while (!reader.isEndElement()) {
|
||||
if (reader.isStartElement() || reader.hasText()) {
|
||||
|
||||
nillableValue = reader.getAttributeValue(
|
||||
"http://www.w3.org/2001/XMLSchema-instance",
|
||||
"nil");
|
||||
if ("true".equals(nillableValue)
|
||||
|| "1".equals(nillableValue)) {
|
||||
throw new org.apache.axis2.databinding.ADBException(
|
||||
"The element: " + "fieldType"
|
||||
+ " cannot be null");
|
||||
}
|
||||
|
||||
java.lang.String content = reader.getElementText();
|
||||
|
||||
if (content.indexOf(":") > 0) {
|
||||
// this seems to be a Qname so find the namespace
|
||||
// and send
|
||||
prefix = content.substring(0, content.indexOf(":"));
|
||||
namespaceuri = reader.getNamespaceURI(prefix);
|
||||
object = FieldType.Factory.fromString(content,
|
||||
namespaceuri);
|
||||
} else {
|
||||
// this seems to be not a qname send and empty
|
||||
// namespace incase of it is
|
||||
// check is done in fromString method
|
||||
object = FieldType.Factory.fromString(content, "");
|
||||
}
|
||||
|
||||
} else {
|
||||
reader.next();
|
||||
}
|
||||
} // end of while loop
|
||||
|
||||
} catch (javax.xml.stream.XMLStreamException e) {
|
||||
throw new java.lang.Exception(e);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
}// end of factory class
|
||||
throw new org.apache.axis2.databinding.ADBException("fieldType cannot be null !!");
|
||||
|
||||
} else {
|
||||
|
||||
xmlWriter.writeCharacters(localFieldType);
|
||||
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
|
||||
}
|
||||
|
||||
private static java.lang.String generatePrefix(java.lang.String namespace) {
|
||||
if (namespace.equals("urn:partner.soap.sforce.com")) {
|
||||
return "ns1";
|
||||
}
|
||||
return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to write an element start tag.
|
||||
*/
|
||||
private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
|
||||
java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
|
||||
if (writerPrefix != null) {
|
||||
xmlWriter.writeStartElement(namespace, localPart);
|
||||
} else {
|
||||
if (namespace.length() == 0) {
|
||||
prefix = "";
|
||||
} else if (prefix == null) {
|
||||
prefix = generatePrefix(namespace);
|
||||
}
|
||||
|
||||
xmlWriter.writeStartElement(prefix, localPart, namespace);
|
||||
xmlWriter.writeNamespace(prefix, namespace);
|
||||
xmlWriter.setPrefix(prefix, namespace);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to write an attribute with the ns prefix
|
||||
*/
|
||||
private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName,
|
||||
java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
|
||||
if (xmlWriter.getPrefix(namespace) == null) {
|
||||
xmlWriter.writeNamespace(prefix, namespace);
|
||||
xmlWriter.setPrefix(prefix, namespace);
|
||||
}
|
||||
xmlWriter.writeAttribute(namespace, attName, attValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to write an attribute without the ns prefix
|
||||
*/
|
||||
private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
|
||||
if (namespace.equals("")) {
|
||||
xmlWriter.writeAttribute(attName, attValue);
|
||||
} else {
|
||||
registerPrefix(xmlWriter, namespace);
|
||||
xmlWriter.writeAttribute(namespace, attName, attValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to write an attribute without the ns prefix
|
||||
*/
|
||||
private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname,
|
||||
javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
|
||||
|
||||
java.lang.String attributeNamespace = qname.getNamespaceURI();
|
||||
java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
|
||||
if (attributePrefix == null) {
|
||||
attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
|
||||
}
|
||||
java.lang.String attributeValue;
|
||||
if (attributePrefix.trim().length() > 0) {
|
||||
attributeValue = attributePrefix + ":" + qname.getLocalPart();
|
||||
} else {
|
||||
attributeValue = qname.getLocalPart();
|
||||
}
|
||||
|
||||
if (namespace.equals("")) {
|
||||
xmlWriter.writeAttribute(attName, attributeValue);
|
||||
} else {
|
||||
registerPrefix(xmlWriter, namespace);
|
||||
xmlWriter.writeAttribute(namespace, attName, attributeValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* method to handle Qnames
|
||||
*/
|
||||
|
||||
private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
java.lang.String namespaceURI = qname.getNamespaceURI();
|
||||
if (namespaceURI != null) {
|
||||
java.lang.String prefix = xmlWriter.getPrefix(namespaceURI);
|
||||
if (prefix == null) {
|
||||
prefix = generatePrefix(namespaceURI);
|
||||
xmlWriter.writeNamespace(prefix, namespaceURI);
|
||||
xmlWriter.setPrefix(prefix, namespaceURI);
|
||||
}
|
||||
|
||||
if (prefix.trim().length() > 0) {
|
||||
xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
|
||||
} else {
|
||||
// i.e this is the default namespace
|
||||
xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
|
||||
}
|
||||
|
||||
} else {
|
||||
xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
|
||||
if (qnames != null) {
|
||||
// we have to store this data until last moment since it is not possible to write any
|
||||
// namespace data after writing the charactor data
|
||||
java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer();
|
||||
java.lang.String namespaceURI = null;
|
||||
java.lang.String prefix = null;
|
||||
|
||||
for (int i = 0; i < qnames.length; i++) {
|
||||
if (i > 0) {
|
||||
stringToWrite.append(" ");
|
||||
}
|
||||
namespaceURI = qnames[i].getNamespaceURI();
|
||||
if (namespaceURI != null) {
|
||||
prefix = xmlWriter.getPrefix(namespaceURI);
|
||||
if ((prefix == null) || (prefix.length() == 0)) {
|
||||
prefix = generatePrefix(namespaceURI);
|
||||
xmlWriter.writeNamespace(prefix, namespaceURI);
|
||||
xmlWriter.setPrefix(prefix, namespaceURI);
|
||||
}
|
||||
|
||||
if (prefix.trim().length() > 0) {
|
||||
stringToWrite.append(prefix).append(":")
|
||||
.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
|
||||
} else {
|
||||
stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
|
||||
}
|
||||
} else {
|
||||
stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
|
||||
}
|
||||
}
|
||||
xmlWriter.writeCharacters(stringToWrite.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a namespace prefix
|
||||
*/
|
||||
private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace)
|
||||
throws javax.xml.stream.XMLStreamException {
|
||||
java.lang.String prefix = xmlWriter.getPrefix(namespace);
|
||||
if (prefix == null) {
|
||||
prefix = generatePrefix(namespace);
|
||||
javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext();
|
||||
while (true) {
|
||||
java.lang.String uri = nsContext.getNamespaceURI(prefix);
|
||||
if (uri == null || uri.length() == 0) {
|
||||
break;
|
||||
}
|
||||
prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
|
||||
}
|
||||
xmlWriter.writeNamespace(prefix, namespace);
|
||||
xmlWriter.setPrefix(prefix, namespace);
|
||||
}
|
||||
return prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* databinding method to get an XML representation of this object
|
||||
*
|
||||
*/
|
||||
public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)
|
||||
throws org.apache.axis2.databinding.ADBException {
|
||||
|
||||
// We can safely assume an element has only one type associated with it
|
||||
return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[] {
|
||||
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT,
|
||||
org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFieldType) }, null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory class that keeps the parse method
|
||||
*/
|
||||
public static class Factory {
|
||||
|
||||
public static FieldType fromValue(java.lang.String value) throws java.lang.IllegalArgumentException {
|
||||
FieldType enumeration = (FieldType)
|
||||
|
||||
_table_.get(value);
|
||||
|
||||
if ((enumeration == null) && !((value == null) || (value.equals("")))) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return enumeration;
|
||||
}
|
||||
|
||||
public static FieldType fromString(java.lang.String value, java.lang.String namespaceURI)
|
||||
throws java.lang.IllegalArgumentException {
|
||||
try {
|
||||
|
||||
return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value));
|
||||
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static FieldType fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) {
|
||||
if (content.indexOf(":") > -1) {
|
||||
java.lang.String prefix = content.substring(0, content.indexOf(":"));
|
||||
java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix);
|
||||
return FieldType.Factory.fromString(content, namespaceUri);
|
||||
} else {
|
||||
return FieldType.Factory.fromString(content, "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* static method to create the object Precondition: If this object is an element, the current or next start
|
||||
* element starts this object and any intervening reader events are ignorable If this object is not an element,
|
||||
* it is a complex type and the reader is at the event just after the outer start element Postcondition: If this
|
||||
* object is an element, the reader is positioned at its end element If this object is a complex type, the
|
||||
* reader is positioned at the end element of its outer element
|
||||
*/
|
||||
public static FieldType parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {
|
||||
FieldType object = null;
|
||||
// initialize a hash map to keep values
|
||||
java.util.Map attributeMap = new java.util.HashMap();
|
||||
java.util.List extraAttributeList = new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();
|
||||
|
||||
int event;
|
||||
java.lang.String nillableValue = null;
|
||||
java.lang.String prefix = "";
|
||||
java.lang.String namespaceuri = "";
|
||||
try {
|
||||
|
||||
while (!reader.isStartElement() && !reader.isEndElement())
|
||||
reader.next();
|
||||
|
||||
// Note all attributes that were handled. Used to differ normal attributes
|
||||
// from anyAttributes.
|
||||
java.util.Vector handledAttributes = new java.util.Vector();
|
||||
|
||||
while (!reader.isEndElement()) {
|
||||
if (reader.isStartElement() || reader.hasText()) {
|
||||
|
||||
nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
|
||||
if ("true".equals(nillableValue) || "1".equals(nillableValue)) {
|
||||
throw new org.apache.axis2.databinding.ADBException("The element: " + "fieldType"
|
||||
+ " cannot be null");
|
||||
}
|
||||
|
||||
java.lang.String content = reader.getElementText();
|
||||
|
||||
if (content.indexOf(":") > 0) {
|
||||
// this seems to be a Qname so find the namespace and send
|
||||
prefix = content.substring(0, content.indexOf(":"));
|
||||
namespaceuri = reader.getNamespaceURI(prefix);
|
||||
object = FieldType.Factory.fromString(content, namespaceuri);
|
||||
} else {
|
||||
// this seems to be not a qname send and empty namespace incase of it is
|
||||
// check is done in fromString method
|
||||
object = FieldType.Factory.fromString(content, "");
|
||||
}
|
||||
|
||||
} else {
|
||||
reader.next();
|
||||
}
|
||||
} // end of while loop
|
||||
|
||||
} catch (javax.xml.stream.XMLStreamException e) {
|
||||
throw new java.lang.Exception(e);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
}// end of factory class
|
||||
|
||||
}
|
||||
|
||||
@@ -941,8 +941,7 @@ public interface SforceService {
|
||||
|
||||
com.salesforce.soap.partner.DescribeDataCategoryGroupStructures describeDataCategoryGroupStructures238,
|
||||
com.salesforce.soap.partner.SessionHeader sessionHeader239, com.salesforce.soap.partner.CallOptions callOptions240,
|
||||
com.salesforce.soap.partner.PackageVersionHeader packageVersionHeader241,
|
||||
com.salesforce.soap.partner.LocaleOptions localeOptions) throws java.rmi.RemoteException
|
||||
com.salesforce.soap.partner.PackageVersionHeader packageVersionHeader241) throws java.rmi.RemoteException
|
||||
|
||||
, com.salesforce.soap.partner.InvalidSObjectFault, com.salesforce.soap.partner.UnexpectedErrorFault;
|
||||
|
||||
@@ -963,7 +962,7 @@ public interface SforceService {
|
||||
com.salesforce.soap.partner.DescribeDataCategoryGroupStructures describeDataCategoryGroupStructures238,
|
||||
com.salesforce.soap.partner.SessionHeader sessionHeader239, com.salesforce.soap.partner.CallOptions callOptions240,
|
||||
com.salesforce.soap.partner.PackageVersionHeader packageVersionHeader241,
|
||||
com.salesforce.soap.partner.LocaleOptions localeOptions,
|
||||
|
||||
final com.salesforce.soap.partner.SforceServiceCallbackHandler callback)
|
||||
|
||||
throws java.rmi.RemoteException;
|
||||
@@ -1162,8 +1161,7 @@ public interface SforceService {
|
||||
|
||||
com.salesforce.soap.partner.DescribeDataCategoryGroups describeDataCategoryGroups263,
|
||||
com.salesforce.soap.partner.SessionHeader sessionHeader264, com.salesforce.soap.partner.CallOptions callOptions265,
|
||||
com.salesforce.soap.partner.PackageVersionHeader packageVersionHeader266,
|
||||
com.salesforce.soap.partner.LocaleOptions localeOptions) throws java.rmi.RemoteException
|
||||
com.salesforce.soap.partner.PackageVersionHeader packageVersionHeader266) throws java.rmi.RemoteException
|
||||
|
||||
, com.salesforce.soap.partner.InvalidSObjectFault, com.salesforce.soap.partner.UnexpectedErrorFault;
|
||||
|
||||
@@ -1184,7 +1182,7 @@ public interface SforceService {
|
||||
com.salesforce.soap.partner.DescribeDataCategoryGroups describeDataCategoryGroups263,
|
||||
com.salesforce.soap.partner.SessionHeader sessionHeader264, com.salesforce.soap.partner.CallOptions callOptions265,
|
||||
com.salesforce.soap.partner.PackageVersionHeader packageVersionHeader266,
|
||||
com.salesforce.soap.partner.LocaleOptions localeOptions,
|
||||
|
||||
final com.salesforce.soap.partner.SforceServiceCallbackHandler callback)
|
||||
|
||||
throws java.rmi.RemoteException;
|
||||
@@ -1369,7 +1367,6 @@ public interface SforceService {
|
||||
* @throws com.salesforce.soap.partner.InvalidFieldFault :
|
||||
* @throws com.salesforce.soap.partner.UnexpectedErrorFault :
|
||||
* @throws com.salesforce.soap.partner.InvalidQueryLocatorFault :
|
||||
* @throws MalformedQueryFault
|
||||
*/
|
||||
|
||||
public com.salesforce.soap.partner.QueryMoreResponse queryMore(
|
||||
@@ -1379,7 +1376,7 @@ public interface SforceService {
|
||||
throws java.rmi.RemoteException
|
||||
|
||||
, com.salesforce.soap.partner.InvalidFieldFault, com.salesforce.soap.partner.UnexpectedErrorFault,
|
||||
com.salesforce.soap.partner.InvalidQueryLocatorFault, MalformedQueryFault;
|
||||
com.salesforce.soap.partner.InvalidQueryLocatorFault;
|
||||
|
||||
/**
|
||||
* Auto generated method signature for Asynchronous Invocations Gets the next batch of sObjects from a query
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,96 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="org.talend.designer.components.libs" default="process" basedir=".">
|
||||
|
||||
<property name="component.plugin.home" value="../../../org.talend.designer.components.localprovider/components" />
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
<!-- modification 1: config -->
|
||||
<property name="jar.name" value="simpleexcel.jar" />
|
||||
<property name="component.name" value="tFileInputExcel" />
|
||||
<property name="author.name" value="wwang" />
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
<path id="compile.classpath">
|
||||
<pathelement location="${component.plugin.home}/tFileInputXML/dom4j-1.6.1.jar" />
|
||||
<pathelement location="${component.plugin.home}/tMicrosoftCrmInput/geronimo-stax-api_1.0_spec-1.0.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/log4j-1.2.15.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-3.8-20120913_modified_talend.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-3.8-20121127_modified_talend.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-schemas-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-scratchpad-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tMicrosoftCrmInput/xmlbeans-2.3.0.jar" />
|
||||
</path>
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
|
||||
<!-- sourcecode and final jar path -->
|
||||
<property name="source.home" value="." />
|
||||
<property name="jar.home" value="${component.plugin.home}/${component.name}/${jar.name}" />
|
||||
|
||||
<!-- temp dir for clasee files -->
|
||||
<property name="build.dir" value="../../build" />
|
||||
|
||||
<!-- compile option -->
|
||||
<property name="compile.debug" value="true" />
|
||||
<property name="compile.deprecation" value="false" />
|
||||
<property name="compile.optimize" value="true" />
|
||||
|
||||
|
||||
<target name="process" description="prepare a temp dir">
|
||||
<antcall target="prepare" />
|
||||
<antcall target="compile" />
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
|
||||
<target name="prepare" description="prepare a temp dir">
|
||||
<delete dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}/classes" />
|
||||
</target>
|
||||
|
||||
<target name="compile" description="Compile Java sources">
|
||||
|
||||
<!-- compile -->
|
||||
<javac srcdir="${source.home}" destdir="${build.dir}/classes" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}">
|
||||
<classpath refid="compile.classpath" />
|
||||
</javac>
|
||||
|
||||
<!-- include source code -->
|
||||
<copy todir="${build.dir}/classes">
|
||||
<fileset dir="${source.home}">
|
||||
<exclude name="build.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- make jar -->
|
||||
<tstamp>
|
||||
<format property="date" pattern="yyyy-MM-dd HH:mm:ss" />
|
||||
</tstamp>
|
||||
|
||||
<jar destfile="${build.dir}/${jar.name}" basedir="${build.dir}/classes">
|
||||
<manifest>
|
||||
<!-- who -->
|
||||
<attribute name="Built-By" value="${author.name}" />
|
||||
<!-- when -->
|
||||
<attribute name="Built-Date" value="${date}"/>
|
||||
<!-- JDK version -->
|
||||
<attribute name="Created-By" value="${java.version} (${java.vendor})" />
|
||||
<!-- Information about the program itself -->
|
||||
<attribute name="Implementation-Vendor" value="Talend SA" />
|
||||
<attribute name="Implementation-Title" value="${jar.name}" />
|
||||
<attribute name="Implementation-Version" value="1.0" />
|
||||
</manifest>
|
||||
</jar>
|
||||
|
||||
<!-- move jar -->
|
||||
<move file="${build.dir}/${jar.name}" tofile="${jar.home}" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="clean" description="clean the temp dir">
|
||||
<delete dir="${build.dir}" />
|
||||
<mkdir dir="${build.dir}" />
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,182 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package com.talend.excel.xssf.event;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment
|
||||
*/
|
||||
public class DataBufferCache {
|
||||
|
||||
// private static DataBufferCache instance = new DataBufferCache();
|
||||
|
||||
private long bufferSize = 5000;
|
||||
|
||||
private boolean isEnd = false;
|
||||
|
||||
private int bufferNum = 10;
|
||||
|
||||
private LinkedList<Buffer> buffers = new LinkedList<Buffer>();
|
||||
|
||||
private Buffer currentReadBuff = null;
|
||||
|
||||
private Buffer currentWriteBuff = null;
|
||||
|
||||
private DataBufferCache() {
|
||||
}
|
||||
|
||||
public static DataBufferCache getInstance() {
|
||||
return new DataBufferCache();
|
||||
}
|
||||
|
||||
public void setIsEnd() {
|
||||
synchronized (buffers) {
|
||||
try {
|
||||
if (!isEnd && currentWriteBuff != null) {
|
||||
buffers.add(currentWriteBuff);
|
||||
}
|
||||
this.isEnd = true;
|
||||
} finally {
|
||||
this.buffers.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setBufferNum(int num) {
|
||||
if (num <= 0) {
|
||||
return;
|
||||
}
|
||||
this.bufferNum = num;
|
||||
}
|
||||
|
||||
public void setBufferSize(long size) {
|
||||
if (size <= 0) {
|
||||
return;
|
||||
}
|
||||
this.bufferSize = size;
|
||||
}
|
||||
|
||||
public boolean hasData() {
|
||||
getCurrReadBuffer();
|
||||
if (currentReadBuff == null) {
|
||||
return false;
|
||||
}
|
||||
return this.currentReadBuff.hasNext();
|
||||
}
|
||||
|
||||
public List<String> readData() {
|
||||
return this.currentReadBuff.Next();
|
||||
}
|
||||
|
||||
private void getCurrReadBuffer() {
|
||||
if (currentReadBuff != null && currentReadBuff.hasNext()) {
|
||||
return;
|
||||
}
|
||||
synchronized (this.buffers) {
|
||||
try {
|
||||
while (!this.isEnd && buffers.size() < 1) {
|
||||
try {
|
||||
buffers.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
if (buffers.size() > 0) {
|
||||
currentReadBuff = buffers.remove();
|
||||
}
|
||||
} finally {
|
||||
this.buffers.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void writeData(List<String> record) {
|
||||
if (currentWriteBuff == null) {
|
||||
currentWriteBuff = new Buffer();
|
||||
}
|
||||
if (currentWriteBuff.size() < this.bufferSize) {
|
||||
currentWriteBuff.add(record);
|
||||
} else {
|
||||
currentWriteBuff.add(record);
|
||||
synchronized (buffers) {
|
||||
try {
|
||||
while (buffers.size() > bufferNum) {
|
||||
try {
|
||||
buffers.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
if (currentWriteBuff.size() > 0) {
|
||||
this.buffers.add(currentWriteBuff);
|
||||
}
|
||||
currentWriteBuff = null;
|
||||
} finally {
|
||||
this.buffers.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void notifyErrorOccurred() {
|
||||
setIsEnd();
|
||||
}
|
||||
|
||||
class Buffer {
|
||||
|
||||
private LinkedList<List<String>> buffer = null;
|
||||
|
||||
private boolean isForRead = false; // false for write, true for read
|
||||
|
||||
public Buffer() {
|
||||
buffer = createNewBuffer();
|
||||
}
|
||||
|
||||
public void setIsForRead(boolean isForRead) {
|
||||
this.isForRead = isForRead;
|
||||
}
|
||||
|
||||
public boolean isForRead() {
|
||||
return this.isForRead;
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return buffer.size() > 0;
|
||||
}
|
||||
|
||||
public List<String> Next() {
|
||||
return buffer.remove();
|
||||
}
|
||||
|
||||
public void add(List<String> o) {
|
||||
this.buffer.add(o);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.buffer.size();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.buffer.clear();
|
||||
buffer = null;
|
||||
}
|
||||
|
||||
private LinkedList<List<String>> createNewBuffer() {
|
||||
return new LinkedList<List<String>>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package com.talend.excel.xssf.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by wwang on 2012-9-27 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class DefaultTalendSheetContentsHandler implements TalendXSSFSheetXMLHandler.TalendSheetContentsHandler {
|
||||
|
||||
private DataBufferCache cache = null;
|
||||
|
||||
private List<String> row = null;
|
||||
|
||||
private boolean stop = false;
|
||||
|
||||
private int currentColumnIndex = -1;
|
||||
|
||||
private int lastColumnIndex = -1;
|
||||
|
||||
public DefaultTalendSheetContentsHandler(DataBufferCache cache) {
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startRow(int rowNum) {
|
||||
row = new ArrayList<String>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endRow() {
|
||||
cache.writeData(row);
|
||||
row = null;
|
||||
// when each row end ,reset lastColumnIndex
|
||||
lastColumnIndex = -1;
|
||||
if (stop) {
|
||||
throw new EnoughDataException("Get enough data,now stop the xml parse action");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cell(String cellReference, String formattedValue) {
|
||||
checkHasNullValue(cellReference);
|
||||
row.add(formattedValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void headerFooter(String text, boolean isHeader, String tagName) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endSheet() {
|
||||
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.stop = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* when currentCellReferecnce is "A1" ,and next currentCellReferecnce is "C1",we need add a null value for "B1"
|
||||
*/
|
||||
private void checkHasNullValue(String cellReference) {
|
||||
currentColumnIndex = getIndexOfColumn(cellReference);
|
||||
// Might be the empty string.
|
||||
for (int i = lastColumnIndex; i < currentColumnIndex - 1; i++) {
|
||||
row.add(null);
|
||||
}
|
||||
// Update column
|
||||
if (currentColumnIndex > -1) {
|
||||
lastColumnIndex = currentColumnIndex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get index of column,like "AB12" return 27
|
||||
*/
|
||||
private int getIndexOfColumn(String cellReference) {
|
||||
int columnIndex = -1;
|
||||
// get First Digit index ,like cellReferecnce is "AA13" ,firstDigitIndex return 2
|
||||
int firstDigitIndex = -1;
|
||||
for (int c = 0; c < cellReference.length(); ++c) {
|
||||
if (Character.isDigit(cellReference.charAt(c))) {
|
||||
firstDigitIndex = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// get String part for cellReference,like "AB2" ,return "AB"
|
||||
String cellStringPart = cellReference.substring(0, firstDigitIndex);
|
||||
for (int i = 0; i < cellStringPart.length(); ++i) {
|
||||
int c = cellStringPart.charAt(i);
|
||||
columnIndex = (columnIndex + 1) * 26 + c - 'A';
|
||||
}
|
||||
return columnIndex;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package com.talend.excel.xssf.event;
|
||||
|
||||
public class EnoughDataException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 2843001993190805937L;
|
||||
|
||||
public EnoughDataException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public EnoughDataException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public EnoughDataException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public EnoughDataException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user