Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gruppensichtbarkeiten reinitialisieren #428

Open
wants to merge 1 commit into
base: WollMux_18.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 89 additions & 9 deletions idl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,72 @@
<relativePath />
</parent>

<properties>
<libreoffice.sdk>${UNO_PATH}/../sdk</libreoffice.sdk>
</properties>

<build>
<resources>
<resource>
<directory>${project.build.directory}/generated-sources/idl</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.openoffice.dev</groupId>
<artifactId>ooo-maven-plugin</artifactId>
<version>1.1.2-SNAPSHOT</version>
<configuration>
<idlDir>${basedir}/src/main/idl</idlDir>
<ooo>${ooo}</ooo>
<sdk>${sdk}</sdk>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>idl</id>
<phase>generate-sources</phase>
<configuration>
<target>
<property name="idlcOutput" value="${project.build.directory}/generated-sources/urd/de/muenchen/allg/itd51/wollmux" />
<fail unless="UNO_PATH" message="No UNO_PATH set! Set UNO_PATH as property in maven settings." />
<echo message="Using UNO_PATH: ${UNO_PATH}" />
<echo message="Create urd files" />
<exec executable="${libreoffice.sdk}/bin/idlc" failonerror="true">
<arg value="-verbose" />
<arg value="-O${idlcOutput}" />
<arg value="-I${libreoffice.sdk}/idl;src/main/idl" />
<arg value="src/main/idl/de/muenchen/allg/itd51/wollmux/XPALChangeEventBroadcaster.idl" />
<arg value="src/main/idl/de/muenchen/allg/itd51/wollmux/XPALChangeEventListener.idl" />
<arg value="src/main/idl/de/muenchen/allg/itd51/wollmux/XPALProvider.idl" />
<arg value="src/main/idl/de/muenchen/allg/itd51/wollmux/XPrintModel.idl" />
<arg value="src/main/idl/de/muenchen/allg/itd51/wollmux/XWollMux.idl" />
<arg value="src/main/idl/de/muenchen/allg/itd51/wollmux/XWollMuxDocument.idl" />
</exec>
<echo message="Create registry library" />
<exec executable="${UNO_PATH}/regmerge" failonerror="true">
<arg value="-v" />
<arg value="target/WollMux.rdb" />
<arg value="/UCR" />
<arg value="${idlcOutput}/XPALChangeEventBroadcaster.urd" />
<arg value="${idlcOutput}/XPALChangeEventListener.urd" />
<arg value="${idlcOutput}/XPALProvider.urd" />
<arg value="${idlcOutput}/XPrintModel.urd" />
<arg value="${idlcOutput}/XWollMux.urd" />
<arg value="${idlcOutput}/XWollMuxDocument.urd" />
</exec>
<echo message="Create class files" />
<exec executable="${libreoffice.sdk}/bin/javamaker" failonerror="true">
<arg value="-Tde.muenchen.allg.itd51.wollmux.*" />
<arg value="-nD" />
<arg value="-Gc" />
<arg value="-O${project.build.directory}/generated-sources/idl" />
<arg value="-X${UNO_PATH}/types.rdb" />
<arg value="-X${UNO_PATH}/types/offapi.rdb" />
<arg value="${project.build.directory}/WollMux.rdb" />
</exec>
</target>
</configuration>
<goals>
<goal>build-idl</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
Expand Down Expand Up @@ -56,5 +106,35 @@
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<versionRange>[1.8,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
44 changes: 25 additions & 19 deletions idl/src/main/idl/de/muenchen/allg/itd51/wollmux/XPrintModel.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
* Projekt : WollMux
* Funktion : Repräsentiert die Schnittstelle WollMux Komfortdruckfunktionen
*
* Copyright (C) 2009 Landeshauptstadt München
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* Copyright (C) 2009 Landeshauptstadt München
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @author Christoph Lutz (D-III-ITD 5.1)
* @version 1.0
Expand Down Expand Up @@ -242,7 +242,13 @@ interface XPrintModel
* Der anzuzeigende String.
*/
void setPrintMessage([in] string value);
};

/**
* Diese Methode initiiert beim Iterieren über Verfügungspunkte die
* Gruppen-Sichtbarkeiten neu.
*
*/
void setGroupsVisibilityState();};

}; }; }; }; };

Expand Down
2 changes: 2 additions & 0 deletions src/de/muenchen/allg/itd51/wollmux/func/StandardPrint.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ public static void sachleitendeVerfuegungOutput(XPrintModel pmod)
for (VerfuegungspunktInfo v : settings)
{
if (pmod.isCanceled()) return;
pmod.setGroupsVisibilityState();

if (v.getCopyCount() > 0)
{
SachleitendeVerfuegung.printVerfuegungspunkt(pmod, v.verfPunktNr, v.isDraft,
Expand Down
35 changes: 34 additions & 1 deletion src/de/muenchen/allg/itd51/wollmux/print/PrintModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;

Expand Down Expand Up @@ -253,6 +254,11 @@ private static class MasterPrintModel implements XPrintModel, InternalPrintModel

private TextDocumentController documentController;

/**
* Speichert die Gruppensichtbarkeiten des originalen Dokumentes vor Start des Druckens.
*/
private Map<String, Boolean> mapGroupIdToVisibilityState;

/**
* Erzeugt ein neues MasterPrintModel-Objekt für das Dokument model, das einen
* Druckvorgang repräsentiert, der mit einer leeren Aufrufkette (Liste von
Expand All @@ -263,11 +269,13 @@ private static class MasterPrintModel implements XPrintModel, InternalPrintModel
*
* @param documentController
*/

private MasterPrintModel(TextDocumentController documentController)
{
this.documentController = documentController;
this.props = new HashMap<String, Object>();
this.functions = new TreeSet<PrintFunction>();
this.mapGroupIdToVisibilityState = documentController.getModel().getMapGroupIdToVisibilityState();
}

/**
Expand Down Expand Up @@ -350,6 +358,21 @@ public XTextDocument getTextDocument()
return documentController.getModel().doc;
}

/**
* Diese Methode reinitialisiert das Dokument mit den originalen
* Gruppen-Sichtbarkeiten.
*
* @see de.muenchen.allg.itd51.wollmux.XPrintModel#setGroupsVisibilityState()
*/
@Override
public void setGroupsVisibilityState()
{
for (Map.Entry<String, Boolean> entry : mapGroupIdToVisibilityState.entrySet())
{
setGroupVisible(entry.getKey(), entry.getValue());
}
}

/**
* Diese Methode ruft numberOfCopies mal printWithProps() auf.
*
Expand Down Expand Up @@ -1056,6 +1079,17 @@ public XTextDocument getTextDocument()
return master.getTextDocument();
}

/**
* Diese Methode reinitialisiert das Dokument mit den originalen
* Gruppen-Sichtbarkeiten.
*
* @see de.muenchen.allg.itd51.wollmux.XPrintModel#setGroupsVisibilityState()
*/
@Override
public void setGroupsVisibilityState()
{
master.setGroupsVisibilityState();
}
/*
* (non-Javadoc)
*
Expand All @@ -1079,7 +1113,6 @@ public void print(short numberOfCopies)
public void printWithProps()
{
if (isCanceled()) return;

PrintFunction f = master.getPrintFunction(idx + 1);
if (f != null)
{
Expand Down