/** * Utility for comparint this instance with another ResourceDsecription * * @param newResourceDescription instance to be compared to * @return true if they are different */ public boolean compare(ResourceDescription newResourceDescription) { if (compareField(newResourceDescription.getShortName(),this.getShortName()) &&compareField(newResourceDescription.getDescription(),this.getDescription()) &&compareField(newResourceDescription.getScriptIdsAsString(),this.getScriptIdsAsString())) { return false; } else { return true; } }
/** * Return a new instance of ResourceDescription * * @return a new instance of ResourceDescription */ public static ResourceDescription newInstance() { ResourceDescription newResourceDescription = new ResourceDescription ("shortname","description",new String[]{}); return newResourceDescription; }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<").append(ResourceDescription.ROOT_ELEMENT_NAME).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<shortname>").append(this.getShortName()).append("</shortname>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<description>").append(this.getDescription()).append("</description>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<").append(WEBSCRIPTS_ELEMENT_NAME).append(">").append(this.getScriptIdsAsString()).append("</").append(WEBSCRIPTS_ELEMENT_NAME).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("</").append(ResourceDescription.ROOT_ELEMENT_NAME).append(">"); return sb.toString(); }
ResourceDescription resourceDescription = new ResourceDescription(); resourceDescription.parse(resourceElement); String [] scriptIds = resourceDescription.getScriptIds(); String scriptPackagePath = this.getPackage().getPath(); if (scriptIds != null)
/** * @throws Exception */ @Test public void testPackageDescriptionDocumentResources() throws Exception { PackageDescriptionDocument doc = getWebscriptRegistry().getPackageDescriptionDocument("/documents/samples"); assertNotNull(doc); ResourceDescription [] resources = doc.getResourceDescriptions(); assertNotNull(resources); assertEquals(2,resources.length); String shortName = resources[0].getShortName(); assertEquals("Alfresco sample1",shortName); String description = resources[0].getDescription(); assertEquals("Alfresco sample1 webscript",description); String[] scriptIds = resources[0].getScriptIds(); assertEquals(4,scriptIds.length); assertEquals("documents/samples/sample1.get",scriptIds[0]); }
public void parse(Element elem) { if (this.validateRootElement(elem, ROOT_ELEMENT_NAME)) { super.parse(elem); Element webscriptElement = elem.element(WEBSCRIPTS_ELEMENT_NAME); if (webscriptElement!=null) { String [] webscriptIds = webscriptElement.getTextTrim().split(","); this.setScriptIds(webscriptIds); } } }
String[] scriptIds = resource.getScriptIds(); for (String scriptId : scriptIds)
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(AbstractBaseDescriptionDocument.COMMON_XML_HEADER).append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append("<").append(PackageDescriptionDocument.ROOT_ELEMENT_NAME).append(" ").append(AbstractBaseDescriptionDocument.COMMON_XML_NS).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<shortname>").append(this.getShortName()).append("</shortname>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<description>").append(this.getDescription()).append("</description>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<resources>").append(AbstractBaseDescriptionDocument.NEW_LINE); if (this.getResourceDescriptions() != null) { for (ResourceDescription rd : this.getResourceDescriptions()) { sb.append(rd.toString()).append(AbstractBaseDescriptionDocument.NEW_LINE); } } sb.append(AbstractBaseDescriptionDocument.TAB).append("</resources>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append("</").append(PackageDescriptionDocument.ROOT_ELEMENT_NAME).append(">"); return sb.toString(); }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<").append(ResourceDescription.ROOT_ELEMENT_NAME).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<shortname>").append(this.getShortName()).append("</shortname>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<description>").append(this.getDescription()).append("</description>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<").append(WEBSCRIPTS_ELEMENT_NAME).append(">").append(this.getScriptIdsAsString()).append("</").append(WEBSCRIPTS_ELEMENT_NAME).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("</").append(ResourceDescription.ROOT_ELEMENT_NAME).append(">"); return sb.toString(); }
ResourceDescription resourceDescription = new ResourceDescription(); resourceDescription.parse(resourceElement); String [] scriptIds = resourceDescription.getScriptIds(); String scriptPackagePath = this.getPackage().getPath(); if (scriptIds != null)
public void parse(Element elem) { if (this.validateRootElement(elem, ROOT_ELEMENT_NAME)) { super.parse(elem); Element webscriptElement = elem.element(WEBSCRIPTS_ELEMENT_NAME); if (webscriptElement!=null) { String [] webscriptIds = webscriptElement.getTextTrim().split(","); this.setScriptIds(webscriptIds); } } }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(AbstractBaseDescriptionDocument.COMMON_XML_HEADER).append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append("<").append(PackageDescriptionDocument.ROOT_ELEMENT_NAME).append(" ").append(AbstractBaseDescriptionDocument.COMMON_XML_NS).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<shortname>").append(this.getShortName()).append("</shortname>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<description>").append(this.getDescription()).append("</description>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<resources>").append(AbstractBaseDescriptionDocument.NEW_LINE); if (this.getResourceDescriptions() != null) { for (ResourceDescription rd : this.getResourceDescriptions()) { sb.append(rd.toString()).append(AbstractBaseDescriptionDocument.NEW_LINE); } } sb.append(AbstractBaseDescriptionDocument.TAB).append("</resources>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append("</").append(PackageDescriptionDocument.ROOT_ELEMENT_NAME).append(">"); return sb.toString(); }
/** * Utility for comparint this instance with another ResourceDsecription * * @param newResourceDescription instance to be compared to * @return true if they are different */ public boolean compare(ResourceDescription newResourceDescription) { if (compareField(newResourceDescription.getShortName(),this.getShortName()) &&compareField(newResourceDescription.getDescription(),this.getDescription()) &&compareField(newResourceDescription.getScriptIdsAsString(),this.getScriptIdsAsString())) { return false; } else { return true; } }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<").append(ResourceDescription.ROOT_ELEMENT_NAME).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<shortname>").append(this.getShortName()).append("</shortname>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<description>").append(this.getDescription()).append("</description>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("<").append(WEBSCRIPTS_ELEMENT_NAME).append(">").append(this.getScriptIdsAsString()).append("</").append(WEBSCRIPTS_ELEMENT_NAME).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append(AbstractBaseDescriptionDocument.TAB).append("</").append(ResourceDescription.ROOT_ELEMENT_NAME).append(">"); return sb.toString(); }
ResourceDescription resourceDescription = new ResourceDescription(); resourceDescription.parse(resourceElement); String [] scriptIds = resourceDescription.getScriptIds(); String scriptPackagePath = this.getPackage().getPath(); if (scriptIds != null)
public void parse(Element elem) { if (this.validateRootElement(elem, ROOT_ELEMENT_NAME)) { super.parse(elem); Element webscriptElement = elem.element(WEBSCRIPTS_ELEMENT_NAME); if (webscriptElement!=null) { String [] webscriptIds = webscriptElement.getTextTrim().split(","); this.setScriptIds(webscriptIds); } } }
/** * Return a new instance of ResourceDescription * * @return a new instance of ResourceDescription */ public static ResourceDescription newInstance() { ResourceDescription newResourceDescription = new ResourceDescription ("shortname","description",new String[]{}); return newResourceDescription; }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(AbstractBaseDescriptionDocument.COMMON_XML_HEADER).append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append("<").append(PackageDescriptionDocument.ROOT_ELEMENT_NAME).append(" ").append(AbstractBaseDescriptionDocument.COMMON_XML_NS).append(">").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<shortname>").append(this.getShortName()).append("</shortname>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<description>").append(this.getDescription()).append("</description>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append(AbstractBaseDescriptionDocument.TAB).append("<resources>").append(AbstractBaseDescriptionDocument.NEW_LINE); if (this.getResourceDescriptions() != null) { for (ResourceDescription rd : this.getResourceDescriptions()) { sb.append(rd.toString()).append(AbstractBaseDescriptionDocument.NEW_LINE); } } sb.append(AbstractBaseDescriptionDocument.TAB).append("</resources>").append(AbstractBaseDescriptionDocument.NEW_LINE); sb.append("</").append(PackageDescriptionDocument.ROOT_ELEMENT_NAME).append(">"); return sb.toString(); }
/** * Utility for comparint this instance with another ResourceDsecription * * @param newResourceDescription instance to be compared to * @return true if they are different */ public boolean compare(ResourceDescription newResourceDescription) { if (compareField(newResourceDescription.getShortName(),this.getShortName()) &&compareField(newResourceDescription.getDescription(),this.getDescription()) &&compareField(newResourceDescription.getScriptIdsAsString(),this.getScriptIdsAsString())) { return false; } else { return true; } }
/** * Return a new instance of ResourceDescription * * @return a new instance of ResourceDescription */ public static ResourceDescription newInstance() { ResourceDescription newResourceDescription = new ResourceDescription ("shortname","description",new String[]{}); return newResourceDescription; }