MOSS Minimal Publishing Site Definition - sharepoint

I'm using the MOSS Minimal Publishing Site Definition from codeplex.
I want to change the default.aspx page to be a publishing page by default, rather than a WSS page as it is currently in this site definition.
Is that possible?

To implement this in the web UI:
You need to create a new page within your publishing site, and then set that page as the 'Welcome' page within Site Settings.
Essentially this will overide the default.aspx and use your new publishing page as the initial opening page for your site.
To implement this for a site definintion:
You need to create a feature which deploys an instance of your initial page to the pages library and then sets the welcome page using the object model (probably using a FeatureReceiver).
More info on how to do this here:
http://www.devexpertise.com/2009/02/02/setting-the-welcome-page-in-wss-30/

You can use the following also (the example is with FeatureStapling):
<!-- Publishing feature -->
<FeatureSiteTemplateAssociation Id="22A9EF51-737B-4ff2-9346-694633FE4416" TemplateName="TEMPLATENAME#NUMBER">
<Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/YOURMASTERPAGE.master"/>
<Property Key="WelcomePageUrl" Value="YOURDEFAULTPAGE.aspx"/>
<Property Key="PagesListUrl" Value=""/>
<Property Key="AvailableWebTemplates" Value="ALLOWED_TEMPLATES"/>
<Property Key="AvailablePageLayouts" Value="PAGELAYOUTS"/>
<Property Key="AlternateCssUrl" Value="" />
<Property Key="SimplePublishing" Value="true" />
</FeatureSiteTemplateAssociation>

Related

How to get only List of all properties of User through Graph API

I am working on CRUD operation of User on Azure AD. I will use Java to handle it.
My requirement is I want one Graph API reference or any other utility through which I will get list of Users all properties like 'accountEnabled', 'displayName', 'mailNickname', 'userPrincipalName' ,'passwordProfile' .... there are so many.
I am trying to get from below API:
https://graph.microsoft.com/v1.0/$metadata
But here, I am getting huge data in which User properties are also present.
Below is piece of response from above API:
<EntityType Name="user" BaseType="microsoft.graph.directoryObject" OpenType="true">
<Property Name="accountEnabled" Type="Edm.Boolean" />
<Property Name="ageGroup" Type="Edm.String" />
<Property Name="assignedLicenses" Type="Collection(microsoft.graph.assignedLicense)" Nullable="false" />
<Property Name="assignedPlans" Type="Collection(microsoft.graph.assignedPlan)" Nullable="false" />
<Property Name="businessPhones" Type="Collection(Edm.String)" Nullable="false" />
<Property Name="city" Type="Edm.String" />
likewise there are so many tags
Can anyone know how to get it?
Any help is much appreciated!!
The $metadata document has a list of all entities like users and groups and I don't think there's a way to scope it down to just users. If you're not interested in parsing it, maybe look at the Graph SDK and use reflection? The SDKs are generated from the Graph metadata so for example the Java SDK has all these properties on the User class - https://github.com/microsoftgraph/msgraph-sdk-java/blob/dev/src/main/java/com/microsoft/graph/models/generated/BaseUser.java#L201
You can check the microsoft graph github organization page for SDKs in other languages.

.webpart file EmptyMessage Property changes not reflecting

we are facing an issue where a custom webpart is alreay deployed in sharepoint and when we are trying to update its EmptyMessage Property and redeploying it, its not reflecting in UI,however, we can see the .webpart file has updated with new value. here is the code snippet of .webpart file
<property name="TitleUrl" type="string" />
<property name="EmptyMessage" type="string">Currently there are no features available. Please check back.</property>
<property name="ShowBestBets" type="bool">True</property>
<property name="ShowViewDuplicates" type="bool">True</property>
<property name="AllowHide" type="bool">False</property>
We're using ctx.ClientControl.get_emptyMessage() to read this property value.
This is by design.
[filename].webpart is just a template for web part instances in the pages. Existing pages save their web part parameters once the web parts are added in the pages. Web part properties in a particular page have no link back to the .webpart file.

Hybris HAC Update Scenario

