Search in sources :

Example 1 with ArtifactInfoGatherer

use of org.apache.ofbiz.widget.artifact.ArtifactInfoGatherer in project ofbiz-framework by apache.

the class FormWidgetArtifactInfo method populateAll.

/**
 * note this is mean to be called after the object is created and added to the ArtifactInfoFactory.allFormInfos in ArtifactInfoFactory.getFormWidgetArtifactInfo
 */
public void populateAll() throws GeneralException {
    ArtifactInfoContext infoContext = new ArtifactInfoContext();
    ArtifactInfoGatherer infoGatherer = new ArtifactInfoGatherer(infoContext);
    try {
        if (this.modelForm instanceof ModelSingleForm) {
            infoGatherer.visit((ModelSingleForm) this.modelForm);
        } else {
            infoGatherer.visit((ModelGrid) this.modelForm);
        }
    } catch (Exception e) {
        throw new GeneralException(e);
    }
    populateEntitiesFromNameSet(infoContext.getEntityNames());
    populateServicesFromNameSet(infoContext.getServiceNames());
    this.populateFormExtended();
    this.populateLinkedRequests(infoContext.getRequestLocations());
    this.populateTargetedRequests(infoContext.getTargetLocations());
}
Also used : ArtifactInfoGatherer(org.apache.ofbiz.widget.artifact.ArtifactInfoGatherer) GeneralException(org.apache.ofbiz.base.util.GeneralException) ArtifactInfoContext(org.apache.ofbiz.widget.artifact.ArtifactInfoContext) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException) GeneralException(org.apache.ofbiz.base.util.GeneralException) ModelSingleForm(org.apache.ofbiz.widget.model.ModelSingleForm)

Example 2 with ArtifactInfoGatherer

use of org.apache.ofbiz.widget.artifact.ArtifactInfoGatherer in project ofbiz-framework by apache.

the class ScreenWidgetArtifactInfo method populateAll.

public void populateAll() throws GeneralException {
    ArtifactInfoContext infoContext = new ArtifactInfoContext();
    ArtifactInfoGatherer infoGatherer = new ArtifactInfoGatherer(infoContext);
    try {
        infoGatherer.visit(this.modelScreen);
    } catch (Exception e) {
        throw new GeneralException(e);
    }
    populateServicesFromNameSet(infoContext.getServiceNames());
    populateEntitiesFromNameSet(infoContext.getEntityNames());
    populateFormsFromNameSet(infoContext.getFormLocations());
    populateLinkedRequests(infoContext.getRequestLocations());
}
Also used : ArtifactInfoGatherer(org.apache.ofbiz.widget.artifact.ArtifactInfoGatherer) GeneralException(org.apache.ofbiz.base.util.GeneralException) ArtifactInfoContext(org.apache.ofbiz.widget.artifact.ArtifactInfoContext) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException) GeneralException(org.apache.ofbiz.base.util.GeneralException)

Aggregations

IOException (java.io.IOException)2 MalformedURLException (java.net.MalformedURLException)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 GeneralException (org.apache.ofbiz.base.util.GeneralException)2 ArtifactInfoContext (org.apache.ofbiz.widget.artifact.ArtifactInfoContext)2 ArtifactInfoGatherer (org.apache.ofbiz.widget.artifact.ArtifactInfoGatherer)2 SAXException (org.xml.sax.SAXException)2 ModelSingleForm (org.apache.ofbiz.widget.model.ModelSingleForm)1