-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MARP-1454 Introduce new UI demo (#79)
- Loading branch information
1 parent
cfd9dad
commit fc63c0a
Showing
20 changed files
with
900 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ware-connector-demo/src/com/axonivy/connector/docuware/connector/demo/enums/ItemType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.axonivy.connector.docuware.connector.demo.enums; | ||
|
||
public enum ItemType { | ||
DECIMAL("Decimal"), STRING("String"), INT("Int"); | ||
|
||
private final String value; | ||
|
||
private ItemType(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...-demo/src/com/axonivy/connector/docuware/connector/demo/managedbean/DocuWareDemoBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.axonivy.connector.docuware.connector.demo.managedbean; | ||
|
||
import java.io.Serializable; | ||
|
||
import javax.faces.application.FacesMessage; | ||
import javax.faces.bean.ManagedBean; | ||
import javax.faces.bean.ViewScoped; | ||
import javax.faces.context.FacesContext; | ||
|
||
import com.axonivy.connector.docuware.connector.DocuWareProperty; | ||
import com.axonivy.connector.docuware.connector.demo.enums.ItemType; | ||
|
||
import ch.ivyteam.ivy.environment.Ivy; | ||
|
||
@ManagedBean | ||
@ViewScoped | ||
public class DocuWareDemoBean implements Serializable { | ||
|
||
private static final long serialVersionUID = 4548574141754643263L; | ||
|
||
private String documentUrl; | ||
private final String DOCUMENT_URL_FORMAT = "https://%s/DocuWare/Platform/WebClient/Client/Document?did=%s&fc=%s"; | ||
|
||
public void buildDocumentUrl(String documentId, String fileCabinetId) { | ||
String host = Ivy.var().get("docuwareConnector.host"); | ||
this.documentUrl = String.format(DOCUMENT_URL_FORMAT, host, documentId, fileCabinetId); | ||
} | ||
|
||
public String getDocumentUrl() { | ||
return documentUrl; | ||
} | ||
|
||
public boolean isFieldNameTypeNumber(DocuWareProperty field) { | ||
return field.getItemElementName().equals(ItemType.DECIMAL.getValue()) | ||
|| field.getItemElementName().equals(ItemType.INT.getValue()); | ||
} | ||
|
||
public boolean isFieldNameTypeString(DocuWareProperty field) { | ||
return field.getItemElementName().equals(ItemType.STRING.getValue()); | ||
} | ||
|
||
public void updateGrowlMessageForEditAction(boolean isUpdateSuccess) { | ||
if (isUpdateSuccess) { | ||
FacesContext.getCurrentInstance().addMessage(null, | ||
new FacesMessage(FacesMessage.SEVERITY_INFO, Ivy.cms().co("/Labels/Success"), Ivy.cms().co( | ||
"/Dialogs/com/axonivy/connector/docuware/connector/demo/DocuWareDemoUI/Dialog/SuccessEditMessage"))); | ||
} else { | ||
FacesContext.getCurrentInstance().addMessage(null, | ||
new FacesMessage(FacesMessage.SEVERITY_ERROR, Ivy.cms().co("/Labels/Failed"), Ivy.cms().co( | ||
"/Dialogs/com/axonivy/connector/docuware/connector/demo/DocuWareDemoUI/Dialog/FailedEditMessage"))); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...e/connector/demo/DocuWareDemoService.java → ...tor/demo/service/DocuWareDemoService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../com/axonivy/connector/docuware/connector/demo/DocuWareDemoUI/DocuWareDemoUI.rddescriptor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<richDialogDescriptor> | ||
<property> | ||
<name>viewTechnology</name> | ||
<value>JSF</value> | ||
</property> | ||
</richDialogDescriptor> |
Oops, something went wrong.