I wrote an interceptor in one of my projects to intercept all the requests. So usually in a spring project i will do normal build and start the server and my changes related to an interceptor will start reflecting. However this doesn't seem to be the case with a hybris project.
Do I need to do update in hybris hac as well? And if I do then out of the available below mentioned options which options do i need to choose and why.
1. Update running system
2. Clear the hMC configuration from the database
3. Create essential data
4. Localize types
Thanks,
Ashish
To answer the second part of your question, I have listed at least one reason for selecting each type of options. Hope this helps.
Update running system - Required when hybris type definition changes. For example, changing the content of file <extnesion-name>-items.xml
Clear the hMC configuration from the database - If you have chosen to persist hmc configuration in the Database and changing it. For example, changing content in the file hmc.xml
Create essential data - If there is a change in the content in the impex files which follows the naming pattern of essentialdata*.impex.
Localize types - If there is a change in the properties files for localizations. for example changing the content in file <extension-name>-locales_en.properties
Assuming you've not made any changes to any underlying data objects (Jalo items) then you won't need to run an update in the hybris hAC.
You should just be able to make your changes, run ant clean all from the platform and then start up the hybris ECP instance and your changes will be visible.
If this is a normal Spring MVC interceptor, then it should work fine.
Have you checked your spring configuration in the storefront extension you are working from?
For example, take a look at the accelerator Spring MVC configuration file:
hybris/bin/ext-template/yacceleratorstorefront/web/webroot/WEB-INF/config/spring-mvc-config.xml
This has some examples where this is used out-of-the-box:
<mvc:interceptors>
<ref bean="beforeControllerHandlerInterceptor" />
<ref bean="beforeViewHandlerInterceptor" />
<ref bean="csrfHandlerInterceptor" />
</mvc:interceptors>
As an example, the default before controller handler interceptor is defined as:
<!-- Interceptor that runs once per request and before the controller handler method is called -->
<alias name="defaultBeforeControllerHandlerInterceptor" alias="beforeControllerHandlerInterceptor" />
<bean id="defaultBeforeControllerHandlerInterceptor" class="de.hybris.platform.yacceleratorstorefront.interceptors.BeforeControllerHandlerInterceptor" >
<property name="beforeControllerHandlers">
<ref bean="beforeControllerHandlersList" />
</property>
</bean>
which references:
<alias name="defaultBeforeControllerHandlersList" alias="beforeControllerHandlersList" />
<util:list id="defaultBeforeControllerHandlersList" >
<!-- List of handlers to run -->
<bean class="de.hybris.platform.yacceleratorstorefront.interceptors.beforecontroller.SecurityUserCheckBeforeControllerHandler" />
<bean class="de.hybris.platform.yacceleratorstorefront.interceptors.beforecontroller.RequireHardLoginBeforeControllerHandler" >
<property name="userService" ref="userService"/>
<property name="redirectStrategy" ref="redirectStrategy"/>
...
</bean>
<bean class="de.hybris.platform.yacceleratorstorefront.interceptors.beforecontroller.DeviceDetectionBeforeControllerHandler" />
...
</util:list>
So you could either override this using the alias with your own implementation, or add additional controller handlers to the list.
As there is no change to the underlying data model - this is just wiring up Spring MVC related classes - no need for an update system or anything like that. Just an 'ant clean all' to recompile to pick up your new interceptor classes, and server restart to pick up the change in the Spring cornfiguraton.

How to REpublish Custom Task Forms (InfoPath) to SharePoint 2010 State Machine Workflows

I am new to SharePoint. Sorry if answer to my question is obvious.
I've create Custom Task Form in InfoPath and publish it (File/Publish/Network Location [Form Template Path and filename='MYPROJECT/Forms/ApprovalForm.xsn'; Form template name='ApprovalForm'], in the next window I've cleared Public URL according to the article http://www.codeproject.com/Articles/195348/SharePoint-2010-State-Machine-Workflows-with-Custo).
After it I've added module Forms, and added ApprovalForm.xsn from the existing items.
My xml files:
Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
Name="Order New Server"
Description="My SharePoint Workflow"
Id="482cbc86-b717-4981-a49a-3cf4c89e9399"
CodeBesideClass="Myproj.OrderNewServer.OrderNewServer"
CodeBesideAssembly="$assemblyname$"
TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160">
<Categories/>
<AssociationData><Data></Data></AssociationData>
<MetaData>
<AssociationCategories>List</AssociationCategories>
<Task2_FormURN>urn:schemas-microsoft-com:office:infopath:ApprovalForm:-myXSD-2012-03-09T14-11-55</Task2_FormURN>
<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
</MetaData>
</Workflow>
</Elements>
Feature.Template.xml:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Receiverlass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver">
<Properties>
<Property Key="GloballyAvailable" Value="true" />
<Property Key="RegisterForms" Value="Forms\*.xsn"/>
</Properties>
</Feature>
My form work fine, but when I make changes and republish it, it doesn't update (I see old form).
What I tryed:
IISReset
Clear all cookies and cache in IE
Retract solution, restart VS2010, reboot computer.
Change assembly number, guid.
I have no ideas, what can I try for republish my form with changes.
Thank you in advance for any suggestions.
PS: sorry for my writing. English is not my native language.
PPS: when I save new Form to new location and add it to the project, it works.
I've found how can I republish changes. But it seems more like crutch than solution, but it works: After republishing InfoPath form, I delete file from project (DEL on ApprovalForm.xsn in Solution explorer) and after it add it again. (Add/Existing Item). And then redeploy! Hurray!

