Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8531a3d26e088b413716968bc73ef0572985f237 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<plugin>
	<extension-point 
		id="jpaPlatform" name="%JPA_PLATFORM" schema="schema/jpaPlatform.exsd"/>
	
	<extension
		point="org.eclipse.core.resources.markers"
		id="jpaProblemMarker"
		name="%JPA_PROBLEM_MARKER">
		<persistent value="true"/>
		
		<!-- Can't use text marker until we have specific models for each input type (XML, java)
		<super type="org.eclipse.core.resources.textmarker"/>
		-->
		
		<super type="org.eclipse.wst.validation.problemmarker"/>
	</extension>
	
	
	<extension
		point="org.eclipse.core.runtime.adapters">
		
		<factory
			class="org.eclipse.jpt.core.internal.JpaProjectAdapterFactory"
			adaptableType="org.eclipse.core.resources.IProject">
			<adapter type="org.eclipse.jpt.core.internal.IJpaProject"/>
		</factory>
		
		<factory
			class="org.eclipse.jpt.core.internal.JpaProjectAdapterFactory"
			adaptableType="org.eclipse.jdt.core.IJavaProject">
			<adapter type="org.eclipse.jpt.core.internal.IJpaProject"/>
		</factory>
		
	</extension>
	
	
	<extension
		point="org.eclipse.core.runtime.contentTypes">
		
		<content-type
        base-type="org.eclipse.core.runtime.xml"
        file-names="orm.xml"
        id="org.eclipse.jpt.core.content.orm"
        name="%ORM_XML_CONTENT"
        priority="normal">
     		Only allowing file names of orm.xml.  Extenders will have to specify a different file name.
     		Limitation with WTP translators for registering files names instead of content types
		</content-type>
  		<content-type
        base-type="org.eclipse.core.runtime.xml"
        file-names="persistence.xml"
        id="org.eclipse.jpt.core.content.persistence"
        name="%PERSISTENCE_XML_CONTENT"
        priority="normal">
	     	Only allowing file names of persistence.xml.
		</content-type>
 
	</extension>
	
	
	<extension
		point="org.eclipse.core.runtime.preferences">
		
		<initializer 
			class="org.eclipse.jpt.core.internal.prefs.JpaPreferenceInitializer"/>
		
	</extension>
	
	
	<extension
		point="org.eclipse.jpt.core.jpaPlatform">
		
		<jpaPlatform
			id="generic"
			label="%GENERIC_PLATFORM_LABEL"
			class="org.eclipse.jpt.core.internal.platform.generic.GenericPlatform"/>
		
	</extension>
	
	
	<extension
		point="org.eclipse.wst.common.project.facet.core.facets">
		
		<project-facet id="jpt.jpa">
			<label>%JPA_FACET_LABEL</label>
			<description>%JPA_FACET_DESCRIPTION</description>
		</project-facet>
		
		<project-facet-version facet="jpt.jpa" version="1.0">
			<constraint>
				<and>
					<requires facet="jst.java" version="[5.0"/>
					<or>
						<requires facet="jst.utility" version="[1.0"/>
						<requires facet="jst.appclient" version="[1.2"/>
						<requires facet="jst.ejb" version="[1.1"/>
						<requires facet="jst.connector" version="[1.0"/>
						<requires facet="jst.web" version="[2.2"/>
					</or>
				</and>
			</constraint>
		</project-facet-version>
		
		<preset id="jpt.jpa.preset">
			<label>%JPA_PRESET_LABEL</label>
			<facet id="jst.java" version="5.0"/>
			<facet id="jst.utility" version="1.0"/>
			<facet id="jpt.jpa" version="1.0"/>
		</preset>
		
		<template id="jpt.jpa.template">
			<label>%JPA_TEMPLATE_LABEL</label>
			<fixed facet="jst.java"/>
			<fixed facet="jst.utility"/>
			<fixed facet="jpt.jpa"/>
			<preset id="jpt.jpa.preset"/>
		</template>
		
		<action facet="jpt.jpa" type="INSTALL" id="jpt.jpa.install">
			<config-factory class="org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProvider"/>
			<delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetInstallDelegate"/>
		</action>
		
		<action facet="jpt.jpa" type="UNINSTALL" id="jpt.jpa.uninstall">
			<delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetUninstallDelegate"/>
		</action>
		
		<event-handler facet="jpt.jpa" type="POST_INSTALL">
			<delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetPostInstallDelegate"/>
		</event-handler>
		
	</extension>
	
	
	<extension 
		point="org.eclipse.wst.common.project.facet.core.runtimes">
		
		<supported>
			<runtime-component any="true"/>
			<facet id="jpt.jpa"/>
		</supported>
		
	</extension>
		
	
	<extension
		point="org.eclipse.wst.validation.validator"
    	id="jpaValidator"
		name="%JPA_VALIDATOR">
		
		<validator>
			<enablement>
				<and>
					<test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa"/>
				</and>
			</enablement>
			
			<filter
				objectClass="org.eclipse.core.resources.IFile"
				nameFilter="orm.xml"/>
			<filter
				objectClass="org.eclipse.core.resources.IFile"
				nameFilter="persistence.xml"/>
			<filter
				objectClass="org.eclipse.core.resources.IFile"
				nameFilter="*.java"/>
         	
         	<run class="org.eclipse.jpt.core.internal.validation.JpaValidator"/>
			<helper class="org.eclipse.jpt.core.internal.validation.JpaHelper"/>
			
			<markerId markerIdValue="jpaProblemMarker"/>
			
			
         	<!-- don't know what this does
			<dependentValidator depValValue="true"/>
			-->
			
		</validator>
		
	</extension>
	
	
</plugin>

Back to the top