Package de.innovationgate.wga.model

Examples of de.innovationgate.wga.model.VersionCompliance


    Set<String> tmlfilerefs = new HashSet<String>();
    Set<String> nontmlspecificrefs = null;
    String medium;

    WGADesignStructureHelper designHelper = new WGADesignStructureHelper(activeFile);
    VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(activeFile);

    String mymedium = WGADesignStructureHelper.determineMediaKey(activeFile);

    String tagName = region.getTagName();
    if (tagName != null && tagName.equals("url")) {
      if (region.hasAttribute("db")) {
        // cannot lookup references in foreign db
        return Collections.emptySet();
      }
    } else if (region.hasAttribute("designdb")) {
      // cannot lookup references in foreign db
      return Collections.emptySet();
    }

    if (region.getAttributeValue("type") != null) {
      if (!region.getAttributeValue("type").equals("portlet") && !region.getAttributeValue("type").equals("tml")) {
        return Collections.emptySet();
      }
    }

    if (region.getAttributeNames().contains("medium")) {
      medium = region.getAttributeValue("medium");
    } else {
      medium = mymedium;
    }

    // the path of the selected medium
    IPath mediumPath = designHelper.getTmlRoot().getFolder(new Path(medium)).getProjectRelativePath();

    // the path to the file which we are currently editing
    IPath pathOfEditedFile = activeFile.getParent().getProjectRelativePath();
    pathOfEditedFile = pathOfEditedFile.removeFirstSegments(mediumPath.segmentCount());

    ResourceIndexManager rsm = Plugin.getDefault().getResourceIndexManager();
    if (rsm != null) {
      nontmlspecificrefs = rsm.getTMLpaths(activeFile, medium);

      Iterator<String> it = nontmlspecificrefs.iterator();
      while (it.hasNext()) {

        // current file from the db
        IPath currentFile = new Path(it.next()).removeFileExtension();

        // path of the current file
        IPath currentFilePath = currentFile.removeLastSegments(1);

        // removing the path of the elected medium
        currentFilePath = currentFilePath.removeFirstSegments(mediumPath.segmentCount());

        // removing the path of the elected medium
        currentFile = currentFile.removeFirstSegments(mediumPath.segmentCount());

        IPath tmp = null;
       
        String reference = currentFile.toString().replaceAll("\\/", ":");
       
       
        if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
            if (reference.startsWith("overlay:") && pathOfEditedFile.toString().contains("overlay")) {
                reference = reference.substring("overlay:".length());
            } else if (pathOfEditedFile.toString().contains("overlay")) {
                reference = reference + "@base";
            }
View Full Code Here


    try {
      IDocumentProvider provider = new WGADesignFileDocumentProvider();
      IFileEditorInput input = new FileEditorInput(file);     
      provider.connect(input);
       
      VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(file);
       
      InvalidEncodingMarkingHandler handler = new InvalidEncodingMarkingHandler();
      handler.setWGAVersionCompliance(versionCompliance);             
      handler.setDocumentProvider(provider);
      handler.createMarkers(file, provider.getDocument(input));
View Full Code Here

  public ContextInformation getAttributeInformation(String tagname, String attribute, IFile file) {
    return getAttributeInformation(tagname, attribute, null,file);
  }

  public ContextInformation getAttributeInformation(String tagname, String attribute, String value, IFile tmlFile) {
      VersionCompliance versionCompliance = retrieveVersionCompliance(tmlFile);     
    if (value != null) {
      // check if attribute value help is available - otherwise disable value lookup (set value to null)
      TMLTag tag = TMLTagDefinitions.getInstance(versionCompliance).getTagByName(tagname);
      if (tag != null) {
        TMLTagAttribute tagAttribute = tag.getAttribute(attribute);
View Full Code Here

    return references;
  }

    private void createReferenceValues(IFile activeFile, Set<String> references) {
        WGADesignStructureHelper helper = new WGADesignStructureHelper(activeFile);
        VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(activeFile);
        Iterator<IFolder> containers = helper.getFileContainers().iterator();
        while (containers.hasNext()) {
           
            IFolder container = containers.next();
           
            if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {                               
                IPath refPath = container.getFullPath().makeRelativeTo(helper.getFileContainerRoot().getFullPath());
              references.add(refPath.toString().toLowerCase().replaceAll("\\/",":"));
             
              IPath activeFolderPath = activeFile.getParent().getFullPath().makeRelativeTo(helper.getTmlRoot().getFullPath());
              // remove medium
View Full Code Here

    String tagName = region.getTagName();
    if (tagName != null && tagName.equals("url") && region.hasAttribute("type") && !region.isDynamicAttributeValue("type")) {
      String type = region.getAttributeValue("type");
      if (type != null && ( type.equals(WGADesignStructureHelper.SCRIPT_TYPE_CSS) || type.equals(WGADesignStructureHelper.SCRIPT_TYPE_JS)) ) {
        WGADesignStructureHelper designHelper = new WGADesignStructureHelper(activeFile);
            VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(activeFile);
           
        IContainer designRoot = designHelper.getDesignRoot();
        String medium = WGADesignStructureHelper.determineMediaKey(activeFile);
       
        ResourceIndexManager rsm = Plugin.getDefault().getResourceIndexManager();
        if (rsm != null) {
          // the path to the file which we are currently editing
          IPath pathOfEditedFile = activeFile.getParent().getProjectRelativePath();
          // the path of the medium of the current file
          IPath mediumPath = designHelper.getTmlRoot().getFolder(new Path(medium)).getProjectRelativePath();
          pathOfEditedFile = pathOfEditedFile.removeFirstSegments(mediumPath.segmentCount());
                         
          Iterator<String> scriptPaths = rsm.getScriptPaths(designRoot, type).iterator();
         
          while (scriptPaths.hasNext()) {
            String scriptPath = scriptPaths.next();
           
            // scriptfile path
            IPath scriptFile = new Path(scriptPath).removeFileExtension();
   
            // path of the current file
            IPath currentFilePath = scriptFile.removeLastSegments(1);
   
            // removing the path of the selected medium
            currentFilePath = currentFilePath.removeFirstSegments(mediumPath.segmentCount());
   
            // removing the path of the elected medium
            scriptFile = scriptFile.removeFirstSegments(mediumPath.segmentCount());
   
            IPath tmp = null;
            if (currentFilePath.segmentCount() >= pathOfEditedFile.segmentCount()) {
   
              int a = currentFilePath.segmentCount();
              int b = pathOfEditedFile.segmentCount();
              tmp = currentFilePath.removeLastSegments(a - b);
              if (tmp.equals(pathOfEditedFile)) {
   
                currentFilePath = scriptFile.removeFirstSegments(tmp.segmentCount());
   
                references.add("::" + currentFilePath.toString().replaceAll("\\/", ":"));
   
              } else {
                  String reference = scriptFile.toString().replaceAll("\\/", ":");
                              if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
                                  if (reference.startsWith("overlay:") && pathOfEditedFile.toString().contains("overlay")) {
                                      reference = reference.substring("overlay:".length());
                                  } else if (pathOfEditedFile.toString().contains("overlay")) {
                                      reference = reference + "@base";
                                  }
                              }
                              references.add(reference);
              }
   
            } else {
                String reference = scriptFile.toString().replaceAll("\\/", ":");
                if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
                          if (reference.startsWith("overlay:") && pathOfEditedFile.toString().contains("overlay")) {
                              reference = reference.substring("overlay:".length());
                          } else if (pathOfEditedFile.toString().contains("overlay")) {
                              reference = reference + "@base";
                          }
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.model.VersionCompliance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.