WSS 3.0 Site Definition breaks when including MasterUrl in onet.xml

I have created a simple site definition for WSS 3.0 which uses a feature, this feature provisions a master page into the masterpage gallery.
This works absolutely fine, and once I've created a site from the definition I can go into the masterpage gallery and view my provisioned file.
If, however, I set the MasterUrl in my Configuration node of onet.xml and then create a new site from it, it fails. After clicking create it redirects me to the new site automatically but presents me with a file not found error. So I type in the url to the settings page and click to view the masterpage gallery which then gives me a file not found error again.
I'm not sure what's going on, but it looks to me like setting the MasterUrl prevents it from creating the correct lists to which the feature can provision the masterpage to. Can anyone shed any light on this matter for me please?
Here is the webtemp*.xml:
<?xml version="1.0" encoding="utf-8"?>
<Templates>
<Template Name="MasterPageTest" ID="10902">
<Configuration ID="0"
Title="MasterPageTest"
Description="Testing master page deployment"
Hidden="FALSE"
ImageUrl="/_layouts/images/stsprev.png"
DisplayCategory="Test"
/>
</Template>
</Templates>
And the onet.xml (with the masterurl attribute removed):
<?xml version="1.0"?>
<Project Title="MasterPageTest" Revision="3" ListDir="$Resources:core,lists_Folder;" xmlns:ows="Microsoft SharePoint" xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- _locID#Title="camlidonet1" _locComment="{StringCategory=HTX}" -->
<NavBars>
</NavBars>
<ListTemplates>
</ListTemplates>
<DocumentTemplates>
</DocumentTemplates>
<Configurations>
<Configuration ID="0"
Description="Testing master page deployment"
Title="Master Page Test"
Name="MasterPageTest"
>
<!-- MasterUrl="_catalogs/masterpage/MasterPage.master" -->
<Lists>
</Lists>
<Modules>
</Modules>
<SiteFeatures>
</SiteFeatures>
<WebFeatures>
<!-- Masterpage -->
<Feature ID="8175B375-38F5-44E2-950A-9600D5427E17"/>
</WebFeatures>
</Configuration>
</Configurations>
<Modules>
</Modules>
<ServerEmailFooter>$Resources:ServerEmailFooter;</ServerEmailFooter>
</Project>
My first thought was: Why in the onet.xml?
I usually do this using a process called Feature stapling. It is impossible to remove / disable functionality created from a site definition later on (off course you could by hand, or a feature + receiver to remove say a list you don't need for a particular site created from the onet.xml, but you probably get the point).
By using feature stapling, (your / the) site definition stays clean and stays what it is meant to be: a definition of a site, that can be selected during site creation. IMHO, it should be nothing more than an empty container.
Feature Stapling binds features you want activated when a site is created to a (custom) siteTEMPLATE. You can even use this to attach features you want activated on out of the box site definitions as well. For instance, feature stapling is the preferred way of enabling features in the "MySite" and "My Site Host" definitions. The original sitedefintion remains untouched, but your features are activated too!
Now to actually answer your question: The masterpage is probably not available yet when the site definition is used, the onet.xml is processed before any features are activated.
If your site is a publishing site (meaning the publishing related features are activated in the site collection), you can set the masterpage in the Publishing Feature with the ChromeMasterUrl property.
If the site is a regular site, you can do 2 things:
deploy the master page from the onet.xml by moving the <Module> from your masterpage feature to the onet.xml, more info here (figure 1).
don't set the masterpage url in the onet, but use a feature + featurereceiver to set the masterpage url, more info here (downloadable code in article).

Resources