Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
Application.inc.php
1 <?php
2 
18 import('lib.pkp.classes.core.PKPApplication');
19 
20 define('PHP_REQUIRED_VERSION', '4.2.0');
21 
22 define('ASSOC_TYPE_MONOGRAPH', ASSOC_TYPE_SUBMISSION);
23 define('ASSOC_TYPE_PUBLISHED_MONOGRAPH', ASSOC_TYPE_PUBLISHED_SUBMISSION);
24 define('ASSOC_TYPE_PUBLICATION_FORMAT', ASSOC_TYPE_REPRESENTATION);
25 
26 define('ASSOC_TYPE_PRESS', 0x0000200);
27 define('ASSOC_TYPE_CATEGORY', 0x000020D);
28 define('ASSOC_TYPE_SERIES', ASSOC_TYPE_SECTION);
29 
30 define('CONTEXT_PRESS', 1);
31 
32 class Application extends PKPApplication {
36  function Application() {
37  parent::PKPApplication();
38  }
39 
47  function getContextDepth() {
48  return 1;
49  }
50 
55  function getContextList() {
56  return array('press');
57  }
58 
63  function getName() {
64  return 'omp';
65  }
66 
71  function getNameKey() {
72  return('common.openMonographPress');
73  }
74 
81  return('http://pkp.sfu.ca/omp/xml/omp-version.xml');
82  }
83 
88  function getDAOMap() {
89  return array_merge(parent::getDAOMap(), array(
90  'AnnouncementDAO' => 'classes.announcement.AnnouncementDAO',
91  'AnnouncementTypeDAO' => 'classes.announcement.AnnouncementTypeDAO',
92  'AuthorDAO' => 'classes.monograph.AuthorDAO',
93  'ChapterAuthorDAO' => 'classes.monograph.ChapterAuthorDAO',
94  'ChapterDAO' => 'classes.monograph.ChapterDAO',
95  'CategoryDAO' => 'classes.press.CategoryDAO',
96  'EmailTemplateDAO' => 'classes.mail.EmailTemplateDAO',
97  'FeatureDAO' => 'classes.press.FeatureDAO',
98  'FooterCategoryDAO' => 'lib.pkp.classes.context.FooterCategoryDAO',
99  'FooterLinkDAO' => 'lib.pkp.classes.context.FooterLinkDAO',
100  'IdentificationCodeDAO' => 'classes.publicationFormat.IdentificationCodeDAO',
101  'LayoutAssignmentDAO' => 'submission.layoutAssignment.LayoutAssignmentDAO',
102  'MarketDAO' => 'classes.publicationFormat.MarketDAO',
103  'SubmissionCommentDAO' => 'lib.pkp.classes.submission.SubmissionCommentDAO',
104  'MetricsDAO' => 'lib.pkp.classes.statistics.PKPMetricsDAO',
105  'MonographDAO' => 'classes.monograph.MonographDAO',
106  'MonographFileEmailLogDAO' => 'classes.log.MonographFileEmailLogDAO',
107  'MonographSearchDAO' => 'classes.search.MonographSearchDAO',
108  'NewReleaseDAO' => 'classes.press.NewReleaseDAO',
109  'NoteDAO' => 'classes.note.NoteDAO',
110  'NotificationStatusDAO' => 'classes.press.NotificationStatusDAO',
111  'OAIDAO' => 'classes.oai.omp.OAIDAO',
112  'OMPCompletedPaymentDAO' => 'classes.payment.omp.OMPCompletedPaymentDAO',
113  'ONIXCodelistItemDAO' => 'classes.codelist.ONIXCodelistItemDAO',
114  'PressDAO' => 'classes.press.PressDAO',
115  'PressSettingsDAO' => 'classes.press.PressSettingsDAO',
116  'ProductionAssignmentDAO' => 'classes.submission.productionAssignment.ProductionAssignmentDAO',
117  'PublicationDateDAO' => 'classes.publicationFormat.PublicationDateDAO',
118  'PublicationFormatDAO' => 'classes.publicationFormat.PublicationFormatDAO',
119  'PublishedMonographDAO' => 'classes.monograph.PublishedMonographDAO',
120  'QualifierDAO' => 'classes.codelist.QualifierDAO',
121  'QueuedPaymentDAO' => 'lib.pkp.classes.payment.QueuedPaymentDAO',
122  'RepresentativeDAO' => 'classes.monograph.RepresentativeDAO',
123  'ReviewAssignmentDAO' => 'lib.pkp.classes.submission.reviewAssignment.ReviewAssignmentDAO',
124  'ReviewerSubmissionDAO' => 'classes.submission.reviewer.ReviewerSubmissionDAO',
125  'ReviewFormDAO' => 'lib.pkp.classes.reviewForm.ReviewFormDAO',
126  'ReviewFormElementDAO' => 'lib.pkp.classes.reviewForm.ReviewFormElementDAO',
127  'ReviewFormResponseDAO' => 'lib.pkp.classes.reviewForm.ReviewFormResponseDAO',
128  'RoleDAO' => 'classes.security.RoleDAO',
129  'SalesRightsDAO' => 'classes.publicationFormat.SalesRightsDAO',
130  'SeriesDAO' => 'classes.press.SeriesDAO',
131  'SeriesEditorsDAO' => 'classes.press.SeriesEditorsDAO',
132  'SeriesEditorSubmissionDAO' => 'classes.submission.seriesEditor.SeriesEditorSubmissionDAO',
133  'SocialMediaDAO' => 'classes.press.SocialMediaDAO',
134  'SpotlightDAO' => 'classes.spotlight.SpotlightDAO',
135  'StageAssignmentDAO' => 'lib.pkp.classes.stageAssignment.StageAssignmentDAO',
136  'SubjectDAO' => 'classes.codelist.SubjectDAO',
137  'SubmissionEventLogDAO' => 'classes.log.SubmissionEventLogDAO',
138  'SubmissionFileDAO' => 'classes.monograph.SubmissionFileDAO',
139  'UserGroupAssignmentDAO' => 'lib.pkp.classes.security.UserGroupAssignmentDAO',
140  'UserDAO' => 'classes.user.UserDAO',
141  'UserSettingsDAO' => 'classes.user.UserSettingsDAO',
142  ));
143  }
144 
149  function getPluginCategories() {
150  return array(
151  // NB: Meta-data plug-ins are first in the list as this
152  // will make them being loaded (and installed) first.
153  // This is necessary as several other plug-in categories
154  // depend on meta-data. This is a very rudimentary type of
155  // dependency management for plug-ins.
156  'viewableFiles',
157  'metadata',
158  'pubIds',
159  'blocks',
160  'generic',
161  'themes',
162  'importexport',
163  'oaiMetadataFormats',
164  );
165  }
166 
170  static function getContextDAO() {
171  return DAORegistry::getDAO('PressDAO');
172  }
173 
177  static function getSubmissionDAO() {
178  return DAORegistry::getDAO('MonographDAO');
179  }
180 
185  static function getSectionDAO() {
186  return DAORegistry::getDAO('SeriesDAO');
187  }
188 
192  static function getRepresentationDAO() {
193  return DAORegistry::getDAO('PublicationFormatDAO');
194  }
195 
200  if (defined('SESSION_DISABLE_INIT')) {
201  $database = Config::getVar('database', 'driver');
202  $pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO');
203  switch ($database) {
204  case 'mysql':
205  $checkResult = $pluginSettingsDao->retrieve('SHOW COLUMNS FROM plugin_settings LIKE ?', array('context_id'));
206  if ($checkResult->NumRows() == 0) {
207  return 'press_id';
208  }
209  break;
210  case 'postgres':
211  $checkResult = $pluginSettingsDao->retrieve('SELECT column_name FROM information_schema.columns WHERE table_name= ? AND column_name= ?', array('plugin_settings', 'context_id'));
212  if ($checkResult->NumRows() == 0) {
213  return 'press_id';
214  }
215  break;
216  }
217  }
218  return 'context_id';
219  }
220 
224  static function getSubEditorDAO() {
225  return DAORegistry::getDAO('SeriesEditorsDAO');
226  }
227 
231  static function getApplicationStages() {
232  // We leave out WORKFLOW_STAGE_ID_PUBLISHED since it technically is not a 'stage'.
233  return array(
234  WORKFLOW_STAGE_ID_SUBMISSION,
235  WORKFLOW_STAGE_ID_INTERNAL_REVIEW,
236  WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
237  WORKFLOW_STAGE_ID_EDITING,
238  WORKFLOW_STAGE_ID_PRODUCTION
239  );
240  }
241 
245  static function getFileDirectories() {
246  return array('context' => '/presses/', 'submission' => '/monographs/');
247  }
248 
252  static function getContextAssocType() {
253  return ASSOC_TYPE_PRESS;
254  }
255 }
256 
257 ?>
static & getDAO($name, $dbconn=null)
static getRepresentationDAO()
static getApplicationStages()
static getVar($section, $key, $default=null)
Definition: Config.inc.php:35
static getSubmissionDAO()
static getSubEditorDAO()
static getPluginSettingsContextColumnName()
Class describing this application.
static getContextAssocType()
static getFileDirectories()
static getContextDAO()
static getSectionDAO()